/* PlayNSolve site shell (header, hero, cards, game page, footer). Game internals live in styles.css. */
:root { --maxw: 1160px; --r-lg: 18px; --r-md: 12px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 50; padding: .6rem 1rem; background: var(--secondary); color: var(--ink); font-weight: 800; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
[hidden] { display: none !important; }

/* Keyboard focus: one clear ring for every interactive element (mouse clicks stay clean) */
a:focus-visible, button:focus-visible, .gcard-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg), transparent 15%); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; gap: 1rem; width: min(var(--maxw), calc(100% - 2rem)); margin: 0 auto; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #4cc9f0); color: var(--ink); font-weight: 900; }
.site-nav { display: flex; gap: .25rem; margin-left: 1rem; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: .45rem .75rem; border-radius: 999px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .9rem; border-radius: 999px; font-weight: 800; }
.pill-daily { background: color-mix(in srgb, var(--secondary), transparent 82%); color: var(--secondary); border: 1px solid color-mix(in srgb, var(--secondary), transparent 60%); }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: 0 1.3rem; border-radius: 999px; font-weight: 800; border: 1px solid transparent; transition: transform .12s ease, background .12s; cursor: pointer; font-size: 1rem; }
.btn:active { transform: scale(.97); }
.btn-ghost:focus-visible, .btn-primary:focus-visible { outline-offset: 3px; }
.pill-daily:hover { background: color-mix(in srgb, var(--secondary), transparent 72%); }
.btn-primary { background: var(--primary); color: var(--ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary), transparent 65%); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

