@font-face { font-family: "Finger Paint"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/finger-paint.ttf") format("truetype"); }

:root { color-scheme: dark; --ink: #fff8e9; --muted: #d1c7e6; --gold: #ffe0a0; --heading: "Finger Paint", "Trebuchet MS", sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #12102d; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: "Trebuchet MS", Arial, sans-serif; font-size: 17px; line-height: 1.5; background: radial-gradient(ellipse at 12% 29%, #29377b70, transparent 47%), radial-gradient(ellipse at 91% 37%, #74206c48, transparent 50%), radial-gradient(ellipse at 50% 100%, #143a603d, transparent 58%), #12102d; min-height: 100vh; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; text-underline-offset: .25em; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #fff2bb; outline-offset: 6px; }
.skip { position: absolute; top: -100px; left: 1rem; z-index: 10; padding: 12px 20px; background: #342355; border-radius: 20px; }
.skip:focus { top: 1rem; }
.stardust { position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(circle, #ffe7ba9c 1px, transparent 1.8px), radial-gradient(circle, #b7d2ff70 1px, transparent 1.8px), radial-gradient(circle, #fff3df38 .7px, transparent 1.5px); background-size: 247px 269px, 193px 237px, 103px 141px; background-position: 18px 32px, 80px 100px, 31px 77px; opacity: .45; }
.topbar { position: relative; max-width: 1180px; margin: auto; padding: 25px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { color: var(--gold); font: 24px/1.2 var(--heading); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.wordmark > span { font-size: 30px; text-shadow: 0 0 20px #ffd78d77; }
.back-link { color: var(--muted); font-size: 14px; text-decoration: none; padding: 10px 0; }
.back-link:hover { color: var(--gold); }
main { position: relative; max-width: 950px; padding: 3px 24px 20px; margin: auto; }
.intro { text-align: center; padding-bottom: 20px; }
.eyebrow { color: #d2b6ef; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; margin: 6px 0 12px; }
h1 { font-family: var(--heading); font-size: clamp(30px, 4.6vw, 49px); line-height: 1.3; font-weight: 400; margin: 0 0 12px; }
h1 span { color: var(--gold); }
.intro-copy { color: var(--muted); font-size: 17px; margin: 0; line-height: 1.55; }
.play-space { width: min(100%, 790px); margin: auto; }
.game-settings { display: flex; justify-content: center; gap: 16px; margin: 0 auto 9px; }
.setting { display: grid; gap: 5px; font-size: 12px; color: var(--muted); min-width: 0; }
.setting select { max-width: 100%; min-height: 44px; padding: 9px 30px 9px 12px; border: 1px solid #b7a3dd70; border-radius: 12px; background: #2a224a; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.setting select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.deck-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 0 0 17px; }
.game-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 18px; padding: 0 3px; }
.progress { display: flex; align-items: center; gap: 12px; }
.progress-stars { display: inline-flex; gap: 5px; font-size: 26px; color: #807196; line-height: 1; }
.progress-stars .found { color: #ffdb87; text-shadow: 0 0 13px #ffca6777; }
#progress-label { font-size: 14px; color: var(--muted); }
.quiet-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 16px; border: 1px solid #b7a3dd48; border-radius: 16px; color: #f2e9ff; background: #2a224a; font-size: 14px; }
.quiet-button:hover { background: #3b2a61; border-color: #dcc4ff80; }
.quiet-button:disabled { opacity: .5; }
.quiet-button > span { font-size: 22px; line-height: 1; }
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; max-width: 660px; margin: auto; }
.board[data-count="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; }
.board[data-count="12"] { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 560px; }
.board[data-count="48"] { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: 790px; gap: 10px; }
.card { position: relative; border: 0; padding: 0; background: transparent; width: 100%; aspect-ratio: 1; border-radius: 25px; perspective: 1000px; cursor: pointer; }
.card[aria-disabled="true"] { cursor: default; }
.card-inner { display: block; position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .48s cubic-bezier(.2,.7,.2,1); }
.card.is-open .card-inner { transform: rotateY(180deg); }
.card-back, .card-front { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 25px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1.5px solid #e2bb776e; overflow: hidden; box-shadow: 0 12px 30px #050a1d55, inset 0 0 0 5px #e5c58c0a; }
.card-back { flex-direction: column; background: radial-gradient(ellipse at 50% 34%, #724b9c60, transparent 60%), radial-gradient(circle at 10% 95%, #3360b960, transparent 70%), linear-gradient(145deg, #43336e, #242f59 70%, #282045); }
.card-back::before { content: ""; position: absolute; inset: 8px; border: 1px solid #e8c68330; border-radius: 18px; }
.card-back::after { content: "✧"; position: absolute; top: 14%; right: 18%; font-size: 17px; color: #dcb9ff; }
.orbit { position: relative; display: grid; place-items: center; width: 50%; aspect-ratio: 1; border: 1px solid #edd09233; border-radius: 50%; margin: 3% 0 5%; }
.orbit::before { content: ""; position: absolute; inset: -10px 13px; border: 1px solid #edd09230; border-radius: 50%; transform: rotate(40deg); }
.orbit::after { content: ""; width: 6px; height: 6px; background: #ffdfa4; border-radius: 50%; position: absolute; top: 10%; right: 11%; box-shadow: 0 0 12px #ffdf85; }
.card-star { font-size: clamp(38px, 7vw, 77px); line-height: 1; color: #ffe3a7; text-shadow: 0 0 28px #fac88555; }
.card-brand { font: clamp(12px, 1.6vw, 19px)/1.4 var(--heading); color: #f3e5cf; }
.card-dots { color: #bb9cd9; letter-spacing: 5px; font-size: 10px; margin-top: 7px; }
.card-front { transform: rotateY(180deg); background: #102346; }
.card-front img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card.is-matched .card-front { border: 2px solid #e9d293; box-shadow: 0 0 0 3px #ffdf9e25, 0 10px 25px #03081c55; }
.match-mark { position: absolute; right: 9px; bottom: 9px; display: none; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #152e25; font-weight: bold; background: #e2f7bf; box-shadow: 0 2px 10px #06152a88; }
.card.is-matched .match-mark { display: flex; }
@media (hover: hover) { .card:not(.is-open):not(:disabled):hover .card-back { border-color: #ffe2a3; box-shadow: 0 0 22px #b88df533; } }
.game-feedback { min-height: 111px; padding: 18px 5px 12px; text-align: center; }
.game-feedback p { margin: 0 0 12px; color: #ddd1ed; font-size: 15px; }
.victory-stars { display: none; color: #ffdb91; font-size: 30px; letter-spacing: 12px; line-height: 1.3; margin: 0 0 8px 12px; text-shadow: 0 0 22px #f8b5ff77; }
.play-space.is-complete .victory-stars { display: block; }
.play-space.is-complete .game-feedback { margin-top: 18px; padding: 20px 12px; border: 1px solid #e7bf7959; border-radius: 22px; background: radial-gradient(ellipse at top, #7d438b44, #2c285536); }
.play-space.is-complete .game-feedback p { color: var(--gold); font-family: var(--heading); font-size: 18px; }
.gold-button { min-height: 46px; border: 1px solid #fff0bc; color: #30213e; background: linear-gradient(120deg, #ffe5aa, #eec57c); border-radius: 18px 22px 18px 22px; padding: 11px 23px; font-weight: 700; box-shadow: 0 5px 25px #ffd68915; }
.gold-button:hover { background: #fff0c9; }
.below-game { width: min(100%, 790px); margin: 0 auto; padding-top: 10px; border-top: 1px solid #c9b2e126; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.instructions { max-width: 490px; color: var(--muted); font-size: 14px; }
.instructions summary { cursor: pointer; padding: 12px 0; min-height: 44px; }
.instructions p { margin: 4px 0 14px; line-height: 1.7; }
.gallery-button { flex-shrink: 0; background: transparent; color: var(--gold); border: 0; padding: 10px 0 10px 12px; font-size: 14px; min-height: 44px; }
.gallery-button span { font-size: 19px; padding-right: 4px; }
.closing-line { color: #a99abf; text-align: center; font-size: 12px; margin: 20px 0 0; }
footer { position: relative; display: flex; justify-content: center; align-items: center; gap: 17px; padding: 12px 20px 25px; color: #b4a1c5; font-size: 12px; }
footer a { padding: 10px 0; }
footer span { color: #c9a46f; }
dialog { padding: 18px; color: var(--ink); background: #19162f; border: 1px solid #d9b88670; border-radius: 25px; width: min(610px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 80px #0009; }
dialog::backdrop { background: #070b20d9; backdrop-filter: blur(7px); }
.gallery-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.gallery-top h2 { margin: 0; font: 19px/1.4 var(--heading); color: var(--gold); }
.close-button { background: #35274f; border: 1px solid #b598ce66; color: #fff5e1; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; flex-shrink: 0; }
dialog figure { margin: 0; text-align: center; }
dialog figure img { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(100dvh - 255px); margin: auto; object-fit: contain; border-radius: 14px; }
dialog figcaption { color: #fff2d4; font: 16px/1.5 var(--heading); margin-top: 12px; }
.gallery-controls { display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.gallery-controls button { min-width: 48px; }
.noscript { padding: 20px; border: 1px solid #e6c895; }
@media (max-width: 600px) {
  .topbar { padding: 17px 20px; gap: 12px; }
  .wordmark { font-size: 19px; gap: 6px; }
  .wordmark > span { font-size: 23px; }
  .back-link { font-size: 12px; }
  main { padding: 4px 18px 12px; }
  .intro { padding-bottom: 20px; }
  .eyebrow { font-size: 10px; margin-bottom: 11px; }
  h1 { font-size: clamp(26px, 7.4vw, 37px); }
  .intro-copy { font-size: 15px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .card, .card-front, .card-back { border-radius: 20px; }
  .card-back::before { border-radius: 14px; inset: 6px; }
  .card-star { font-size: 55px; }
  .card-brand { font-size: 15px; }
  .game-toolbar { gap: 8px; margin-bottom: 13px; }
  .progress { gap: 8px; }
  .progress-stars { font-size: 20px; gap: 2px; }
  #progress-label { font-size: 12px; }
  #restart { font-size: 12px; padding: 8px 11px; }
  .game-feedback { min-height: 109px; }
  .below-game { gap: 8px; }
  .instructions, .gallery-button { font-size: 13px; }
  .closing-line { font-size: 11px; }
}
@media (max-width: 350px) {
  .topbar { padding-inline: 13px; }
  .back-link { font-size: 11px; }
  main { padding-inline: 13px; }
  .progress { display: block; }
  .progress-stars { display: flex; margin-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-inner { transition: none; }
}

/* Compact cards keep larger rounds visible together. */
.card, .card-back, .card-front { border-radius: 14px; }
.card-inner { transition-duration: .32s; }
.card-back::before { inset: 5px; border-radius: 10px; }
.card-back::after { font-size: 10px; }
.card-star { font-size: clamp(26px, 4vw, 41px); }
.card-brand { font-size: 11px; }
.orbit { width: 43%; margin: 4% 0 7%; }
.orbit::before { inset: -6px 7px; }
.orbit::after { width: 4px; height: 4px; }
.card-front-simple { background: radial-gradient(ellipse at 50% 35%, #fffaf0, #e9dcf6); }
.card-front-simple img { padding: 7%; }
.match-mark { width: 23px; height: 23px; right: 4px; bottom: 4px; font-size: 13px; }
.game-feedback { min-height: 68px; }
@media (max-width: 600px) {
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .board[data-count="6"] { max-width: 330px; gap: 9px; }
  .board[data-count="12"] { max-width: 100%; }
  .board[data-count="48"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .game-settings { gap: 10px; }
  .setting { flex: 1; }
  .setting select { width: 100%; font-size: 12px; padding-right: 18px; padding-left: 8px; }
  .deck-hint { font-size: 11px; }
  .card, .card-back, .card-front { border-radius: 10px; }
  .card-back::before { inset: 4px; border-radius: 7px; }
  .card-star { font-size: 25px; }
  .card-brand { font-size: 9px; }
  .card-back::after { font-size: 8px; }
  .match-mark { width: 18px; height: 18px; font-size: 11px; }
  .below-game { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .card-inner { transition: none; } }

/* Large symbol rounds: compact, colourful and still comfortable to tap. */
.board[data-count="92"] { grid-template-columns: repeat(12, minmax(0, 1fr)); max-width: 790px; gap: 7px; }
.board[data-count="92"] .card { min-height: 44px; }
.board[data-count="92"] .card-back { background: radial-gradient(ellipse at 15% 15%,#ffdd8b88,transparent 65%),linear-gradient(135deg,#b758b4,#7b67c0 52%,#35aeb7); border-color:#fbe5a9; }
.board[data-count="92"] .card-brand { font-size: 8px; color:#fff8e7; }
.board[data-count="92"] .card-star { font-size: 26px; color:#fff0a7; }
.board[data-count="92"] .card-back::before { border-color:#fff6d65c; }
.card-front-symbol { background:#ffe4e8; }
.card-front-symbol img { object-fit:contain; }
.board[data-count="92"] .match-mark { width:16px;height:16px;right:2px;bottom:2px;font-size:10px; }
@media(max-width:900px) { .board[data-count="92"] { grid-template-columns:repeat(10,minmax(0,1fr)); } }
@media(max-width:600px) { .board[data-count="92"] { grid-template-columns:repeat(6,minmax(0,1fr));gap:6px; }.board[data-count="92"] .card-brand { font-size:7px; }.board[data-count="92"] .card-star { font-size:23px; } }
@media(max-width:360px) { .board[data-count="92"] { grid-template-columns:repeat(5,minmax(0,1fr)); } }
