:root {
  --bg: #fff7dc;
  --bg-2: #e8f4ff;
  --panel: rgba(255, 255, 255, 0.94);
  --text: #102033;
  --muted: #64748b;
  --primary: #ff8629;
  --primary-dark: #f26a16;
  --blue: #1788d5;
  --blue-dark: #0b5792;
  --green: #14b8a6;
  --yellow: #ffd166;
  --line: rgba(16, 32, 51, 0.13);
  --win: #16a34a;
  --danger: #dc2626;
  --shadow: 0 28px 80px rgba(23, 136, 213, 0.18);
  --shadow-card: 0 18px 45px rgba(2, 12, 27, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 176, 0, 0.38), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(69, 183, 255, 0.28), transparent 30%),
    radial-gradient(circle at 55% 106%, rgba(255, 134, 41, 0.18), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(7, 17, 31, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  overflow-x: clip;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.03em;
  color: #fff;
  min-width: 0;
  flex-shrink: 1;
}

.brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 16px;
  background: #050b14;
  box-shadow: 0 0 0 2px rgba(255, 134, 41, 0.22), 0 10px 28px rgba(255, 134, 41, 0.22);
}

.site-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.site-nav a, .header-tools a {
  padding: 9px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a:hover, .header-tools a:hover {
  background: rgba(255, 134, 41, 0.16);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.account-box {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.account-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
  font-size: 14px;
}

.small-link {
  padding: 8px 11px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.google-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff, #fff7ed);
  color: #102033;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.google-button::before {
  content: "G";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(#4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  font-weight: 900;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 20px;
}

.page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 22px auto 44px;
}

.hero, .panel, .game-card, .stats-grid article {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 26px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.hero-pro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(22px, 4vw, 46px);
  padding: clamp(24px, 5vw, 58px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 247, 255, 0.9)),
    radial-gradient(circle at 85% 25%, rgba(255, 134, 41, 0.28), transparent 30%);
}

.hero-pro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(23, 136, 213, 0.18);
}

.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #07111f, #0e2b4d);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.hero h1 {
  margin: 0 0 14px;
  max-width: 760px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  color: #07111f;
}

.hero p {
  margin: 0 0 24px;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
}

.hero-actions, .feature-strip, .game-toolbar, .stats-row, .player-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.feature-strip { margin-top: 20px; }
.feature-strip span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(23, 136, 213, 0.1);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.hero-dashboard {
  position: relative;
  z-index: 1;
  min-height: 390px;
  border-radius: 30px;
  padding: 24px;
  background:
    linear-gradient(160deg, #050b14, #0b5792 58%, #ff8629),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,.1) 18px 20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-dashboard::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
}

.score-card {
  position: relative;
  z-index: 1;
  width: fit-content;
  min-width: 220px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.score-card span, .score-card em { display: block; color: rgba(255,255,255,.72); font-style: normal; font-weight: 800; }
.score-card strong { display: block; margin: 4px 0; font-size: 22px; }
.score-card-float { position: absolute; right: 24px; bottom: 24px; }

.pixel-board {
  position: absolute;
  left: 50%;
  top: 54%;
  display: grid;
  grid-template-columns: repeat(4, 54px);
  gap: 10px;
  transform: translate(-50%, -50%) rotate(-6deg);
}

.pixel-board span {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: inset 0 -5px rgba(0,0,0,.16);
}

.pixel-board .hot { background: var(--primary); }
.pixel-board .safe { background: var(--green); }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--primary), #ffb000);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 107, 53, 0.28);
}

