:root {
  --bg: #070b14;
  --bg-elev: #101827;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e8eef9;
  --muted: #8b9bb4;
  --cyan: #22d3ee;
  --magenta: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --font: "Outfit", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html:has(body.game-page),
body.game-page {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.14), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(244, 114, 182, 0.12), transparent 46%),
    var(--bg);
  line-height: 1.5;
}

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

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

/* ----- Hub ----- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

.hero {
  padding: 36px 0 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 42ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-bottom: 64px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.card.soon {
  opacity: 0.72;
}

.card.soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.thumb {
  height: 168px;
  position: relative;
  overflow: hidden;
  background: #0a1220;
}

.thumb-breaker {
  background:
    radial-gradient(circle at 50% 120%, rgba(34, 211, 238, 0.18), transparent 42%),
    #0a1220;
}

.mini-bricks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 22px 22px 0;
}

.mini-bricks span {
  height: 10px;
  border-radius: 2px;
  background: #38bdf8;
}

.mini-bricks span:nth-child(3),
.mini-bricks span:nth-child(14),
.mini-bricks span:nth-child(27) {
  background: #fbbf24;
}

.mini-ball {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px #22d3ee;
  left: 46%;
  bottom: 48px;
  animation: bounce 1.6s ease-in-out infinite;
}

.mini-paddle {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 72px;
  height: 8px;
  margin-left: -36px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
  animation: slide 1.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translate(8px, 0); }
  50% { transform: translate(-18px, -28px); }
}

@keyframes slide {
  0%, 100% { transform: translateX(10px); }
  50% { transform: translateX(-16px); }
}

.thumb-snake {
  background:
    radial-gradient(circle at 30% 70%, rgba(52, 211, 153, 0.16), transparent 40%),
    #0a1220;
}

.snake-path {
  position: absolute;
  inset: 28px 32px;
  border: 6px solid #34d399;
  border-right: none;
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 18px;
}

.snake-head {
  position: absolute;
  right: 48px;
  top: 25px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #6ee7b7;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

.thumb-2048 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 34px 48px;
  background:
    radial-gradient(circle at 70% 30%, rgba(251, 191, 36, 0.16), transparent 40%),
    #0a1220;
}

.tile {
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 22px;
}

.tile.t2 { background: #1f2a44; color: #dbe7ff; }
.tile.t4 { background: #fbbf24; color: #1a1403; }
.tile.t8 { background: #f472b6; color: #2a0b18; }
.tile.t16 { background: #22d3ee; color: #042026; }

.card-body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.card-body p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(90deg, var(--cyan), #67e8f9);
  color: #042026;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: fit-content;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.ghost,
.btn:disabled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: default;
  filter: none;
}

.site-footer {
  color: var(--muted);
  font-size: 13px;
  padding: 0 0 40px;
}

/* ----- Game page ----- */

body.game-page {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #050814;
}

.game-bar {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.back:hover {
  color: var(--text);
}

.game-bar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage {
  width: 100%;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playfield {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: #050814;
}

.playfield.full {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
}

.floating-back {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 16px;
}

.playfield canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  cursor: default;
  touch-action: none;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 620px) and (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}
