:root {
  --navy: #17355f;
  --navy-2: #244d82;
  --blue: #3979c6;
  --sky: #e8f3ff;
  --mint: #dff7ef;
  --cream: #fbf8f1;
  --card: #ffffff;
  --text: #19314e;
  --muted: #65758a;
  --line: #d9e2ec;
  --gold: #f5b942;
  --success: #25865f;
  --danger: #b44444;
  --shadow: 0 12px 30px rgba(23,53,95,.10);
  --radius: 22px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); }
body { overscroll-behavior: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 4px solid rgba(57,121,198,.28); outline-offset: 2px; }
.app-shell { min-height: 100vh; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 72px; padding: max(12px, env(safe-area-inset-top)) 18px 10px; background: rgba(251,248,241,.96); border-bottom: 1px solid rgba(217,226,236,.7); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; flex: 1; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; grid-template-columns: 1fr 1fr; place-items: center; color: white; font-size: 12px; background: linear-gradient(145deg, var(--navy-2), var(--blue)); box-shadow: 0 8px 18px rgba(36,77,130,.24); }
.brand-mark span:first-child { transform: translate(4px,4px); }
.brand-mark span:last-child { transform: translate(-4px,-4px); }
.brand-title { font-size: 18px; font-weight: 850; letter-spacing: -.3px; }
.brand-subtitle { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.icon-button { border: 0; background: transparent; color: var(--navy); width: 44px; height: 44px; border-radius: 14px; font-size: 24px; display: grid; place-items: center; }
.icon-button:active { background: var(--sky); }
.screen { display: none; width: min(720px, 100%); margin: 0 auto; padding: 18px; animation: fadeIn .22s ease; }
.screen.active { display: block; }
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hero-card { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 24px; border-radius: 28px; color: white; background: radial-gradient(circle at 92% 10%, rgba(255,255,255,.24), transparent 32%), linear-gradient(145deg, var(--navy), var(--navy-2)); box-shadow: var(--shadow); }
.hero-card h1 { margin: 5px 0 8px; font-size: clamp(26px, 7vw, 38px); line-height: 1.04; letter-spacing: -.04em; }
.hero-card p { margin: 0; max-width: 440px; color: rgba(255,255,255,.82); line-height: 1.45; }
.eyebrow { font-size: 11px; font-weight: 850; letter-spacing: .12em; color: var(--blue); }
.hero-card .eyebrow { color: #acd2ff; }
.hero-score { width: 82px; height: 82px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); display: grid; place-content: center; text-align: center; flex-shrink: 0; }
.hero-score span { font-size: 30px; font-weight: 900; line-height: 1; }
.hero-score small { max-width: 55px; font-size: 10px; color: rgba(255,255,255,.8); }
.daily-card { width: 100%; margin: 16px 0 24px; border: 0; border-radius: var(--radius); background: var(--mint); color: var(--text); display: flex; gap: 13px; align-items: center; text-align: left; padding: 16px 18px; box-shadow: 0 7px 20px rgba(37,134,95,.08); }
.daily-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: white; color: var(--gold); font-size: 25px; }
.daily-copy { display: flex; flex-direction: column; flex: 1; }
.daily-copy strong { font-size: 16px; }
.daily-copy small { color: var(--muted); margin-top: 3px; }
.daily-arrow { font-size: 30px; color: var(--success); }
.section-heading, .game-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2, .game-heading h2, .panel-heading h2 { margin: 3px 0 0; font-size: 25px; letter-spacing: -.02em; }
.pill-button, .small-action { border: 1px solid var(--line); background: white; color: var(--navy); border-radius: 999px; padding: 10px 13px; font-weight: 750; font-size: 12px; white-space: nowrap; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.category-card { position: relative; overflow: hidden; min-height: 136px; border: 1px solid rgba(217,226,236,.9); border-radius: 22px; background: var(--card); text-align: left; padding: 16px; color: var(--text); box-shadow: 0 5px 16px rgba(23,53,95,.06); }
.category-card:active { transform: scale(.985); }
.category-card .category-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; font-size: 33px; margin-bottom: 12px; background: var(--accent-soft); }
.category-card strong { display: block; font-size: 16px; }
.category-card small { color: var(--muted); }
.category-card::after { content: ""; position: absolute; width: 78px; height: 78px; border-radius: 50%; right: -35px; top: -35px; background: var(--accent-soft); opacity: .8; }
.stats-card { margin: 18px 0 12px; display: grid; grid-template-columns: repeat(3,1fr); border-radius: var(--radius); background: white; border: 1px solid var(--line); overflow: hidden; }
.stats-card div { padding: 17px 8px; text-align: center; }
.stats-card div + div { border-left: 1px solid var(--line); }
.stats-card strong, .stats-card span { display: block; }
.stats-card strong { color: var(--navy); font-size: 20px; }
.stats-card span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.more-games-button { width: 100%; border: 0; border-radius: 17px; padding: 15px 17px; display: flex; justify-content: space-between; align-items: center; background: transparent; color: var(--blue); font-weight: 750; }
.score-strip { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 18px; background: white; margin-bottom: 14px; }
.score-strip div { text-align: center; padding: 12px 5px; }
.score-strip div + div { border-left: 1px solid var(--line); }
.score-strip span { display: block; color: var(--muted); font-size: 11px; }
.score-strip strong, .score-strip strong span { color: var(--navy); font-size: 18px; display: inline; }
.game-board { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0,1fr)); gap: 9px; perspective: 1000px; margin: 0 auto 16px; max-width: 620px; }
.memory-card { position: relative; aspect-ratio: .78; border: 0; border-radius: 15px; background: transparent; padding: 0; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.memory-card.flipped, .memory-card.matched { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; border-radius: 15px; backface-visibility: hidden; display: grid; place-items: center; overflow: hidden; }
.card-back { color: white; background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.24), transparent 25%), linear-gradient(145deg, var(--navy-2), var(--blue)); border: 2px solid rgba(255,255,255,.32); box-shadow: 0 7px 16px rgba(23,53,95,.15); }
.card-back::before { content: "★"; width: 42%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); font-size: clamp(17px,5vw,28px); }
.card-front { transform: rotateY(180deg); background: white; border: 2px solid #bed2e8; box-shadow: 0 7px 16px rgba(23,53,95,.10); }
.card-front .emoji { font-size: clamp(28px, 10vw, 52px); filter: drop-shadow(0 4px 4px rgba(23,53,95,.12)); }
.card-front .card-label { position: absolute; bottom: 5px; left: 3px; right: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(7px,2.4vw,11px); font-weight: 800; text-align: center; color: var(--navy); }
.memory-card.matched .card-front { border-color: #58b78d; background: #edf9f4; animation: matchPulse .42s ease; }
@keyframes matchPulse { 50% { transform: rotateY(180deg) scale(1.08); } }
.game-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; max-width: 620px; margin: 0 auto; }
.primary-action, .secondary-action, .primary-wide, .secondary-wide, .danger-wide { min-height: 50px; border-radius: 16px; font-weight: 800; border: 0; }
.primary-action, .primary-wide { color: white; background: linear-gradient(145deg, var(--navy-2), var(--blue)); box-shadow: 0 8px 18px rgba(57,121,198,.22); }
.secondary-action, .secondary-wide { color: var(--navy); background: white; border: 1px solid var(--line); }
.danger-wide { color: var(--danger); background: #fff2f2; border: 1px solid #f2cccc; }
.panel-heading { margin-bottom: 15px; }
.settings-list { border: 1px solid var(--line); background: white; border-radius: var(--radius); overflow: hidden; }
.setting-row { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 17px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row span { display: flex; flex-direction: column; }
.setting-row small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
.setting-row input { appearance: none; width: 48px; height: 28px; border-radius: 999px; background: #ccd6e2; position: relative; transition: .2s; flex-shrink: 0; }
.setting-row input::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .2s; }
.setting-row input:checked { background: var(--blue); }
.setting-row input:checked::after { transform: translateX(20px); }
.settings-actions { display: grid; gap: 10px; margin-top: 14px; }
.version-note { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0 0; }
.overlay { position: fixed; z-index: 50; inset: 0; background: rgba(14,32,55,.62); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-card { width: min(410px,100%); border-radius: 28px; background: white; padding: 26px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.modal-card.compact { max-width: 340px; }
.modal-card h2 { margin: 12px 0 5px; font-size: 28px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); }
.modal-icon { margin: auto; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 22px; color: var(--navy); background: var(--sky); font-size: 28px; font-weight: 900; }
.modal-icon.celebration { color: white; background: var(--success); }
.win-stars { color: var(--gold); letter-spacing: 6px; font-size: 23px; margin-bottom: 8px; }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); border-radius: 18px; background: var(--cream); margin-bottom: 16px; }
.result-grid div { padding: 14px 4px; }
.result-grid strong, .result-grid span { display: block; }
.result-grid strong { font-size: 20px; }
.result-grid span { color: var(--muted); font-size: 11px; }
.modal-card .primary-wide, .modal-card .secondary-wide { width: 100%; margin-top: 9px; }
.sheet { position: fixed; z-index: 55; inset: 0; display: flex; align-items: end; }
.sheet-scrim { position: absolute; inset: 0; border: 0; background: rgba(14,32,55,.55); }
.sheet-panel { position: relative; width: 100%; border-radius: 28px 28px 0 0; background: white; padding: 10px 18px max(22px, env(safe-area-inset-bottom)); box-shadow: 0 -18px 60px rgba(0,0,0,.24); }
.sheet-handle { width: 48px; height: 5px; border-radius: 999px; background: #cbd5df; margin: 0 auto 16px; }
.sheet-panel h2 { margin: 0 0 12px; }
.difficulty-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); background: white; border-radius: 17px; padding: 15px; text-align: left; color: var(--navy); margin-top: 9px; }
.difficulty-option span:first-child { display: flex; flex-direction: column; }
.difficulty-option small { color: var(--muted); margin-top: 2px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 36px); color: white; background: rgba(23,53,95,.96); padding: 12px 17px; border-radius: 14px; box-shadow: var(--shadow); text-align: center; font-size: 13px; }
body.large-cards .game-board { gap: 12px; max-width: 680px; }
body.large-cards .card-front .emoji { font-size: clamp(34px, 12vw, 60px); }
body.high-contrast { --text: #091d35; --muted: #3c4f64; --line: #8295aa; }
body.high-contrast .memory-card .card-face { border-width: 3px; }
@media (min-width: 600px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .screen { padding: 24px; }
  .game-board { gap: 12px; }
}
@media (max-width: 380px) {
  .hero-card { padding: 20px; }
  .hero-score { width: 70px; height: 70px; }
  .category-card { min-height: 124px; padding: 14px; }
  .game-board { gap: 7px; }
}

.site-home{color:var(--navy);font-size:12px;font-weight:750;text-decoration:none;padding:10px;border-radius:12px;background:var(--sky)}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* The embedded game occupies the player viewport without an internal catalogue. */
html,body{height:100%;min-height:0;overflow:hidden}
.app-shell{height:100vh;height:100dvh;min-height:0;padding:0}
.app-shell>main{height:100%}
#gameScreen{display:flex;flex-direction:column;width:100%;max-width:1000px;height:100%;min-height:0;margin:0 auto;padding:clamp(8px,2vh,20px) clamp(8px,2vw,24px);animation:none}
.game-heading{flex:none;align-items:center;margin:0 0 10px;gap:10px}
.game-heading h2{font-size:clamp(16px,2.5vh,24px);line-height:1.2}
.game-heading .eyebrow{font-size:10px}
.board-controls{display:flex;gap:8px;flex:none}
.small-action{padding:9px 12px}
.score-strip{flex:none;margin:0 0 10px}
.score-strip div{padding:8px 5px}
.board-space{display:grid;place-items:center;flex:1;min-height:0;min-width:0;overflow:hidden}
body .game-board{display:grid;flex:none;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));gap:var(--board-gap,8px);max-width:none;margin:0}
.memory-card{aspect-ratio:auto;min-height:0;min-width:0;border-radius:12px}
.card-face{border-radius:12px}
body .card-front .emoji{font-size:var(--emoji-size,32px)}
.card-front .card-label{font-size:var(--label-size,10px);bottom:4px}
.card-back::before{font-size:var(--emoji-size,32px)}
.game-actions{flex:none;width:100%;max-width:none;margin:10px 0 0}
.game-actions button{min-height:42px;font-size:13px;border-radius:12px}
.overlay{padding:12px;overflow:auto}
.modal-card{max-height:100%;overflow:auto}
.sheet-panel{max-height:100%;overflow:auto}
@media(max-height:450px){#gameScreen{padding:6px 12px}.game-heading{margin-bottom:5px}.game-heading h2{font-size:16px}.game-heading .eyebrow{display:none}.score-strip{margin-bottom:5px}.score-strip div{padding:4px}.score-strip strong,.score-strip strong span{font-size:15px}.game-actions{margin-top:5px}.game-actions button{min-height:34px}.small-action{padding:6px 10px}.card-front .card-label{bottom:2px}}
@media(max-width:420px){.game-heading h2{font-size:15px}.board-controls{gap:4px}.small-action{padding:8px;font-size:11px}}
