﻿:root {
  --bg-a: #2a1f3f;
  --bg-b: #19372f;
  --bg-c: #5c2f28;
  --panel: rgba(20, 16, 29, 0.86);
  --panel-2: rgba(28, 21, 37, 0.9);
  --text: #f4f0ff;
  --muted: #c3bdd6;
  --accent: #9d74ff;
  --accent-2: #56d6a3;
  --danger: #ff8670;
  --border: rgba(172, 149, 255, 0.52);
  --btn-a: #a560ff;
  --btn-b: #6f3ecc;
  --btn2-a: #4fcf97;
  --btn2-b: #278a69;
  --board: rgba(14, 12, 21, 0.92);
  --cell: rgba(255, 255, 255, 0.07);
  --tile: #ece5ff;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Bahnschrift", "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 14px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  background:
    radial-gradient(1200px 540px at -5% 0%, rgba(173, 117, 255, 0.38), transparent 60%),
    radial-gradient(1100px 600px at 100% 100%, rgba(90, 224, 170, 0.32), transparent 58%),
    radial-gradient(900px 420px at 86% 10%, rgba(255, 141, 111, 0.26), transparent 52%),
    linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 42%, var(--bg-c) 100%);
}

.app {
  width: 940px;
  height: 740px;
  position: fixed;
  left: 0;
  top: 0;
  transform-origin: top left;
  transform: translate(var(--app-x, 0px), var(--app-y, 0px)) scale(var(--app-scale, 1));
  will-change: transform;
}

.screen {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  min-height: 0;
  height: 100%;
  box-shadow:
    0 30px 56px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(157, 116, 255, 0.15);
  backdrop-filter: blur(10px);
  animation: fade-up 260ms ease;
  position: relative;
  overflow: hidden;
}

#menu,
#game {
  min-height: 0;
  height: 100%;
}

.screen::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 25% 20%, rgba(157, 116, 255, 0.18), transparent 28%),
    radial-gradient(circle at 74% 70%, rgba(86, 214, 163, 0.16), transparent 30%);
  pointer-events: none;
}

.screen:not(.active),
.screen[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
  position: relative;
  z-index: 1;
}

h1,
h2,
h3 {
  letter-spacing: 0.02em;
}

#menu {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 42px;
}

.menu-hero {
  border: 0;
  border-radius: 0;
  padding: 8px 4px 2px;
  background: transparent;
  text-align: center;
  position: relative;
  overflow: visible;
}

.menu-hero::before,
.menu-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.menu-hero::before {
  width: min(80vw, 760px);
  height: clamp(84px, 14vw, 136px);
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(255, 96, 96, 0.28) 0deg 7deg,
      rgba(126, 255, 223, 0.06) 7deg 14deg,
      rgba(203, 114, 255, 0.24) 14deg 21deg,
      transparent 21deg 30deg
    );
  filter: blur(14px);
  mix-blend-mode: screen;
  opacity: 0.8;
  animation: title-rays-spin 7.6s linear infinite;
}

.menu-hero::after {
  width: min(66vw, 620px);
  height: clamp(54px, 9vw, 94px);
  background:
    radial-gradient(ellipse at center, rgba(248, 128, 255, 0.38), rgba(89, 255, 219, 0.14) 56%, transparent 76%);
  filter: blur(10px);
  opacity: 0.9;
  animation: title-rays-breath 2.4s ease-in-out infinite;
}

.menu-hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
  text-shadow:
    0 0 6px rgba(255, 218, 255, 0.85),
    0 0 16px rgba(201, 129, 255, 0.86),
    0 0 28px rgba(148, 255, 212, 0.62),
    0 0 44px rgba(151, 92, 255, 0.5);
  animation: title-neon-pulse 1.85s ease-in-out infinite;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}


.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 999px;
  border: 1px solid rgba(170, 145, 255, 0.42);
  background: rgba(13, 10, 21, 0.58);
  font-weight: 800;
  color: #e7dcff;
  font-size: 0.92rem;
  position: relative;
  cursor: help;
}

.feature-pill::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: min(220px, 80vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(173, 151, 255, 0.52);
  background: rgba(11, 8, 18, 0.95);
  color: #f4eeff;
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.44);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 8;
}

.feature-pill::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(173, 151, 255, 0.75);
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 8;
}

.feature-pill:hover::after,
.feature-pill:hover::before {
  opacity: 1;
}

.feature-pill:hover::after {
  transform: translateX(-50%) translateY(0);
}

.menu-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  max-width: 460px;
  width: min(100%, 460px);
  margin-inline: auto;
  margin-top: 8px;
}

.neon-ticker {
  margin-top: auto;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(163, 137, 248, 0.4);
  background: rgba(14, 11, 24, 0.68);
  box-shadow: inset 0 0 0 1px rgba(194, 174, 255, 0.12);
  padding: 7px 0;
  min-height: 38px;
}

.neon-ticker-inner {
  position: relative;
  height: 24px;
  overflow: hidden;
}

.neon-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 8%,
      rgba(198, 98, 255, 0.45) 18%,
      rgba(102, 255, 214, 0.5) 34%,
      rgba(248, 120, 255, 0.45) 48%,
      rgba(102, 255, 214, 0.5) 64%,
      rgba(198, 98, 255, 0.45) 78%,
      rgba(255, 255, 255, 0.05) 92%,
      transparent 100%
    );
  background-size: 240px 100%;
  background-repeat: repeat-x;
  filter: drop-shadow(0 0 10px rgba(200, 108, 255, 0.66))
          drop-shadow(0 0 14px rgba(109, 255, 214, 0.44));
  will-change: background-position;
  animation: neon-flow-run 3.2s linear infinite;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #cf5dff, #7e2dff);
  box-shadow:
    0 0 0 1px rgba(230, 174, 255, 0.55),
    0 0 22px rgba(191, 89, 255, 0.55),
    0 10px 20px rgba(90, 37, 174, 0.58),
    0 4px 0 rgba(50, 25, 103, 0.72);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15) saturate(1.15);
  box-shadow:
    0 0 0 1px rgba(236, 184, 255, 0.65),
    0 0 28px rgba(198, 98, 255, 0.72),
    0 12px 24px rgba(90, 37, 174, 0.65),
    0 4px 0 rgba(50, 25, 103, 0.72);
}

.btn:active {
  transform: translateY(2px);
  box-shadow:
    0 9px 14px rgba(90, 54, 168, 0.4),
    0 2px 0 rgba(50, 25, 103, 0.7);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.2);
  box-shadow:
    0 0 0 1px rgba(211, 197, 255, 0.24),
    0 4px 10px rgba(45, 28, 76, 0.35);
}

.btn-secondary {
  background: linear-gradient(180deg, #64f7b8, #1fb07e);
  box-shadow:
    0 0 0 1px rgba(168, 255, 219, 0.56),
    0 0 22px rgba(71, 247, 177, 0.52),
    0 10px 20px rgba(20, 119, 84, 0.58),
    0 4px 0 rgba(17, 77, 56, 0.75);
}

.audio-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
  width: min(100%, 460px);
  margin-inline: auto;
}

.audio-btn {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #e7dcff;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  padding: 10px 0;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, text-shadow 120ms ease;
  min-height: 52px;
  box-shadow: none;
  text-shadow: 0 0 14px rgba(168, 112, 255, 0.62);
}