.button:hover { background: linear-gradient(135deg, var(--primary-dark), #ff9f1c); }
.button.secondary { background: #fff; color: var(--text); box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08); }
.button.secondary:hover { background: #f8fafc; }
.button-large { min-height: 50px; padding: 13px 20px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 30px;
}

.stats-grid article { padding: 20px; }
.stats-grid strong { display: block; font-size: 34px; line-height: 1; color: var(--blue); }
.stats-grid span { display: block; margin-top: 8px; color: var(--muted); font-weight: 900; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin: 18px 0 30px;
}

.info-card {
  padding: 24px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-card);
}

.eyebrow.light {
  background: rgba(255, 134, 41, 0.13);
  color: var(--primary-dark);
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.steps-row div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.steps-row strong {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 1000;
}

.steps-row h3, .cta-card h2 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.steps-row p, .cta-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cta-card {
  background:
    linear-gradient(145deg, rgba(5, 11, 20, .96), rgba(11, 87, 146, .9)),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .25), transparent 25%);
  color: #fff;
}

.cta-card p {
  margin-bottom: 18px;
  color: rgba(255,255,255,.78);
}

.section-title { margin: 30px 0 14px; font-size: 28px; letter-spacing: -0.03em; }

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

.game-card {
  position: relative;
  min-height: 230px;
  padding: 22px;
  overflow: hidden;
}

.game-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(23, 136, 213, 0.12);
}

.game-card-featured { background: linear-gradient(135deg, #ffffff, #fff3e6); }
.game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #07111f, #0b5792);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
}

.game-card h3 { margin: 0 0 8px; font-size: 22px; }
.game-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }

.panel { padding: 22px; margin-bottom: 18px; }

.page-heading-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(24px, 4vw, 34px);
}

.page-heading-panel h1 {
  margin: 10px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.auth-required-panel {
  max-width: 680px;
  margin: 34px auto;
  padding: clamp(28px, 5vw, 44px);
  text-align: center;
}

.auth-required-panel h1 {
  margin: 12px 0 10px;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.05em;
}

.auth-required-panel p {
  max-width: 480px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.6;
}

.leaderboard-filter {
  justify-content: flex-end;
  align-items: flex-end;
  margin-left: auto;
}

.leaderboard-filter label {
  min-width: 180px;
}

.leaderboard-filter .button {
  min-height: 44px;
}

label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
input, select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  font: inherit;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.game-toolbar, .stats-row { margin-bottom: 14px; }

.stat-pill {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 900;
}

.mines-grid {
  --mine-cell-size: 34px;
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  overflow: visible;
  padding: 10px;
  border-radius: 18px;
  background: #334155;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.game-help {
  margin: -4px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.game-stage,
.lines-stage {
  position: relative;
  width: min(100%, 468px);
  max-width: 100%;
  border-radius: 24px;
}

.mines-stage {
  width: fit-content;
}

.button.game-fullscreen-exit,
.game-fullscreen-exit {
  display: none;
}

.game-fullscreen-bar {
  display: none;
}

.game-stage:fullscreen,
.lines-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3vw, 28px);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 134, 41, .26), transparent 28%),
    linear-gradient(135deg, #050b14, #0b5792);
}

.mines-stage:fullscreen,
.mines-stage.is-pseudo-fullscreen {
  flex-direction: column;
  gap: clamp(12px, 2vmin, 20px);
  padding: clamp(76px, 12vh, 104px) clamp(10px, 3vw, 28px) clamp(18px, 4vh, 34px);
}

.mines-stage:fullscreen .game-fullscreen-bar,
.mines-stage.is-pseudo-fullscreen .game-fullscreen-bar {
  position: fixed;
  top: clamp(10px, 2vh, 18px);
  left: 50%;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100vw - 28px);
  padding: 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.16);
  box-shadow: 0 18px 45px rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.game-stage:fullscreen .game-fullscreen-exit,
.game-stage.is-pseudo-fullscreen .game-fullscreen-exit,
.lines-stage:fullscreen .game-fullscreen-exit,
.lines-stage.is-pseudo-fullscreen .game-fullscreen-exit {
  position: static;
  z-index: 3;
  display: inline-flex;
}

.lines-stage:fullscreen .game-fullscreen-exit,
.lines-stage.is-pseudo-fullscreen .game-fullscreen-exit {
  position: fixed;
  top: 14px;
  right: 14px;
}

.game-stage:fullscreen .mines-grid,
.game-stage.is-pseudo-fullscreen .mines-grid {
  gap: clamp(2px, .65vmin, 6px);
  padding: clamp(8px, 1.6vmin, 14px);
  border-radius: 24px;
  background: linear-gradient(135deg, #102033, #0b5792);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 28px 80px rgba(0,0,0,.32);
}

.game-stage:fullscreen .cell,
.game-stage.is-pseudo-fullscreen .cell {
  width: var(--mine-cell-size);
  height: var(--mine-cell-size);
  border-radius: 10px;
  font-size: clamp(15px, 2.1vmin, 22px);
}

.lines-stage:fullscreen .lines-board,
.lines-stage.is-pseudo-fullscreen .lines-board {
  width: min(94vmin, 760px);
  gap: clamp(4px, 1vmin, 8px);
  padding: clamp(8px, 2vmin, 16px);
}

.game-stage.is-pseudo-fullscreen,
.lines-stage.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  max-width: none;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 134, 41, .26), transparent 28%),
    linear-gradient(135deg, #050b14, #0b5792);
}

