@font-face {
  font-family: 'Nunito Sans';
  src: url('assets/fonts/NunitoSans-Latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3eaf7;
  --paper: #fff;
  --ink: #2f2440;
  --muted: #655a70;
  --accent: #8e3d66;
  --accent-deep: #712f50;
  --rose: #d9a8b9;
  --rose-pale: #f7e6ed;
  --line: #dfd0e5;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(55, 29, 65, .09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: 'Nunito Sans', 'Trebuchet MS', sans-serif; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-deep); }
:focus-visible { outline: 4px solid #255ab3; outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 99; padding: 12px 18px; background: var(--paper); color: var(--ink); border-radius: var(--radius); }

.site-shell { min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; }
.site-header, .site-footer { width: min(100% - 48px, 1392px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header { min-height: 74px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 11px; border: 0; background: transparent; color: var(--ink); padding: 8px 0; font-size: 21px; font-weight: 850; letter-spacing: -.04em; }
.wordmark-mark { position: relative; width: 30px; height: 30px; display: inline-block; }
.wordmark-mark span { position: absolute; width: 19px; height: 24px; border: 2px solid var(--accent); border-radius: 5px; background: var(--paper); transform: rotate(-12deg); left: 3px; top: 3px; }
.wordmark-mark span + span { background: var(--rose); transform: rotate(8deg); left: 10px; top: 2px; }
.header-note { font-size: 12px; font-weight: 800; letter-spacing: .18em; color: var(--muted); }
.site-footer { min-height: 46px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a { text-decoration-thickness: 1px; text-underline-offset: 2px; }

#main { width: min(100% - 48px, 1392px); margin: 0 auto; min-width: 0; }
#app { min-height: 100%; }
.view { padding: 34px 0 28px; }
.home-head, .setup-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.home-head h1, .setup-head h1 { margin: 0; font-size: clamp(36px, 4vw, 55px); line-height: 1.06; letter-spacing: -.055em; font-weight: 900; }
.home-head p, .setup-head p { margin: 10px 0 0; font-size: 17px; color: var(--muted); line-height: 1.35; }
.head-counter { min-width: 130px; color: var(--accent); font-size: 14px; font-weight: 800; text-align: right; white-space: nowrap; }
.head-counter strong { display: block; color: var(--ink); font-size: 46px; line-height: 1; letter-spacing: -.06em; }

.category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.category-tile { min-height: 170px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; text-align: left; padding: 18px; border: 2px solid transparent; border-radius: var(--radius); background: var(--paper); color: var(--ink); box-shadow: 0 5px 18px rgba(55, 29, 65, .045); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.category-tile:hover { transform: translateY(-3px); border-color: var(--rose); box-shadow: var(--shadow); }
.category-tile:active { transform: translateY(0); }
.category-tile .visual { width: 55px; height: 55px; margin: 0; }
.category-tile .visual-emoji img, .category-tile .visual-emoji .native-emoji { width: 55px; height: 55px; font-size: 48px; }
.category-tile .visual-combo { width: 82px; height: 55px; }
.category-tile .visual-combo img, .category-tile .visual-combo .native-emoji { width: 52px; height: 52px; font-size: 42px; }
.category-tile .visual-number { font-size: 45px; }
.category-tile .tile-meta { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.category-tile strong { display: block; min-width: 0; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.1; font-weight: 850; overflow-wrap: anywhere; }
.category-tile small { flex: none; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.category-tile .tile-arrow { position: absolute; right: 16px; top: 14px; font-size: 22px; color: var(--accent); }

.back-button { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0 8px 0 0; color: var(--accent-deep); font-weight: 850; }
.back-button span { font-size: 23px; font-weight: 500; line-height: 1; }
.setup-head { align-items: center; margin-top: 8px; }
.setup-head h1 { font-size: clamp(34px, 3.4vw, 49px); }
.setup-head .title-group { display: flex; flex-direction: column; align-items: flex-start; }
.setup-count { font-size: 22px; font-weight: 900; color: var(--accent-deep); white-space: nowrap; }
.setup-actions { display: flex; gap: 10px; margin: 6px 0 18px; }
.text-button { min-height: 43px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 8px 14px; border-radius: var(--radius); font-weight: 800; }
.text-button:hover { border-color: var(--accent); }
.selection-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.selection-item { min-height: 82px; display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.selection-item:has(input:checked) { border-color: var(--accent); }
.selection-item:hover { background: #fcf8fd; }
.selection-item input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.selection-item .visual { width: 52px; height: 52px; margin: 0; flex: none; }
.selection-item .visual-emoji img, .selection-item .visual-emoji .native-emoji { width: 52px; height: 52px; font-size: 43px; }
.selection-item .visual-combo { width: 65px; }
.selection-item .visual-combo img, .selection-item .visual-combo .native-emoji { width: 39px; height: 39px; font-size: 35px; }
.selection-item .visual-number { font-size: 40px; }
.selection-item .visual-clock svg, .selection-item .visual-preposition svg, .selection-item .visual-daypart svg, .selection-item .visual-shape svg { width: 52px; height: 52px; }
.selection-item .selection-answer { min-width: 0; font-weight: 850; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.setup-bottom { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0 0; margin-top: 16px; background: var(--bg); border-top: 1px solid var(--line); }
.setup-bottom p { margin: 0; color: var(--muted); font-size: 14px; }
.primary-button, .secondary-button { min-height: 55px; border-radius: var(--radius); padding: 11px 22px; font-size: 17px; font-weight: 900; border: 2px solid var(--accent); }
.primary-button { color: var(--paper); background: var(--accent); }
.primary-button:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
.primary-button:disabled { opacity: .45; }
.secondary-button { color: var(--accent-deep); background: var(--paper); }
.secondary-button:hover:not(:disabled) { background: var(--rose-pale); }

.game-view { display: flex; flex-direction: column; min-height: calc(100svh - 121px); padding: 16px 0 14px; }
.game-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 50px; }
.game-top .back-button { justify-self: start; }
.game-label { font-size: 22px; font-weight: 900; text-align: center; }
.game-tools { justify-self: end; display: flex; align-items: center; gap: 12px; }
.game-progress { color: var(--accent-deep); font-size: 21px; font-weight: 900; white-space: nowrap; }
.icon-button { width: 56px; height: 56px; display: inline-grid; place-items: center; border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper); }
.icon-button:hover { border-color: var(--accent); }
.icon-button svg { width: 23px; height: 23px; }
.game-stage { position: relative; isolation: isolate; flex: 1; min-height: 470px; display: grid; place-items: center; padding: 18px 72px; }
.game-stage::before { content: ''; position: absolute; z-index: -2; width: min(66vw, 910px); height: min(62vh, 590px); bottom: 5px; border-radius: 48% 48% 0 0; background: #e9d4e5; }
.game-stage::after { content: ''; position: absolute; z-index: -1; width: min(69vw, 945px); height: 25px; bottom: 2px; border-radius: 50%; background: rgba(55, 29, 65, .12); filter: blur(13px); }
.confetti-layer { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.confetti-piece { position: absolute; left: 50%; top: 42%; width: 9px; height: 14px; border-radius: 2px; background: var(--accent); opacity: 0; animation: confetti-burst 1.08s cubic-bezier(.18,.7,.24,1) both; animation-delay: .22s; }
.confetti-piece:nth-child(3n + 2) { background: #d884a7; }
.confetti-piece:nth-child(3n) { background: #f2bc69; }
.confetti-piece:nth-child(4n) { width: 10px; height: 10px; border-radius: 50%; }
.confetti-piece:nth-child(1) { --dx: -285px; --dy: -210px; --turn: -240deg; }
.confetti-piece:nth-child(2) { --dx: -230px; --dy: -120px; --turn: 180deg; animation-delay: .25s; }
.confetti-piece:nth-child(3) { --dx: -180px; --dy: 45px; --turn: -130deg; }
.confetti-piece:nth-child(4) { --dx: -130px; --dy: -240px; --turn: 270deg; animation-delay: .26s; }
.confetti-piece:nth-child(5) { --dx: -95px; --dy: -30px; --turn: 170deg; }
.confetti-piece:nth-child(6) { --dx: -50px; --dy: -165px; --turn: -240deg; animation-delay: .28s; }
.confetti-piece:nth-child(7) { --dx: -25px; --dy: -80px; --turn: 240deg; }
.confetti-piece:nth-child(8) { --dx: 25px; --dy: -245px; --turn: -280deg; animation-delay: .26s; }
.confetti-piece:nth-child(9) { --dx: 65px; --dy: -80px; --turn: 160deg; }
.confetti-piece:nth-child(10) { --dx: 100px; --dy: -190px; --turn: 260deg; animation-delay: .24s; }
.confetti-piece:nth-child(11) { --dx: 145px; --dy: 70px; --turn: -180deg; }
.confetti-piece:nth-child(12) { --dx: 190px; --dy: -255px; --turn: 240deg; animation-delay: .29s; }
.confetti-piece:nth-child(13) { --dx: 245px; --dy: -70px; --turn: -280deg; }
.confetti-piece:nth-child(14) { --dx: 295px; --dy: 70px; --turn: 130deg; animation-delay: .27s; }
.confetti-piece:nth-child(15) { --dx: -305px; --dy: 80px; --turn: 200deg; }
.confetti-piece:nth-child(16) { --dx: -215px; --dy: 75px; --turn: -160deg; animation-delay: .25s; }
.confetti-piece:nth-child(17) { --dx: 215px; --dy: 80px; --turn: 120deg; }
.confetti-piece:nth-child(18) { --dx: 5px; --dy: -265px; --turn: -120deg; animation-delay: .28s; }
@keyframes confetti-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(.4); }
  12% { opacity: 1; }
  65% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--turn)) scale(.9); }
}
.scene-mark { position: absolute; z-index: -1; width: 64px; height: 135px; top: 50%; background: var(--rose); transform: translateY(-50%) rotate(-8deg); border-radius: var(--radius); transition: transform .46s ease; }
.scene-mark.left { left: max(0px, calc(50% - 475px)); }
.scene-mark.right { right: max(0px, calc(50% - 475px)); transform: translateY(-50%) rotate(8deg); }
.game-stage:has(.flip-card.is-flipped) .scene-mark.left { transform: translate(-14px, -50%) rotate(-8deg); }
.game-stage:has(.flip-card.is-flipped) .scene-mark.right { transform: translate(14px, -50%) rotate(8deg); }
.flip-card { width: min(100%, 790px); height: clamp(430px, 59vh, 570px); display: block; border: 0; padding: 0; color: var(--ink); background: transparent; text-align: center; perspective: 1500px; border-radius: var(--radius); }
.flip-card-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .46s cubic-bezier(.42,0,.58,1); transform-style: preserve-3d; }
.flip-card.is-flipped .flip-card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; padding: 28px; }
.card-face::before { content: ''; position: absolute; width: 82%; height: 77%; border: 2px solid #f0e4f0; border-radius: 48% 48% 14px 14px; top: 8%; left: 9%; z-index: 0; pointer-events: none; }
.card-face > * { position: relative; z-index: 1; }
.card-face.front { opacity: 1; transition: opacity 0s linear .23s; }
.card-face.back { transform: rotateY(180deg); opacity: 0; transition: opacity 0s linear .23s; }
.flip-card.is-flipped .card-face.front { opacity: 0; }
.flip-card.is-flipped .card-face.back { opacity: 1; }
.card-face .visual { width: min(61%, 375px); height: min(65%, 355px); }
.card-face.back .visual { height: 225px; max-height: 44%; }
.card-answer { margin: 0; max-width: 95%; color: var(--accent-deep); font-size: clamp(38px, 5.7vw, 78px); font-weight: 900; letter-spacing: -.045em; line-height: 1.06; text-wrap: balance; }
.card-answer.is-long { font-size: clamp(29px, 4.5vw, 61px); }
.card-hint { position: absolute !important; bottom: 22px; font-size: 17px; color: var(--muted); font-weight: 850; }
.game-nav { min-height: 77px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.game-nav button { min-width: 170px; }
.game-instruction { margin: 0; color: var(--muted); text-align: center; font-size: 18px; font-weight: 750; }
.finish-panel { align-self: center; margin: auto 0; width: min(100%, 610px); text-align: center; padding: 46px 35px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.finish-panel .finish-art { font-size: 76px; line-height: 1; margin-bottom: 12px; }
.finish-panel h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.03; margin: 0 0 8px; letter-spacing: -.05em; }
.finish-panel p { margin: 0 0 25px; color: var(--muted); font-size: 19px; }
.finish-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.visual { position: relative; display: grid; place-items: center; margin: 0 auto; }
.visual-emoji .emoji-piece { display: grid; place-items: center; width: 100%; height: 100%; }
.visual-emoji img, .visual-emoji .native-emoji { display: block; width: 100%; height: 100%; max-width: 315px; max-height: 315px; object-fit: contain; }
.card-face.back .visual-emoji img, .card-face.back .visual-emoji .native-emoji { width: 180px; height: 180px; max-width: 180px; max-height: 180px; }
.native-emoji { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif; line-height: 1; font-size: min(25vw, 240px); }
.visual-combo { width: min(100%, 390px); height: min(100%, 340px); display: flex; align-items: center; justify-content: center; gap: 2%; }
.visual-combo .emoji-piece { flex: 1 1 0; min-width: 0; display: grid; place-items: center; }
.visual-combo img, .visual-combo .native-emoji { width: 100%; max-width: 210px; max-height: 260px; object-fit: contain; font-size: min(15vw, 150px); }
.card-face.back .visual-combo img, .card-face.back .visual-combo .native-emoji { max-width: 160px; max-height: 160px; }
.visual-number { color: var(--accent-deep); font-size: clamp(118px, 22vw, 265px); font-weight: 900; letter-spacing: -.08em; line-height: 1; }
.card-face.back .visual-number { font-size: clamp(84px, 11vw, 135px); }
.visual-routine { grid-template-columns: 1fr 1fr; align-items: end; column-gap: 3%; }
.visual-routine .routine-light { position: absolute; right: 10%; top: 1%; width: 25%; height: 25%; }
.visual-routine .routine-person, .visual-routine .routine-object { width: 100%; height: 72%; display: grid; place-items: end center; }
.visual-routine .emoji-piece { display: grid; place-items: center; width: 100%; height: 100%; }
.visual-routine img, .visual-routine .native-emoji { display: block; width: 100%; height: 100%; object-fit: contain; font-size: min(15vw, 150px); }
.card-face.back .visual-routine img, .card-face.back .visual-routine .native-emoji { width: 130px; height: 130px; max-width: 130px; max-height: 130px; }
.visual-routine.routine-wake-up .routine-person { width: 130%; transform: translateX(10%); }
.visual-routine.routine-bed .routine-object { width: 135%; transform: translateX(-5%); }
.visual-color .color-swatch { width: 75%; aspect-ratio: 1; border: 5px solid rgba(47, 36, 64, .18); border-radius: 50%; box-shadow: 10px 10px 0 #f0e3ee; }
.card-face.back .visual-color .color-swatch { width: 140px; }
.swatch-red { background: #e53935; }
.swatch-blue { background: #1e88e5; }
.swatch-yellow { background: #fdd835; }
.swatch-green { background: #43a047; }
.swatch-orange { background: #fb8c00; }
.swatch-purple { background: #8e24aa; }
.swatch-pink { background: #ec407a; }
.swatch-black { background: #202124; }
.visual svg { display: block; width: auto; height: 100%; max-width: 100%; max-height: 100%; overflow: visible; justify-self: center; align-self: center; }
.card-face.front :is(.visual-clock, .visual-preposition, .visual-daypart, .visual-shape, .visual-hair, .visual-action) > svg { width: clamp(215px, 31vw, 310px); height: clamp(215px, 31vw, 310px); max-width: none; max-height: none; }
.card-face.back :is(.visual-clock, .visual-preposition, .visual-daypart, .visual-shape, .visual-hair, .visual-action) > svg { width: min(180px, 40vw); height: min(180px, 40vw); max-width: none; max-height: none; }
.card-face.front .visual-preposition svg { transform: scale(1.35); }

@media (max-width: 1080px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .selection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-stage { padding-inline: 35px; }
}
@media (max-width: 760px) {
  .site-header, .site-footer, #main { width: min(100% - 30px, 680px); }
  .site-header { min-height: 66px; }
  .header-note { display: none; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 11px 0; }
  .view { padding-top: 27px; }
  .home-head, .setup-head { align-items: flex-start; }
  .home-head { flex-direction: column; gap: 10px; }
  .head-counter { text-align: left; }
  .head-counter strong { display: inline; margin-right: 6px; font-size: 25px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-tile { min-height: 140px; padding: 14px; }
  .category-tile strong { font-size: 17px; }
  .category-tile[data-category="transportation"] strong { font-size: 15px; letter-spacing: -.04em; }
  .selection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-bottom { flex-direction: column; align-items: stretch; padding-bottom: 9px; }
  .setup-bottom p { text-align: center; }
  .game-view { min-height: calc(100svh - 120px); }
  .game-top { grid-template-columns: auto 1fr auto; }
  .game-label { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .game-stage { min-height: 420px; padding: 13px 0; }
  .game-stage::before { width: 95%; height: 77%; }
  .scene-mark { display: none; }
  .flip-card { height: min(55vh, 520px); min-height: 350px; }
  .card-face .visual { width: min(80%, 310px); }
  .game-nav button { min-width: 0; flex: 1; }
}
@media (max-width: 480px) {
  .wordmark { font-size: 18px; }
  .home-head h1, .setup-head h1 { font-size: 37px; }
  .setup-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .selection-grid { grid-template-columns: 1fr; }
  .selection-item { min-height: 70px; }
  .game-top { grid-template-columns: auto 1fr auto; gap: 5px; }
  .game-top .back-button { font-size: 0; padding-right: 0; }
  .game-top .back-button span { font-size: 26px; }
  .game-tools { gap: 5px; }
  .game-progress { font-size: 14px; }
  .icon-button { width: 48px; height: 48px; }
  .game-stage { min-height: 360px; }
  .flip-card { min-height: 325px; height: 45vh; }
  .card-face { padding: 13px; }
  .card-face .visual { height: 60%; }
  .card-face.back .visual { height: 145px; max-height: 43%; }
  .card-face.back .visual-color .color-swatch { width: 100px; }
  .card-face.back .visual-number { font-size: clamp(76px, 22vw, 110px); }
  .card-face.back .visual-emoji img, .card-face.back .visual-emoji .native-emoji { width: 125px; height: 125px; max-width: 125px; max-height: 125px; }
  .card-face.back .visual-routine img, .card-face.back .visual-routine .native-emoji { width: 95px; height: 95px; max-width: 95px; max-height: 95px; }
  .card-answer { font-size: clamp(31px, 8vw, 46px); }
  .card-answer.is-long { font-size: clamp(25px, 6.6vw, 39px); }
  .card-hint { font-size: 14px; }
  .game-instruction { font-size: 15px; }
  .game-nav { gap: 9px; }
  .game-nav button { padding-inline: 7px; font-size: 15px; }
}
@media (max-height: 790px) and (min-width: 761px) {
  .game-stage { min-height: 390px; }
  .flip-card { height: min(54vh, 475px); }
  .game-stage::before { height: 94%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .confetti-layer { display: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .card-face { transition-delay: 0s !important; }
  .flip-card-inner, .flip-card.is-flipped .flip-card-inner { transform: none; }
  .card-face.back { transform: none; opacity: 0; }
  .flip-card.is-flipped .card-face.front { opacity: 0; }
  .flip-card.is-flipped .card-face.back { opacity: 1; }
}