.audio-btn.active {
  color: #d9ffe9;
  text-shadow: 0 0 16px rgba(114, 249, 191, 0.8);
}

.audio-btn:not(.active) {
  opacity: 0.65;
}

.audio-btn:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.08);
}

.lang-toggle {
  font-size: 1.22rem;
  letter-spacing: 0.12em;
  font-weight: 900;
  background: transparent;
  box-shadow: none;
  color: #ffd9df;
  text-shadow:
    0 0 12px rgba(255, 124, 142, 0.95),
    0 0 26px rgba(255, 72, 99, 0.82),
    0 0 40px rgba(255, 56, 56, 0.58);
}

/* Lang button parity with audio buttons */
#lang-toggle {
  opacity: 1 !important;
  filter: none !important;
  cursor: pointer !important;
  font-size: clamp(0.9rem, 1.35vw, 1.05rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  text-shadow: none !important;
}

#game.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.turn-text {
  display: none;
}

.score-wrap {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: 6px;
}

.score-card {
  border: 1px solid rgba(167, 143, 255, 0.46);
  border-radius: 12px;
  background: rgba(12, 9, 22, 0.62);
  padding: 5px 8px;
  text-align: center;
  display: grid;
  gap: 2px;
}

.score-card span {
  color: var(--muted);
  font-size: 0.74rem;
}

.score-card strong {
  font-size: 0.98rem;
}

.combo-card {
  border-color: rgba(255, 151, 120, 0.65);
}

.overdrive-card {
  border-color: rgba(94, 230, 178, 0.7);
}

.boost-card {
  border-color: rgba(144, 206, 255, 0.72);
}

#combo-value.combo-hot,
#overdrive-value.overdrive-hot {
  animation: pulse-hot 280ms ease;
}

.board {
  --size: 4;
  --gap: 8px;
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  padding: var(--gap);
  border-radius: 20px;
  border: 1px solid rgba(190, 165, 255, 0.76);
  background:
    radial-gradient(circle at 16% 14%, rgba(206, 112, 255, 0.28), transparent 36%),
    radial-gradient(circle at 82% 82%, rgba(89, 255, 219, 0.22), transparent 40%),
    linear-gradient(160deg, rgba(12, 8, 24, 0.97), rgba(22, 12, 35, 0.97));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.52),
    0 0 34px rgba(190, 102, 255, 0.36),
    0 0 26px rgba(78, 245, 206, 0.24),
    inset 0 0 0 1px rgba(201, 173, 255, 0.28);
  overflow: hidden;
  touch-action: none;
}

.board.overdrive {
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(90, 233, 177, 0.32),
    inset 0 0 0 1px rgba(102, 242, 188, 0.42);
}

.board.boost-active {
  animation: boost-transform 1240ms cubic-bezier(0.14, 0.74, 0.15, 1);
}

.board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  grid-template-rows: repeat(var(--size), 1fr);
  gap: var(--gap);
}

.bg-cell {
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(196, 170, 255, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 12px rgba(176, 121, 255, 0.12);
}

.tile-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tile-layer.boost-shock .tile {
  animation: boost-tile-shock 860ms cubic-bezier(0.2, 0.88, 0.16, 1);
}

.tile {
  position: absolute;
  width: var(--cell-size, 40px);
  height: var(--cell-size, 40px);
  border-radius: 13px;
  background: var(--tile);
  border: 1px solid rgba(214, 191, 255, 0.72);
  display: grid;
  place-items: center;
  font-family: "Bahnschrift", "Consolas", "Segoe UI", sans-serif;
  font-weight: 900;
  color: #1c1232;
  font-size: clamp(1rem, 4.2vw, 2rem);
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.82),
    0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--r, 0deg));
  transition: transform 150ms ease, background-color 130ms ease, box-shadow 130ms ease;
  box-shadow:
    0 0 0 1px rgba(216, 191, 255, 0.72),
    0 0 18px rgba(181, 121, 255, 0.48),
    0 0 30px rgba(113, 255, 216, 0.2),
    0 4px 0 rgba(84, 62, 123, 0.22);
}

.tile-pop {
  animation: pop-tile 170ms ease;
}