.lines-board {
  display: grid;
  gap: clamp(4px, 1vw, 6px);
  width: 100%;
  max-width: calc(100vw - 48px);
  padding: 10px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(5, 11, 20, .96), rgba(11, 87, 146, .88)),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255,255,255,.08) 18px 20px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 18px 45px rgba(2, 12, 27, .18);
}

.lines-cell {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -3px rgba(0,0,0,.08);
  touch-action: manipulation;
  transition: transform .12s ease, background .12s ease, outline-color .12s ease;
}

.lines-cell:hover,
.lines-cell.selected {
  outline: 3px solid rgba(255, 134, 41, .48);
  outline-offset: -3px;
  background: #fff8ed;
  transform: translateY(-1px);
}

.lines-cell.selected .ball {
  animation: ball-bounce .64s ease-in-out infinite;
}

.lines-cell.blocked {
  animation: cell-shake .24s ease-in-out;
  background: #fff1f2;
  outline: 3px solid rgba(220, 38, 38, .35);
  outline-offset: -3px;
}

.lines-cell.clearing {
  background: #fff7ed;
  animation: cell-flash .24s ease-in-out infinite alternate;
}

.ball {
  display: inline-block;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  box-shadow: inset -7px -9px rgba(0,0,0,.18), inset 5px 5px rgba(255,255,255,.36), 0 6px 12px rgba(0,0,0,.16);
  transform-origin: 50% 82%;
}

.ball.spawn {
  animation: ball-pop .28s cubic-bezier(.2, 1.35, .3, 1) both;
}

.ball.moving {
  animation: ball-slide .08s ease-out both;
}

.lines-cell.clearing .ball {
  animation: ball-clear .26s ease-in both;
}

.next-balls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.next-ball {
  width: 18px;
  height: 18px;
}

