html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: #008080;
  display: flex;
  padding: 16px;
  box-sizing: border-box;
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  -webkit-font-smoothing: none;
}
#app { width: 100%; max-width: 760px; margin: auto; }
.window-body { padding: 12px; }

.quote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.speaker {
  min-width: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quote {
  flex: 1 1 auto;
  margin: 0;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px grey, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
  padding: 12px 14px;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: auto;
  font-size: 18px;
  line-height: 1.45;
  min-height: 3.2em;
  box-sizing: border-box;
}

.faces {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.face {
  min-width: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.face:disabled { cursor: default; }
.frame {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  box-shadow: inset -1px -1px #fff, inset 1px 1px grey, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
  padding: 3px;
  box-sizing: border-box;
  overflow: hidden;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  display: block;
  image-rendering: auto;
}
.name { font-size: 15px; font-weight: bold; }


@media (max-width: 520px) {
  .window-body { display: flex; flex-direction: column; gap: 12px; padding: 10px; }
  .faces { order: 1; grid-template-columns: 1fr; gap: 10px; }
  .quote-row { order: 2; margin-bottom: 0; flex-direction: row-reverse; }
  .face { padding: 6px; gap: 6px; }
  .frame { aspect-ratio: auto; height: 28vh; }
  .quote { font-size: 16px; padding: 10px 12px; min-height: 2.8em; }
  .speaker { width: 56px; height: 56px; align-self: stretch; height: auto; }
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.dialog { width: 100%; max-width: 320px; }
.dialog-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.dialog-body p { margin: 0; font-size: 14px; }
.dialog-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Times New Roman", serif;
}
.dialog-icon.ok  { background: #fff; color: #000080; border: 2px solid #000080; }
.dialog-icon.bad { background: #fff; color: #c00; border: 2px solid #c00; }
.dialog-buttons { display: flex; justify-content: center; padding: 0 12px 12px; }
.dialog-buttons button { min-width: 90px; }

.overlay[hidden] { display: none; }