.tile[data-v="2"] { background: #f6e9ff; box-shadow: 0 0 0 1px rgba(226, 199, 255, 0.78), 0 0 24px rgba(191, 128, 255, 0.54), 0 0 40px rgba(149, 245, 255, 0.24), 0 4px 0 rgba(84, 62, 123, 0.2); }
.tile[data-v="4"] { background: #ead4ff; box-shadow: 0 0 0 1px rgba(220, 188, 255, 0.8), 0 0 28px rgba(176, 114, 255, 0.58), 0 0 44px rgba(139, 240, 255, 0.26), 0 4px 0 rgba(84, 62, 123, 0.2); }
.tile[data-v="8"] { background: #c8efff; box-shadow: 0 0 0 1px rgba(162, 241, 255, 0.82), 0 0 30px rgba(74, 220, 255, 0.62), 0 0 50px rgba(164, 110, 255, 0.2), 0 4px 0 rgba(70, 92, 120, 0.2); }
.tile[data-v="16"] { background: #b2ffd6; box-shadow: 0 0 0 1px rgba(130, 255, 199, 0.84), 0 0 32px rgba(77, 243, 176, 0.64), 0 0 52px rgba(111, 133, 255, 0.2), 0 4px 0 rgba(58, 114, 89, 0.2); }
.tile[data-v="32"] { background: #ffd6b8; box-shadow: 0 0 0 1px rgba(255, 201, 154, 0.84), 0 0 34px rgba(255, 147, 84, 0.66), 0 0 54px rgba(255, 99, 189, 0.2), 0 4px 0 rgba(128, 81, 70, 0.2); }
.tile[data-v="64"] { background: #ffc6ab; box-shadow: 0 0 0 1px rgba(255, 185, 146, 0.86), 0 0 36px rgba(255, 122, 86, 0.68), 0 0 56px rgba(255, 81, 167, 0.24), 0 4px 0 rgba(128, 81, 70, 0.2); }
.tile[data-v="128"] { background: #ffb8dd; box-shadow: 0 0 0 1px rgba(255, 169, 223, 0.88), 0 0 38px rgba(255, 92, 186, 0.7), 0 0 58px rgba(147, 255, 226, 0.24), 0 4px 0 rgba(128, 78, 96, 0.2); }
.tile[data-v="256"] { background: #ffb7c0; box-shadow: 0 0 0 1px rgba(255, 166, 183, 0.9), 0 0 40px rgba(255, 88, 118, 0.72), 0 0 62px rgba(171, 104, 255, 0.24), 0 4px 0 rgba(132, 74, 66, 0.2); }
.tile[data-v="512"] { background: #ffb58f; box-shadow: 0 0 0 1px rgba(255, 171, 124, 0.9), 0 0 42px rgba(255, 108, 55, 0.74), 0 0 64px rgba(255, 85, 161, 0.26), 0 4px 0 rgba(135, 73, 62, 0.2); }
.tile[data-v="1024"] { background: #ff9c88; box-shadow: 0 0 0 1px rgba(255, 150, 132, 0.92), 0 0 46px rgba(255, 86, 66, 0.78), 0 0 68px rgba(255, 122, 220, 0.3), 0 4px 0 rgba(135, 73, 62, 0.2); }
.tile[data-v="2048"] { background: #ff8a73; color: #2f1120; box-shadow: 0 0 0 1px rgba(255, 138, 108, 0.94), 0 0 50px rgba(255, 80, 52, 0.82), 0 0 76px rgba(255, 204, 70, 0.48), 0 4px 0 rgba(135, 73, 62, 0.2); }
.tile[data-v="4096"],
.tile[data-v="8192"] { background: #ff6f62; color: #250c15; box-shadow: 0 0 0 1px rgba(255, 111, 98, 0.95), 0 0 56px rgba(255, 58, 58, 0.86), 0 0 86px rgba(255, 80, 189, 0.52), 0 4px 0 rgba(135, 73, 62, 0.2); }

.combo-burst,
.overdrive-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  pointer-events: none;
  z-index: 8;
}

.boost-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(180deg, #7cf3ff, #5f7fff);
  box-shadow: 0 0 0 1px rgba(193, 246, 255, 0.68), 0 0 28px rgba(104, 200, 255, 0.58);
  animation: boost-burst-up 1220ms ease forwards;
  pointer-events: none;
  z-index: 12;
}

.combo-burst {
  background: linear-gradient(180deg, #a97bff, #6b3dd0);
  box-shadow: 0 8px 16px rgba(103, 62, 201, 0.4);
  animation: combo-up 600ms ease forwards;
}

.overdrive-burst {
  background: linear-gradient(180deg, #74e4b8, #2fa57d);
  box-shadow: 0 9px 18px rgba(44, 153, 115, 0.37);
  animation: combo-up 640ms ease forwards;
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 11;
  animation: spark-fly 980ms ease-out forwards;
}

.game-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}

.game-actions .btn {
  background: transparent !important;
  border: 1px solid rgba(210, 176, 255, 0.62) !important;
  box-shadow:
    0 0 0 1px rgba(188, 150, 255, 0.25),
    0 0 18px rgba(171, 104, 255, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
  padding: 8px 6px;
  font-size: 1.06rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.game-actions .btn:hover {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(224, 193, 255, 0.82) !important;
  box-shadow:
    0 0 0 1px rgba(205, 171, 255, 0.42),
    0 0 24px rgba(183, 113, 255, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

#boost-btn {
  color: #bcecff;
  text-shadow:
    0 0 16px rgba(106, 217, 255, 0.88),
    0 0 32px rgba(63, 159, 255, 0.7);
}

#boost-ad-btn {
  color: #e3ffd5;
  text-shadow:
    0 0 16px rgba(117, 255, 165, 0.86),
    0 0 34px rgba(66, 233, 139, 0.68);
  position: relative;
  overflow: hidden;
  animation: boost-charge-pulse 1.35s ease-in-out infinite;
}

#boost-ad-btn::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -32%;
  width: 34%;
  height: 340%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.55),
    rgba(180, 255, 219, 0.15),
    rgba(255, 255, 255, 0)
  );
  transform: rotate(18deg);
  animation: boost-charge-shimmer 1.8s linear infinite;
}

#restart-btn {
  color: #ffe3be;
  text-shadow:
    0 0 16px rgba(255, 186, 110, 0.86),
    0 0 34px rgba(255, 132, 62, 0.68);
}

#menu-btn {
  color: #f2dfff;
  text-shadow:
    0 0 16px rgba(190, 122, 255, 0.86),
    0 0 34px rgba(117, 238, 207, 0.58);
}

.game-actions .btn:disabled {
  opacity: 0.38;
  filter: grayscale(0.15);
  border-color: rgba(210, 176, 255, 0.28) !important;
  box-shadow:
    0 0 0 1px rgba(188, 150, 255, 0.14),
    0 0 10px rgba(171, 104, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02) !important;
}

#boost-ad-btn:disabled {
  animation: none;
}

#boost-ad-btn:disabled::after {
  display: none;
}

.menu-btn {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #f2e8ff;
  text-shadow:
    0 0 18px rgba(181, 121, 255, 0.82),
    0 0 36px rgba(105, 255, 203, 0.35);
  font-size: clamp(2.2rem, 4.7vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  padding: 16px 8px;
  font-weight: 900;
}

.menu-btn:hover {
  color: #f6f1ff;
  transform: translateY(-1px) scale(1.02);
  text-shadow: 0 0 20px rgba(185, 126, 255, 0.78);
}

.menu-btn-alt {
  color: #dcffed;
  text-shadow:
    0 0 18px rgba(104, 246, 184, 0.82),
    0 0 34px rgba(103, 255, 223, 0.4);
}

.menu-btn-alt:hover {
  color: #eefff6;
  text-shadow: 0 0 20px rgba(114, 249, 191, 0.8);
}

.menu-btn-rank {
  color: #ffe5b9;
  text-shadow:
    0 0 18px rgba(255, 189, 104, 0.82),
    0 0 34px rgba(255, 141, 71, 0.44);
}

.menu-btn-rank:hover {
  color: #fff0cf;
  text-shadow: 0 0 20px rgba(255, 203, 127, 0.88);
}

.tile-boom {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(circle, #ffffff 0, #9ce0ff 35%, #7f7fff 70%, transparent 100%);
  box-shadow: 0 0 20px rgba(127, 127, 255, 0.7);
  animation: tile-boom 520ms ease-out forwards;
}

.boost-wave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(76%, 420px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(150, 228, 255, 0.78);
  box-shadow:
    0 0 26px rgba(133, 222, 255, 0.7),
    inset 0 0 22px rgba(177, 126, 255, 0.45);
  transform: translate(-50%, -50%) scale(0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  animation: boost-wave 1080ms cubic-bezier(0.12, 0.75, 0.16, 1) forwards;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  background:
    radial-gradient(circle at 50% 12%, rgba(183, 100, 255, 0.22), transparent 48%),
    rgba(8, 6, 14, 0.58);
}

.overlay[hidden] {
  display: none !important;
}

.overlay-card {
  width: min(92%, 500px);
  border: 1px solid rgba(203, 172, 255, 0.78);
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 12%, rgba(212, 121, 255, 0.2), transparent 38%),
    radial-gradient(circle at 84% 82%, rgba(92, 255, 215, 0.12), transparent 40%),
    rgba(16, 12, 26, 0.96);
  padding: 22px 20px 18px;
  text-align: center;
  display: grid;
  gap: 14px;
  box-shadow:
    0 20px 36px rgba(0, 0, 0, 0.5),
    0 0 26px rgba(178, 102, 255, 0.32),
    inset 0 0 0 1px rgba(226, 196, 255, 0.2);
}

.overlay-mini {
  background:
    radial-gradient(circle at 50% 14%, rgba(183, 100, 255, 0.16), transparent 48%),
    rgba(8, 6, 14, 0.46);
}

.notice-card {
  width: min(90%, 430px);
}

.leaderboard-card {
  width: min(94%, 640px);
  gap: 10px;
}

.leaderboard-head {
  display: grid;
  grid-template-columns: 84px 1fr 120px;
  gap: 10px;
  padding: 4px 4px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
  max-height: min(50vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  padding: 4px;
}

.leaderboard-empty {
  border: 1px solid rgba(208, 175, 255, 0.46);
  border-radius: 14px;
  background: rgba(13, 9, 22, 0.64);
  color: #efe6ff;
  padding: 14px 12px;
  text-align: center;
  font-weight: 800;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 84px 1fr 120px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(210, 176, 255, 0.62);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(12, 9, 22, 0.7);
  box-shadow:
    0 0 0 1px rgba(188, 150, 255, 0.2),
    0 0 16px rgba(171, 104, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.leaderboard-row-me {
  border-color: rgba(168, 255, 219, 0.66);
  box-shadow:
    0 0 0 1px rgba(168, 255, 219, 0.35),
    0 0 18px rgba(71, 247, 177, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.lb-rank,
.lb-score {
  font-weight: 900;
  font-size: 1.05rem;
}

.lb-rank {
  color: #ffe3be;
  text-shadow:
    0 0 14px rgba(255, 186, 110, 0.8),
    0 0 28px rgba(255, 132, 62, 0.55);
}

.lb-name {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f2e8ff;
  font-weight: 800;
}

.lb-score {
  text-align: right;
  color: #d7ffe9;
  text-shadow:
    0 0 12px rgba(114, 249, 191, 0.76),
    0 0 24px rgba(95, 246, 204, 0.34);
}

.leaderboard-actions {
  margin-top: 4px;
}

.notice-card p {
  color: #f2e9ff;
  font-size: clamp(1.12rem, 2.2vw, 1.36rem);
  line-height: 1.35;
  font-weight: 800;
}

.overlay-card p {
  color: #e7dcff;
  font-size: clamp(1.08rem, 2.1vw, 1.32rem);
  line-height: 1.35;
}

.overlay-card h3 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: #f8eeff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 12px rgba(188, 117, 255, 0.72),
    0 0 30px rgba(100, 255, 217, 0.36);
}

.overlay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.overlay-actions .btn,
.notice-card .btn {
  background: transparent !important;
  border: 1px solid rgba(212, 181, 255, 0.72) !important;
  box-shadow:
    0 0 0 1px rgba(196, 163, 255, 0.3),
    0 0 20px rgba(174, 108, 255, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  color: #f3e7ff;
  font-size: clamp(1.08rem, 2.2vw, 1.34rem);
  font-weight: 900;
  padding: 11px 8px;
  text-shadow:
    0 0 12px rgba(185, 125, 255, 0.62),
    0 0 22px rgba(117, 241, 206, 0.32);
}

.overlay-actions .btn:hover,
.notice-card .btn:hover {
  border-color: rgba(228, 200, 255, 0.86) !important;
  box-shadow:
    0 0 0 1px rgba(211, 184, 255, 0.44),
    0 0 28px rgba(186, 113, 255, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

#overlay-menu {
  color: #dffff2;
  text-shadow:
    0 0 12px rgba(119, 246, 187, 0.72),
    0 0 24px rgba(95, 246, 204, 0.34);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-tile {
  from { transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.82) rotate(var(--r, 0deg)); }
  to { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1) rotate(var(--r, 0deg)); }
}

@keyframes pulse-hot {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes combo-up {
  0% { opacity: 0; transform: translate(-50%, -30%); }
  20% { opacity: 1; transform: translate(-50%, -52%); }
  100% { opacity: 0; transform: translate(-50%, -92%); }
}

@keyframes spark-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

@keyframes boost-transform {
  0% {
    transform: scale(1) rotate(0deg);
    box-shadow:
      0 16px 28px rgba(0, 0, 0, 0.46),
      inset 0 0 0 1px rgba(167, 143, 255, 0.18);
  }
  24% {
    transform: scale(1.06) rotate(-1.4deg);
    box-shadow:
      0 28px 42px rgba(0, 0, 0, 0.56),
      0 0 58px rgba(103, 199, 255, 0.7),
      0 0 42px rgba(159, 116, 255, 0.6),
      inset 0 0 0 1px rgba(183, 233, 255, 0.68);
  }
  54% {
    transform: scale(1.025) rotate(0.8deg);
  }
  78% {
    transform: scale(1.05) rotate(-0.6deg);
    box-shadow:
      0 24px 38px rgba(0, 0, 0, 0.54),
      0 0 52px rgba(124, 209, 255, 0.62),
      0 0 36px rgba(167, 125, 255, 0.52),
      inset 0 0 0 1px rgba(183, 233, 255, 0.68);
  }
  100% {
    transform: scale(1) rotate(0deg);
    box-shadow:
      0 16px 28px rgba(0, 0, 0, 0.46),
      inset 0 0 0 1px rgba(167, 143, 255, 0.18);
  }
}

@keyframes boost-tile-shock {
  0% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1) rotate(var(--r, 0deg)); }
  24% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.22) rotate(calc(var(--r, 0deg) + 3deg)); }
  48% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.94) rotate(calc(var(--r, 0deg) - 2deg)); }
  72% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.14) rotate(calc(var(--r, 0deg) + 1.4deg)); }
  100% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1) rotate(var(--r, 0deg)); }
}

@keyframes tile-boom {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.45); }
  38% { opacity: 1; transform: translate(-50%, -50%) scale(1.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.2); }
}

@keyframes boost-burst-up {
  0% { opacity: 0; transform: translate(-50%, -28%) scale(0.78); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); }
  66% { opacity: 1; transform: translate(-50%, -64%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -100%) scale(0.95); }
}

@keyframes boost-wave {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.24); }
  68% { opacity: 0.65; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}

@keyframes boost-charge-pulse {
  0%, 100% {
    text-shadow:
      0 0 14px rgba(117, 255, 165, 0.78),
      0 0 28px rgba(66, 233, 139, 0.56);
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 20px rgba(152, 255, 190, 0.96),
      0 0 40px rgba(85, 255, 173, 0.84),
      0 0 56px rgba(93, 247, 204, 0.46);
    transform: scale(1.04);
  }
}

@keyframes boost-charge-shimmer {
  0% { left: -42%; opacity: 0; }
  14% { opacity: 0.85; }
  52% { opacity: 0.2; }
  100% { left: 128%; opacity: 0; }
}

@keyframes neon-flow-run {
  0% { background-position-x: 0; }
  100% { background-position-x: -240px; }
}

@keyframes title-neon-pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow:
      0 0 7px rgba(255, 218, 255, 0.88),
      0 0 18px rgba(206, 133, 255, 0.86),
      0 0 30px rgba(148, 255, 212, 0.64),
      0 0 48px rgba(154, 96, 255, 0.52);
  }
  50% {
    transform: scale(1.035);
    text-shadow:
      0 0 10px rgba(255, 234, 255, 0.96),
      0 0 26px rgba(231, 122, 255, 0.96),
      0 0 42px rgba(130, 255, 233, 0.78),
      0 0 70px rgba(255, 91, 91, 0.6);
  }
}

