.games-page{padding:34px 0 70px;background:linear-gradient(180deg,var(--brand-50),transparent 300px)}
.games-hero{position:relative;overflow:hidden;min-height:160px;display:flex;flex-direction:column;justify-content:center;padding:38px;border:1px solid var(--slate-200);border-radius:var(--radius-lg);background:linear-gradient(135deg,var(--slate-900),var(--slate-800));color:#fff;box-shadow:var(--shadow-md)}
.games-hero::after{content:"";position:absolute;right:-40px;bottom:-70px;width:210px;height:210px;border-radius:50%;background:rgba(34,197,94,.2)}
.game-head>div>span{color:#78f0ad;font-size:12px;font-weight:900;letter-spacing:.16em}
.games-hero h1{position:relative;z-index:1;margin:0 0 8px;color:#fff;font-size:32px;line-height:1.2;font-weight:900;letter-spacing:-.04em}.games-hero p{position:relative;z-index:1;margin:0;color:var(--slate-300)}
.game-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:16px 0 20px}
.game-tabs button{min-height:38px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:7px;padding:0 14px;border:1px solid var(--slate-200);border-radius:8px;background:var(--surface);color:var(--slate-600);font:inherit;font-size:12px;font-weight:850;cursor:pointer;transition:.18s}
.game-tabs button:hover{border-color:var(--brand-300);color:var(--brand-700)}.game-tabs button.active{background:var(--brand-600);border-color:var(--brand-600);color:#fff;box-shadow:none}
.game-tabs i{display:grid;place-items:center;min-width:22px;height:22px;border-radius:6px;background:var(--brand-50);color:var(--brand-700);font-size:9px;font-style:normal}.game-tabs .active i{background:rgba(255,255,255,.18);color:#fff}
.game-panel{padding:28px;border:1px solid var(--slate-200);border-radius:28px;background:var(--surface);box-shadow:0 15px 40px rgba(15,23,42,.07)}.game-panel[hidden]{display:none}.game-panel.active{animation:game-in .25s ease}@keyframes game-in{from{opacity:.4;transform:translateY(8px)}}
.game-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}.game-head h2{margin:5px 0;font-size:29px;color:var(--slate-900)}.game-head p{margin:0;color:var(--slate-500)}
.game-score{flex:0 0 auto;min-width:112px;padding:11px 18px;text-align:center;border-radius:16px;background:var(--slate-50)}.game-score small{display:block;color:var(--slate-500);font-size:11px;font-weight:800}.game-score strong{display:block;color:var(--brand-700);font-size:24px}.game-score b{font:inherit}
.game-stage{position:relative;display:flex;justify-content:center;min-height:360px;padding:20px;border-radius:22px;background:var(--slate-50)}
.grid-2048{display:grid;grid-template-columns:repeat(4,76px);grid-template-rows:repeat(4,76px);gap:9px;padding:10px;border-radius:15px;background:#bbada0;touch-action:none;user-select:none;-webkit-user-select:none}.tile-2048{display:grid;place-items:center;border-radius:9px;background:#cdc1b4;color:#776e65;font-size:25px;font-weight:950}.tile-2048[data-value="0"]{color:transparent;background:rgba(238,228,218,.35)}.tile-2048[data-value="2"]{background:#eee4da}.tile-2048[data-value="4"]{background:#ede0c8}.tile-2048[data-value="8"]{background:#f2b179;color:#fff}.tile-2048[data-value="16"]{background:#f59563;color:#fff}.tile-2048[data-value="32"]{background:#f67c5f;color:#fff}.tile-2048[data-value="64"]{background:#f65e3b;color:#fff}.tile-2048[data-value="128"],.tile-2048[data-value="256"],.tile-2048[data-value="512"],.tile-2048[data-value="1024"],.tile-2048[data-value="2048"]{background:#edcf72;color:#fff;font-size:20px}
.canvas-stage{align-items:center}.canvas-stage canvas{display:block;width:min(360px,100%);height:auto;border-radius:14px;background:#0d1729;touch-action:none;-webkit-user-select:none;user-select:none}.tetris-stage{overscroll-behavior:contain}.tetris-stage canvas{width:240px;touch-action:none}.game-overlay{position:absolute;inset:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:14px;background:rgba(10,18,32,.78);color:#fff}.game-overlay[hidden]{display:none}.game-overlay strong{font-size:28px}.game-overlay span{margin-top:6px;color:#cbd5e1}
.game-actions{display:flex;align-items:center;justify-content:center;gap:15px;margin-top:18px}.game-actions>button{border:0;border-radius:13px;padding:12px 22px;background:var(--brand-600);color:#fff;font:inherit;font-weight:900;cursor:pointer}.game-actions span{color:var(--slate-500);font-size:13px}
.direction-pad,.tetris-controls{display:grid;grid-template-columns:repeat(3,52px);gap:7px;justify-content:center;margin:15px auto 0}.direction-pad button,.tetris-controls button{height:46px;border:1px solid var(--slate-200);border-radius:12px;background:var(--surface);color:var(--slate-700);font-size:18px;font-weight:900;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none}.direction-pad button:first-child{grid-column:2}.direction-pad button:nth-child(2){grid-column:1}.direction-pad button:nth-child(3){grid-column:2}.direction-pad button:nth-child(4){grid-column:3}.direction-pad button:not(:first-child){grid-row:2}.tetris-controls{grid-template-columns:repeat(4,52px)}
.memory-grid{display:grid;grid-template-columns:repeat(4,76px);gap:10px}.memory-card{width:76px;height:76px;border:0;border-radius:14px;background:var(--brand-600);font-size:31px;cursor:pointer;transition:.2s;-webkit-appearance:none;appearance:none}.memory-card span{display:block;opacity:0;transform:scale(.7);transition:opacity .15s,transform .2s;font-family:"Apple Color Emoji","Segoe UI Emoji",sans-serif}.memory-card.open,.memory-card.matched{background:var(--surface);box-shadow:inset 0 0 0 2px var(--brand-300)}.memory-card.open span,.memory-card.matched span{opacity:1;transform:scale(1)}.memory-card.matched{background:var(--brand-50);opacity:.8}
.ttt-grid{display:grid;grid-template-columns:repeat(5,68px);gap:7px}.ttt-cell{width:68px;height:68px;border:1px solid var(--slate-200);border-radius:13px;background:var(--surface);color:var(--brand-700);font-size:34px;font-weight:950;cursor:pointer;touch-action:manipulation}.ttt-cell[data-value="O"]{color:#f97316}
.games-note{display:flex;gap:10px;justify-content:center;margin-top:18px;padding:16px;border-radius:16px;background:var(--brand-50);color:var(--slate-600);font-size:13px}.games-note strong{color:var(--brand-800)}
.breakout-controls{display:grid;grid-template-columns:repeat(2,70px);gap:10px;justify-content:center;margin-top:15px}.breakout-controls button{height:48px;border:1px solid var(--slate-200);border-radius:13px;background:var(--surface);color:var(--slate-700);font-size:20px;font-weight:900;cursor:pointer;touch-action:manipulation}.game-actions button,.game-tabs button,.sudoku-numbers button,.mine-cell,.mole-hole{touch-action:manipulation}.game-actions .game-secondary{background:var(--slate-700)}
.mines-grid{display:grid;grid-template-columns:repeat(9,36px);gap:3px;padding:8px;border-radius:14px;background:var(--slate-300)}.mine-cell{width:36px;height:36px;border:0;border-radius:6px;background:var(--surface);color:var(--slate-800);font-size:15px;font-weight:950;cursor:pointer}.mine-cell.open{background:var(--slate-100);cursor:default}.mine-cell.flagged{background:var(--brand-50)}.mine-cell.mine{background:#fee2e2}.mine-cell[data-count="1"]{color:#2563eb}.mine-cell[data-count="2"]{color:#16a34a}.mine-cell[data-count="3"]{color:#dc2626}.mine-cell[data-count="4"],.mine-cell[data-count="5"]{color:#7c3aed}
.sudoku-stage{min-height:380px}.sudoku-grid{display:grid;grid-template-columns:repeat(9,40px);border:3px solid var(--slate-700);background:var(--slate-400)}.sudoku-cell{width:40px;height:40px;padding:0;border:0;border-right:1px solid var(--slate-300);border-bottom:1px solid var(--slate-300);background:var(--surface);color:var(--brand-700);font:900 18px/1 inherit;text-align:center;cursor:pointer}.sudoku-cell:nth-child(3n){border-right:3px solid var(--slate-700)}.sudoku-cell:nth-child(n+19):nth-child(-n+27),.sudoku-cell:nth-child(n+46):nth-child(-n+54){border-bottom:3px solid var(--slate-700)}.sudoku-cell.fixed{background:var(--slate-100);color:var(--slate-900);cursor:default}.sudoku-cell.selected{background:var(--brand-100)}.sudoku-cell.wrong{background:#fee2e2;color:#dc2626}.sudoku-numbers{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin-top:15px}.sudoku-numbers button{width:42px;height:42px;border:1px solid var(--slate-200);border-radius:10px;background:var(--surface);color:var(--slate-800);font-weight:900;cursor:pointer}.sudoku-numbers button:last-child{width:64px;font-size:11px}
.mole-grid{display:grid;grid-template-columns:repeat(3,100px);gap:14px}.mole-hole{position:relative;width:100px;height:86px;overflow:hidden;border:0;border-radius:50% 50% 38% 38%;background:linear-gradient(#d6b48b 55%,#79543a 56%);cursor:pointer}.mole-hole:after{content:"";position:absolute;left:13px;right:13px;bottom:8px;height:18px;border-radius:50%;background:#2d1f18}.mole-character{position:absolute;z-index:1;left:22px;bottom:-65px;width:56px;height:65px;border-radius:50% 50% 40% 40%;background:#8b5e3c;transition:bottom .12s}.mole-character:before{content:"●  ●";position:absolute;top:14px;left:11px;color:#111;font-size:12px;word-spacing:8px}.mole-character:after{content:"⌣";position:absolute;top:27px;left:21px;color:#fff;font-weight:900}.mole-hole.active .mole-character{bottom:10px}.mole-hole.hit .mole-character{background:#f59e0b}
.reaction-stage{min-height:350px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:22px;background:#1e293b;color:#fff;cursor:pointer;user-select:none;touch-action:manipulation;transition:background .15s}.reaction-stage.waiting{background:#dc2626}.reaction-stage.ready{background:#16a34a}.reaction-stage.result{background:#2563eb}.reaction-stage strong{font-size:34px}.reaction-stage span{margin-top:10px;color:rgba(255,255,255,.8)}
html[data-theme="dark"] .mine-cell,html[data-theme="dark"] .sudoku-cell,html[data-theme="dark"] .sudoku-numbers button,html[data-theme="dark"] .breakout-controls button{background:#111a16}html[data-theme="dark"] .mine-cell.open,html[data-theme="dark"] .sudoku-cell.fixed{background:#1c2821}
html[data-theme="dark"] .games-note{border:1px solid #234333;background:#10251a;color:#a9bdb1}html[data-theme="dark"] .games-note strong{color:#77e3a3}
.tetris-stage canvas{width:300px}.breakout-stage canvas{width:min(420px,100%)}
.mines-grid{grid-template-columns:repeat(12,32px)}.mine-cell{width:32px;height:32px}
@media(max-width:768px){.tetris-stage canvas{width:min(270px,100%)}.mines-grid{grid-template-columns:repeat(12,min(7.2vw,29px))}.mine-cell{width:min(7.2vw,29px);height:min(7.2vw,29px);font-size:12px}}
html[data-theme="dark"] .games-page{background:linear-gradient(180deg,rgba(22,163,74,.08),transparent 300px)}html[data-theme="dark"] .game-panel,html[data-theme="dark"] .game-tabs button,html[data-theme="dark"] .direction-pad button,html[data-theme="dark"] .tetris-controls button,html[data-theme="dark"] .memory-card.open,html[data-theme="dark"] .ttt-cell{background:#111a16}html[data-theme="dark"] .game-stage,html[data-theme="dark"] .game-score{background:#0d1511}
@media(max-width:768px){.games-page{padding:18px 0 45px}.games-hero{padding:26px 22px;border-radius:22px}.games-hero h1{font-size:27px}.games-hero p{font-size:14px}.game-tabs{display:flex;overflow-x:auto;gap:7px;padding:1px 1px 5px;scrollbar-width:none;scroll-padding-inline:1px}.game-tabs::-webkit-scrollbar{display:none}.game-tabs button{flex:0 0 auto;min-width:74px;min-height:44px;padding:0 14px;gap:0;border-radius:13px;font-size:13px;white-space:nowrap}.game-tabs i{display:none}.game-panel{padding:18px 12px;border-radius:22px;scroll-margin-top:12px}.game-head h2{font-size:24px}.game-head p{font-size:12px}.game-score{min-width:85px;padding:9px}.game-stage{min-height:330px;padding:10px}.grid-2048{grid-template-columns:repeat(4,min(18vw,70px));grid-template-rows:repeat(4,min(18vw,70px));gap:7px}.tile-2048{font-size:21px}.canvas-stage canvas{width:min(330px,100%)}.tetris-stage canvas{width:220px}.game-overlay{inset:10px}.game-actions{flex-direction:column;gap:8px;text-align:center}.memory-grid{grid-template-columns:repeat(4,min(18vw,70px));gap:7px}.memory-card{width:min(18vw,70px);height:min(18vw,70px)}.ttt-grid{grid-template-columns:repeat(5,min(16vw,62px));gap:5px}.ttt-cell{width:min(16vw,62px);height:min(16vw,62px);border-radius:11px;font-size:29px}.mines-grid{grid-template-columns:repeat(9,min(9vw,34px));gap:2px}.mine-cell{width:min(9vw,34px);height:min(9vw,34px);font-size:13px}.sudoku-stage{min-height:330px}.sudoku-grid{grid-template-columns:repeat(9,min(9vw,36px))}.sudoku-cell{width:min(9vw,36px);height:min(9vw,36px);font-size:16px}.sudoku-numbers{gap:5px}.sudoku-numbers button{width:34px;height:38px}.mole-grid{grid-template-columns:repeat(3,min(27vw,92px));gap:8px}.mole-hole{width:min(27vw,92px);height:78px}.mole-character{left:calc(50% - 28px)}.reaction-stage{min-height:320px;text-align:center;padding:15px}.reaction-stage strong{font-size:28px}.games-note{flex-direction:column;text-align:center}}
