/* Local font files keep screen rendering and PNG exports independent of a CDN. */
@font-face {
  font-family: "Roboto";
  src: url("fonts/Roboto.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("fonts/NotoSansThai.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-family: "Roboto", "Noto Sans Thai", sans-serif;
  font-family: var(--font-family);
  color: #192b38;
  background: #e7eced;
  font-synthesis: none;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button,
.primary,
.secondary {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 20px;
  border: 2px solid #17394c;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.primary {
  background: #17394c;
  color: white;
}
.secondary {
  background: #ffffffdc;
  color: #17394c;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible + span {
  outline: 3px solid #146ac4;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.screen {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}
.art {
  position: relative;
  width: 100%;
  container-type: inline-size;
  aspect-ratio: 1500 / 2667;
  /* Suppress the iOS long-press callout only on the in-game artwork. */
  -webkit-touch-callout: none;
}
.art img {
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.background {
  width: 100%;
  height: auto;
  display: block;
}
.logo {
  position: absolute;
  width: 94%;
  height: auto;
  left: 3%;
  top: 0;
}

/* Shared edge-to-edge header for Welcome, Quiz, and Result. */
.art::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(94cqw * 465 / 2250);
  background: #fff;
}

.welcome-action {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 78%;
  text-align: center;
}
.welcome-action button {
  width: 100%;
  font-size: clamp(15px, 4cqw, 21px);
}
.welcome-action p {
  font-size: clamp(11px, 2.6cqw, 14px);
  line-height: 1.7;
  margin: 8px 0;
}
.quiz-content {
  position: absolute;
  top: 30%;
  left: 11.3%;
  right: 11.3%;
  bottom: 12%;
  background: #f0f0f0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.eyebrow {
  font-size: clamp(11px, 2.8cqw, 15px);
  font-weight: 700;
  letter-spacing: 0.07em;
  margin: 0 0 8px;
  line-height: 1.4;
}
h1 {
  font-size: clamp(19px, 5cqw, 27px);
  line-height: 1.45;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
label {
  position: relative;
  cursor: pointer;
}
label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
label span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1.5px solid #9baeb6;
  border-radius: 12px;
  background: #ffffffd9;
  font-size: clamp(13px, 3.4cqw, 18px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
label input:checked + span {
  border-color: #17394c;
  background: #d2e5ef;
  box-shadow: inset 0 0 0 1px #17394c;
}
.letter {
  font-size: 0.85em;
  font-weight: 700;
  flex-shrink: 0;
}
.swatch {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid #52616a;
  border-radius: 50%;
}
.navigation {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}
.navigation button {
  font-size: clamp(12px, 3.1cqw, 16px);
  padding: 8px 12px;
  min-height: 44px;
}
.navigation .primary {
  flex: 1;
}
.result-copy {
  position: absolute;
  top: 17%;
  left: 23%;
  right: 8%;
  height: 29%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.result-copy h1 {
  font-size: clamp(20px, 6.5cqw, 35px);
  line-height: 1.2;
  margin: 0 0 8px;
}
.result-copy h2 {
  font-weight: 600;
  font-size: clamp(16px, 4.3cqw, 23px);
  line-height: 1.5;
  margin: 0 0 10px;
}
.result-copy #prediction {
  font-size: clamp(14px, 3.7cqw, 20px);
  line-height: 1.8;
  margin: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}
.color-name {
  font-size: clamp(11px, 2.8cqw, 15px);
  font-weight: bold;
  margin: 12px 0 0;
}
.result-actions {
  text-align: center;
  background: #f7f9fa;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.result-actions p {
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.hint {
  color: #51616b;
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 20px;
  max-width: 460px;
  width: calc(100% - 24px);
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #102637aa;
}
dialog h2 {
  font-size: 20px;
  margin-top: 0;
}
dialog p {
  line-height: 1.6;
}
dialog img {
  width: 100%;
  display: block;
  margin-bottom: 12px;
}
dialog a,
dialog button {
  margin: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 360px) {
  .quiz-content {
    top: 29.5%;
    bottom: 7%;
  }
  h1 {
    margin-bottom: 8px;
  }
  fieldset {
    gap: 6px;
  }
  label span {
    padding: 7px 8px;
    min-height: 44px;
  }
  .eyebrow {
    margin-bottom: 5px;
  }
  .navigation {
    padding-top: 8px;
  }
  .result-copy #prediction {
    line-height: 1.7;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  label span {
    transition:
      background 0.15s,
      box-shadow 0.15s;
  }
}