@keyframes title-rays-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

@keyframes title-rays-breath {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); opacity: 0.76; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

/* Roblox edition theme overrides: visuals only, gameplay untouched. */
:root {
  --bg-a: #86c5ff;
  --bg-b: #dff1ff;
  --bg-c: #62a1f2;
  --panel: rgba(233, 245, 255, 0.9);
  --panel-2: rgba(219, 239, 255, 0.94);
  --text: #1b2f52;
  --muted: #3f5f8e;
  --accent: #2f8eff;
  --accent-2: #29c983;
  --danger: #ff6f5f;
  --border: rgba(94, 152, 222, 0.45);
  --btn-a: #44a0ff;
  --btn-b: #2e77de;
  --btn2-a: #42d487;
  --btn2-b: #22a667;
  --board: rgba(94, 155, 224, 0.22);
  --cell: rgba(233, 245, 255, 0.86);
}

body {
  background:
    radial-gradient(780px 340px at 10% 14%, rgba(255, 255, 255, 0.9), transparent 56%),
    radial-gradient(740px 320px at 86% 84%, rgba(174, 226, 255, 0.82), transparent 64%),
    linear-gradient(180deg, #8fd0ff 0%, #bce5ff 43%, #7cb0ec 100%);
}

.screen {
  box-shadow:
    0 26px 50px rgba(28, 73, 130, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 0 0 1px rgba(103, 158, 228, 0.22);
  backdrop-filter: blur(7px);
}

.screen::before {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.46), transparent 32%),
    radial-gradient(circle at 76% 72%, rgba(114, 184, 255, 0.22), transparent 36%);
}