/* Layout */
.section { width: min(var(--maxw), calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0; }
h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 0 0 1rem; letter-spacing: -.01em; }
.lede { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 60ch; margin: 0; }
.kicker { display: inline-block; margin: 0 0 1rem; padding: .3rem .75rem; border-radius: 999px; background: color-mix(in srgb, var(--primary), transparent 85%); color: var(--primary); font-weight: 800; font-size: .85rem; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; width: min(var(--maxw), calc(100% - 2rem)); margin: 0 auto; padding: 3.5rem 0 1.5rem; min-height: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.daily-card { position: relative; display: grid; justify-items: center; gap: .4rem; padding: 1.75rem; border-radius: var(--r-lg); text-align: center; background: linear-gradient(160deg, color-mix(in srgb, var(--accent), transparent 70%), var(--surface) 70%); border: 1px solid var(--line); box-shadow: var(--shadow); }
.daily-label { margin: 0; color: var(--secondary); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.daily-icon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 24px; background: var(--accent); color: var(--ink); font-size: 2.4rem; font-weight: 900; margin: .5rem 0; animation: bob 3s ease-in-out infinite; }
.daily-title { margin: 0; font-size: 1.5rem; font-weight: 900; color: var(--text); }
.daily-skill { margin: 0 0 .5rem; color: var(--muted); }
.streak { margin-bottom: .75rem; color: var(--muted); font-weight: 700; }
.streak strong { color: var(--text); font-size: 1.1rem; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .daily-icon { animation: none; } .btn { transition: none; } html { scroll-behavior: auto; } }

/* Chips + cards */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; }
.chips { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { min-height: 40px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 800; white-space: nowrap; }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.gcard-link { display: flex; flex-direction: column; height: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .15s ease, border-color .15s, box-shadow .15s; }
.gcard-link:hover, .gcard-link:focus-visible { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent), transparent 40%); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent), transparent 80%); }
.gcard-art { display: grid; place-items: center; aspect-ratio: 16 / 9; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent), transparent 45%), transparent 60%), var(--surface-2); }
.gcard-art span { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 18px; background: var(--accent); color: var(--ink); font-size: 1.7rem; font-weight: 900; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.gcard-body { display: grid; gap: .25rem; padding: 1rem 1.1rem 1.2rem; }
.gcard-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.gcard-title { margin: 0; font-size: 1.15rem; }
.gcard-skill { color: var(--muted); font-size: .92rem; }
.gcard-best { color: var(--primary); font-size: .85rem; font-weight: 800; min-height: 1.2em; }
.card-grid-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.why-grid article { padding: 1.4rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.why-grid span { font-size: 1.8rem; }
.why-grid h3 { margin: .5rem 0 .25rem; }
.why-grid p { margin: 0; color: var(--muted); }

/* Game page */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.game-head { padding-bottom: 1rem; }
.game-title-row { display: flex; gap: 1rem; align-items: center; }
.game-title-row h1 { margin-bottom: .4rem; font-size: clamp(1.8rem, 5vw, 3rem); }
.game-badge { flex: none; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--accent); color: var(--ink); font-size: 2rem; font-weight: 900; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.tags li { padding: .3rem .75rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .85rem; }
.play-wrap { padding-top: 0; }
.play-area { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; align-items: start; }
.game-shell { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); padding: .75rem; min-width: 0; }
.game-shell .play-card { min-height: 380px; border-radius: var(--r-md); }
.side-panel { display: grid; gap: .75rem; padding: 1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); position: sticky; top: 80px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
.stat span { color: var(--muted); font-weight: 700; }
.stat strong { font-size: 1.5rem; }
.share-status { margin: 0; min-height: 1.2em; color: var(--primary); font-weight: 700; font-size: .9rem; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.info-grid article { padding: 1.4rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.info-grid h2 { font-size: 1.25rem; }
.info-grid ol, .info-grid ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; color: var(--muted); }
.page-head { padding-bottom: .5rem; }

/* End-of-round panel: play again or continue to the next game */
.next-up { margin-top: .75rem; padding: 1rem 1.1rem; border-radius: var(--r-md); background: color-mix(in srgb, var(--primary), transparent 88%); border: 1px solid color-mix(in srgb, var(--primary), transparent 55%); animation: rise .25s ease-out; }
.next-up p { margin: 0 0 .75rem; color: var(--text); }
.next-up-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.next-up-actions .btn { flex: 1 1 180px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .next-up { animation: none; } }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 1.5rem; width: min(var(--maxw), calc(100% - 2rem)); margin: 0 auto; padding: 2.5rem 0 1.5rem; }
.footer-about p { color: var(--muted); max-width: 32ch; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .4rem 0 .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer ul a:hover { color: var(--primary); }
.footer-legal { width: min(var(--maxw), calc(100% - 2rem)); margin: 0 auto; padding: 1rem 0 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* Responsive (mobile-first tweaks) */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .play-area { grid-template-columns: 1fr; }
  .side-panel { position: static; grid-template-columns: 1fr 1fr; }
  .side-panel .btn, .share-status { grid-column: span 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: span 2; }
  .why-grid, .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; min-height: 0; padding: .6rem 0 0; gap: .5rem; }
  .site-nav { order: 3; width: 100%; margin: 0 -.25rem; padding-bottom: .5rem; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .gcard-art span { width: 52px; height: 52px; font-size: 1.3rem; }
  .gcard-body { padding: .75rem; }
  .gcard-title { font-size: 1rem; }
  .gcard-skill { font-size: .82rem; }
  .section { padding: 1.75rem 0; }
  .hero-cta .btn { flex: 1 1 auto; }
  .game-badge { width: 56px; height: 56px; font-size: 1.5rem; }
  .game-shell { padding: .4rem; }
}
.hero, .hero-text { text-align: left; }
.hero-text .lede { margin-inline: 0; }
.hero-cta { justify-content: flex-start; }
.game-shell .sudoku-grid, .game-shell .grid-2048, .game-shell .memory-grid, .game-shell .maze-grid, .game-shell .prime-grid { width: 100%; max-width: 440px; margin-inline: auto; }
@media (max-width: 720px) { .hero, .hero-text { text-align: center; } .hero-cta { justify-content: center; } .hero-text .lede { margin-inline: auto; } }
