/* Playbox: shared site and game styling. Edit this file to change the theme. */
:root {
    --bg: #0b1120;
    --panel: #121c2e;
    --panel2: #19263b;
    --text: #f3f6fc;
    --muted: #a7b4c9;
    --accent: #8b5cf6;
    --cyan: #35d6d0;
    --line: #2a3850;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at top right,#1c2850,transparent 50%),var(--bg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
.site-header, .page, .site-footer { max-width: 1180px; margin: auto; padding-left: 24px; padding-right: 24px; }
.site-header { padding-top: 24px; padding-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { font-size: 1.5rem; font-weight: 850; text-decoration: none; letter-spacing: -.04em; }
.brand span { color: var(--cyan); }
.nav { display: flex; gap: 10px; flex-wrap: wrap; }
.nav a, .crumbs a { color: var(--muted); text-decoration: none; }
.nav a { border: 1px solid var(--line); padding: 9px 12px; border-radius: 999px; font-size: .88rem; }
.nav a:hover, .crumbs a:hover { color: white; border-color: var(--accent); }
.page { padding-top: 35px; padding-bottom: 70px; min-height: 72vh; }
.eyebrow { color: var(--cyan); font-size: .77rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
h1 { font-size: clamp(2.3rem,5vw,4rem); letter-spacing: -.055em; margin: 10px 0 14px; }
h2 { letter-spacing: -.025em; }
.intro { color: var(--muted); max-width: 720px; line-height: 1.7; margin-bottom: 28px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.category-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 34px; }
.category-links a { display: inline-block; text-decoration: none; padding: 10px 14px; border-radius: 12px; background: #1c2a44; border: 1px solid var(--line); }
.category-links a:hover, .category-links a[aria-current="page"] { background: #3a2c68; border-color: #9a83f9; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.card { background: linear-gradient(145deg,#192742,#111a2b); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); border-color: #7864d4; }
.card-link { display: block; text-decoration: none; height: 100%; }
.card-art { min-height: 145px; display: grid; place-items: center; font-size: 4.4rem; background: linear-gradient(135deg,#293b71,#3e2a68); }
.card-info { padding: 18px; }
.card-info h3 { margin: 0 0 7px; font-size: 1.16rem; }
.card-info p { color: var(--muted); margin: 0 0 13px; font-size: .91rem; line-height: 1.55; }
.tag { color: #bba9ff; text-transform: uppercase; font-size: .73rem; letter-spacing: .07em; font-weight: 750; }
.section-title { margin-top: 40px; }
.game-panel { background: #111c2f; border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin-top: 25px; }
.game-panel h2 { margin: 0 0 10px; }
.game-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; color: var(--muted); }
.game-status strong { color: #e9e4ff; }
.game-surface { display: flex; justify-content: center; align-items: center; min-height: 340px; padding: 22px 8px; background: #0b1526; border-radius: 15px; }
.game-note { color: var(--muted); line-height: 1.6; margin: 15px 0 0; }
.game-actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.game-actions a { text-decoration: none; padding: 11px 15px; border: 1px solid var(--line); border-radius: 11px; }
.site-footer { padding-top: 25px; padding-bottom: 35px; color: var(--muted); border-top: 1px solid var(--line); font-size: .88rem; }
@media (max-width: 850px) { .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .site-header { flex-direction: column; align-items: flex-start; } .grid { grid-template-columns: 1fr; } .page { padding-left: 16px; padding-right: 16px; } .game-panel { padding: 12px; } .game-surface { padding: 14px 4px; } }

/* Legacy game widget styles (shared across individual game pages). */

:root{--bg:#0b1120;--panel:#121c2e;--panel2:#19263b;--text:#f3f6fc;--muted:#a7b4c9;--accent:#8b5cf6;--cyan:#35d6d0;--line:#2a3850}

*{box-sizing:border-box}
body{margin:0;background:radial-gradient(ellipse at top right,#1c2850 0,transparent 42%),var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}

header{max-width:1180px;margin:auto;padding:30px 24px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px}

.brand{display:flex;align-items:center;gap:12px;font-weight:800;font-size:1.25rem;letter-spacing:-.04em}
.logo{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,var(--accent),#4f46e5);box-shadow:0 8px 25px #8b5cf633;font-size:1.3rem}

.badge{border:1px solid var(--line);border-radius:999px;padding:8px 12px;color:var(--muted);font-size:.82rem}

main{max-width:1180px;margin:auto;padding:36px 24px 70px}
.eyebrow{color:var(--cyan);font-size:.76rem;font-weight:800;letter-spacing:.16em;text-transform:uppercase}

h1{font-size:clamp(2.5rem,6vw,4.7rem);line-height:1.02;letter-spacing:-.065em;margin:14px 0 18px;max-width:780px}
h1 span{color:#a78bfa}

.intro{color:var(--muted);font-size:1.08rem;line-height:1.7;max-width:630px;margin:0 0 34px}

.section-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin:42px 0 18px}
.section-head h2{margin:0;font-size:1.4rem;letter-spacing:-.03em}
.section-head p{margin:0;color:var(--muted);font-size:.9rem}

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

.card{overflow:hidden;border:1px solid var(--line);border-radius:22px;background:linear-gradient(145deg,#172338,#101827);transition:transform .2s,border-color .2s,box-shadow .2s}
.card:hover{transform:translateY(-5px);border-color:#7664c9;box-shadow:0 18px 50px #0004}

.thumb{width:100%;aspect-ratio:16/9;display:grid;place-items:center;position:relative;overflow:hidden;cursor:pointer;border:0;color:inherit;padding:0;background:#202a48}
.thumb:focus-visible,.play-btn:focus-visible,button:focus-visible{outline:3px solid var(--cyan);outline-offset:3px}

.thumb:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#090e1bb8,transparent 55%);pointer-events:none}

.thumb-art{width:100%;height:100%;display:grid;place-items:center}
.play-icon{position:absolute;z-index:1;left:50%;top:50%;transform:translate(-50%,-50%);width:58px;height:58px;border-radius:50%;display:grid;place-items:center;background:#ffffffeb;color:#17152b;box-shadow:0 5px 30px #0005;font-size:1.2rem;transition:transform .2s}
.thumb:hover .play-icon{transform:translate(-50%,-50%) scale(1.1)}

.card-content{padding:20px 21px 22px}
.card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.card h3{margin:0;font-size:1.25rem;letter-spacing:-.03em}
.tag{font-size:.72rem;font-weight:750;color:#b7a8ff;background:#8b5cf622;border:1px solid #8b5cf644;padding:6px 9px;border-radius:99px}
.card p{color:var(--muted);line-height:1.6;font-size:.93rem;margin:10px 0 17px}
.card-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}
.meta{font-size:.8rem;color:#8494ad}
.play-btn{border:0;border-radius:11px;background:var(--accent);color:white;padding:10px 15px;font-weight:750;cursor:pointer}
.play-btn:hover{background:#7c3aed}

footer{border-top:1px solid var(--line);padding:24px;text-align:center;color:#8190a7;font-size:.85rem}

.modal{display:none;position:fixed;inset:0;z-index:10;background:#050914eF;padding:clamp(10px,3vw,34px);align-items:center;justify-content:center;backdrop-filter:blur(10px)}
.modal.open{display:flex}
.modal-box{width:min(100%,980px);max-height:100%;overflow:auto;border:1px solid #38445f;border-radius:22px;background:#101827;box-shadow:0 30px 100px #0009}
.modal-head{position:sticky;top:0;z-index:2;background:#101827ed;backdrop-filter:blur(12px);padding:16px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px}
.modal-head h2{margin:0;font-size:1.1rem}
.close{border:1px solid var(--line);background:var(--panel2);color:var(--text);width:38px;height:38px;border-radius:12px;font-size:1.25rem;cursor:pointer}
.game-wrap{padding:clamp(14px,3vw,28px)}
.game-status{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;color:var(--muted);font-size:.9rem}
.game-status strong{color:var(--text)}
.game-surface{min-height:320px;border-radius:18px;background:#0b1220;border:1px solid var(--line);padding:18px;display:grid;place-items:center}
.game-note{text-align:center;color:var(--muted);font-size:.84rem;margin:14px 0 0;line-height:1.5}

.ttt{display:grid;grid-template-columns:repeat(3,min(24vw,110px));gap:9px}
.ttt button{width:min(24vw,110px);height:min(24vw,110px);border:1px solid #33415e;border-radius:15px;background:#19263b;color:#a78bfa;font-size:clamp(2rem,7vw,3.4rem);font-weight:800;cursor:pointer}
.ttt button:hover{background:#243451}
.reset{margin-top:16px;border:1px solid #4b3c83;background:#251d42;color:#d9d0ff;border-radius:10px;padding:10px 15px;cursor:pointer;font-weight:700}

.snake-layout{width:min(100%,540px);text-align:center}
.snake-canvas{width:100%;max-width:500px;aspect-ratio:1.5;border-radius:12px;background:#0d1825;border:1px solid #30415a;display:block;margin:auto;touch-action:pan-y}
.snake-controls{display:flex;justify-content:center;gap:8px;margin-top:12px;flex-wrap:wrap}
.snake-controls button{background:#1d2a40;color:var(--text);border:1px solid #364661;border-radius:10px;padding:9px 13px;cursor:pointer}
.snake-controls .start{background:#087f78;border-color:#0d9c92}

.extra-art{height:100%;width:100%;display:grid;place-items:center;font-size:clamp(3rem,8vw,5.5rem);filter:drop-shadow(0 12px 20px #0005)}

.memory-grid{display:grid;grid-template-columns:repeat(4,minmax(48px,78px));gap:8px;justify-content:center}
.memory-card{aspect-ratio:1;border:1px solid #3b4b68;background:#1b2940;color:#e8edfa;border-radius:12px;font-size:clamp(1.5rem,5vw,2.3rem);cursor:pointer}
.memory-card.matched{background:#123f3d;border-color:#27b8a7}
.number-grid{display:grid;grid-template-columns:repeat(4,minmax(48px,76px));gap:7px;background:#8e7d6c;padding:7px;border-radius:12px}
.tile{aspect-ratio:1;border-radius:7px;display:grid;place-items:center;background:#c9bca9;color:#51483f;font-weight:850;font-size:clamp(1.1rem,4vw,1.8rem)}
.tile.v2{background:#eee4da}
.tile.v4{background:#ede0c8}
.tile.v8{background:#f2b179;color:#fff}
.tile.v16{background:#f59563;color:#fff}
.tile.v32{background:#f67c5f;color:#fff}
.tile.v64{background:#f65e3b;color:#fff}
.tile.high{background:#6f5bd3;color:#fff}
.action-btn{border:0;border-radius:10px;background:var(--accent);color:#fff;padding:10px 15px;font-weight:750;cursor:pointer;margin:5px}
.play-area{text-align:center;width:min(100%,520px)}
.big-action{font-size:1.1rem;min-height:100px;min-width:190px;border:0;border-radius:16px;background:#273854;color:white;font-weight:800;cursor:pointer;padding:20px}
.big-action.ready{background:#0d9488}
.big-action.go{background:#d9465f}
.mole-grid{display:grid;grid-template-columns:repeat(3,min(22vw,95px));gap:9px;justify-content:center}
.mole-hole{width:min(22vw,95px);height:min(22vw,95px);border:0;border-radius:50%;background:#24344b;font-size:2.4rem;cursor:pointer}
.simon-grid{display:grid;grid-template-columns:repeat(2,min(28vw,130px));gap:10px;justify-content:center}
.simon-pad{width:min(28vw,130px);height:min(28vw,130px);border:0;border-radius:18px;opacity:.72;cursor:pointer}
.simon-pad.active{opacity:1;filter:brightness(1.5);transform:scale(.97)}
.math-answer{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:16px}
.math-answer button{background:#1b2940;color:white;border:1px solid #3b4b68;border-radius:10px;padding:12px 18px;font-size:1.1rem;cursor:pointer}

@media(max-width:700px){header{padding:20px 18px}
main{padding:28px 18px 50px}
.grid{grid-template-columns:1fr}
.section-head{align-items:start;flex-direction:column}
.badge{display:none}
.modal{padding:8px}
.modal-box{border-radius:16px}
.game-surface{min-height:290px;padding:12px}
}

@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}
}