.menu-hero h1 {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 16px rgba(106, 175, 255, 0.5),
    0 0 28px rgba(47, 142, 255, 0.34);
  color: #15457f;
}

.feature-pill {
  border-color: rgba(102, 160, 230, 0.42);
  background: rgba(247, 252, 255, 0.85);
  color: #204a80;
}

.neon-ticker {
  border-color: rgba(93, 151, 220, 0.38);
  background: rgba(235, 247, 255, 0.82);
}

.neon-flow {
  filter: drop-shadow(0 0 8px rgba(89, 156, 239, 0.34));
}

.btn {
  box-shadow:
    0 0 0 1px rgba(200, 234, 255, 0.8),
    0 10px 20px rgba(43, 113, 195, 0.26);
}

.btn.btn-secondary {
  color: #194d36;
}

.board {
  --gap: 10px;
  border-radius: 20px;
  border: 1px solid rgba(117, 168, 226, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 16px 30px rgba(43, 97, 164, 0.18);
}

.bg-cell {
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(235, 247, 255, 0.78));
  box-shadow: inset 0 0 0 1px rgba(120, 176, 238, 0.2);
}

.tile.tile-roblox {
  --head-skin: #d0d0d2;
  --head-accent: #4ca5ff;
  --head-shine: 0.2;
  --head-bright: 1.04;
  --head-sat: 1.08;
  --tile-glow-alpha: 0.2;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.4), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(233, 245, 255, 0.1)),
    linear-gradient(140deg, rgba(77, 158, 255, 0.2), rgba(12, 34, 64, 0.12));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 9px 18px rgba(18, 52, 96, 0.24),
    0 0 20px rgba(68, 157, 255, var(--tile-glow-alpha));
  overflow: hidden;
  display: block;
  font-size: initial;
}

.tile.tile-roblox::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.24) 0 18%, transparent 26% 100%),
    radial-gradient(circle at 18% 88%, rgba(0, 0, 0, 0.07), transparent 45%);
  pointer-events: none;
}

.rbx-head {
  position: absolute;
  left: 8%;
  top: 7%;
  width: 84%;
  height: 82%;
  border-radius: 22%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.02) 34%, rgba(255, 255, 255, 0.28) 64%, rgba(0, 0, 0, 0.08) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(0, 0, 0, 0.1)),
    var(--head-skin);
  border: 1px solid rgba(0, 0, 0, 0.16);
  transform: rotate(var(--head-twist, 0deg));
  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.16),
    inset 0 7px 10px rgba(255, 255, 255, 0.34),
    0 3px 7px rgba(0, 0, 0, 0.28);
  filter: saturate(var(--head-sat)) brightness(var(--head-bright));
}

.rbx-shine {
  position: absolute;
  left: 10%;
  top: 9%;
  width: 36%;
  height: 18%;
  border-radius: 999px;
  background: rgba(255, 255, 255, var(--head-shine, 0.16));
}

.rbx-decal {
  position: absolute;
  inset: 0;
  background-image: var(--head-decal);
  background-size: cover;
  background-position: center;
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 90ms linear;
}

.tile.rbx-decal-on .rbx-decal {
  opacity: 0.22;
}

.rbx-eye,
.rbx-mouth,
.rbx-brow {
  position: absolute;
  background: #111114;
}

.rbx-hat {
  display: none;
  position: absolute;
  left: 16%;
  top: 5%;
  width: 68%;
  height: 18%;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hat-color, #4ca5ff) 85%, #fff 15%), color-mix(in srgb, var(--hat-color, #4ca5ff) 78%, #1b2f52 22%));
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.24);
}

.rbx-hat::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -4px;
  height: 5px;
  border-radius: 999px;
  background: rgba(20, 27, 46, 0.6);
}

.tile.rbx-hat-on .rbx-hat {
  display: block;
}

.rbx-hair {
  display: none;
  position: absolute;
  left: 14%;
  top: -1%;
  width: 72%;
  height: 16%;
  border-radius: 12px 12px 8px 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--head-accent) 54%, #2e2134 46%), color-mix(in srgb, var(--head-accent) 36%, #17131e 64%));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22);
}

.tile.rbx-hair-on .rbx-hair {
  display: block;
}

.rbx-eye {
  top: 34%;
  width: 14%;
  height: 17%;
  border-radius: 46%;
  background: #f6f8fb;
  border: 2px solid #1a1d23;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 1px 2px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.rbx-eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #111114;
}

.rbx-eye-left {
  left: 28%;
}

.rbx-eye-right {
  right: 28%;
}

.rbx-mouth {
  left: 50%;
  top: 58%;
  width: 44%;
  height: 18%;
  transform: translateX(-50%);
  border-radius: 0 0 999px 999px;
  background: transparent;
  border-bottom: 4px solid #141417;
}

.rbx-mustache {
  display: none;
  position: absolute;
  left: 50%;
  top: 51%;
  width: 28%;
  height: 6%;
  transform: translateX(-50%);
}

.rbx-mustache::before,
.rbx-mustache::after {
  content: "";
  position: absolute;
  top: 0;
  width: 48%;
  height: 100%;
  background: #1a1716;
  border-radius: 999px 999px 60% 60%;
}

.rbx-mustache::before {
  left: 0;
  transform: rotate(14deg);
}

.rbx-mustache::after {
  right: 0;
  transform: rotate(-14deg);
}

.tile.rbx-mustache-on .rbx-mustache {
  display: block;
}

.rbx-glasses {
  display: none;
  position: absolute;
  left: 20%;
  top: 31.5%;
  width: 60%;
  height: 20%;
  z-index: 1;
}

.rbx-glasses::before,
.rbx-glasses::after {
  content: "";
  position: absolute;
  top: 0;
  width: 35%;
  height: 100%;
  border: 2px solid #16171b;
  border-radius: 50%;
  background: transparent;
}

.rbx-glasses::before { left: 0; }
.rbx-glasses::after { right: 0; }

.rbx-glasses {
  border-top: 2px solid #16171b;
  border-radius: 999px;
}

.tile.rbx-glasses-on .rbx-glasses {
  display: block;
}

.tile[data-eye="round"] .rbx-eye {
  width: 18%;
  height: 19%;
  border-radius: 50%;
  background: #f4f4f5;
  border: 2px solid #151518;
}

.tile[data-eye="round"] .rbx-eye::after {
  width: 36%;
  height: 36%;
}

.tile[data-eye="oval"] .rbx-eye {
  width: 14%;
  height: 15%;
  border-radius: 48%;
}