.ball-orange { background: linear-gradient(135deg, #ffb000, #f26a16); }
.ball-blue { background: linear-gradient(135deg, #45b7ff, #0b5792); }
.ball-green { background: linear-gradient(135deg, #5eead4, #0f766e); }
.ball-purple { background: linear-gradient(135deg, #c084fc, #6d28d9); }
.ball-red { background: linear-gradient(135deg, #fb7185, #be123c); }
.ball-yellow { background: linear-gradient(135deg, #fde68a, #d97706); }

.board-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2vw, 12px);
  width: min(100%, 440px);
  max-width: calc(100vw - 48px);
  padding: clamp(10px, 2vw, 14px);
  border-radius: 22px;
  background: linear-gradient(135deg, #102033, #0b5792);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 20px 50px rgba(2,12,27,.2);
  touch-action: none;
}

.stage-2048 {
  width: min(100%, 440px);
}

.stage-2048:fullscreen,
.stage-2048.is-pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(52px, 8vh, 82px) 16px 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 134, 41, .26), transparent 28%),
    linear-gradient(135deg, #050b14, #0b5792);
}

.stage-2048:fullscreen .board-2048,
.stage-2048.is-pseudo-fullscreen .board-2048 {
  width: min(92vmin, 720px);
  gap: clamp(8px, 2vmin, 16px);
  padding: clamp(10px, 2vmin, 18px);
}

.stage-2048:fullscreen .game-fullscreen-exit,
.stage-2048.is-pseudo-fullscreen .game-fullscreen-exit {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: inline-flex;
}

.tile-cell-2048 {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  color: #102033;
  font-size: clamp(24px, 8vw, 46px);
  font-weight: 1000;
  box-shadow: inset 0 -5px rgba(0,0,0,.12);
  user-select: none;
  transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.tile-new {
  animation: tile-pop .2s cubic-bezier(.2, 1.35, .3, 1) both;
}

.tile-merged {
  animation: tile-merge .24s ease both;
  box-shadow: inset 0 -5px rgba(0,0,0,.14), 0 0 24px rgba(255, 134, 41, .45);
}

.tile-empty { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.tile-2 { background: #eee2d5; color: #776e65; }
.tile-4 { background: #eadfc6; color: #776e65; }
.tile-8 { background: #f3b176; color: #fff; }
.tile-16 { background: #f79261; color: #fff; }
.tile-32 { background: #f7775f; color: #fff; }
.tile-64 { background: #f75a3d; color: #fff; }
.tile-128 { background: #f2d36d; color: #fff; font-size: clamp(21px, 7vw, 40px); }
.tile-256 { background: #f0cf5f; color: #fff; font-size: clamp(21px, 7vw, 40px); }
.tile-512 { background: #efca45; color: #fff; font-size: clamp(21px, 7vw, 40px); }
.tile-1024 { background: #efc737; color: #fff; font-size: clamp(18px, 6vw, 34px); }
.tile-2048 { background: #f0c21f; color: #fff; font-size: clamp(18px, 6vw, 34px); }

@keyframes tile-pop {
  from { opacity: 0; transform: scale(.35); }
  80% { transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tile-merge {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); filter: brightness(1.14); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes ball-pop {
  from { opacity: 0; transform: scale(.25); }
  70% { transform: scale(1.14); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ball-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-15%) scale(1.04, .96); }
  70% { transform: translateY(3%) scale(.98, 1.04); }
}

@keyframes ball-slide {
  from { transform: scale(.82); filter: brightness(1.2); }
  to { transform: scale(1); filter: brightness(1); }
}

@keyframes ball-clear {
  from { opacity: 1; transform: scale(1); filter: brightness(1.25); }
  to { opacity: 0; transform: scale(1.55); filter: brightness(1.8); }
}

@keyframes cell-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes cell-flash {
  from { box-shadow: inset 0 -3px rgba(0,0,0,.08), 0 0 0 rgba(255,134,41,0); }
  to { box-shadow: inset 0 -3px rgba(0,0,0,.08), 0 0 18px rgba(255,134,41,.55); }
}

.cell {
  width: var(--mine-cell-size);
  height: var(--mine-cell-size);
  border: 0;
  border-radius: 8px;
  background: linear-gradient(#ffffff, #cbd5e1);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -3px rgba(0,0,0,.16);
}

.cell.open { background: #eef2f7; box-shadow: none; cursor: default; }
.cell.flag { color: var(--danger); }
.cell.mine { background: #fee2e2; color: var(--danger); }
.cell.n1 { color: #2563eb; }
.cell.n2 { color: #16a34a; }
.cell.n3 { color: #dc2626; }
.cell.n4, .cell.n5, .cell.n6, .cell.n7, .cell.n8 { color: #7c3aed; }

.result-box {
  display: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}
.result-box.is-visible { display: block; }
.result-box.win { border-color: #86efac; background: #f0fdf4; }
.result-box.lose { border-color: #fecaca; background: #fef2f2; }

.table-panel {
  padding: 18px 22px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: transparent; }
.leaderboard-table { min-width: 760px; table-layout: fixed; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
.rank-col { width: 52px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.score-col { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.time-col { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.score-value { color: var(--blue-dark); font-weight: 900; }

.mini-score-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}

.mini-score-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-score-row b {
  color: var(--blue-dark);
  text-align: right;
}

.ad-slot {
  width: min(1000px, calc(100% - 32px));
  min-height: 82px;
  margin: 14px auto;
  border: 1px dashed rgba(100, 116, 139, 0.45);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255,255,255,.52);
}
.ad-sidebar { width: 100%; min-height: 260px; margin: 0 0 18px; }

.site-footer { padding: 24px; text-align: center; color: var(--muted); }

@media (max-width: 1040px) {
  .site-header { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    order: 5;
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    border-radius: 18px;
  }
  .site-nav.is-open { display: flex; }
  .header-tools { margin-left: auto; }
}

@media (max-width: 820px) {
  .hero-pro, .game-layout { grid-template-columns: 1fr; }
  .hero-dashboard { min-height: 310px; }
  .grid, .stats-grid, .content-grid, .steps-row { grid-template-columns: 1fr; }
  .pixel-board { grid-template-columns: repeat(4, 42px); }
  .pixel-board span { width: 42px; height: 42px; }
  .cell { width: 30px; height: 30px; }
  .account-box { width: 100%; justify-content: center; }
  .brand span { font-size: 17px; }
  .page-heading-panel { align-items: stretch; flex-direction: column; }
  .leaderboard-filter { justify-content: flex-start; margin-left: 0; }
  .leaderboard-filter label, .leaderboard-filter select, .leaderboard-filter .button { width: 100%; }
}
