:root { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; }
body { background: #0f1115; color: #e8eaf0; font-family: system-ui, -apple-system, sans-serif; }
a { color: #7dd3fc; text-decoration: none; }
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }
.topbar { display: flex; align-items: baseline; gap: 14px; margin-bottom: 4px; }
.topbar .logo { font-size: 24px; font-weight: 800; color: #7dd3fc; }
.topbar nav { margin-left: auto; font-size: 13px; display: flex; gap: 14px; }
.topbar nav a { color: #8b93a7; }
.topbar nav a:hover { color: #7dd3fc; }
.sub { color: #8b93a7; margin-bottom: 20px; font-size: 14px; }
.hero { display: block; background: linear-gradient(135deg, #1a1e28, #141925); border: 1px solid #2b3346; border-radius: 16px; padding: 20px; margin-bottom: 22px; color: inherit; }
.hero:hover { border-color: #7dd3fc; }
.hero .k { font-size: 12px; color: #f59e0b; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.hero .t { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.hero .d { color: #8b93a7; font-size: 14px; }
.hero .go { display: inline-block; margin-top: 14px; background: #4ade80; color: #0f1115; font-weight: 700; padding: 8px 20px; border-radius: 10px; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: #1a1e28; border: 1px solid #262c3d; border-radius: 12px; overflow: hidden; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card:hover { border-color: #7dd3fc; transform: translateY(-2px); }
.cover { height: 76px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.c-2048 { background: linear-gradient(135deg, #f59e0b33, #7c2d1233); }
.c-snake { background: linear-gradient(135deg, #4ade8033, #14532d33); }
.c-saper { background: linear-gradient(135deg, #f8717133, #450a0a33); }
.c-tetris { background: linear-gradient(135deg, #c084fc33, #3b076433); }
.c-piatnashki { background: linear-gradient(135deg, #7dd3fc33, #0c4a6e33); }
.c-memory { background: linear-gradient(135deg, #f472b633, #50072433); }
.c-runner { background: linear-gradient(135deg, #a3e63533, #1a2e0533); }
.c-soon { background: #161a24; }
.card .body { padding: 10px 12px 12px; }
.card .t { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.card .d { font-size: 12px; color: #8b93a7; }
.card .rec { font-size: 11px; color: #4ade80; margin-top: 6px; min-height: 13px; }
.badge { display: inline-block; margin: 8px 12px 10px; font-size: 11px; color: #4ade80; }
.badge.soon { color: #f59e0b; }
.news { margin-top: 26px; }
.news h2 { font-size: 16px; margin-bottom: 10px; color: #e8eaf0; }
.news .n { font-size: 13px; color: #8b93a7; padding: 6px 0; border-bottom: 1px solid #1a1e28; }
.news .n b { color: #7dd3fc; font-weight: 600; margin-right: 8px; }
footer { margin-top: 30px; color: #5b6274; font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
footer a { color: #5b6274; }
footer a:hover { color: #8b93a7; }
/* Шелл страницы игры */
body.game { padding: 16px; text-align: center; touch-action: manipulation; }
.gtop { display: flex; justify-content: space-between; max-width: 520px; margin: 0 auto 12px; font-size: 13px; }
.gtitle { color: #7dd3fc; font-size: 22px; margin-bottom: 10px; }
.gbar { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.chip { background: #1a1e28; border: 1px solid #262c3d; border-radius: 999px; padding: 5px 14px; font-size: 13px; color: #8b93a7; }
.chip b { color: #4ade80; font-family: ui-monospace, monospace; }
.msg { margin: 12px 0 4px; color: #f87171; font-weight: 600; min-height: 20px; }
.msg.win { color: #4ade80; }
.gbtns { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.btn { background: #262c3d; color: #e8eaf0; border: 0; border-radius: 8px; padding: 8px 18px; font-size: 15px; cursor: pointer; }
.btn:active { background: #2f3648; }
canvas { background: #1a1e28; border-radius: 10px; max-width: 94vw; }
/* 2048 */
#board2048 { display: grid; grid-template-columns: repeat(4, 70px); gap: 8px; justify-content: center; }
#board2048 .c { width: 70px; height: 70px; background: #1a1e28; border-radius: 8px; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
/* сапёр */
#boardsaper { display: grid; grid-template-columns: repeat(9, 34px); gap: 3px; justify-content: center; }
#boardsaper .c { width: 34px; height: 34px; background: #262c3d; border-radius: 6px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
#boardsaper .c.open { background: #1a1e28; cursor: default; }
#boardsaper .c.flag { color: #f59e0b; }
.n1 { color: #7dd3fc; } .n2 { color: #4ade80; } .n3 { color: #f87171; } .n4 { color: #c084fc; }
.n5 { color: #f59e0b; } .n6 { color: #22d3ee; } .n7 { color: #e8eaf0; } .n8 { color: #8b93a7; }
/* пятнашки */
#board15 { display: grid; grid-template-columns: repeat(4, 64px); gap: 6px; justify-content: center; }
#board15 .c { width: 64px; height: 64px; background: #262c3d; border-radius: 10px; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
#board15 .c.hole { background: transparent; cursor: default; }
/* память */
#boardmem { display: grid; grid-template-columns: repeat(4, 68px); gap: 8px; justify-content: center; }
#boardmem .c { width: 68px; height: 68px; background: #262c3d; border-radius: 10px; font-size: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; }
#boardmem .c.open, #boardmem .c.done { background: #1a1e28; border: 1px solid #4ade8055; }
#boardmem .c.done { opacity: .55; cursor: default; }
/* тетрис: тач-кнопки */
.tpad { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.tpad .btn { padding: 10px 16px; font-size: 18px; }
/* текстовые страницы */
.page h1 { color: #7dd3fc; font-size: 24px; margin: 18px 0 10px; }
.page h2 { color: #e8eaf0; font-size: 17px; margin: 18px 0 6px; }
.page p, .page li { color: #b6bcc9; font-size: 14px; line-height: 1.6; }
.page ul { padding-left: 20px; }
.page .back { font-size: 13px; }