.tile[data-eye="dot"] .rbx-eye {
  width: 13%;
  height: 14%;
  border-radius: 50%;
  background: #f9fbff;
}

.tile[data-eye="dot"] .rbx-eye::after {
  width: 52%;
  height: 52%;
}

.tile[data-eye="pixel"] .rbx-eye {
  width: 12%;
  height: 14%;
  border-radius: 2px;
  background: #f5f7fb;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.26);
}

.tile[data-eye="pixel"] .rbx-eye::after {
  width: 44%;
  height: 44%;
  border-radius: 1px;
}

.tile[data-eye="sharp"] .rbx-eye {
  width: 16%;
  height: 12%;
  border-radius: 50% 50% 45% 45%;
  transform: skewX(-12deg);
}

.tile[data-eye="female"] .rbx-eye {
  width: 15%;
  height: 16%;
  border-radius: 65% 35% 60% 35%;
  transform: rotate(-8deg);
}

.tile[data-eye="sleepy"] .rbx-eye {
  height: 12%;
  top: 36%;
  border-radius: 999px;
}

.tile[data-eye="sleepy"] .rbx-eye::after {
  width: 56%;
  height: 18%;
  top: 66%;
}

.tile[data-eye="closed"] .rbx-eye {
  top: 40%;
  height: 3px;
  width: 16%;
  border: 0;
  background: #1a1d23;
  box-shadow: none;
}

.tile[data-eye="closed"] .rbx-eye::after {
  display: none;
}

.tile[data-eye="wink"] .rbx-eye-right {
  top: 40%;
  height: 3px;
  width: 16%;
  border: 0;
  background: #1a1d23;
  box-shadow: none;
}

.tile[data-eye="wink"] .rbx-eye-right::after {
  display: none;
}

.tile[data-mouth="flat"] .rbx-mouth {
  top: 62%;
  width: 40%;
  height: 0;
  border-bottom-width: 3px;
  border-radius: 999px;
}

.tile[data-mouth="open"] .rbx-mouth {
  top: 57%;
  width: 42%;
  height: 18%;
  border: 2px solid #24262d;
  border-radius: 44% 44% 52% 52%;
  background: #be3a50;
}

.tile[data-mouth="smirk"] .rbx-mouth {
  top: 60%;
  width: 43%;
  border-bottom-width: 5px;
  border-radius: 999px;
  transform: translateX(-50%) rotate(-8deg);
}

.tile[data-mouth="pixel-smile"] .rbx-mouth {
  top: 60%;
  width: 40%;
  border-bottom-width: 4px;
  border-radius: 0;
  clip-path: polygon(0 45%, 12% 45%, 22% 70%, 32% 88%, 45% 100%, 55% 100%, 68% 88%, 78% 70%, 88% 45%, 100% 45%, 100% 100%, 0 100%);
}

.tile[data-mouth="frown"] .rbx-mouth {
  top: 64%;
  width: 41%;
  height: 12%;
  border: 0;
  border-top: 4px solid #141417;
  border-radius: 999px;
}

.tile[data-mouth="lip"] .rbx-mouth {
  top: 60%;
  width: 38%;
  height: 14%;
  border: 2px solid #7d3349;
  background: #f58fb2;
  border-radius: 999px;
}

.rbx-brow {
  display: none;
  top: 26%;
  width: 20%;
  height: 3px;
  border-radius: 999px;
  background: #23242a;
  opacity: 0.82;
}

.rbx-brow-left {
  left: 20%;
  transform: rotate(-8deg);
}

.rbx-brow-right {
  right: 20%;
  transform: rotate(8deg);
}

.tile.rbx-brow-on .rbx-brow {
  display: block;
}

.rbx-bow {
  display: none;
  position: absolute;
  left: 50%;
  top: 76%;
  width: 22%;
  height: 10%;
  transform: translateX(-50%);
  background: color-mix(in srgb, #f36ea0 68%, var(--head-accent) 32%);
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.rbx-bow::before,
.rbx-bow::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 52%;
  height: 130%;
  border-radius: 999px;
  background: inherit;
  transform: translateY(-50%);
}

.rbx-bow::before { left: -46%; }
.rbx-bow::after { right: -46%; }

.tile.rbx-bow-on .rbx-bow {
  display: block;
}

.rbx-tattoo {
  display: none;
  position: absolute;
  right: 18%;
  top: 52%;
  width: 14%;
  height: 14%;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--head-accent) 70%, #172337 30%);
  background: rgba(255, 255, 255, 0.18);
}

.tile.rbx-tattoo-on .rbx-tattoo {
  display: block;
}

.tile.rbx-rainbow .rbx-head {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.18),
    inset 0 7px 10px rgba(255, 255, 255, 0.34),
    0 3px 7px rgba(0, 0, 0, 0.28),
    0 0 0 2px rgba(255, 0, 85, 0.46),
    0 0 0 4px rgba(255, 170, 0, 0.45),
    0 0 0 6px rgba(190, 255, 0, 0.44),
    0 0 0 8px rgba(0, 200, 255, 0.42),
    0 0 0 10px rgba(185, 80, 255, 0.38);
}

.tile-value {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 38%;
  padding: 3px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(8, 20, 42, 0.68);
  color: #eaf4ff;
  font-family: "Bahnschrift", "Consolas", "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: clamp(0.82rem, 2.35vw, 1.22rem);
  line-height: 1;
  text-align: center;
}

.tile.tile-roblox[data-v="1024"],
.tile.tile-roblox[data-v="2048"],
.tile.tile-roblox[data-v="4096"],
.tile.tile-roblox[data-v="8192"] {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.62),
    0 11px 22px rgba(18, 52, 96, 0.3),
    0 0 26px rgba(255, 208, 82, 0.32);
}

/* Final readability pass: remove neon look and increase contrast. */
body,
button,
input {
  font-family: "Trebuchet MS", "Verdana", "Tahoma", "Segoe UI", sans-serif !important;
}

h1,
h2,
h3,
.btn,
.audio-btn {
  font-family: "Trebuchet MS", "Verdana", "Tahoma", "Segoe UI", sans-serif !important;
  letter-spacing: 0.01em;
}

.menu-hero::before,
.menu-hero::after,
.neon-ticker {
  display: none !important;
}

