:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #66727f;
  --paper: #f7f3e8;
  --panel: #fffdf6;
  --line: rgba(23, 33, 43, 0.14);
  --teal: #05a7a0;
  --coral: #ff6b4a;
  --lemon: #ffd447;
  --violet: #5e55d6;
  --green: #35b86b;
  --shadow: 0 22px 55px rgba(23, 33, 43, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 212, 71, 0.34), transparent 28rem),
    linear-gradient(145deg, #f7f3e8 0%, #e9f4f3 48%, #f9ebe4 100%);
  color: var(--ink);
  overflow: auto;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100dvh;
  position: relative;
}

.screen {
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.hidden {
  display: none !important;
}

.setup-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}

.brand-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mark {
  align-items: center;
  display: flex;
  gap: 4px;
  height: 34px;
}

.mark span {
  border-radius: 999px;
  display: block;
  width: 14px;
}

.mark span:nth-child(1) {
  height: 22px;
  background: var(--teal);
}

.mark span:nth-child(2) {
  height: 32px;
  background: var(--coral);
}

.mark span:nth-child(3) {
  height: 18px;
  background: var(--lemon);
}

.intro h1 {
  font-size: clamp(50px, 9vw, 92px);
  line-height: 0.88;
  margin: 6px 0 10px;
  max-width: 720px;
}

.intro p {
  color: #34414d;
  font-size: clamp(17px, 2.8vw, 24px);
  line-height: 1.45;
  margin: 0;
  max-width: 680px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 18px;
  margin: 0;
}

.howto-strip {
  background: rgba(255, 253, 246, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.06);
  padding: 14px;
}

.mini-flow {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-step {
  align-items: center;
  background: white;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 58px 1fr;
  min-height: 78px;
  padding: 10px;
}

.mini-step strong,
.mini-step p {
  grid-column: 2;
}

.mini-step strong {
  font-size: 15px;
  line-height: 1.2;
}

.mini-step p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  margin: 4px 0 0;
}

.mini-art {
  grid-row: 1 / span 2;
  height: 50px;
  position: relative;
  width: 50px;
}

.forehead-art .head {
  background: #f0c6a7;
  border: 4px solid #17212b;
  border-radius: 50% 50% 42% 42%;
  bottom: 3px;
  height: 34px;
  left: 8px;
  position: absolute;
  width: 34px;
}

.forehead-art .head::before,
.forehead-art .head::after {
  background: #17212b;
  border-radius: 999px;
  content: "";
  height: 5px;
  position: absolute;
  top: 13px;
  width: 5px;
}

.forehead-art .head::before {
  left: 8px;
}

.forehead-art .head::after {
  right: 8px;
}

.forehead-art .phone {
  align-items: center;
  background: var(--coral);
  border: 3px solid #17212b;
  border-radius: 8px;
  color: white;
  display: flex;
  font-size: 13px;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  left: 7px;
  position: absolute;
  top: 0;
  width: 36px;
}

.hint-art {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
}

.hint-art span {
  background: var(--teal);
  border-radius: 999px 999px 999px 2px;
  display: block;
  height: 18px;
  width: 22px;
}

.hint-art span:nth-child(2) {
  background: var(--lemon);
  height: 26px;
}

.hint-art span:nth-child(3) {
  background: var(--violet);
}

.tilt-art {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.tilt-phone {
  align-items: center;
  background: var(--green);
  border: 3px solid #17212b;
  border-radius: 8px;
  color: white;
  display: flex;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  transform: rotate(18deg);
  width: 24px;
}

.pass-phone {
  background: #617080;
  transform: rotate(-18deg);
}

.setup-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1.45fr 0.9fr;
}

