:root {
  --bg: #f5f7fb;
  --ink: #192033;
  --muted: #70788e;
  --line: #e4e8f0;
  --card: rgba(255,255,255,.86);
  --purple: #7767f5;
  --purple-dark: #5848df;
  --yellow: #ffcc62;
  --shadow: 0 20px 50px rgba(49, 58, 100, .12);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at top left, #eef0ff, transparent 38%), var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 22px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.eyebrow, .kicker { margin: 0 0 8px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(34px, 6vw, 58px); line-height: .98; letter-spacing: -.06em; }
h2 { margin-bottom: 9px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; }
.subtitle, .game-heading p:not(.kicker) { color: var(--muted); line-height: 1.65; }
.subtitle { max-width: 520px; margin-bottom: 0; }
.status-pill { display: inline-flex; gap: 8px; align-items: center; padding: 10px 13px; color: #4c566d; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.68); font-size: 13px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #41c58a; box-shadow: 0 0 0 5px rgba(65,197,138,.12); }
.game-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.tab { cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.6); color: var(--muted); border-radius: 14px; padding: 13px 17px; font-weight: 750; transition: .2s ease; }
.tab span { margin-left: 9px; color: #a3aabd; font-size: 11px; }
.tab:hover { transform: translateY(-1px); border-color: #cfd4fe; }
.tab.active { color: white; border-color: var(--purple); background: var(--purple); box-shadow: 0 10px 22px rgba(119,103,245,.22); }
.tab.active span { color: #dcd8ff; }
.game-screen { display: none; padding: clamp(20px, 4vw, 38px); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.game-screen.active { display: block; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.game-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 26px; }
.game-heading p:not(.kicker) { max-width: 580px; margin-bottom: 0; }
.score-card { min-width: 98px; padding: 12px 15px; text-align: right; border: 1px solid var(--line); border-radius: 15px; background: white; }
.score-card span { display: block; color: var(--muted); font-size: 12px; }
.score-card strong { display: block; margin-top: 2px; font-size: 28px; letter-spacing: -.04em; }
.match-layout, .maze-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; gap: 26px; align-items: start; }
.match-board-wrap, .maze-board-wrap { position: relative; padding: 14px; border-radius: 22px; background: #f0efff; }
.match-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; max-width: 560px; margin: 0 auto; aspect-ratio: 1; }
.tile { cursor: pointer; min-width: 0; border: 0; border-radius: 13px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.08), 0 5px 10px rgba(60,66,100,.1); transition: transform .15s ease, filter .15s ease; }
.tile:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.05); }
.tile.selected { outline: 4px solid rgba(119,103,245,.35); transform: scale(.92); }
.color-0 { background: #ff7c8b; } .color-1 { background: #62c9ac; } .color-2 { background: #6c8cff; } .color-3 { background: #ffbe67; } .color-4 { background: #b18df4; }
.board-message { padding: 11px 4px 0; color: #6e7690; text-align: center; font-size: 13px; }
.side-panel { display: flex; flex-direction: column; gap: 14px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 13px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stat-row strong { color: var(--ink); font-size: 24px; letter-spacing: -.04em; }
.tip { padding: 14px; color: #646d83; border-radius: 15px; background: #faf8ed; font-size: 13px; line-height: 1.55; }
.tip span { display: block; margin-bottom: 4px; color: #be8e32; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.primary-btn { cursor: pointer; width: 100%; padding: 13px 15px; color: white; border: 0; border-radius: 13px; background: var(--purple); font-weight: 750; box-shadow: 0 9px 18px rgba(119,103,245,.2); transition: .2s ease; }
.primary-btn:hover { background: var(--purple-dark); transform: translateY(-1px); }
#maze-canvas { display: block; width: min(100%, 560px); aspect-ratio: 1; margin: 0 auto; border-radius: 14px; background: #1d2335; }
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; max-width: 170px; margin: 2px auto 0; }
.dpad button { cursor: pointer; aspect-ratio: 1; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 20px; transition: .15s ease; }
.dpad button:first-child { grid-column: 2; } .dpad button:nth-child(2) { grid-column: 1; grid-row: 2; } .dpad button:nth-child(3) { grid-column: 2; grid-row: 2; } .dpad button:nth-child(4) { grid-column: 3; grid-row: 2; }
.dpad button:hover { border-color: var(--purple); color: var(--purple); }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 18px 4px 0; color: #9aa1b2; font-size: 12px; }
@media (max-width: 760px) { .shell { width: min(100% - 20px, 640px); padding-top: 22px; } .topbar { display: block; } .status-pill { margin-top: 17px; } .game-tabs { overflow-x: auto; } .match-layout, .maze-layout { grid-template-columns: 1fr; } .side-panel { display: grid; grid-template-columns: 1fr 1fr; } .side-panel .tip, .side-panel .primary-btn, .side-panel .dpad { grid-column: 1 / -1; } .game-heading { margin-bottom: 18px; } .game-screen { padding: 18px; border-radius: 22px; } .match-board { gap: 5px; } .match-board-wrap, .maze-board-wrap { padding: 9px; } .footer { padding-bottom: 8px; } }
.seo-copy { margin-top: 24px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.68); }
.seo-copy h2 { margin-bottom: 10px; font-size: clamp(24px, 3vw, 34px); }
.seo-copy h3 { margin: 20px 0 7px; font-size: 18px; }
.seo-copy p:not(.kicker) { max-width: 760px; color: var(--muted); line-height: 1.7; }
.seo-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.seo-links a { color: var(--purple-dark); border: 1px solid #d9d5ff; border-radius: 999px; padding: 9px 13px; background: #f8f7ff; font-size: 13px; font-weight: 700; text-decoration: none; }
.seo-links a:hover { background: #efedff; }
.seo-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.seo-facts span { padding: 8px 10px; color: #5f687d; border-radius: 9px; background: #f3f5fa; font-size: 12px; }
:root { --purple: #6858f4; --purple-dark: #4e3ddd; --ink: #172033; --bg: #f1f4fb; }
body { background: radial-gradient(circle at 10% -10%, #dcd9ff 0, transparent 34%), radial-gradient(circle at 100% 10%, #d5f7eb 0, transparent 28%), var(--bg); }
.topbar { position: relative; overflow: hidden; padding: 8px 0 6px; }
.topbar::after { content: ''; position: absolute; right: 2%; top: -45px; width: 210px; height: 210px; border-radius: 50%; background: linear-gradient(135deg, rgba(119,103,245,.2), rgba(98,201,172,.12)); filter: blur(1px); pointer-events: none; }
.game-screen { border-color: rgba(255,255,255,.95); background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(248,249,255,.78)); }
.match-board-wrap, .maze-board-wrap { background: linear-gradient(145deg, #edeaff, #e9f5f3); box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.match-board { gap: 7px; }
.tile { position: relative; border-radius: 14px; box-shadow: inset 0 -6px 0 rgba(0,0,0,.1), inset 0 2px 0 rgba(255,255,255,.32), 0 6px 13px rgba(60,66,100,.12); }
.tile::after { content: ''; position: absolute; top: 12%; left: 15%; width: 28%; height: 16%; border-radius: 999px; background: rgba(255,255,255,.42); transform: rotate(-24deg); }
.tile.selected { outline: 4px solid rgba(104,88,244,.42); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), 0 0 0 4px rgba(104,88,244,.08), 0 8px 18px rgba(104,88,244,.28); }
.color-0 { background: linear-gradient(145deg, #ff9aa5, #f45f77); } .color-1 { background: linear-gradient(145deg, #83e1c2, #43b99e); } .color-2 { background: linear-gradient(145deg, #8ba6ff, #5675ea); } .color-3 { background: linear-gradient(145deg, #ffd78a, #f2a84f); } .color-4 { background: linear-gradient(145deg, #c4a7ff, #8a68e6); } 
.difficulty-block { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.difficulty-label { margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.level-picker { display: flex; gap: 6px; }
.level-btn { cursor: pointer; flex: 1; padding: 8px 7px; color: #7a8294; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 750; transition: .18s ease; }
.level-btn:hover { border-color: #c5bfff; color: var(--purple); }
.level-btn.active { color: #fff; border-color: var(--purple); background: var(--purple); box-shadow: 0 6px 12px rgba(104,88,244,.18); }
.progress-track { height: 7px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #e6e8f3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6858f4, #67d4b3); transition: width .3s ease; }
#maze-canvas { box-shadow: 0 16px 30px rgba(29,35,53,.2); }
.seo-copy { box-shadow: 0 12px 26px rgba(49,58,100,.06); }
@media (max-width: 760px) { .level-picker { gap: 4px; } .level-btn { padding-inline: 4px; } .tile { border-radius: 10px; } }