.menu-hero h1 {
  animation: none !important;
  text-transform: none;
  color: #133f76 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.feature-pill::before,
.feature-pill::after {
  display: none !important;
}

.btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  background: linear-gradient(180deg, #3f9cff, #2a73da) !important;
  box-shadow: 0 8px 18px rgba(33, 95, 171, 0.36) !important;
  text-shadow: none !important;
}

.btn:hover,
.game-actions .btn:hover,
.overlay-actions .btn:hover,
.notice-card .btn:hover {
  background: linear-gradient(180deg, #56abff, #307be4) !important;
}

.btn.btn-secondary,
.game-actions .btn.btn-secondary {
  color: #143a2a !important;
  border-color: rgba(215, 255, 234, 0.94) !important;
  background: linear-gradient(180deg, #8de7b6, #41bf79) !important;
}

.audio-btn {
  color: #103d73 !important;
  border-color: rgba(127, 176, 232, 0.72) !important;
  background: linear-gradient(180deg, #ffffff, #dcedff) !important;
  text-shadow: none !important;
}

.audio-btn.active {
  color: #0b3a20 !important;
  border-color: rgba(110, 194, 146, 0.76) !important;
  background: linear-gradient(180deg, #c8f8de, #96e6be) !important;
}

.topbar,
.score-card,
.turn-text,
#hint-text,
.leaderboard-head,
.leaderboard-row,
.overlay-card,
.notice-card {
  color: #143a6f !important;
}

.score-card {
  background: rgba(251, 253, 255, 0.92) !important;
  border-color: rgba(128, 179, 238, 0.52) !important;
}

.score-card span {
  color: #466b97 !important;
}

.score-card strong,
#score,
#best,
#combo-value,
#overdrive-value,
#boost-value {
  color: #183f74 !important;
  text-shadow: none !important;
}

.combo-burst,
.overdrive-burst,
.boost-burst {
  display: none !important;
}

#leaderboard-modal,
#overlay,
#notice-modal {
  background: rgba(24, 72, 132, 0.24) !important;
}

.overlay-card,
.leaderboard-card,
.notice-card {
  border: 1px solid rgba(136, 185, 240, 0.72) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(248, 253, 255, 0.97), rgba(231, 244, 255, 0.95)) !important;
  box-shadow: 0 16px 34px rgba(32, 88, 158, 0.26) !important;
}

.overlay-card h3,
#leaderboard-title {
  color: #1a4a83 !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  text-shadow: none !important;
}

.overlay-card p,
.notice-card p {
  color: #244f83 !important;
  text-shadow: none !important;
}

.leaderboard-head {
  color: #456b99 !important;
}

.leaderboard-empty {
  border-color: rgba(135, 184, 239, 0.66) !important;
  background: rgba(242, 250, 255, 0.96) !important;
  color: #2a568b !important;
}

.leaderboard-row {
  border-color: rgba(135, 184, 239, 0.68) !important;
  background: rgba(248, 253, 255, 0.98) !important;
  box-shadow: none !important;
}

.leaderboard-row-me {
  border-color: rgba(96, 191, 149, 0.88) !important;
  background: rgba(238, 255, 247, 0.98) !important;
}

.lb-rank {
  color: #265f9f !important;
  text-shadow: none !important;
}

.lb-name {
  color: #214a7e !important;
}

.lb-score {
  color: #1c6e4d !important;
  text-shadow: none !important;
}

/* Color boost pass: make menu/background more vivid and playful. */
body {
  background:
    radial-gradient(980px 420px at 6% 8%, rgba(255, 245, 154, 0.68), transparent 60%),
    radial-gradient(860px 380px at 94% 12%, rgba(255, 176, 176, 0.56), transparent 62%),
    radial-gradient(980px 440px at 50% 102%, rgba(143, 223, 255, 0.72), transparent 64%),
    linear-gradient(180deg, #8ed7ff 0%, #aee4ff 36%, #80bfff 100%) !important;
}

.screen {
  background:
    linear-gradient(180deg, rgba(245, 252, 255, 0.95), rgba(228, 244, 255, 0.94)) !important;
  border-color: rgba(132, 190, 255, 0.62) !important;
}

.screen::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 214, 107, 0.34), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(255, 130, 130, 0.24), transparent 33%),
    radial-gradient(circle at 50% 88%, rgba(89, 201, 255, 0.24), transparent 37%) !important;
}

#menu {
  position: relative;
}

#menu::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.26;
}

.menu-hero {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(236, 248, 255, 0.72));
  border: 1px solid rgba(141, 191, 245, 0.5);
  border-radius: 18px;
  padding: 14px 12px 10px;
  box-shadow: 0 12px 24px rgba(69, 136, 214, 0.2);
}

.menu-hero h1 {
  color: #0d4f92 !important;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 16px rgba(98, 185, 255, 0.36) !important;
}

.feature-strip {
  gap: 10px;
}

.feature-pill {
  border-color: rgba(110, 180, 255, 0.58) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(231, 245, 255, 0.9)) !important;
  box-shadow: 0 7px 14px rgba(67, 138, 216, 0.2);
  color: #18518e !important;
}

.menu-actions {
  gap: 16px;
}

.btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #53b2ff, #2b7ae0) !important;
}

.btn.btn-secondary,
.game-actions .btn.btn-secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #9cf0c0, #47c67f) !important;
}

#overlay-revive {
  color: #5f4300 !important;
  border-color: rgba(255, 245, 187, 0.92) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #ffe28d, #ffbd45) !important;
  box-shadow: 0 8px 18px rgba(192, 129, 28, 0.34) !important;
}

.decor-heads {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.decor-head {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  transform: translate(-50%, -50%) rotate(var(--rot));
  opacity: var(--alpha);
  border: 0;
  background: transparent;
  box-shadow: 0 0 26px rgba(80, 174, 255, var(--glow));
  animation: decor-head-float var(--dur, 9s) cubic-bezier(0.34, 0.04, 0.2, 1) infinite alternate;
  will-change: transform, opacity, filter;
}

.decor-head::before {
  content: none;
}

.decor-head::after {
  content: none;
}

.decor-head .rbx-head {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.16),
    inset 0 7px 10px rgba(255, 255, 255, 0.34),
    0 8px 16px rgba(22, 69, 133, 0.24);
}

.decor-head:nth-child(2n) { animation-delay: -1.1s; }
.decor-head:nth-child(3n) { animation-delay: -2.3s; }
.decor-head:nth-child(4n) { animation-delay: -3.2s; }
.decor-head:nth-child(5n) { animation-delay: -4.1s; }

.decor-paused .decor-head {
  animation-play-state: paused !important;
}

@keyframes decor-head-float {
  0% {
    transform: translate(calc(-50% - var(--dx, 0px)), calc(-50% - var(--dy, 0px))) rotate(calc(var(--rot) - 9deg)) scale(0.9);
    filter: saturate(1) brightness(1);
  }
  50% {
    transform: translate(calc(-50% + (var(--dx, 0px) * 0.78)), calc(-50% + (var(--dy, 0px) * -0.85))) rotate(calc(var(--rot) + 10deg)) scale(1.16);
    filter: saturate(1.22) brightness(1.1);
  }
  100% {
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) rotate(calc(var(--rot) + 12deg)) scale(1.14);
    filter: saturate(1.24) brightness(1.12);
  }
}

#menu::after {
  opacity: 0.14;
}

.overlay {
  z-index: 35 !important;
}

#menu > *:not(.decor-heads):not(.overlay),
#game > *:not(.decor-heads):not(.overlay) {
  position: relative;
  z-index: 2;
}

/* Final visual punch: Roblox-like bold type, juicy colors, grid texture. */
:root {
  --rbx-font: "Press Start 2P", "VT323", "Cascadia Mono", "Consolas", "Lucida Console", "Courier New", monospace;
}

body,
button,
input,
h1,
h2,
h3,
.btn,
.audio-btn,
.feature-pill,
.score-card strong {
  font-family: var(--rbx-font) !important;
}

#menu-title,
#game-title {
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.btn,
.feature-pill,
.score-card {
  position: relative;
  overflow: hidden;
}

.btn::before,
.feature-pill::before,
.score-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 16px 16px;
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

.btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  border-color: rgba(255, 255, 255, 0.92) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #6fd0ff, #2e80e8) !important;
  box-shadow:
    0 10px 22px rgba(25, 101, 184, 0.42),
    0 0 0 1px rgba(156, 213, 255, 0.62) !important;
}