.panel {
  background: rgba(255, 253, 246, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.08);
  padding: 16px;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-title h2 {
  font-size: 18px;
  margin: 0;
}

.icon {
  align-items: center;
  background: var(--ink);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.category-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-card {
  align-items: center;
  background: white;
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 12px;
  min-height: 60px;
  padding: 10px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.category-card.active {
  background: #effcf8;
  border-color: var(--teal);
}

.category-card:active {
  transform: scale(0.98);
}

.category-card span {
  align-items: center;
  border-radius: 8px;
  color: white;
  display: inline-flex;
  font-size: 24px;
  height: 40px;
  justify-content: center;
  min-width: 40px;
}

.category-card strong {
  display: block;
  font-size: 16px;
}

.category-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.time-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}

.time-chip {
  background: white;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 46px;
  font-weight: 850;
}

.time-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.toggle-row {
  align-items: center;
  border-top: 1px solid var(--line);
  color: #34414d;
  display: flex;
  font-weight: 750;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.toggle-row input {
  accent-color: var(--teal);
  height: 22px;
  width: 22px;
}

.primary-action,
.secondary-action {
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
  min-height: 58px;
  padding: 0 22px;
}

.primary-action {
  background: var(--coral);
  box-shadow: 0 12px 28px rgba(255, 107, 74, 0.32);
  color: white;
}

.secondary-action {
  background: white;
  border: 2px solid var(--line);
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  gap: 6px 14px;
  justify-content: space-between;
  line-height: 1.55;
  padding: 4px 0 20px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.guide-screen {
  align-items: center;
  display: flex;
  justify-content: center;
}

.guide-shell {
  max-width: 980px;
  width: 100%;
}

.guide-copy {
  margin-bottom: 18px;
  text-align: center;
}

.guide-copy p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.guide-copy h2 {
  font-size: clamp(42px, 8vw, 82px);
  line-height: 0.98;
  margin: 0;
}

.guide-flow {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-card {
  background: rgba(255, 253, 246, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(23, 33, 43, 0.08);
  min-height: 320px;
  padding: 18px;
  position: relative;
}

.guide-number {
  align-items: center;
  background: #17212b;
  border-radius: 999px;
  color: white;
  display: flex;
  font-size: 18px;
  font-weight: 950;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
}

.guide-visual {
  height: 150px;
  margin: 22px auto 18px;
  position: relative;
  width: 190px;
}

.guide-visual.forehead-art .head {
  bottom: 8px;
  height: 104px;
  left: 42px;
  width: 104px;
}

.guide-visual.forehead-art .head::before,
.guide-visual.forehead-art .head::after {
  height: 10px;
  top: 42px;
  width: 10px;
}

.guide-visual.forehead-art .head::before {
  left: 28px;
}

.guide-visual.forehead-art .head::after {
  right: 28px;
}

.guide-visual.forehead-art .phone {
  border-radius: 12px;
  font-size: 20px;
  height: 68px;
  left: 46px;
  top: 0;
  width: 98px;
}

.clue-visual {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.clue-visual span {
  align-items: center;
  background: var(--teal);
  border: 3px solid #17212b;
  border-radius: 999px 999px 999px 8px;
  color: white;
  display: flex;
  font-size: 18px;
  font-weight: 950;
  height: 56px;
  justify-content: center;
  width: 72px;
}

.clue-visual span:nth-child(2) {
  background: var(--lemon);
  color: #17212b;
  transform: translateY(-18px);
}

.clue-visual span:nth-child(3) {
  background: var(--violet);
}

.tilt-visual {
  align-items: center;
  display: flex;
  gap: 22px;
  justify-content: center;
}

.tilt-visual span {
  align-items: center;
  border: 4px solid #17212b;
  border-radius: 14px;
  color: white;
  display: flex;
  font-size: 18px;
  font-weight: 950;
  height: 104px;
  justify-content: center;
  width: 66px;
}

.up-phone {
  background: #617080;
  transform: rotate(-18deg);
}

.down-phone {
  background: var(--green);
  transform: rotate(18deg);
}

.guide-card h3 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.guide-card p {
  color: #45525e;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
  margin: 0;
}

.guide-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.95fr 1.05fr;
  margin-top: 14px;
}

.countdown-screen,
.result-screen {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.countdown-screen p {
  color: var(--muted);
  font-size: 24px;
  font-weight: 850;
  margin: 0 0 10px;
}

#countdownNumber {
  font-size: clamp(120px, 34vw, 280px);
  font-weight: 950;
  line-height: 0.9;
}

.play-screen {
  background: #111820;
  color: white;
  display: grid;
  grid-template-rows: auto 74px minmax(220px, 1fr) 74px auto;
  gap: 10px;
  overflow: hidden;
}

.hud {
  display: flex;
  justify-content: space-between;
}

.hud > div {
  min-width: 96px;
}

.hud p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 850;
  margin: 0;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.tilt-guide {
  align-items: center;
  display: flex;
  justify-content: center;
  opacity: 0.86;
}

.tilt-guide span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  font-weight: 900;
  padding: 10px 18px;
}

.word-stage {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 212, 71, 0.95), rgba(255, 107, 74, 0.92)),
    var(--coral);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #111820;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  overflow: hidden;
  padding: 18px;
  position: relative;
  text-align: center;
  transform-origin: center;
  transition: transform 180ms ease, background 180ms ease;
}

.word-stage::before,
.word-stage::after {
  background: rgba(255, 255, 255, 0.2);
  content: "";
  height: 120%;
  position: absolute;
  transform: rotate(-16deg);
  width: 44px;
}

.word-stage::before {
  left: 12%;
}

.word-stage::after {
  right: 16%;
}

.word-stage p,
.word-stage h2 {
  position: relative;
  z-index: 1;
}

.word-stage p {
  background: rgba(17, 24, 32, 0.12);
  border-radius: 999px;
  font-size: clamp(14px, 3vw, 22px);
  font-weight: 900;
  margin: 0 0 18px;
  padding: 8px 16px;
}

.word-stage h2 {
  font-size: clamp(54px, 15vw, 176px);
  line-height: 0.95;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.word-stage.correct-flash {
  background: linear-gradient(135deg, #68e08f, #21b87c);
  transform: rotate(1deg) scale(0.985);
}

.word-stage.pass-flash {
  background: linear-gradient(135deg, #a9b4c0, #617080);
  color: white;
  transform: rotate(-1deg) scale(0.985);
}

.controls {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.control-button {
  border-radius: 8px;
  color: white;
  font-size: 20px;
  font-weight: 950;
  min-height: 56px;
}

.control-button.pass {
  background: #617080;
}

.control-button.correct {
  background: var(--green);
}

.result-screen {
  max-width: 680px;
  margin: 0 auto;
}

.result-kicker {
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 4px;
}

.result-screen h2 {
  font-size: clamp(46px, 12vw, 94px);
  line-height: 0.95;
  margin: 0 0 24px;
}

.result-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
}

.result-stats div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.result-stats span {
  display: block;
  font-size: 36px;
  font-weight: 950;
}

.result-stats p {
  color: var(--muted);
  font-weight: 850;
  margin: 2px 0 0;
}

.history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0;
  max-height: 28vh;
  overflow: auto;
}

.history span {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #34414d;
  font-weight: 800;
  padding: 7px 12px;
}

.history .got {
  background: #e8f9ee;
  color: #146b39;
}

.history .skipped {
  background: #eef1f4;
  color: #617080;
}

.result-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.9fr 1.1fr;
  width: 100%;
}

@media (max-width: 720px) {
  .mini-flow,
  .guide-flow,
  .guide-actions {
    grid-template-columns: 1fr;
  }

  .mini-step {
    min-height: 70px;
  }

  .guide-screen {
    align-items: flex-start;
  }

  .guide-copy {
    text-align: left;
  }

  .guide-card {
    min-height: auto;
  }

  .guide-visual {
    height: 124px;
    margin-bottom: 12px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .intro h1 {
    font-size: clamp(56px, 20vw, 92px);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .play-screen {
    grid-template-rows: auto 0 minmax(170px, 1fr) 0 auto;
  }

  .tilt-guide {
    display: none;
  }

  .hud strong {
    font-size: 30px;
  }

  .word-stage h2 {
    font-size: clamp(54px, 18vw, 130px);
  }
}