.btn:hover,
.game-actions .btn:hover,
.overlay-actions .btn:hover,
.notice-card .btn:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #7cdbff, #3589f0) !important;
}

.btn.btn-secondary,
.game-actions .btn.btn-secondary {
  color: #103a28 !important;
  border-color: rgba(230, 255, 243, 0.95) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #b3f8cb, #52ce86) !important;
}

.feature-pill {
  border-color: rgba(120, 193, 255, 0.74) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(233, 247, 255, 0.9)) !important;
  color: #12508e !important;
  box-shadow:
    0 10px 18px rgba(62, 145, 231, 0.24),
    0 0 0 1px rgba(160, 214, 255, 0.52) !important;
}

.audio-btn {
  border-color: rgba(153, 205, 255, 0.92) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(224, 243, 255, 0.88)) !important;
}

.feature-pill::before {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  border: 0 !important;
  border-radius: inherit !important;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px) !important;
  background-size: 14px 14px !important;
  opacity: 0.52 !important;
}

/* Punchier menu + score cards */
#menu {
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 212, 93, 0.28), transparent 34%),
    radial-gradient(circle at 86% 22%, rgba(255, 128, 128, 0.22), transparent 38%),
    radial-gradient(circle at 52% 88%, rgba(95, 212, 255, 0.25), transparent 42%),
    linear-gradient(180deg, rgba(246, 252, 255, 0.96), rgba(225, 242, 255, 0.94)) !important;
}

.menu-hero {
  border: 2px solid rgba(122, 196, 255, 0.76) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(223, 242, 255, 0.86)) !important;
  box-shadow:
    0 14px 30px rgba(40, 123, 211, 0.28),
    0 0 0 2px rgba(171, 223, 255, 0.52) !important;
}

#menu-title,
#game-title {
  color: #0b4f94 !important;
  text-shadow:
    0 0 14px rgba(112, 194, 255, 0.54),
    0 0 26px rgba(87, 146, 255, 0.42) !important;
}

.menu-actions .btn {
  min-height: 58px;
}

.score-card {
  border: 2px solid rgba(143, 206, 255, 0.8) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(220, 242, 255, 0.9)) !important;
  box-shadow:
    0 8px 18px rgba(47, 131, 217, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
}

.score-card span {
  color: #2a66a6 !important;
}

.score-card strong,
#score,
#best,
#combo-value,
#overdrive-value,
#boost-value {
  color: #0f4f96 !important;
  text-shadow: 0 0 10px rgba(111, 190, 255, 0.4) !important;
}

.btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  color: #fff !important;
  letter-spacing: 0.04em !important;
  border-width: 2px !important;
}

/* Final requested tuning: brighter blue buttons + hover pulse + brighter tile values. */
.btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  border-color: rgba(220, 242, 255, 0.96) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #66c9ff, #1f4fff) !important;
  box-shadow:
    0 12px 24px rgba(24, 84, 220, 0.48),
    0 0 0 2px rgba(139, 206, 255, 0.58) !important;
}

.btn.btn-secondary,
.game-actions .btn.btn-secondary {
  color: #ffffff !important;
  border-color: rgba(214, 245, 255, 0.96) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #5ec8ff, #1745e8) !important;
  box-shadow:
    0 12px 24px rgba(21, 79, 208, 0.46),
    0 0 0 2px rgba(141, 226, 255, 0.56) !important;
}

#overlay-revive {
  color: #5f4300 !important;
  border-color: rgba(255, 245, 187, 0.92) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #ffe28d, #ffbd45) !important;
}

.btn:hover,
.game-actions .btn:hover,
.overlay-actions .btn:hover,
.notice-card .btn:hover {
  animation: ui-btn-pulse 560ms ease-out;
  transform: translateY(-2px) scale(1.025);
}

.tile-value {
  border: 1px solid rgba(232, 247, 255, 0.82) !important;
  background: linear-gradient(180deg, rgba(228, 244, 255, 0.96), rgba(157, 214, 255, 0.86)) !important;
  color: #0d4f95 !important;
  text-shadow: 0 0 8px rgba(187, 234, 255, 0.7) !important;
}

@keyframes ui-btn-pulse {
  0% {
    box-shadow:
      0 10px 20px rgba(32, 110, 216, 0.36),
      0 0 0 1px rgba(158, 217, 255, 0.45);
  }
  55% {
    box-shadow:
      0 16px 30px rgba(36, 125, 240, 0.52),
      0 0 0 2px rgba(176, 231, 255, 0.72),
      0 0 22px rgba(114, 199, 255, 0.58);
  }
  100% {
    box-shadow:
      0 12px 24px rgba(34, 120, 232, 0.44),
      0 0 0 2px rgba(139, 206, 255, 0.58);
  }
}

#boost-ad-btn {
  color: #5b3400 !important;
  border-color: rgba(255, 234, 171, 0.96) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #ffd978, #ff9f2f) !important;
  box-shadow:
    0 12px 24px rgba(214, 130, 22, 0.46),
    0 0 0 2px rgba(255, 198, 117, 0.58) !important;
}

/* Final UI icon pass: font-independent SVG icons + centered button labels. */
.ui-icon {
  width: 1.14em;
  height: 1.14em;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn,
.menu-actions .btn,
.game-actions .btn,
.overlay-actions .btn,
.notice-card .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.48em !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
  padding-inline: 0.9em !important;
}

.btn-label {
  display: inline-block;
  text-align: center;
}

.menu-actions .btn {
  white-space: nowrap !important;
}

#continue-btn .btn-label {
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

.audio-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.35em;
}

#lang-toggle {
  white-space: nowrap;
}

.feature-pill {
  gap: 0.5em !important;
}

.feature-pill .pill-label {
  text-align: center;
}

.feature-pill .ui-icon {
  width: 1em;
  height: 1em;
}

.topbar .game-hero {
  max-width: min(54%, 420px);
  border-radius: 16px;
  border: 2px solid rgba(122, 196, 255, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.93), rgba(223, 242, 255, 0.86));
  box-shadow:
    0 10px 24px rgba(40, 123, 211, 0.24),
    0 0 0 1px rgba(171, 223, 255, 0.46) inset;
  padding: 8px 12px;
}

#game-title {
  margin: 0 !important;
  text-align: center !important;
}

.topbar .game-hero .turn-text {
  margin-top: 4px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar .game-hero {
    max-width: 100%;
  }

  .score-wrap {
    width: 100%;
  }

  #continue-btn .btn-label {
    font-size: 0.86em;
  }
}

/* Overlay sizing + compact revive button text layout */
#overlay .overlay-card {
  width: min(96%, 620px) !important;
  padding: 24px 22px 20px !important;
  gap: 12px !important;
}

#overlay .overlay-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#overlay .overlay-actions .btn {
  min-height: 52px;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  padding-inline: 0.72em !important;
  font-size: clamp(0.92rem, 1.85vw, 1.08rem) !important;
}

#overlay .overlay-actions .btn .btn-label {
  white-space: nowrap !important;
}

#overlay-revive {
  white-space: pre-line !important;
  line-height: 1.1 !important;
  grid-column: span 2 !important;
  min-height: 62px !important;
  font-size: clamp(0.94rem, 1.7vw, 1.08rem) !important;
}

#overlay-restart,
#overlay-menu {
  grid-column: auto !important;
  min-height: 56px !important;
}
