/* Block Battle - Emerald/Gold Theme */

/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #05050f;
  --bg-secondary: #0a0a1a;
  --bg-card: #071f1a;
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --surface: #0b2a23;
  --accent: #2fe39a;
  --accent-light: #6ff2b2;
  --accent-glow: rgba(47, 227, 154, 0.34);
  --neon-cyan: #58efa5;
  --neon-cyan-glow: rgba(88, 239, 165, 0.28);
  --neon-purple: #ffbd35;
  --neon-purple-glow: rgba(255, 189, 53, 0.28);
  --danger: #ff3e3e;
  --success: #00ff9d;
  --warning: #ffcc00;
  --text-primary: #ffffff;
  --text-secondary: rgba(239, 244, 238, 0.72);
  --text-muted: #64748b;
  --neon-green: #00ff88;
  --glass: rgba(20, 20, 45, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 25px var(--neon-cyan-glow);
}

:root[data-ui-theme="light"] {
  --bg-primary: #cfe0f7;
  --bg-secondary: #b8d0ef;
  --bg-card: rgba(219, 233, 249, 0.94);
  --bg-card-border: rgba(38, 80, 132, 0.22);
  --surface: #d7e8fb;
  --accent: #1f8f67;
  --accent-light: #2fae7d;
  --accent-glow: rgba(31, 143, 103, 0.18);
  --neon-cyan: #126782;
  --neon-cyan-glow: rgba(18, 103, 130, 0.22);
  --neon-purple: #b7791f;
  --neon-purple-glow: rgba(183, 121, 31, 0.20);
  --danger: #d43f4b;
  --success: #16835c;
  --warning: #b7791f;
  --text-primary: #10233f;
  --text-secondary: #385271;
  --text-muted: #667c96;
  --neon-green: #16835c;
  --glass: rgba(216, 232, 249, 0.76);
  --glass-border: rgba(38, 80, 132, 0.18);
  --shadow: 0 14px 30px rgba(31, 63, 104, 0.18);
  --shadow-glow: 0 0 22px rgba(18, 103, 130, 0.12);
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
}

body {
  background: radial-gradient(circle at 50% -20%, #171738 0%, var(--bg-primary) 70%);
}

body.game-menu-open {
  touch-action: pan-y;
}

:root[data-ui-theme="light"] body {
  background:
    radial-gradient(circle at 18% -8%, rgba(18,103,130,0.24), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(91,85,189,0.18), transparent 32%),
    linear-gradient(180deg, #dcecff 0%, #c4d9f3 52%, #b6cde9 100%);
}

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.screen.active {
  display: flex;
}

.screen.overlay {
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.screen.overlay.hidden,
.quick-shop-modal.hidden,
.game-menu-drawer.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.screen.overlay,
.quick-shop-modal,
.game-menu-drawer,
.game-menu-backdrop {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {

  .screen.active .glass-panel,
  .screen.active .cyber-header,
  .screen.active .menu-content,
  .screen.active .cyber-scroll-area,
  .screen.active .bottom-nav,
  .screen.active #game-header,
  .screen.active #game-area,
  .screen.active #power-ups,
  .screen.active #piece-tray,
  .screen.active .cyber-card,
  .screen.active .card-btn,
  .screen.active .leaderboard-item,
  .screen.active .quest-row,
  .screen.active .level-card,
  .screen.active .match-history-item,
  .screen.active .shop-item-card,
  .screen.active .power-shop-card,
  .screen.active .cosmetic-card,
  .game-menu-backdrop,
  .game-menu-panel,
  .quick-shop-modal,
  .quick-shop-panel {
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }

  .screen {
    transition: none !important;
  }
}

.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow), var(--shadow-glow);
  max-width: 440px;
  width: 90%;
  text-align: center;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent-light), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#menu-screen {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 80px;
}

.menu-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  gap: 24px;
}

.menu-header {
  text-align: left;
  width: 100%;
}

.logo {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--neon-purple-glow);
}

.logo-block {
  color: var(--text-primary);
}

.logo-battle {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logoShimmer 3s ease-in-out infinite;
}

@keyframes logoShimmer {

  0%,
  100% {
    filter: hue-rotate(0deg);
  }

  50% {
    filter: hue-rotate(30deg);
  }
}

#btn-store {
  border: none;
  color: white;
}

#btn-store:hover {
  box-shadow: 0 6px 25px rgba(255, 159, 67, 0.4);
}

/* Floating blocks background */
.menu-bg-effects {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-block {
  position: absolute;
  border-radius: 6px;
  opacity: 0.08;
  animation: floatBlock 12s ease-in-out infinite;
}

.fb1 {
  width: 60px;
  height: 60px;
  background: #ff6b6b;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.fb2 {
  width: 80px;
  height: 40px;
  background: #48dbfb;
  top: 60%;
  right: 15%;
  animation-delay: -3s;
}

.fb3 {
  width: 40px;
  height: 80px;
  background: #feca57;
  bottom: 20%;
  left: 20%;
  animation-delay: -6s;
}

.fb4 {
  width: 50px;
  height: 50px;
  background: #ff9ff3;
  top: 30%;
  right: 25%;
  animation-delay: -2s;
}

.fb5 {
  width: 70px;
  height: 35px;
  background: #54a0ff;
  bottom: 35%;
  right: 10%;
  animation-delay: -8s;
}

@keyframes floatBlock {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-30px) rotate(5deg);
  }

  50% {
    transform: translateY(-15px) rotate(-3deg);
  }

  75% {
    transform: translateY(-40px) rotate(4deg);
  }
}

.btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(108, 92, 231, 0.5);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: white;
  box-shadow: 0 4px 20px rgba(0,184,148,0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 28px rgba(0,184,148,0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
}

.btn-guest {
  background: rgba(0, 243, 255, 0.08);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 243, 255, 0.28);
  box-shadow: 0 4px 18px rgba(0, 243, 255, 0.12);
}

.btn-guest:hover {
  box-shadow: 0 6px 24px rgba(0, 243, 255, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 20px;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: var(--radius);
}

.btn-small {
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-icon-only {
  padding: 10px 14px;
  font-size: 1.3rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--bg-card-border);
}

.hamburger-menu-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--text-primary);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.hamburger-menu-btn span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.game-menu-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: block;
  overflow: hidden;
  touch-action: pan-y;
}

.game-menu-drawer.hidden {
  display: none;
}

.game-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.56);
}

.game-menu-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, 360px);
  height: auto;
  max-height: none;
  overflow-y: scroll;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(18, 18, 43, 0.98), rgba(5, 5, 15, 0.98)),
    var(--bg-primary);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.45);
}

.game-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.game-menu-head strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.game-menu-kicker,
.drawer-section-title,
.drawer-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.drawer-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 1.45rem;
  line-height: 1;
}

.drawer-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 243, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 243, 255, 0.06);
  margin-bottom: 18px;
}

.drawer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  color: white;
  font-weight: 900;
  letter-spacing: 1px;
}

.drawer-player-card strong {
  display: block;
  margin-top: 2px;
  color: var(--text-primary);
}

.drawer-section {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.drawer-section-title {
  padding: 0 4px;
}

.drawer-row {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  text-decoration: none;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font: inherit;
  text-align: left;
}

.drawer-row span {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--neon-cyan);
  font-weight: 900;
}

.drawer-row strong {
  font-size: 0.96rem;
}

.drawer-row em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.drawer-row:active {
  transform: scale(0.98);
}

.drawer-row.danger span,
.drawer-row.danger strong {
  color: var(--danger);
}

.settings-panel {
  text-align: left;
  max-width: 420px;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-row {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  text-decoration: none;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
}

.settings-row span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--neon-cyan);
  font-weight: 900;
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row strong {
  font-size: 0.96rem;
}

.settings-row small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.settings-row em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.settings-row.danger span,
.settings-row.danger strong {
  color: var(--danger);
}

:root[data-ui-theme="light"] .game-menu-panel {
  background:
    linear-gradient(180deg, rgba(230, 241, 253, 0.98), rgba(201, 220, 242, 0.98)),
    var(--bg-primary);
  border-right-color: rgba(38, 80, 132, 0.18);
}

:root[data-ui-theme="light"] .hamburger-menu-btn,
:root[data-ui-theme="light"] .drawer-icon-btn,
:root[data-ui-theme="light"] .drawer-row,
:root[data-ui-theme="light"] #btn-profile.drawer-row,
:root[data-ui-theme="light"] .settings-row {
  background: rgba(255, 255, 255, 0.42) !important;
  border-color: rgba(38, 80, 132, 0.18) !important;
  box-shadow: none !important;
  color: var(--text-primary);
}

:root[data-ui-theme="light"] .drawer-player-card {
  background: rgba(18, 103, 130, 0.08);
  border-color: rgba(18, 103, 130, 0.16);
}

.mode-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.mode-btn {
  font-family: var(--font);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s;
  color: var(--text-secondary);
}

.mode-btn .mode-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 6px;
}

.mode-btn .mode-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.mode-btn .mode-desc {
  display: block;
  font-size: 0.72rem;
  margin-top: 4px;
  color: var(--text-muted);
}

.mode-btn.active {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.12);
  box-shadow: 0 0 16px var(--accent-glow);
}

.mode-btn:hover {
  border-color: var(--accent-light);
}

.match-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.join-section {
  display: flex;
  gap: 8px;
}

.input-field {
  flex: 1;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--accent);
}

.waiting-panel {
  padding: 40px 32px;
}

.spinner-container {
  margin-bottom: 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.room-info {
  margin: 20px 0;
}

.room-code-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.room-code-display {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 10px;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
  margin-bottom: 16px;
}

.room-share-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.waiting-subtitle {
  margin: -8px 0 16px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-badge {
  display: grid;
  place-items: center;
  min-width: 124px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.14), rgba(255, 190, 56, 0.12)), var(--surface);
  border: 1px solid rgba(0, 243, 255, 0.22);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
}

.level-badge.hidden {
  display: none;
}

.level-badge span {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  text-align: center;
  min-width: 80px;
}

.stat-label {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
}

.timer-value {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  font-variant-numeric: tabular-nums;
}

.combo-display {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 50;
}

.combo-display.hidden {
  display: none;
}

.combo-display.show {
  display: block;
  animation: comboPopup 0.8s ease-out forwards;
}

#combo-text {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #feca57, #ff6b6b, #ff9ff3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(255, 107, 107, 0.5));
}

@keyframes comboPopup {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(1);
  }
}

#game-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 0 calc(24px + env(safe-area-inset-bottom));
  gap: 0;
  height: 100dvh;
}

#game-screen.active {
  display: flex;
}

#game-area {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 780px;
  min-height: 0;
  overflow: hidden;
}

#boards-container {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
}

#main-board-wrap {
  position: relative;
}

#game-canvas {
  display: block;
  border-radius: var(--radius);
  touch-action: none;
}

#opponent-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#opponent-board-wrap.hidden {
  display: none;
}

.opponent-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

#opponent-canvas {
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
}

#piece-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 16px 8px;
  width: 100%;
  max-width: 780px;
  min-height: 76px;
  margin-bottom: 8px;
}

.piece-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(20, 20, 50, 0.5);
  border: 1px solid rgba(108, 92, 231, 0.1);
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
  touch-action: none;
}

.piece-slot:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px var(--accent-glow);
}

.piece-slot:active {
  cursor: grabbing;
}

.piece-slot.placed {
  opacity: 0.15;
  pointer-events: none;
  transform: scale(0.85);
}

.piece-slot.dragging {
  opacity: 0.3;
  transform: scale(0.9);
}

#piece-tray.power-pulse .piece-slot {
  animation: powerPulse 0.34s ease;
}

#piece-tray.locked .piece-slot {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.7);
}

@keyframes powerPulse {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 rgba(0, 243, 255, 0);
  }

  45% {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(0, 243, 255, 0.22);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 243, 255, 0);
  }
}

.piece-grid {
  display: grid;
  gap: 2px;
}

.piece-cell {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

.piece-cell.filled {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.piece-cell.empty {
  background: transparent;
}

/* Floating dragged piece */
.drag-piece {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  display: grid;
  gap: 2px;
  transition: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.drag-cell {
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.drag-bomb {
  position: fixed;
  width: 58px;
  height: 58px;
  pointer-events: none;
  z-index: 220;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), rgba(255, 71, 87, 0.22) 48%, rgba(10, 10, 22, 0.88) 100%);
  border: 1px solid rgba(255, 71, 87, 0.75);
  box-shadow: 0 0 22px rgba(255, 71, 87, 0.45), 0 10px 28px rgba(0, 0, 0, 0.45);
  font-size: 2rem;
  transform: translate(-50%, -50%);
}

#score-popup-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.score-popup {
  position: absolute;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
  animation: scorePopFade 0.9s ease-out forwards;
  pointer-events: none;
}

@keyframes scorePopFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.7);
  }
}

.gameover-panel {
  padding: 36px;
}

.gameover-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 20px;
}

.gameover-title.win {
  color: var(--success);
}

.gameover-title.lose {
  color: var(--danger);
}

.gameover-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.go-stat {
  text-align: center;
}

.go-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.gameover-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 20px;
}

.gameover-detail-item {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.gameover-detail-item span {
  display: block;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gameover-detail-item strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 900;
}

.go-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.gameover-result {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: var(--radius-sm);
}

.gameover-result.hidden {
  display: none;
}

.gameover-result.win {
  background: rgba(46, 213, 115, 0.12);
  color: var(--success);
}

.gameover-result.lose {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
}

.gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-panel {
  max-width: 400px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bg-card-border);
}

.social-auth-actions {
  display: grid;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.logo-small {
  font-size: 2rem;
  margin-bottom: 8px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.input-group {
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.auth-input {
  width: 100%;
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 500;
  padding: 12px 14px;
  font-size: 0.95rem;
}

.btn-full {
  width: 100%;
}

.auth-error {
  background: rgba(255, 71, 87, 0.12);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-error.hidden {
  display: none;
}

.auth-switch {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.auth-link {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 700;
}

.auth-link:hover {
  text-decoration: underline;
}

.account-required-panel {
  max-width: 360px;
}

.account-required-copy {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 10px 0 18px;
}

.account-required-actions {
  display: grid;
  gap: 10px;
}

/* Loading */
.loading-text {
  color: var(--text-secondary);
  margin-top: 16px;
  font-size: 0.9rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--bg-card-border);
  padding: 8px 18px;
  border-radius: 50px;
  margin-bottom: 8px;
}

.user-avatar {
  font-size: 1.2rem;
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-light);
}

.menu-footer-btns {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.leaderboard-panel {
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.leaderboard-list {
  margin-bottom: 16px;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: background 0.2s;
}

.lb-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.lb-row:hover {
  background: rgba(108, 92, 231, 0.08);
}

.lb-rank {
  width: 36px;
  font-weight: 900;
  font-size: 1rem;
  color: var(--text-muted);
}

.lb-rank.gold {
  color: #feca57;
  text-shadow: 0 0 8px rgba(254, 202, 87, 0.4);
}

.lb-rank.silver {
  color: #dfe6e9;
  text-shadow: 0 0 8px rgba(223, 230, 233, 0.3);
}

.lb-rank.bronze {
  color: #e17055;
  text-shadow: 0 0 8px rgba(225, 112, 85, 0.3);
}

.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.lb-name.me {
  color: var(--accent-light);
}

.lb-score {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--neon-green);
}

.leaderboard-loading {
  padding: 30px 0;
  text-align: center;
}

.spinner-sm {
  width: 32px;
  height: 32px;
}

.leaderboard-hero {
  margin-bottom: 14px;
  padding: 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 204, 0, 0.14), rgba(0, 243, 255, 0.08)),
    var(--bg-card);
  border: 1px solid rgba(255, 204, 0, 0.2);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2), 0 0 28px rgba(255, 204, 0, 0.08);
  text-align: center;
}

.leaderboard-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.leaderboard-hero strong {
  display: block;
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 950;
}

.leaderboard-hero small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 800;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-item.rank-1 {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.16), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 204, 0, 0.34);
}

.leaderboard-item.rank-2 {
  background: linear-gradient(135deg, rgba(223, 230, 233, 0.12), rgba(255, 255, 255, 0.05));
  border-color: rgba(223, 230, 233, 0.24);
}

.leaderboard-item.rank-3 {
  background: linear-gradient(135deg, rgba(225, 112, 85, 0.13), rgba(255, 255, 255, 0.05));
  border-color: rgba(225, 112, 85, 0.26);
}

.leaderboard-item.me {
  border-color: rgba(0, 243, 255, 0.44);
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.09);
}

.rank {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.5px;
}

.rank.rank-1 {
  color: var(--warning);
}

.rank.rank-2 {
  color: #dfe6e9;
}

.rank.rank-3 {
  color: #e17055;
}

.player-info {
  display: grid;
  min-width: 0;
}

.player-name {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.player-score {
  display: grid;
  justify-items: end;
  min-width: 64px;
}

.player-score span {
  color: var(--neon-cyan);
  font-size: 1.08rem;
  font-weight: 950;
}

.player-score small {
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.premium-icon {
  margin-left: 6px;
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 950;
}

.profile-panel {
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}

.profile-header {
  margin-bottom: 20px;
}

.profile-avatar {
  font-size: 3rem;
  margin-bottom: 6px;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-light);
}

.profile-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
}

.p-stat {
  text-align: center;
}

.p-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
}

.p-stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 2px;
  text-transform: uppercase;
}

.panel-subtitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: left;
}

.match-history {
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.match-row.win {
  background: rgba(46, 213, 115, 0.08);
  border-left: 3px solid var(--success);
}

.match-row.lose {
  background: rgba(255, 71, 87, 0.08);
  border-left: 3px solid var(--danger);
}

.match-opponent {
  font-weight: 600;
}

.match-scores {
  font-weight: 800;
}

.match-result {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.match-result.w {
  color: var(--success);
}

.match-result.l {
  color: var(--danger);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.tutorial-panel {
  width: min(430px, calc(100vw - 28px));
}

.tutorial-steps {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.tutorial-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tutorial-step span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--neon-purple));
  font-weight: 900;
}

.tutorial-step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.global-back {
  display: none !important;
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 1100;
  min-width: 78px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(10, 10, 26, 0.88);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.global-back:active {
  transform: scale(0.97);
}

@media (max-width: 480px) {
  .logo {
    font-size: 2.4rem;
  }

  .logo-small {
    font-size: 1.5rem;
  }

  .glass-panel {
    padding: 24px 18px;
  }

  .mode-select {
    grid-template-columns: 1fr;
  }

  .piece-cell {
    width: 14px;
    height: 14px;
  }

  #game-area {
    padding: 0 8px;
  }

  #boards-container {
    gap: 8px;
    justify-content: center;
  }

  #opponent-board-wrap {
    gap: 4px;
  }

  .opponent-label {
    font-size: 0.58rem;
    letter-spacing: 1.4px;
  }

  #game-screen {
    padding-bottom: calc(34px + env(safe-area-inset-bottom));
  }

  #power-ups {
    margin: 0 0 2px;
  }

  #piece-tray {
    gap: 10px;
    padding: 4px 8px 8px;
    min-height: 60px;
    margin-bottom: 10px;
  }

  #game-header {
    padding: 6px 10px;
  }

  .header-center {
    gap: 8px;
  }

  .level-badge {
    min-width: 98px;
    padding: 5px 9px;
  }

  .level-badge span {
    font-size: 0.72rem;
  }

  .stat-box {
    padding: 4px 10px;
    min-width: 60px;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .menu-buttons {
    width: 240px;
  }

  .profile-stats {
    gap: 14px;
    padding: 12px;
  }

  .p-stat-value {
    font-size: 1.3rem;
  }

  .match-history-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .match-score-pill {
    grid-column: 2;
    justify-self: start;
    padding: 5px 9px;
  }

  .match-result-badge {
    width: 38px;
    height: 38px;
  }

  .match-topline {
    flex-wrap: wrap;
  }

  .leaderboard-hero {
    padding: 18px;
  }

  .leaderboard-item {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 66px;
    padding: 10px;
  }

  .rank {
    font-size: 0.72rem;
    min-height: 38px;
  }

  .player-name {
    font-size: 0.92rem;
  }

  .player-score {
    min-width: 54px;
  }

  .player-score span {
    font-size: 0.98rem;
  }
}

@media (max-height: 700px) {
  #game-header {
    padding: 4px 12px;
  }

  #game-screen {
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .stat-box {
    padding: 3px 8px;
  }

  .stat-value {
    font-size: 1rem;
  }

  #power-ups {
    margin: 0 0 2px;
  }

  #piece-tray {
    min-height: 54px;
    padding: 4px 8px 6px;
    margin-bottom: 6px;
  }

  .piece-cell {
    width: 14px;
    height: 14px;
  }
}

.store-panel {
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bg-card-border);
}

.store-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #feca57, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.store-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.store-tab {
  flex: 1;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.store-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent-light);
}

.store-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.store-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, background 0.2s;
}

.store-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.item-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-info {
  flex: 1;
  text-align: left;
}

.item-name {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.item-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-buy {
  background: var(--surface);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  padding: 10px 16px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  min-width: 85px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy:hover:not(:disabled) {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.btn-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

#power-ups {
  display: flex;
  gap: 12px;
  margin: 2px 0 4px;
}

.power-up-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--bg-card-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.power-up-btn:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.power-up-btn.active {
  background: var(--accent);
  border-color: var(--accent-light);
  animation: glowPulse 1.5s infinite;
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 5px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 20px var(--accent-glow);
  }
}

.pu-icon {
  font-size: 1.6rem;
}

.pu-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

.pu-plus {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 22px;
  height: 22px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), var(--neon-cyan));
  color: #06111f;
  font-size: 1rem;
  font-weight: 900;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.35);
}

.power-up-btn.empty .pu-plus {
  display: grid;
}

.power-up-btn.empty {
  opacity: 1;
  border-color: rgba(0, 255, 157, 0.28);
}

.quick-shop-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.quick-shop-panel {
  width: min(420px, 100%);
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.08), rgba(255, 190, 56, 0.08)), rgba(12, 12, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

.quick-shop-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 800;
}

.quick-shop-title {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.quick-shop-balance {
  margin-top: 4px;
  color: var(--warning);
  font-size: 0.85rem;
  font-weight: 800;
}

.quick-shop-items {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.quick-shop-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-shop-icon {
  font-size: 1.5rem;
  text-align: center;
}

.quick-shop-name {
  font-weight: 900;
  color: var(--text-primary);
}

.quick-shop-desc {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-shop-buy {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--neon-purple));
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.quick-shop-buy:disabled {
  opacity: 0.45;
}

.quick-shop-status {
  min-height: 20px;
  margin-top: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.password-reset-panel {
  display: grid;
  gap: 12px;
}

.password-reset-copy {
  margin: 6px 0 2px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

#password-reset-status.success {
  color: var(--success);
  background: rgba(0, 255, 157, 0.12);
  border-color: rgba(0, 255, 157, 0.28);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.coin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(254, 202, 87, 0.1);
  border: 1px solid rgba(254, 202, 87, 0.3);
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 800;
  color: #feca57;
}

.coin-icon {
  font-size: 1.1rem;
}

.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

@media (max-width: 480px) {
  .store-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding-bottom: 90px;
    border: none;
  }
}

.level-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 18px;
  padding-bottom: 8px;
}

.level-card {
  min-height: 142px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background:
    radial-gradient(circle at 80% 10%, rgba(0, 243, 255, 0.18), transparent 35%),
    linear-gradient(145deg, rgba(24, 24, 58, 0.9), rgba(7, 7, 18, 0.96));
  color: var(--text-primary);
  font-family: var(--font);
  text-align: left;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.level-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.level-card:not(:disabled):active {
  transform: scale(0.98);
}

.level-card.active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.25);
}

.level-card.completed {
  border-color: rgba(0, 184, 148, 0.75);
}

.level-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.level-card-top,
.level-card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.level-number {
  font-size: 1.9rem;
  font-weight: 900;
  color: #fff;
}

.level-state {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--neon-cyan);
}

.level-title {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--text-primary);
  text-transform: uppercase;
}

.level-target,
.level-difficulty {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.level-help {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.level-help strong {
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (min-width: 520px) {
  .level-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 85px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px 15px;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  cursor: pointer;
}

.nav-icon {
  font-size: 1.4rem;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--neon-cyan);
}

.nav-item.active .nav-icon {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 8px var(--neon-cyan-glow));
}

.nav-item:active .nav-icon {
  transform: scale(0.9);
}

.card-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-btn:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.05);
}

.feedback-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.feedback-modal-panel {
  text-align: left;
}

.profile-account-card {
  text-align: center;
  margin-bottom: 24px;
}

.feedback-help {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

.feedback-input {
  width: 100%;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: rgba(5, 5, 15, 0.62);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 12px;
  outline: none;
}

.feedback-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.08);
}

.feedback-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

.feedback-status {
  min-height: 18px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.shop-item-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.shop-item-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #000;
}

.shop-item-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shop-item-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.store-pack-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.store-pack-icons span {
  min-width: 70px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.78rem;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.12);
}

.campaign-card {
  border-color: rgba(255, 204, 0, 0.24);
}

.campaign-ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid rgba(255, 204, 0, 0.42);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 204, 0, 0.12);
  color: #ffcc00;
  font-size: 0.62rem;
  font-weight: 900;
}

.campaign-price {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.campaign-price s {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.campaign-price strong {
  color: var(--accent-light);
  font-size: 0.92rem;
}

.shop-item-details {
  background: rgba(8, 14, 32, 0.24);
}

.shop-item-details span {
  color: var(--text-primary);
}

.shop-item-details span:first-child {
  color: #fff;
}

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

.power-shop-card {
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
}

.power-shop-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.24);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
}

.power-shop-card strong {
  color: #fff;
  font-size: 0.92rem;
}

.power-shop-card span {
  min-height: 34px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.25;
}

.power-shop-card .btn-buy {
  width: 100%;
  padding: 9px 8px;
  font-size: 0.72rem;
}

.coin-pack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.coin-pack-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 178px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 204, 0, 0.16), transparent 34%),
    rgba(8, 14, 32, 0.58);
}

.coin-pack-card.featured {
  border-color: rgba(255, 204, 0, 0.42);
  box-shadow: 0 0 22px rgba(255, 204, 0, 0.10);
}

.coin-pack-badge {
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.10);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coin-pack-card strong {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
}

.coin-pack-card small {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.35;
  min-height: 38px;
}

.coin-pack-card .btn-buy {
  margin-top: auto;
  width: 100%;
  padding: 10px 8px;
  font-size: 0.78rem;
}

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

.cosmetic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  padding: 16px;
}

.cosmetic-card strong {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.cosmetic-card small {
  color: var(--text-secondary);
  min-height: 30px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.cosmetic-card .btn-buy {
  width: 100%;
  padding: 9px 8px;
  font-size: 0.72rem;
}

.cosmetic-preview {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmetic-preview span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
}

.cosmetic-preview.classic {
  background: radial-gradient(circle, rgba(255, 214, 102, 0.42), rgba(90, 59, 43, 0.34) 58%, rgba(10, 10, 26, 0.8));
}

.cosmetic-preview.classic span {
  background: #ff8c42;
  box-shadow: 0 0 18px #ff8c42;
}

.cosmetic-preview.smoke {
  background: radial-gradient(circle, rgba(255, 126, 46, 0.26), rgba(28, 29, 36, 0.92) 60%, #05050f);
}

.cosmetic-preview.smoke span {
  background: #1c1d24;
  box-shadow: 0 0 16px #3a3b45;
}

.cosmetic-preview.neon {
  background: radial-gradient(circle, rgba(0, 243, 255, 0.34), rgba(255, 190, 56, 0.18) 58%, #05050f);
}

.cosmetic-preview.neon span {
  background: #00f3ff;
  box-shadow: 0 0 20px #00f3ff;
}

.cosmetic-preview.frost {
  background: radial-gradient(circle, rgba(199, 249, 255, 0.5), rgba(126, 214, 223, 0.25) 60%, #0b1824);
}

.cosmetic-preview.frost span {
  background: #c7f9ff;
  box-shadow: 0 0 18px #c7f9ff;
}

@media (max-width: 420px) {

  .coin-pack-grid,
  .store-power-grid {
    grid-template-columns: 1fr;
  }
}

.quest-summary-card {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.10), rgba(255, 190, 56, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 22px;
}

.quest-summary-card h3 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.quest-summary-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.quest-tab {
  position: relative;
  min-width: 0;
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 36, 0.58);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quest-tab span {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.quest-tab small {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.quest-tab b {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  box-shadow: 0 0 16px var(--accent-glow);
}

.quest-tab.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.18), rgba(255, 190, 56, 0.12));
  border-color: rgba(0, 243, 255, 0.34);
  transform: translateY(-1px);
}

.quest-board,
.quest-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-section {
  margin-bottom: 24px;
}

.quest-card {
  background: rgba(20, 20, 45, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.quest-card.ready {
  border-color: rgba(0, 255, 157, 0.35);
}

.quest-card.claimed {
  opacity: 0.72;
}

.quest-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.quest-main strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.quest-main span,
.quest-main small {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.quest-bar {
  height: 7px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.quest-bar div {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  border-radius: inherit;
}

.quest-reward {
  min-width: 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.quest-reward b {
  color: var(--warning);
  font-size: 1rem;
}

.quest-reward span {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quest-claim {
  min-width: 70px;
  padding: 8px 10px;
}

.shop-item-name {
  font-weight: 800;
  font-size: 1rem;
}

.shop-item-price {
  font-weight: 700;
  color: #feca57;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cyber-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-stats-capsule {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px;
}

.stat-item:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label-mini {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
}

.stat-value-mini {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.cyber-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 90px;
  /* Space for bottom nav */
  scrollbar-width: none;
}

.cyber-scroll-area::-webkit-scrollbar {
  display: none;
}

.section-title-cyber {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-cyber::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

/* Glass Cards */
.cyber-card {
  background: rgba(20, 20, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.cyber-card.accent-pink {
  border-left: 3px solid var(--accent);
}

.cyber-card.accent-cyan {
  border-left: 3px solid var(--neon-cyan);
}

.cyber-card.accent-purple {
  border-left: 3px solid var(--neon-purple);
}

#match-history.cyber-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.match-history-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(20, 20, 45, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.match-history-item.win {
  border-left: 3px solid var(--success);
}

.match-history-item.lose {
  border-left: 3px solid var(--danger);
}

.match-result-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.match-history-item.win .match-result-badge {
  color: #001f12;
  background: linear-gradient(135deg, #00ff9d, #00d5ff);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.24);
}

.match-history-item.lose .match-result-badge {
  color: #fff;
  background: linear-gradient(135deg, #ff3e3e, #d92332);
  box-shadow: 0 0 18px rgba(255, 62, 62, 0.22);
}

.match-main {
  min-width: 0;
}

.match-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.match-opponent {
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-type {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.09);
  border: 1px solid rgba(0, 243, 255, 0.16);
}

.match-result-text {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.match-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.match-score-pill small {
  color: var(--text-muted);
  font-weight: 800;
}

/* Card Buttons */
.card-btn {
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  text-align: left;
}

.card-btn:active {
  transform: scale(0.98);
}

.card-btn.cyber-card {
  padding: 24px;
}

/* Navigation Refinement */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75px;
  background: rgba(5, 5, 15, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

body.ad-banner-visible .bottom-nav {
  bottom: calc(64px + env(safe-area-inset-bottom));
}

body.ad-banner-visible .cyber-scroll-area {
  padding-bottom: 170px;
}

body.ad-banner-visible #menu-screen {
  padding-bottom: 155px;
}

/* Play-ready UI polish */
#menu-screen {
  justify-content: flex-start;
  align-items: center;
  min-height: 100dvh;
  touch-action: pan-y;
}

#menu-screen>.cyber-header {
  width: 100%;
  min-height: 76px;
  flex-shrink: 0;
}

#menu-screen .menu-content {
  width: min(100%, 540px);
  padding: 24px 20px calc(112px + env(safe-area-inset-bottom)) !important;
  gap: 20px;
  min-height: 0;
  flex: 1;
  overflow: visible;
}

#menu-screen .menu-header {
  margin-bottom: 26px !important;
}

#menu-screen .menu-header .logo span {
  font-size: clamp(2.65rem, 11vw, 3.5rem) !important;
}

#menu-screen .menu-header p {
  margin-top: 15px !important;
  font-size: clamp(0.9rem, 3.2vw, 1rem) !important;
}

#menu-screen .menu-grid {
  gap: 20px !important;
  min-height: 0;
}

#btn-solo {
  height: clamp(180px, 27dvh, 210px) !important;
}

#btn-online,
#btn-leaderboard {
  height: clamp(150px, 22dvh, 170px) !important;
}

@media (max-width: 520px) {
  #menu-screen {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  body.ad-banner-visible #menu-screen {
    padding-bottom: 0;
  }

  #menu-screen .menu-content {
    height: calc(100dvh - 76px);
    padding: 16px 18px calc(92px + env(safe-area-inset-bottom)) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.ad-banner-visible #menu-screen .menu-content {
    padding-bottom: calc(154px + env(safe-area-inset-bottom)) !important;
  }

  #menu-screen .menu-header {
    flex: 0 0 auto;
    margin-bottom: 16px !important;
  }

  #menu-screen .menu-header .logo span {
    font-size: clamp(2.25rem, 10.4vw, 3rem) !important;
  }

  #menu-screen .menu-header p {
    margin-top: 8px !important;
    font-size: 0.86rem !important;
  }

  #menu-screen .menu-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  #menu-screen .menu-grid>div[style*="grid-template-columns"] {
    flex: 1 1 0;
    min-height: 0;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  #btn-solo {
    flex: 1.18 1 0;
    min-height: 150px;
    height: auto !important;
  }

  #btn-online,
  #btn-leaderboard {
    height: 100% !important;
    min-height: 128px;
  }

  #btn-online h2,
  #btn-leaderboard h2 {
    font-size: clamp(1.15rem, 5.6vw, 1.55rem) !important;
  }
}

#header-username {
  max-width: min(42vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-stats-capsule {
  flex-shrink: 0;
  max-width: 52vw;
}

.stat-item {
  min-width: 42px;
}

.stat-label-mini,
.stat-value-mini {
  white-space: nowrap;
}

.menu-footer-btns .btn-icon-only {
  width: 66px;
  height: 56px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 0.74rem;
  line-height: 1;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  overflow: hidden;
}

.bottom-nav {
  height: calc(75px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  min-width: 0;
  min-height: 75px;
  justify-content: center;
}

.nav-item .nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.nav-item span:not(.nav-icon) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-block {
  opacity: 0.06;
  pointer-events: none;
}

#menu-screen .floating-block {
  opacity: 0.035;
}

@media (max-width: 420px) {
  #menu-screen>.cyber-header {
    padding: 10px 12px;
    gap: 8px;
  }

  #header-username {
    max-width: 32vw;
    font-size: 0.95rem !important;
    letter-spacing: 0.8px !important;
  }

  .header-stats-capsule {
    padding: 5px 8px;
    gap: 6px;
    max-width: 58vw;
  }

  .stat-item {
    min-width: 34px;
    padding: 0 5px;
  }

  .stat-label-mini {
    font-size: 0.52rem;
  }

  .stat-value-mini {
    font-size: 0.68rem;
  }

  #btn-solo h2,
  #btn-profile h2 {
    font-size: 1.1rem !important;
    line-height: 1.1;
  }

  #btn-solo {
    height: auto !important;
    min-height: 150px;
  }

  #btn-online,
  #btn-leaderboard {
    height: 100% !important;
    min-height: 128px;
  }

  #menu-screen .menu-header .logo span {
    font-size: clamp(2.35rem, 10.8vw, 3rem) !important;
  }

  #menu-screen .menu-content {
    padding-top: 18px !important;
  }

  .menu-grid>div[style*="grid-template-columns"] {
    gap: 12px !important;
  }
}

@media (max-height: 720px) {
  #menu-screen>.cyber-header {
    min-height: 62px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  #menu-screen .menu-header {
    margin-bottom: 16px !important;
  }

  #menu-screen .menu-header p {
    display: block;
    font-size: 0.82rem !important;
    margin-top: 8px !important;
  }

  #btn-solo {
    height: auto !important;
    min-height: 138px;
  }

  #btn-online,
  #btn-leaderboard {
    height: 100% !important;
    min-height: 112px;
  }
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 60px;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
  transition: transform 0.3s;
}

.nav-item span:not(.nav-icon) {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-item.active {
  color: var(--neon-cyan);
}

.nav-item.active .nav-icon {
  transform: translateY(-5px) scale(1.1);
  filter: drop-shadow(0 0 10px var(--neon-cyan-glow));
}

.nav-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

/* Premium Badges */
.premium-tag {
  background: linear-gradient(90deg, #ffcc00, #ff9500);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Animations */
@keyframes pulse-cyan {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
  }
}

.pulse-active {
  animation: pulse-cyan 2s infinite;
}

:root[data-ui-theme="light"] .screen {
  color: var(--text-primary);
}

:root[data-ui-theme="light"] .cyber-header,
:root[data-ui-theme="light"] .bottom-nav {
  background: rgba(197, 218, 242, 0.88);
  border-color: rgba(38, 80, 132, 0.18);
  box-shadow: 0 10px 30px rgba(31, 63, 104, 0.14);
}

:root[data-ui-theme="light"] .header-stats-capsule,
:root[data-ui-theme="light"] .premium-tag,
:root[data-ui-theme="light"] .global-back {
  background: rgba(223, 237, 252, 0.72) !important;
  border-color: rgba(38, 80, 132, 0.20) !important;
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] .stat-value-mini,
:root[data-ui-theme="light"] .cyber-header span,
:root[data-ui-theme="light"] .logo-block,
:root[data-ui-theme="light"] .panel-title,
:root[data-ui-theme="light"] .gameover-title,
:root[data-ui-theme="light"] .go-stat-value,
:root[data-ui-theme="light"] .stat-value,
:root[data-ui-theme="light"] .level-number,
:root[data-ui-theme="light"] .level-title,
:root[data-ui-theme="light"] .player-score,
:root[data-ui-theme="light"] .player-name,
:root[data-ui-theme="light"] .rank,
:root[data-ui-theme="light"] .cyber-card h2,
:root[data-ui-theme="light"] .cyber-card h3,
:root[data-ui-theme="light"] .cyber-card h4,
:root[data-ui-theme="light"] .cyber-card strong,
:root[data-ui-theme="light"] .cyber-card>span,
:root[data-ui-theme="light"] .shop-item-details span:first-child {
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] [style*="color: #fff"],
:root[data-ui-theme="light"] [style*="color:#fff"],
:root[data-ui-theme="light"] [style*="color: white"],
:root[data-ui-theme="light"] [style*="color:white"] {
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] #btn-solo,
:root[data-ui-theme="light"] #btn-online,
:root[data-ui-theme="light"] #btn-leaderboard,
:root[data-ui-theme="light"] #btn-profile,
:root[data-ui-theme="light"] .cyber-card,
:root[data-ui-theme="light"] .shop-item-card,
:root[data-ui-theme="light"] .power-shop-card,
:root[data-ui-theme="light"] .level-card,
:root[data-ui-theme="light"] .glass-panel,
:root[data-ui-theme="light"] .store-panel {
  background:
    radial-gradient(circle at 90% 0%, rgba(178, 59, 116, 0.10), transparent 34%),
    linear-gradient(145deg, rgba(231, 241, 253, 0.96), rgba(199, 220, 244, 0.90)) !important;
  border-color: rgba(38, 80, 132, 0.18) !important;
  box-shadow: 0 14px 30px rgba(31, 63, 104, 0.15) !important;
}

:root[data-ui-theme="light"] #btn-solo {
  background:
    radial-gradient(circle at 80% 10%, rgba(91, 85, 189, 0.20), transparent 36%),
    linear-gradient(135deg, #e3effc, #bdd5f2) !important;
}

:root[data-ui-theme="light"] #btn-online {
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 103, 130, 0.20), transparent 38%),
    linear-gradient(135deg, #d9edf8, #b9d7ec) !important;
}

:root[data-ui-theme="light"] #btn-leaderboard,
:root[data-ui-theme="light"] #btn-profile {
  background:
    radial-gradient(circle at 100% 20%, rgba(178, 59, 116, 0.12), transparent 35%),
    linear-gradient(135deg, #e6effb, #c9d9f2) !important;
}

:root[data-ui-theme="light"] #btn-solo [style*="background: rgba(181"],
:root[data-ui-theme="light"] #btn-online [style*="background: url"] {
  opacity: 0.08 !important;
}

:root[data-ui-theme="light"] #btn-solo [style*="rgba(255,255,255,0.2)"],
:root[data-ui-theme="light"] #btn-profile [style*="rgba(255,255,255,0.05)"],
:root[data-ui-theme="light"] #btn-leaderboard [style*="rgba(255,255,255,0.1)"] {
  background: rgba(18, 103, 130, 0.12) !important;
  color: var(--neon-cyan) !important;
  border: 1px solid rgba(18, 103, 130, 0.20);
}

:root[data-ui-theme="light"] .menu-content h1 span:first-child,
:root[data-ui-theme="light"] #btn-solo h2,
:root[data-ui-theme="light"] #btn-online h2,
:root[data-ui-theme="light"] #btn-leaderboard h2,
:root[data-ui-theme="light"] #btn-profile h2,
:root[data-ui-theme="light"] .cyber-card p {
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] .section-title-cyber::after {
  background: linear-gradient(90deg, rgba(38, 80, 132, 0.22), transparent);
}

:root[data-ui-theme="light"] .store-pack-icons span {
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 243, 255, 0.18), transparent 42%),
    linear-gradient(145deg, #1b4f6c, #17344f);
  border-color: rgba(199, 232, 255, 0.32);
  color: #e9f8ff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 10px 20px rgba(31, 63, 104, 0.22);
}

:root[data-ui-theme="light"] .power-shop-icon {
  background: rgba(162, 198, 230, 0.66);
  border-color: rgba(18, 103, 130, 0.32);
  color: #0f5067;
}

:root[data-ui-theme="light"] .btn {
  box-shadow: 0 8px 18px rgba(30, 49, 92, 0.12);
}

:root[data-ui-theme="light"] .stat-box,
:root[data-ui-theme="light"] .go-stat,
:root[data-ui-theme="light"] .p-stat-card,
:root[data-ui-theme="light"] .leaderboard-item,
:root[data-ui-theme="light"] .match-history-item,
:root[data-ui-theme="light"] .room-code-container,
:root[data-ui-theme="light"] .input-field,
:root[data-ui-theme="light"] .level-help,
:root[data-ui-theme="light"] .profile-card-cyber {
  background: rgba(186, 212, 238, 0.62) !important;
  border: 1px solid rgba(38, 80, 132, 0.22) !important;
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] .stat-label,
:root[data-ui-theme="light"] .go-stat-label,
:root[data-ui-theme="light"] .stat-label-mini,
:root[data-ui-theme="light"] .level-target,
:root[data-ui-theme="light"] .level-difficulty,
:root[data-ui-theme="light"] .section-title-cyber,
:root[data-ui-theme="light"] .item-desc,
:root[data-ui-theme="light"] .p-email,
:root[data-ui-theme="light"] .opponent-label {
  color: #385271 !important;
}

:root[data-ui-theme="light"] .level-state {
  background: rgba(18, 103, 130, 0.14) !important;
  color: #0f5067 !important;
  border: 1px solid rgba(18, 103, 130, 0.22);
}

:root[data-ui-theme="light"] .piece-slot,
:root[data-ui-theme="light"] .piece-grid {
  background: rgba(186, 212, 238, 0.42);
}

:root[data-ui-theme="light"] .shop-item-details,
:root[data-ui-theme="light"] .quest-summary-card,
:root[data-ui-theme="light"] .quest-card {
  background: rgba(186, 212, 238, 0.64) !important;
  border: 1px solid rgba(38, 80, 132, 0.24) !important;
}

:root[data-ui-theme="light"] .shop-item-details span,
:root[data-ui-theme="light"] .shop-item-details span:first-child,
:root[data-ui-theme="light"] .quest-summary-card h3,
:root[data-ui-theme="light"] .quest-main strong {
  color: var(--text-primary) !important;
}

:root[data-ui-theme="light"] .quest-main span,
:root[data-ui-theme="light"] .quest-main small,
:root[data-ui-theme="light"] .quest-summary-card p {
  color: #385271 !important;
}

:root[data-ui-theme="light"] .quest-bar {
  background: rgba(38, 80, 132, 0.18);
}

:root[data-ui-theme="light"] .quest-tab {
  background: rgba(212, 229, 247, 0.78);
  border-color: rgba(38, 80, 132, 0.22);
}

:root[data-ui-theme="light"] .quest-tab.active {
  background: linear-gradient(135deg, rgba(18, 103, 130, 0.18), rgba(91, 85, 189, 0.14));
  border-color: rgba(18, 103, 130, 0.34);
}

:root[data-ui-theme="light"] .quest-tab span {
  color: var(--text-primary);
}

:root[data-ui-theme="light"] .quest-tab small {
  color: #385271;
}

:root[data-ui-theme="light"] #game-canvas,
:root[data-ui-theme="light"] #opponent-canvas {
  filter: drop-shadow(0 10px 18px rgba(31, 63, 104, 0.16));
}

/* Login scene inspired by the Block Battle key art */
#login-screen {
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(circle at 50% 18%, rgba(19, 72, 66, 0.28), transparent 34%),
    radial-gradient(circle at 50% 105%, rgba(6, 72, 52, 0.28), transparent 34%),
    linear-gradient(180deg, #071211 0%, #061010 45%, #03080a 100%);
  color: #f5ecd8;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(255,255,255,0.032) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 82px 72px, 64px 58px;
  opacity: 0.42;
  pointer-events: none;
}

.auth-arena-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-crest-outline {
  position: absolute;
  top: 18.5%;
  left: 50%;
  width: min(54vw, 330px);
  aspect-ratio: 1.08;
  transform: translateX(-50%) rotate(45deg);
  border: 4px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 0 0 8px rgba(0,0,0,0.16),
    0 26px 60px rgba(0,0,0,0.46);
  opacity: 0.82;
}

.auth-tile {
  position: absolute;
  width: 74px;
  height: 74px;
  border-radius: 9px;
  transform: rotate(-15deg);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 36%),
    linear-gradient(180deg, #0d7f5f, #06442f);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    inset -8px -8px 18px rgba(0,0,0,0.28),
    inset 3px 3px 8px rgba(255,255,255,0.10),
    0 22px 38px rgba(0,0,0,0.42);
}

.tile-a { left: -36px; top: 9%; }
.tile-b { left: 52px; top: 8%; }
.tile-c { left: 28px; top: 18%; }
.tile-d,
.tile-e,
.tile-f {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 36%),
    linear-gradient(180deg, #d8750d, #8c3508);
}
.tile-d { right: 34px; top: 7%; transform: rotate(16deg); }
.tile-e { right: -12px; top: 16%; transform: rotate(16deg); }
.tile-f { right: 72px; bottom: 5%; transform: rotate(17deg); }

.auth-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff941a;
  box-shadow: 0 0 16px #ff941a;
}

.spark-a { top: 9%; left: 36%; }
.spark-b { right: 13%; bottom: 22%; background: #4be28f; box-shadow: 0 0 18px #4be28f; }
.spark-c { left: 12%; bottom: 18%; }

.auth-stage {
  position: relative;
  z-index: 2;
  width: min(78vw, 560px);
  margin: 6.3vh auto 0;
  display: grid;
  gap: 18px;
}

.auth-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 10px;
}

.auth-crown {
  position: relative;
  width: 74px;
  height: 48px;
  margin-bottom: -2px;
  filter: drop-shadow(0 0 12px rgba(255,136,0,0.88));
}

.auth-crown::before {
  content: '';
  position: absolute;
  inset: 15px 8px 2px;
  background: linear-gradient(180deg, #ffd86b, #ff8b05 58%, #b95c04);
  clip-path: polygon(0 100%, 0 35%, 26% 72%, 50% 0, 74% 72%, 100% 35%, 100% 100%);
  border: 2px solid rgba(255,242,172,0.72);
  box-shadow: inset 0 -8px 12px rgba(116,47,0,0.25);
}

.auth-crown span {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #7a3b05;
  left: 31px;
  top: 28px;
  transform: rotate(45deg);
  border: 1px solid rgba(255,222,112,0.5);
}

.auth-title {
  margin: 0;
  display: grid;
  justify-items: center;
  line-height: 0.78;
  letter-spacing: -2px;
  text-transform: uppercase;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(4.5rem, 17vw, 8.2rem);
  font-weight: 900;
}

.auth-title span {
  display: block;
  transform: scaleX(1.12);
}

.auth-title-block {
  color: #f2e3c4;
  -webkit-text-stroke: 2px rgba(84,58,31,0.78);
  text-shadow:
    0 4px 0 #9f7c4b,
    0 10px 0 #5a3b1d,
    0 18px 24px rgba(0,0,0,0.62),
    0 -2px 0 rgba(255,255,255,0.62);
}

.auth-title-battle {
  color: #2fd07d;
  -webkit-text-stroke: 2px rgba(5,77,51,0.9);
  text-shadow:
    0 4px 0 #128750,
    0 10px 0 #074b31,
    0 18px 24px rgba(0,0,0,0.72),
    0 -2px 0 rgba(154,255,200,0.48);
}

#login-screen .auth-error {
  width: 100%;
  border-radius: 14px;
  background: rgba(107, 21, 21, 0.55);
}

#login-screen .auth-form {
  gap: 16px;
  margin-bottom: 0;
}

#login-screen .auth-field {
  height: 74px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-radius: 22px;
  border: 2px solid rgba(185, 149, 95, 0.30);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(9, 15, 15, 0.82);
  box-shadow:
    inset 0 0 28px rgba(0,0,0,0.58),
    0 14px 32px rgba(0,0,0,0.34);
}

.auth-field-icon,
.auth-eye {
  color: #58d986;
  font-size: 2.25rem;
  line-height: 1;
  text-shadow: 0 0 12px rgba(76, 219, 129, 0.38);
}

.lock-icon {
  font-size: 1.8rem;
}

.auth-eye {
  color: #b5ab96;
  font-size: 1.85rem;
}

#login-screen .auth-input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f8ecd2;
  font-size: clamp(1.25rem, 3.7vw, 1.65rem);
  font-weight: 700;
  outline: 0;
  box-shadow: none;
}

#login-screen .auth-input::placeholder {
  color: rgba(232, 226, 211, 0.56);
}

.auth-login-btn,
.auth-google-btn,
.auth-guest-btn {
  position: relative;
  min-height: 78px;
  border-radius: 22px;
  font-size: clamp(1.28rem, 4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: 0.5px;
}

.auth-login-btn {
  margin-top: 8px;
  color: #1c1307;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), transparent 34%),
    linear-gradient(180deg, #ffbc31 0%, #ff8a05 58%, #d96103 100%);
  border: 2px solid #ffd66e;
  box-shadow:
    inset 0 -8px 0 rgba(139, 60, 0, 0.35),
    0 0 18px rgba(255, 149, 20, 0.66),
    0 16px 32px rgba(0,0,0,0.45);
}

.auth-login-badge {
  position: absolute;
  left: 21%;
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #ffd86d;
  background: linear-gradient(180deg, #343128, #151714);
  border: 2px solid #9f6d12;
  box-shadow: 0 7px 12px rgba(0,0,0,0.34);
}

.auth-divider-royal {
  margin: 2px 0 0;
  color: rgba(239, 233, 217, 0.62);
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: 5px;
}

.auth-divider-royal::before,
.auth-divider-royal::after {
  background: linear-gradient(90deg, transparent, rgba(186, 153, 98, 0.55), transparent);
  height: 2px;
}

.auth-divider-royal span::before,
.auth-divider-royal span::after {
  content: '◆';
  color: #60df8a;
  font-size: 0.7rem;
  margin: 0 12px;
}

#login-screen .social-auth-actions {
  gap: 16px;
}

.auth-google-btn {
  color: #f7ead1;
  background: rgba(10, 18, 17, 0.84);
  border: 2px solid rgba(103, 164, 91, 0.43);
  box-shadow:
    inset 0 0 24px rgba(255,255,255,0.025),
    0 14px 28px rgba(0,0,0,0.35);
}

.google-mark {
  position: absolute;
  left: 14%;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -8px 0 0 #4285f4,
    0 -8px 0 #ea4335,
    8px 0 0 #fbbc05,
    0 8px 0 #34a853;
}

.auth-guest-btn {
  color: #68f293;
  background:
    linear-gradient(180deg, rgba(89,255,154,0.12), rgba(29,130,75,0.18)),
    rgba(9, 60, 39, 0.72);
  border: 2px solid rgba(84, 226, 126, 0.43);
  box-shadow:
    inset 0 -7px 0 rgba(0,0,0,0.22),
    0 16px 28px rgba(0,0,0,0.32);
}

.guest-mark {
  position: absolute;
  left: 8%;
  font-size: 2.05rem;
  filter: drop-shadow(0 0 10px rgba(104,242,147,0.42));
}

#login-screen .auth-switch {
  text-align: center;
  color: rgba(238, 231, 214, 0.75);
  font-size: clamp(1rem, 3.2vw, 1.32rem);
  font-weight: 800;
}

.forgot-row {
  margin-top: 0;
}

.auth-create-row {
  margin-top: -2px;
}

#login-screen .auth-link {
  color: #43e685;
  font-weight: 900;
  text-decoration: none;
  border-bottom: 2px dashed rgba(67,230,133,0.65);
}

#login-screen .auth-create-row .auth-link {
  color: #ff9a18;
  border-bottom: 0;
}

@media (max-width: 620px) {
  #login-screen {
    min-height: 100svh;
    padding: max(14px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
  }

  #login-screen::before {
    opacity: 0.28;
    background-size: 110px 96px, 86px 78px;
  }

  .auth-arena-bg {
    opacity: 0.58;
  }

  .auth-crest-outline {
    top: 5%;
    width: min(70vw, 260px);
  }

  .auth-stage {
    width: min(88vw, 390px);
    min-height: calc(100svh - max(14px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
    margin: 0 auto;
    align-content: start;
    gap: 10px;
  }

  .auth-brand {
    margin-bottom: 2px;
  }

  .auth-title {
    font-size: clamp(3rem, 14vw, 4.85rem);
    line-height: 0.84;
    letter-spacing: -1px;
  }

  .auth-title span {
    transform: scaleX(1.07);
  }

  .auth-crown {
    width: 52px;
    height: 34px;
  }

  #login-screen .auth-field {
    height: 56px;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    border-radius: 16px;
    padding: 0 14px;
  }

  .auth-field-icon,
  .auth-eye {
    font-size: 1.45rem;
  }

  .lock-icon {
    font-size: 1.22rem;
  }

  #login-screen .auth-input {
    font-size: clamp(1rem, 4vw, 1.18rem);
  }

  .auth-login-btn,
  .auth-google-btn,
  .auth-guest-btn {
    min-height: 56px;
    border-radius: 16px;
    font-size: clamp(1rem, 4.2vw, 1.22rem);
  }

  .auth-login-badge {
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .google-mark,
  .guest-mark {
    left: 14px;
    font-size: 1.45rem;
  }

  .auth-divider-royal {
    font-size: 0.86rem;
    letter-spacing: 3px;
  }

  #login-screen .auth-form,
  #login-screen .social-auth-actions {
    gap: 10px;
  }

  #login-screen .auth-switch {
    display: block;
    position: relative;
    z-index: 3;
    color: rgba(245, 236, 216, 0.86);
    font-size: 0.9rem;
    line-height: 1.25;
    opacity: 1;
    visibility: visible;
  }

  #login-screen .auth-link {
    color: #62efa6;
  }

  #login-screen .auth-divider-royal,
  #login-screen .auth-divider-royal span,
  #login-screen .auth-login-btn span:last-child,
  #login-screen .auth-google-btn span:last-child,
  #login-screen .auth-guest-btn span:last-child {
    position: relative;
    z-index: 3;
    opacity: 1;
    visibility: visible;
    white-space: normal;
  }

  .tile-a,
  .tile-b,
  .tile-c,
  .tile-d,
  .tile-e,
  .tile-f {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 620px) and (max-height: 760px) {
  .auth-stage {
    gap: 8px;
  }

  .auth-crown {
    width: 44px;
    height: 30px;
  }

  .auth-title {
    font-size: clamp(2.7rem, 13vw, 4.15rem);
  }

  .auth-divider-royal {
    margin-top: -2px;
  }

  .forgot-row,
  .auth-create-row {
    margin-top: -4px;
  }
}

/* Main menu key-art treatment */
#menu-screen {
  background:
    radial-gradient(circle at 50% 12%, rgba(30, 101, 79, 0.22), transparent 32%),
    radial-gradient(circle at 48% 64%, rgba(4, 61, 47, 0.30), transparent 34%),
    linear-gradient(180deg, #071311 0%, #03090b 100%) !important;
  color: #f4ead4;
}

#menu-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.016) 1px, transparent 1px);
  background-size: 90px 78px, 66px 58px;
  opacity: 0.36;
  pointer-events: none;
}

#menu-screen .menu-arena-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

#menu-screen > .cyber-header,
#menu-screen .menu-content {
  position: relative;
  z-index: 2;
}

.menu-tile {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.12), transparent 36%),
    linear-gradient(180deg, #0a8f65, #053827);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset -8px -8px 18px rgba(0,0,0,0.28), 0 20px 40px rgba(0,0,0,0.42);
}

.tile-left-a { left: -24px; top: 17%; transform: rotate(-18deg); }
.tile-left-b { left: 44px; top: 21%; transform: rotate(-18deg); }
.tile-right-a,
.tile-right-b {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.13), transparent 36%),
    linear-gradient(180deg, #dd840d, #803307);
}
.tile-right-a { right: 34px; top: 12%; transform: rotate(17deg); }
.tile-right-b { right: -16px; top: 19%; transform: rotate(17deg); }

.menu-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #24e68e;
  box-shadow: 0 0 15px currentColor;
}
.ms-a { left: 34%; top: 10%; color: #24e68e; }
.ms-b { right: 18%; bottom: 24%; color: #ff9a16; background: #ff9a16; }
.ms-c { left: 10%; bottom: 26%; color: #ff9a16; background: #ff9a16; }

#menu-screen > .cyber-header {
  min-height: 104px;
  padding: 22px 28px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

#menu-screen .hamburger-menu-btn {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(14, 22, 20, 0.84);
  border: 2px solid rgba(176, 143, 92, 0.32);
  box-shadow: inset 0 0 22px rgba(255,255,255,0.035), 0 14px 28px rgba(0,0,0,0.38);
  color: #f0dec0;
}

#menu-screen .hamburger-menu-btn span {
  width: 34px;
  height: 4px;
  background: #f2e2c7;
  box-shadow: 0 0 10px rgba(255,228,185,0.22);
}

#menu-screen .cyber-header img {
  border-radius: 50%;
}

#menu-screen .cyber-header > div:first-child > div {
  width: 62px !important;
  height: 62px !important;
  border: 4px solid #62e7a2 !important;
  box-shadow: 0 0 18px rgba(98,231,162,0.36);
}

#header-username {
  color: #f4ead4 !important;
  font-size: clamp(1.45rem, 4vw, 2.1rem) !important;
  font-style: normal !important;
  letter-spacing: 0 !important;
  text-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

#menu-screen .header-stats-capsule {
  min-height: 72px;
  padding: 0 26px;
  border-radius: 34px;
  background: rgba(13, 18, 18, 0.86);
  border: 2px solid rgba(177, 126, 57, 0.34);
  box-shadow: inset 0 0 24px rgba(255,255,255,0.035), 0 14px 30px rgba(0,0,0,0.34);
}

#menu-screen .stat-label-mini {
  color: #62e7a2 !important;
  font-size: 1rem;
}

#menu-screen .stat-value-mini {
  color: #f4ead4;
  font-size: 1.36rem;
}

#menu-coins {
  color: #ffbd31 !important;
}

#menu-screen .menu-content {
  width: min(91vw, 920px) !important;
  padding: 38px 24px calc(130px + env(safe-area-inset-bottom)) !important;
  max-width: 920px !important;
}

#menu-screen .menu-header {
  margin-bottom: 38px !important;
}

#menu-screen .menu-header .logo {
  line-height: 0.95 !important;
  letter-spacing: -2px !important;
}

#menu-screen .menu-header .logo span {
  font-size: clamp(3.8rem, 9vw, 6.5rem) !important;
  transform: scaleX(1.08);
}

#menu-screen .menu-header .logo span:first-child {
  color: #f2e4ca !important;
  -webkit-text-stroke: 2px rgba(83,58,32,0.68);
  text-shadow:
    0 4px 0 #9d7b4c,
    0 10px 0 #4d321a,
    0 20px 28px rgba(0,0,0,0.68) !important;
}

#menu-screen .menu-header .logo span:last-child {
  background: none !important;
  -webkit-text-fill-color: #44d68d !important;
  color: #44d68d !important;
  -webkit-text-stroke: 2px rgba(6,77,51,0.78);
  text-shadow:
    0 4px 0 #138855,
    0 10px 0 #07452e,
    0 20px 28px rgba(0,0,0,0.68) !important;
}

#menu-screen .menu-header p {
  color: rgba(232,231,226,0.72) !important;
  font-size: clamp(1.1rem, 3.4vw, 1.45rem) !important;
  font-weight: 800;
  margin-top: 26px !important;
  text-shadow: 0 5px 14px rgba(0,0,0,0.6);
}

#menu-screen .menu-grid {
  gap: 26px !important;
}

#btn-solo,
#btn-online,
#btn-leaderboard {
  border-radius: 26px !important;
  box-shadow:
    inset 0 0 28px rgba(255,255,255,0.035),
    0 18px 38px rgba(0,0,0,0.42) !important;
}

#btn-solo {
  min-height: 330px !important;
  height: clamp(265px, 33dvh, 350px) !important;
  border: 3px solid rgba(52, 226, 151, 0.45) !important;
  background:
    radial-gradient(circle at 66% 42%, rgba(74,226,151,0.22), transparent 24%),
    linear-gradient(135deg, rgba(6,75,55,0.86), rgba(5,20,21,0.98)) !important;
}

#btn-solo h2,
#btn-online h2,
#btn-leaderboard h2 {
  color: #f4ead4 !important;
  text-shadow: 0 5px 0 rgba(40,26,14,0.5), 0 12px 18px rgba(0,0,0,0.6);
}

#btn-solo h2 {
  font-size: clamp(3.1rem, 9vw, 5rem) !important;
  letter-spacing: -1px !important;
}

#btn-solo p,
#btn-online p,
#btn-leaderboard p {
  color: rgba(231,233,226,0.72) !important;
  font-size: clamp(1rem, 3vw, 1.3rem) !important;
  font-weight: 800;
  line-height: 1.4;
}

:root[data-ui-theme="light"] #menu-screen .cyber-header,
:root[data-ui-theme="light"] #menu-screen #btn-solo,
:root[data-ui-theme="light"] #menu-screen #btn-online,
:root[data-ui-theme="light"] #menu-screen #btn-leaderboard {
  color: #f4ead4 !important;
}

:root[data-ui-theme="light"] #menu-screen #btn-solo {
  background:
    radial-gradient(circle at 66% 42%, rgba(74,226,151,0.22), transparent 24%),
    linear-gradient(135deg, rgba(6,75,55,0.86), rgba(5,20,21,0.98)) !important;
  border-color: rgba(52, 226, 151, 0.45) !important;
}

:root[data-ui-theme="light"] #menu-screen #btn-online {
  background:
    radial-gradient(circle at 54% 25%, rgba(0,243,255,0.17), transparent 28%),
    linear-gradient(145deg, rgba(7,73,65,0.84), rgba(4,18,20,0.98)) !important;
  border-color: rgba(33, 206, 154, 0.45) !important;
}

:root[data-ui-theme="light"] #menu-screen #btn-leaderboard {
  background:
    radial-gradient(circle at 62% 28%, rgba(255,173,27,0.24), transparent 28%),
    linear-gradient(145deg, rgba(62,35,10,0.82), rgba(10,12,12,0.98)) !important;
  border-color: rgba(217,125,16,0.58) !important;
}

:root[data-ui-theme="light"] #menu-screen h2,
:root[data-ui-theme="light"] #menu-screen .menu-header p,
:root[data-ui-theme="light"] #menu-screen [style*="color: #fff"],
:root[data-ui-theme="light"] #menu-screen [style*="color:#fff"] {
  color: #f4ead4 !important;
  -webkit-text-fill-color: currentColor !important;
}

:root[data-ui-theme="light"] #menu-screen #btn-solo p,
:root[data-ui-theme="light"] #menu-screen #btn-online p,
:root[data-ui-theme="light"] #menu-screen #btn-leaderboard p {
  color: rgba(231,233,226,0.72) !important;
}

:root[data-ui-theme="light"] #bottom-nav {
  background: rgba(8,18,18,0.93) !important;
  border-color: rgba(185,149,95,0.22) !important;
  box-shadow: inset 0 0 28px rgba(255,255,255,0.035), 0 12px 34px rgba(0,0,0,0.42) !important;
}

#btn-solo div[style*="SINIRSIZ"] {
  color: #5cf0a2 !important;
  font-size: clamp(1.05rem, 3vw, 1.35rem) !important;
}

#btn-solo div[style*="right: 20px"] {
  width: 120px !important;
  height: 120px !important;
  right: 46px !important;
  top: 50% !important;
  transform: translateY(-50%);
  border: 4px solid rgba(62,239,166,0.72) !important;
  background: rgba(8,31,26,0.86) !important;
  color: #fff4dc !important;
  font-size: 3.25rem !important;
  box-shadow: 0 0 28px rgba(62,239,166,0.52), inset 0 0 28px rgba(62,239,166,0.10);
}

.menu-card-cubes {
  position: absolute;
  right: 28%;
  top: 26%;
  width: 170px;
  height: 125px;
  opacity: 0.74;
}

.menu-card-cubes span {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(145deg, #2fd08a, #0c5d42);
  box-shadow: inset -7px -7px 12px rgba(0,0,0,0.25), 0 14px 24px rgba(0,0,0,0.34);
  transform: rotate(-17deg);
}
.menu-card-cubes span:nth-child(1) { left: 48px; top: 0; }
.menu-card-cubes span:nth-child(2) { left: 95px; top: 48px; }
.menu-card-cubes span:nth-child(3) { left: 10px; top: 50px; }
.menu-card-cubes span:nth-child(4) { left: 66px; top: 83px; width: 44px; height: 44px; }

#btn-online,
#btn-leaderboard {
  min-height: 300px !important;
  height: clamp(255px, 32dvh, 330px) !important;
}

#btn-online {
  border: 3px solid rgba(33, 206, 154, 0.45) !important;
  background:
    radial-gradient(circle at 54% 25%, rgba(0,243,255,0.17), transparent 28%),
    linear-gradient(145deg, rgba(7,73,65,0.84), rgba(4,18,20,0.98)) !important;
}

#btn-leaderboard {
  border: 3px solid rgba(217,125,16,0.58) !important;
  background:
    radial-gradient(circle at 62% 28%, rgba(255,173,27,0.24), transparent 28%),
    linear-gradient(145deg, rgba(62,35,10,0.82), rgba(10,12,12,0.98)) !important;
}

#btn-online > div:not(.menu-gamepad),
#btn-leaderboard > div:not(.menu-podium) {
  align-items: flex-start !important;
  justify-content: flex-end !important;
  text-align: left !important;
  padding: 28px 32px !important;
}

#btn-online h2,
#btn-leaderboard h2 {
  font-size: clamp(2rem, 5.5vw, 3.1rem) !important;
  line-height: 1.05 !important;
}

#btn-leaderboard > div[style*="TOP 100"] {
  top: 28px !important;
  right: 28px !important;
  border-radius: 9px !important;
  padding: 10px 18px !important;
  color: #ffca50 !important;
  border-color: rgba(255,177,31,0.42) !important;
  background: rgba(96,56,10,0.66) !important;
  font-size: 1rem !important;
}

.menu-gamepad {
  position: absolute;
  left: 50%;
  top: 33%;
  width: 250px;
  height: 142px;
  transform: translate(-50%, -50%) rotate(-10deg);
  opacity: 0.82;
}
.pad-body {
  position: absolute;
  inset: 25px 8px 8px;
  border-radius: 44px 44px 34px 34px;
  background: linear-gradient(180deg, #172927, #07100f);
  border: 2px solid rgba(74,232,171,0.24);
  box-shadow: inset 0 8px 18px rgba(255,255,255,0.05), 0 16px 30px rgba(0,0,0,0.5);
}
.pad-cross,
.pad-stick,
.pad-dot {
  position: absolute;
  z-index: 1;
  background: #52e5a2;
}
.pad-cross { left: 50px; top: 68px; width: 52px; height: 18px; box-shadow: 17px -17px 0 #52e5a2, 17px 17px 0 #52e5a2; border-radius: 4px; }
.pad-stick { left: 118px; top: 84px; width: 28px; height: 28px; border-radius: 50%; background: #203a39; border: 4px solid #345b57; }
.pad-dot { right: 62px; width: 19px; height: 19px; border-radius: 50%; background: #314844; }
.d1 { top: 57px; }
.d2 { top: 82px; right: 42px; }
.d3 { top: 82px; right: 82px; }

.menu-podium {
  position: absolute;
  left: 53%;
  top: 37%;
  width: 190px;
  height: 170px;
  transform: translate(-50%, -50%);
}
.menu-podium span {
  position: absolute;
  bottom: 24px;
  width: 48px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #ffd166, #c46e0a);
  box-shadow: inset -5px -5px 12px rgba(0,0,0,0.22), 0 12px 22px rgba(0,0,0,0.32);
}
.menu-podium span:nth-child(1) { left: 30px; height: 64px; }
.menu-podium span:nth-child(2) { left: 78px; height: 104px; }
.menu-podium span:nth-child(3) { left: 126px; height: 52px; background: linear-gradient(180deg, #39d58b, #0f7148); }
.menu-podium em {
  position: absolute;
  top: 3px;
  left: 76px;
  color: #ffd259;
  font-style: normal;
  font-size: 58px;
  filter: drop-shadow(0 0 16px rgba(255,196,52,0.68));
}

#menu-screen .bottom-nav {
  left: 24px;
  right: 24px;
  bottom: 14px;
  height: calc(92px + env(safe-area-inset-bottom));
  border-radius: 22px;
  border: 2px solid rgba(185,149,95,0.22);
  background: rgba(8,18,18,0.92);
  box-shadow: inset 0 0 28px rgba(255,255,255,0.035), 0 12px 34px rgba(0,0,0,0.42);
  overflow: hidden;
}

#menu-screen .nav-item {
  min-height: 92px;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(213,219,215,0.52);
  font-size: 0.9rem;
  letter-spacing: 1.7px;
}

#menu-screen .nav-item.active {
  color: #5ff0a4;
  background: rgba(255,255,255,0.035);
}

#menu-screen .nav-item.active::after {
  width: 70px;
  height: 4px;
  top: 0;
  background: #37f0b3;
  box-shadow: 0 0 16px #37f0b3;
}

#menu-screen .nav-icon {
  font-size: 2.2rem;
}

@media (max-width: 620px) {
  #menu-screen > .cyber-header {
    min-height: 84px;
    padding: 14px 16px;
  }

  #menu-screen .hamburger-menu-btn {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  #menu-screen .hamburger-menu-btn span {
    width: 27px;
    height: 3px;
  }

  #menu-screen .cyber-header > div:first-child > div {
    width: 50px !important;
    height: 50px !important;
  }

  #header-username {
    font-size: 1.08rem !important;
    max-width: 30vw;
  }

  #menu-screen .header-stats-capsule {
    min-height: 54px;
    padding: 0 12px;
    border-radius: 24px;
    max-width: 44vw;
  }

  #menu-screen .stat-label-mini {
    font-size: 0.68rem;
  }

  #menu-screen .stat-value-mini {
    font-size: 0.9rem;
  }

  #menu-screen .menu-content {
    width: 100% !important;
    padding: 10px 18px calc(118px + env(safe-area-inset-bottom)) !important;
  }

  #menu-screen .menu-header {
    margin-bottom: 20px !important;
  }

  #menu-screen .menu-header .logo span {
    font-size: clamp(3rem, 15vw, 4.2rem) !important;
  }

  #menu-screen .menu-header p {
    font-size: 1rem !important;
    margin-top: 18px !important;
    color: rgba(245, 236, 216, 0.82) !important;
    line-height: 1.35 !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: currentColor !important;
  }

  #btn-solo {
    min-height: 235px !important;
    height: auto !important;
  }

  #btn-solo h2 {
    font-size: 3rem !important;
  }

  #btn-solo div[style*="right: 20px"] {
    width: 84px !important;
    height: 84px !important;
    right: 22px !important;
    font-size: 2.3rem !important;
  }

  .menu-card-cubes {
    right: 22%;
    top: 29%;
    transform: scale(0.68);
  }

  #btn-online,
  #btn-leaderboard {
    min-height: 250px !important;
    height: 100% !important;
  }

  .menu-gamepad {
    transform: translate(-50%, -50%) rotate(-10deg) scale(0.62);
    top: 31%;
  }

  .menu-podium {
    transform: translate(-50%, -50%) scale(0.66);
    top: 34%;
  }

  #btn-online > div:not(.menu-gamepad),
  #btn-leaderboard > div:not(.menu-podium) {
    padding: 20px 18px !important;
  }

  #btn-online h2,
  #btn-leaderboard h2 {
    font-size: 1.7rem !important;
  }

  #btn-online p,
  #btn-leaderboard p {
    font-size: 0.9rem !important;
    color: rgba(245, 236, 216, 0.76) !important;
    line-height: 1.32 !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: currentColor !important;
  }

  #menu-screen .bottom-nav {
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: calc(82px + env(safe-area-inset-bottom));
  }

  #menu-screen .nav-item {
    min-height: 82px;
    font-size: 0.72rem;
  }

  #menu-screen .nav-icon {
    font-size: 1.65rem;
  }
}

/* Drawer key-art treatment */
#main-menu-drawer .game-menu-backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: none;
}

#main-menu-drawer .game-menu-panel {
  width: min(74vw, 520px);
  padding: max(34px, env(safe-area-inset-top)) 34px calc(128px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 88% 18%, rgba(69, 231, 157, 0.12), transparent 30%),
    radial-gradient(circle at 25% 66%, rgba(21, 100, 82, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(6, 18, 17, 0.98), rgba(4, 12, 14, 0.99));
  border-right: 2px solid rgba(224, 205, 164, 0.18);
  box-shadow: 26px 0 52px rgba(0,0,0,0.62);
}

#main-menu-drawer .game-menu-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 78px 68px, 60px 54px;
  opacity: 0.36;
  pointer-events: none;
}

#main-menu-drawer .game-menu-head,
#main-menu-drawer .drawer-player-card,
#main-menu-drawer .drawer-section {
  position: relative;
  z-index: 1;
}

#main-menu-drawer .game-menu-head {
  align-items: flex-start;
  margin-bottom: 26px;
}

#main-menu-drawer .game-menu-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f4ead4;
  font-size: 1.05rem;
  letter-spacing: 2.4px;
}

#main-menu-drawer .game-menu-kicker::before {
  content: '♛';
  color: #ffbe39;
  font-size: 1.55rem;
  filter: drop-shadow(0 0 10px rgba(255,190,57,0.55));
}

#main-menu-drawer .game-menu-head strong {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: none;
  margin-top: 34px;
  color: #f6ead1;
  font-size: clamp(1.8rem, 4.4vw, 2.45rem);
  letter-spacing: 0;
  text-shadow: 0 6px 18px rgba(0,0,0,0.62);
}

#main-menu-drawer .game-menu-head strong::before {
  content: '';
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    url("https://api.dicebear.com/7.x/avataaars/svg?seed=Felix") center/cover no-repeat,
    #0e211e;
  border: 4px solid #62e7a2;
  box-shadow: 0 0 18px rgba(98,231,162,0.42);
}

#main-menu-drawer .game-menu-head strong::after {
  content: '';
  width: 20px;
  height: 20px;
  margin-left: -28px;
  margin-top: 50px;
  border-radius: 50%;
  background: #55eba0;
  box-shadow: 0 0 12px rgba(85,235,160,0.68);
}

#main-menu-drawer .drawer-icon-btn {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  border: 2px solid rgba(185,149,95,0.34);
  background: rgba(13, 20, 19, 0.9);
  color: #65f0a2;
  font-size: 2.65rem;
  line-height: 0;
  box-shadow: inset 0 0 18px rgba(255,255,255,0.04), 0 12px 26px rgba(0,0,0,0.36);
}

#main-menu-drawer .drawer-player-card {
  min-height: 124px;
  padding: 18px 24px;
  gap: 24px;
  margin-bottom: 34px;
  border-radius: 24px;
  border: 2px solid rgba(38, 219, 156, 0.36);
  background:
    radial-gradient(circle at 28% 50%, rgba(48, 219, 180, 0.24), transparent 30%),
    rgba(7, 49, 41, 0.52);
  box-shadow: inset 0 0 28px rgba(255,255,255,0.035), 0 16px 30px rgba(0,0,0,0.30);
}

#main-menu-drawer .drawer-avatar {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  background: linear-gradient(145deg, #2bd0c0, #0b765d);
  border: 2px solid rgba(111,255,208,0.38);
  color: #f9fff1;
  font-size: 2rem;
  box-shadow: inset -8px -8px 16px rgba(0,0,0,0.22), 0 12px 24px rgba(0,0,0,0.30);
}

#main-menu-drawer .drawer-label {
  color: #60e69f;
  font-size: 1.1rem;
  letter-spacing: 4px;
}

#main-menu-drawer .drawer-player-card strong {
  margin-top: 6px;
  color: #f4ead4;
  font-size: clamp(1.55rem, 4.2vw, 2.2rem);
  line-height: 1;
  text-shadow: 0 5px 14px rgba(0,0,0,0.52);
}

#main-menu-drawer .drawer-player-card strong::after {
  content: '🪙';
  margin-left: 12px;
  font-size: 0.8em;
}

#main-menu-drawer .drawer-section {
  gap: 12px;
  margin-top: 34px;
}

#main-menu-drawer .drawer-section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 4px 8px;
  color: rgba(96, 230, 159, 0.75);
  font-size: 1.08rem;
  letter-spacing: 4px;
}

#main-menu-drawer .drawer-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(185,149,95,0.42), rgba(96,230,159,0.16), transparent);
}

#main-menu-drawer .drawer-row {
  min-height: 78px;
  grid-template-columns: 66px 1fr 28px;
  gap: 18px;
  padding: 12px 18px;
  border-radius: 18px;
  border: 2px solid rgba(185,149,95,0.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(13, 21, 21, 0.78);
  box-shadow: inset 0 0 18px rgba(255,255,255,0.025), 0 10px 22px rgba(0,0,0,0.24);
}

#main-menu-drawer .drawer-row span {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent),
    rgba(255,255,255,0.055);
  color: #62e7a2;
  font-size: 1.55rem;
  box-shadow: inset 0 0 18px rgba(255,255,255,0.035);
}

#main-menu-drawer .drawer-row strong {
  color: #f4ead4;
  font-size: clamp(1.18rem, 3.4vw, 1.58rem);
  font-weight: 900;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#main-menu-drawer .drawer-row::after {
  content: '›';
  color: #67efa4;
  font-size: 2.4rem;
  font-weight: 500;
  justify-self: end;
  line-height: 1;
}

#main-menu-drawer #drawer-store span {
  color: #ffb52d;
}

#main-menu-drawer #drawer-feedback span,
#main-menu-drawer #drawer-tutorial span {
  color: #23ded4;
}

@media (max-width: 620px) {
  #main-menu-drawer .game-menu-panel {
    width: min(76vw, 390px);
    padding: max(26px, env(safe-area-inset-top)) 18px calc(118px + env(safe-area-inset-bottom));
  }

  #main-menu-drawer .game-menu-kicker {
    font-size: 0.72rem;
    letter-spacing: 2px;
  }

  #main-menu-drawer .game-menu-head strong {
    margin-top: 24px;
    gap: 14px;
    font-size: 1.45rem;
  }

  #main-menu-drawer .game-menu-head strong::before {
    width: 60px;
    height: 60px;
    border-width: 3px;
  }

  #main-menu-drawer .game-menu-head strong::after {
    width: 16px;
    height: 16px;
    margin-left: -24px;
    margin-top: 42px;
  }

  #main-menu-drawer .drawer-icon-btn {
    width: 50px;
    height: 50px;
    font-size: 2rem;
  }

  #main-menu-drawer .drawer-player-card {
    min-height: 96px;
    padding: 14px 16px;
    gap: 16px;
    border-radius: 20px;
    margin-bottom: 26px;
  }

  #main-menu-drawer .drawer-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.55rem;
  }

  #main-menu-drawer .drawer-label,
  #main-menu-drawer .drawer-section-title {
    font-size: 0.8rem;
    letter-spacing: 3px;
  }

  #main-menu-drawer .drawer-player-card strong {
    font-size: 1.45rem;
  }

  #main-menu-drawer .drawer-section {
    gap: 10px;
    margin-top: 26px;
  }

  #main-menu-drawer .drawer-row {
    min-height: 64px;
    grid-template-columns: 50px 1fr 20px;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 15px;
  }

  #main-menu-drawer .drawer-row span {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
  }

  #main-menu-drawer .drawer-row strong {
    font-size: 1.12rem;
  }
}

/* Level, quests and store key-art treatment */
#map-screen,
#quests-screen,
#store-screen {
  background:
    radial-gradient(circle at 18% 20%, rgba(26, 177, 128, 0.17), transparent 31%),
    radial-gradient(circle at 86% 15%, rgba(211, 118, 15, 0.13), transparent 30%),
    linear-gradient(180deg, #061110 0%, #020809 100%);
  color: #f7eedc;
}

#map-screen .store-panel,
#quests-screen .store-panel,
#store-screen .store-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(30deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    radial-gradient(circle at 12% 35%, rgba(48, 229, 159, 0.13), transparent 31%),
    radial-gradient(circle at 91% 30%, rgba(243, 144, 25, 0.12), transparent 27%),
    #04100f !important;
  background-size: 86px 78px, 70px 62px, auto, auto, auto;
}

#map-screen .store-panel::before,
#quests-screen .store-panel::before,
#store-screen .store-panel::before,
#map-screen .store-panel::after,
#quests-screen .store-panel::after,
#store-screen .store-panel::after {
  content: '';
  position: absolute;
  z-index: 0;
  width: 112px;
  height: 84px;
  opacity: 0.86;
  pointer-events: none;
  filter: drop-shadow(0 16px 18px rgba(0,0,0,0.38));
  background:
    linear-gradient(145deg, rgba(255,255,255,0.13), transparent 38%),
    linear-gradient(145deg, #37d692, #075a43);
  clip-path: polygon(0 12%, 36% 0, 44% 36%, 82% 25%, 100% 62%, 60% 73%, 67% 100%, 24% 88%);
}

#map-screen .store-panel::before,
#quests-screen .store-panel::before,
#store-screen .store-panel::before {
  left: 36px;
  top: 148px;
}

#map-screen .store-panel::after,
#quests-screen .store-panel::after,
#store-screen .store-panel::after {
  right: 34px;
  top: 168px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.14), transparent 38%),
    linear-gradient(145deg, #f59b20, #8e3b06);
  transform: rotate(18deg);
}

.screen-topbar {
  position: relative;
  z-index: 2;
  min-height: 116px;
  padding: max(24px, env(safe-area-inset-top)) 34px 18px !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(224, 205, 164, 0.09) !important;
}

.screen-back-btn,
.screen-bell-btn {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 2px solid rgba(185, 149, 95, 0.34);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)), rgba(8, 18, 17, 0.92);
  color: #65efa7;
  font-size: 3rem;
  font-weight: 900;
  box-shadow: inset 0 0 24px rgba(255,255,255,0.045), 0 14px 30px rgba(0,0,0,0.34);
}

.screen-bell-btn {
  margin-left: auto;
  color: #ffc33f;
  font-size: 2.6rem;
}

.screen-title-wrap,
.screen-title-main,
.screen-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.screen-title-wrap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  gap: 0;
}

.mini-crown {
  color: #ffbf38;
  font-size: 2.3rem;
  line-height: 0.7;
  text-shadow: 0 0 14px rgba(255,191,56,0.72), 0 7px 0 rgba(0,0,0,0.26);
}

.screen-title-main,
.screen-kicker {
  color: #f5ead7 !important;
  font-size: clamp(2.1rem, 6vw, 3.6rem) !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(80,54,26,0.9),
    0 8px 15px rgba(0,0,0,0.52);
}

.map-topbar .screen-kicker {
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.9rem, 5vw, 3rem) !important;
}

.screen-avatar-chip {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #64eba5;
  padding: 3px;
  background: #0c211d;
  box-shadow: 0 0 18px rgba(100,235,165,0.42);
}

.screen-avatar-chip img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: block;
}

.screen-balance-pill,
.screen-xp-pill {
  min-height: 68px;
  padding: 0 20px;
  border-radius: 26px;
  border: 2px solid rgba(185, 149, 95, 0.32);
  background: rgba(8, 18, 17, 0.92);
  color: #f7eedc;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 1.55rem;
  font-weight: 900;
  box-shadow: inset 0 0 22px rgba(255,255,255,0.035);
}

.screen-xp-pill {
  color: #f7eedc;
}

.screen-xp-pill span:first-child {
  color: #ffb52f;
  filter: drop-shadow(0 0 8px rgba(255,181,47,0.58));
}

.coin-mark,
.plus-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.coin-mark {
  color: #7b4300;
  background: radial-gradient(circle at 35% 25%, #fff3a6, #ffbf2e 44%, #b35d05 74%);
  box-shadow: inset -3px -4px 0 rgba(0,0,0,0.18), 0 0 12px rgba(255,180,47,0.4);
}

.plus-mark {
  color: #66eea2;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(102,238,162,0.26);
}

.themed-scroll {
  position: relative;
  z-index: 1;
  height: calc(100vh - 116px);
  padding: 36px 34px calc(130px + env(safe-area-inset-bottom)) !important;
  background: transparent !important;
}

.map-hero-title {
  position: relative;
  max-width: 760px;
  margin: 22px auto 12px;
  text-align: center;
  color: #f5ead7;
  font-size: clamp(3.3rem, 9vw, 6.1rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 rgba(78, 51, 27, 0.92),
    0 14px 25px rgba(0,0,0,0.62);
}

.map-hero-title::before {
  content: '♛';
  display: block;
  margin-bottom: 14px;
  color: #ffbd35;
  font-size: clamp(2.4rem, 8vw, 4.3rem);
  line-height: 0.7;
  text-shadow: 0 0 18px rgba(255,189,53,0.75);
}

.map-hero-title::first-line {
  color: #f5ead7;
}

.map-hero-copy {
  color: rgba(227,232,226,0.72);
  font-size: clamp(1rem, 3vw, 1.35rem);
  text-align: center;
  margin: 0 auto 42px;
  font-weight: 700;
}

#map-screen .level-map {
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

#map-screen .level-card {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  padding: 26px 28px;
  border-radius: 24px;
  border: 2px solid rgba(185,149,95,0.26);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.04), transparent 45%),
    linear-gradient(180deg, rgba(14,32,29,0.92), rgba(8,17,16,0.92));
  box-shadow: inset 0 0 26px rgba(255,255,255,0.025), 0 16px 28px rgba(0,0,0,0.32);
  text-align: left;
}

#map-screen .level-card.active {
  border-color: #38efaa;
  background:
    radial-gradient(circle at 72% 45%, rgba(57,229,159,0.20), transparent 32%),
    linear-gradient(180deg, rgba(5,84,63,0.86), rgba(8,36,30,0.94));
  box-shadow: 0 0 22px rgba(56,239,170,0.42), inset 0 0 36px rgba(56,239,170,0.12);
}

#map-screen .level-card.locked {
  filter: grayscale(0.52);
  opacity: 0.78;
}

.level-card-art {
  position: absolute;
  right: 24px;
  top: 34px;
  width: 130px;
  height: 92px;
  opacity: 0.7;
  transform: rotate(-18deg);
}

.level-card-art i {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: linear-gradient(145deg, #36d693, #0b6047);
  box-shadow: inset -5px -6px 0 rgba(0,0,0,0.16), 0 10px 18px rgba(0,0,0,0.24);
}

.level-card-art i:nth-child(1) { left: 24px; top: 5px; }
.level-card-art i:nth-child(2) { left: 66px; top: 4px; }
.level-card-art i:nth-child(3) { left: 44px; top: 47px; }
.level-card-art i:nth-child(4) { left: 88px; top: 46px; }

#map-screen .level-number {
  color: #f5ead7;
  font-size: clamp(3.6rem, 8vw, 5.3rem);
  line-height: 0.85;
  text-shadow: 0 5px 0 rgba(62,50,38,0.76), 0 12px 18px rgba(0,0,0,0.48);
}

#map-screen .level-card.active .level-number {
  color: #58e9a3;
  text-shadow: 0 0 14px rgba(88,233,163,0.38), 0 6px 0 rgba(11,61,45,0.68);
}

#map-screen .level-state {
  min-width: 76px;
  height: 46px;
  border-radius: 15px;
  border: 2px solid rgba(255,190,56,0.28);
  background: rgba(255,184,37,0.08);
  color: #ffc23f;
  font-size: 0;
  display: inline-grid;
  place-items: center;
}

#map-screen .level-state::before {
  content: 'LOCK';
  font-size: 1.08rem;
  font-weight: 900;
}

#map-screen .level-card.active .level-state::before,
#map-screen .level-card.completed .level-state::before {
  content: 'PLAY';
}

#map-screen .level-title {
  position: relative;
  z-index: 1;
  margin-top: 42px;
  color: #f7eedc;
  font-size: clamp(1.45rem, 3.5vw, 2.05rem);
  text-shadow: 0 5px 10px rgba(0,0,0,0.62);
}

#map-screen .level-card-bottom {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  border-top: 1px solid rgba(224,205,164,0.12);
  padding-top: 14px;
}

#map-screen .level-target,
#map-screen .level-difficulty {
  color: rgba(229,231,225,0.76);
  font-size: 1.05rem;
}

#map-screen .level-target::before {
  content: '* ';
  color: #5df0a6;
}

#map-screen .level-difficulty::before {
  content: '||| ';
  color: #ffb52f;
}

#map-screen .level-help {
  max-width: 940px;
  margin: 22px auto 0;
  border-radius: 18px;
  border-color: rgba(96,230,159,0.25);
  background: rgba(8,18,17,0.72);
}

#quests-screen .quest-summary-card {
  position: relative;
  max-width: 940px;
  min-height: 205px;
  margin: 0 auto 26px;
  overflow: hidden;
  padding: 42px 38px 26px;
  border-radius: 28px;
  border: 2px solid rgba(56, 239, 170, 0.34);
  background:
    radial-gradient(circle at 18% 20%, rgba(57,229,159,0.18), transparent 34%),
    linear-gradient(135deg, rgba(10,80,62,0.82), rgba(8,26,23,0.9));
}

#quests-screen .quest-summary-card h3 {
  margin: 0 0 14px 210px;
  color: #61efa7;
  font-size: clamp(2.2rem, 6vw, 3.7rem);
  line-height: 0.95;
  text-shadow: 0 4px 0 rgba(4,69,47,0.7), 0 12px 18px rgba(0,0,0,0.52);
}

#quests-screen .quest-summary-card p {
  margin-left: 210px;
  max-width: 520px;
  color: rgba(232,234,226,0.75);
  font-size: 1.18rem;
  font-weight: 700;
}

.quest-summary-art {
  position: absolute;
  right: 48px;
  top: 38px;
  width: 180px;
  height: 138px;
}

.quest-summary-art span {
  position: absolute;
  bottom: 14px;
  width: 44px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #ffd86c, #bf6808);
  box-shadow: inset -5px -5px 10px rgba(0,0,0,0.18), 0 10px 20px rgba(0,0,0,0.32);
}

.quest-summary-art span:nth-child(1) { left: 40px; height: 62px; }
.quest-summary-art span:nth-child(2) { left: 84px; height: 102px; }
.quest-summary-art span:nth-child(3) { left: 128px; height: 50px; background: linear-gradient(180deg, #42db90, #176d4c); }
.quest-summary-art em {
  position: absolute;
  top: -12px;
  left: 82px;
  color: #ffc33f;
  font-size: 4rem;
  font-style: normal;
  filter: drop-shadow(0 0 16px rgba(255,195,63,0.6));
}

#quests-screen .quest-tabs {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  gap: 20px;
}

#quests-screen .quest-tab {
  min-height: 72px;
  border-radius: 20px;
  border: 2px solid rgba(224,205,164,0.22);
  color: #f7eedc;
  background: rgba(8,18,17,0.78);
  box-shadow: inset 0 0 18px rgba(255,255,255,0.025);
}

#quests-screen .quest-tab.active {
  border-color: #55efaa;
  background: rgba(21, 108, 77, 0.72);
  box-shadow: 0 0 16px rgba(85,239,170,0.28), inset 0 0 22px rgba(85,239,170,0.12);
}

#quests-screen .quest-tab span {
  color: #f7eedc;
  font-size: 1.1rem;
}

#quests-screen .quest-tab b {
  background: linear-gradient(180deg, #ffc33f, #f17f12);
  color: #fff2cf;
}

#quests-screen .quest-board,
#quests-screen .quest-section {
  max-width: 940px;
  margin: 0 auto;
}

#quests-screen .quest-card {
  grid-template-columns: 112px 1fr minmax(170px, 230px);
  min-height: 142px;
  padding: 24px 28px;
  border-radius: 24px;
  border: 2px solid rgba(185,149,95,0.18);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.035), transparent 45%),
    rgba(9, 22, 21, 0.88);
  box-shadow: inset 0 0 24px rgba(255,255,255,0.025), 0 14px 24px rgba(0,0,0,0.28);
}

.quest-icon {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-self: center;
  color: #61efa7;
  font-size: 2.55rem;
  background: radial-gradient(circle at 38% 28%, rgba(98,239,167,0.28), rgba(10,48,38,0.95));
  border: 2px solid rgba(96,230,159,0.32);
  box-shadow: inset 0 0 22px rgba(255,255,255,0.035), 0 10px 22px rgba(0,0,0,0.28);
}

#quests-screen .quest-main strong {
  color: #f7eedc;
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  text-shadow: 0 5px 12px rgba(0,0,0,0.52);
}

#quests-screen .quest-main span,
#quests-screen .quest-main small {
  color: rgba(232,234,226,0.72);
  font-size: 1.02rem;
}

#quests-screen .quest-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

#quests-screen .quest-bar div {
  background: linear-gradient(90deg, #36d68c, #63efaa);
  box-shadow: 0 0 12px rgba(99,239,170,0.42);
}

#quests-screen .quest-reward {
  border-left: 1px solid rgba(224,205,164,0.18);
  padding-left: 28px;
}

#quests-screen .quest-reward b {
  color: #ffbd35;
  font-size: 2.5rem;
  text-shadow: 0 0 12px rgba(255,189,53,0.36);
}

#quests-screen .quest-reward b::before {
  content: 'C';
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-right: 12px;
  border-radius: 50%;
  color: #7a4100;
  font-size: 1.2rem;
  background: radial-gradient(circle at 35% 25%, #fff3a6, #ffbd35 44%, #ad5b05 74%);
}

#quests-screen .quest-claim {
  min-width: 150px;
  min-height: 54px;
  border-radius: 15px;
  font-size: 1.35rem !important;
}

#store-screen .store-themed-scroll {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  overflow-x: hidden;
}

#store-screen .section-header {
  justify-content: center !important;
  text-align: center;
}

#store-screen .section-title-cyber {
  position: relative;
  color: #62efa6;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: 2px;
  text-shadow: 0 4px 0 rgba(7,67,47,0.72), 0 10px 16px rgba(0,0,0,0.42);
}

#store-screen .section-title-cyber::before,
#store-screen .section-title-cyber::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin: 0 18px 6px;
  background: #62efa6;
  transform: rotate(45deg);
}

#store-screen .store-grid-large {
  width: 100%;
  min-width: 0;
  gap: 24px !important;
}

#store-screen .campaign-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 34px 34px 30px !important;
  border-radius: 28px;
  border: 2px solid rgba(56,239,170,0.36);
  background:
    radial-gradient(circle at 22% 16%, rgba(58,229,159,0.16), transparent 34%),
    linear-gradient(135deg, rgba(8,72,56,0.74), rgba(7,19,18,0.94)) !important;
  box-shadow: inset 0 0 30px rgba(255,255,255,0.028), 0 18px 32px rgba(0,0,0,0.32);
}

#store-screen .campaign-card:nth-child(even) {
  border-color: rgba(255,158,31,0.46);
  background:
    radial-gradient(circle at 80% 18%, rgba(255,163,34,0.13), transparent 34%),
    linear-gradient(135deg, rgba(62,31,10,0.74), rgba(7,19,18,0.94)) !important;
}

#store-screen .campaign-card > div:first-child {
  height: auto !important;
  min-height: 166px;
  padding: 24px 0 28px !important;
  background: transparent !important;
}

#store-screen .campaign-ribbon {
  right: -14px;
  top: -24px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #ffd75f, #f08911);
  color: #3a1b00;
  font-size: 1.05rem;
  box-shadow: 0 8px 0 rgba(112,52,0,0.55), 0 10px 20px rgba(0,0,0,0.32);
}

#store-screen .store-pack-icons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

#store-screen .store-pack-icons span {
  min-width: 0;
  min-height: 132px;
  border-radius: 20px;
  border: 2px solid rgba(79, 222, 143, 0.25);
  background:
    radial-gradient(circle at 50% 35%, rgba(80,222,143,0.22), transparent 40%),
    rgba(13, 52, 40, 0.64);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 10px;
  color: #f7eedc;
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 4px 10px rgba(0,0,0,0.58);
}

#store-screen .store-pack-icons span::before {
  content: '';
  position: absolute;
}

#store-screen .shop-item-details {
  min-width: 0;
  padding: 24px 0 0 !important;
  border-top: 1px solid rgba(224,205,164,0.15) !important;
  gap: 20px;
}

#store-screen .shop-item-details span:first-child {
  color: #f7eedc !important;
  font-size: clamp(1.8rem, 5vw, 2.65rem) !important;
  text-shadow: 0 5px 12px rgba(0,0,0,0.58);
}

#store-screen .shop-item-details span:nth-child(2) {
  color: rgba(233,235,226,0.76) !important;
  font-size: 1.15rem !important;
}

#store-screen .campaign-price {
  color: rgba(233,235,226,0.56) !important;
  font-size: 1.4rem !important;
}

#store-screen .campaign-price strong {
  color: #ffbd35;
  font-size: clamp(2rem, 6vw, 3.3rem);
  margin-left: 16px;
  text-shadow: 0 0 14px rgba(255,189,53,0.28);
}

#store-screen .btn-buy[data-type="bundle"] {
  width: min(100%, 620px);
  min-height: 74px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffc34a, #f0830b) !important;
  border: 2px solid #ffd967 !important;
  color: #2d1700 !important;
  font-size: 1.65rem !important;
  font-weight: 900;
  box-shadow: inset 0 -6px 0 rgba(117,52,0,0.38), 0 14px 22px rgba(0,0,0,0.34);
}

#store-screen .store-power-grid,
#store-screen #store-themes,
#store-screen .cosmetic-grid {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

#map-screen .bottom-nav,
#quests-screen .bottom-nav,
#store-screen .bottom-nav {
  left: 24px;
  right: 24px;
  bottom: 14px;
  height: calc(92px + env(safe-area-inset-bottom));
  border-radius: 22px;
  border: 2px solid rgba(185,149,95,0.22);
  background: rgba(8,18,18,0.93);
  box-shadow: inset 0 0 28px rgba(255,255,255,0.035), 0 12px 34px rgba(0,0,0,0.42);
  overflow: hidden;
}

.bottom-nav {
  left: 24px;
  right: 24px;
  bottom: 14px;
  height: calc(92px + env(safe-area-inset-bottom));
  border-radius: 22px;
  border: 2px solid rgba(185,149,95,0.22);
  background: rgba(8,18,18,0.93);
  box-shadow: inset 0 0 28px rgba(255,255,255,0.035), 0 12px 34px rgba(0,0,0,0.42);
  overflow: hidden;
}

.bottom-nav .nav-item {
  min-height: 92px;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(213,219,215,0.52);
}

.bottom-nav .nav-item.active {
  color: #5ff0a4;
  background: rgba(255,255,255,0.035);
}

.bottom-nav .nav-item.active::after {
  background: #37f0b3;
  box-shadow: 0 0 16px #37f0b3;
}

#map-screen .nav-item,
#quests-screen .nav-item,
#store-screen .nav-item {
  min-height: 92px;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(213,219,215,0.52);
}

#map-screen .nav-item.active,
#quests-screen .nav-item.active,
#store-screen .nav-item.active {
  color: #5ff0a4;
  background: rgba(255,255,255,0.035);
}

@media (max-width: 720px) {
  #map-screen .store-panel::before,
  #quests-screen .store-panel::before,
  #store-screen .store-panel::before {
    left: -26px;
    top: 132px;
    transform: scale(0.72) rotate(-8deg);
  }

  #map-screen .store-panel::after,
  #quests-screen .store-panel::after,
  #store-screen .store-panel::after {
    right: -28px;
    top: 140px;
    transform: scale(0.72) rotate(18deg);
  }

  .screen-topbar {
    min-height: 92px;
    padding: max(16px, env(safe-area-inset-top)) 14px 12px !important;
  }

  #store-screen .store-topbar {
    display: grid !important;
    grid-template-columns: 54px minmax(0, 1fr) minmax(112px, 132px);
    gap: 8px;
    align-items: center;
  }

  #store-screen .screen-title-wrap {
    position: static;
    transform: none;
    min-width: 0;
  }

  #store-screen .screen-title-main {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    letter-spacing: 0 !important;
  }

  #store-screen .mini-crown {
    font-size: 1.8rem;
  }

  .screen-back-btn,
  .screen-bell-btn,
  .screen-avatar-chip {
    width: 54px;
    height: 54px;
    border-radius: 15px;
  }

  .screen-avatar-chip {
    border-radius: 50%;
    border-width: 3px;
  }

  .screen-back-btn,
  .screen-bell-btn {
    font-size: 2.2rem;
  }

  .screen-title-main,
  .screen-kicker {
    font-size: clamp(1.75rem, 8vw, 2.65rem) !important;
  }

  .screen-balance-pill,
  .screen-xp-pill {
    min-height: 48px;
    padding: 0 9px;
    gap: 8px;
    font-size: 1rem;
    border-radius: 19px;
  }

  #store-screen .screen-balance-pill {
    width: 100%;
    min-width: 0;
    justify-content: center;
    font-size: 1.08rem;
  }

  .coin-mark,
  .plus-mark {
    width: 30px;
    height: 30px;
  }

  .themed-scroll {
    height: calc(100vh - 92px);
    padding: 24px 16px calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .map-hero-title {
    margin-top: 12px;
    font-size: clamp(3.25rem, 13vw, 5rem);
  }

  .map-hero-copy {
    color: rgba(245, 236, 216, 0.82);
    line-height: 1.35;
    margin-bottom: 28px;
    opacity: 1;
    visibility: visible;
  }

  #map-screen .level-map {
    gap: 14px;
  }

  #map-screen .level-card {
    min-height: 152px;
    padding: 18px 16px;
    border-radius: 18px;
  }

  .level-card-art {
    right: 10px;
    top: 30px;
    transform: rotate(-18deg) scale(0.58);
    transform-origin: top right;
  }

  #map-screen .level-title {
    margin-top: 30px;
    color: #fff4df;
    font-size: 1.18rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  #map-screen .level-target,
  #map-screen .level-difficulty {
    color: rgba(245, 236, 216, 0.78);
    font-size: 0.82rem;
    line-height: 1.25;
    opacity: 1;
    visibility: visible;
  }

  #map-screen .level-help {
    color: rgba(245, 236, 216, 0.78);
    font-size: 0.86rem;
    line-height: 1.35;
  }

  #map-screen .level-help strong {
    color: #62efa6;
  }

  #map-screen .level-help span {
    display: block;
    margin-top: 4px;
  }

  #quests-screen .quest-summary-card {
    min-height: 178px;
    padding: 28px 22px 20px;
    border-radius: 22px;
  }

  #quests-screen .quest-summary-card h3,
  #quests-screen .quest-summary-card p {
    margin-left: 0;
    max-width: 62%;
  }

  #quests-screen .quest-summary-card h3 {
    font-size: 2rem;
  }

  #quests-screen .quest-summary-card p {
    font-size: 0.95rem;
  }

  .quest-summary-art {
    right: 2px;
    top: 30px;
    transform: scale(0.72);
    transform-origin: top right;
  }

  #quests-screen .quest-tabs {
    gap: 10px;
  }

  #quests-screen .quest-tab {
    min-height: 56px;
    border-radius: 16px;
  }

  #quests-screen .quest-tab span {
    font-size: 0.8rem;
  }

  #quests-screen .quest-card {
    grid-template-columns: 58px 1fr 92px;
    min-height: 124px;
    padding: 16px 14px;
    border-radius: 18px;
    gap: 12px;
  }

  .quest-icon {
    width: 50px;
    height: 50px;
    font-size: 1.55rem;
  }

  #quests-screen .quest-main strong {
    font-size: 1rem;
  }

  #quests-screen .quest-main span,
  #quests-screen .quest-main small {
    font-size: 0.78rem;
  }

  #quests-screen .quest-reward {
    padding-left: 10px;
  }

  #quests-screen .quest-reward b {
    font-size: 1.35rem;
  }

  #quests-screen .quest-reward b::before {
    width: 26px;
    height: 26px;
    margin-right: 5px;
    font-size: 0.8rem;
  }

  #quests-screen .quest-claim {
    min-width: 70px;
    min-height: 42px;
    font-size: 0.95rem !important;
  }

  #store-screen .store-pack-icons {
    gap: 8px;
  }

  #store-screen .store-pack-icons span {
    min-height: 86px;
    border-radius: 14px;
    padding: 12px 6px;
    font-size: clamp(0.78rem, 3.4vw, 0.95rem);
    white-space: nowrap;
  }

  #store-screen .campaign-card {
    padding: 22px 14px 20px !important;
    border-radius: 22px;
  }

  #store-screen .campaign-card > div:first-child {
    min-height: 126px;
    padding: 18px 0 20px !important;
  }

  #store-screen .campaign-ribbon {
    right: -2px;
    top: -2px;
    max-width: 132px;
    font-size: 0.82rem;
  }

  #store-screen .shop-item-details {
    flex-direction: column;
    align-items: stretch !important;
    text-align: center;
    gap: 14px;
  }

  #store-screen .shop-item-details span:first-child {
    font-size: clamp(1.65rem, 7vw, 2.25rem) !important;
  }

  #store-screen .shop-item-details span:nth-child(2) {
    font-size: clamp(0.95rem, 4.2vw, 1.15rem) !important;
    line-height: 1.25;
  }

  #store-screen .campaign-price {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.95rem !important;
  }

  #store-screen .campaign-price strong {
    margin-left: 0;
    font-size: clamp(1.95rem, 8vw, 2.75rem);
  }

  #store-screen .btn-buy[data-type="bundle"] {
    min-height: 62px;
    font-size: 1.28rem !important;
  }

  #map-screen .bottom-nav,
  #quests-screen .bottom-nav,
  #store-screen .bottom-nav {
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: calc(82px + env(safe-area-inset-bottom));
  }

  #map-screen .nav-item,
  #quests-screen .nav-item,
  #store-screen .nav-item {
    min-height: 82px;
  }

  .bottom-nav {
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: calc(82px + env(safe-area-inset-bottom));
  }

  .bottom-nav .nav-item {
    min-height: 82px;
  }
}

/* Gameplay, profile, leaderboard and modal key-art treatment */
#game-screen,
#gameover-screen,
#leaderboard-screen,
#profile-screen {
  background:
    radial-gradient(circle at 50% 16%, rgba(22, 116, 87, 0.26), transparent 34%),
    radial-gradient(circle at 12% 74%, rgba(35, 205, 157, 0.12), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(223, 135, 24, 0.14), transparent 30%),
    linear-gradient(180deg, #04100f 0%, #010607 100%) !important;
  color: #f7eedc;
}

#game-screen::before,
#gameover-screen::before,
#leaderboard-screen .store-panel::before,
#profile-screen .store-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(85, 239, 170, 0.45) 0 2px, transparent 3px),
    linear-gradient(120deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 210px 220px, 86px 78px;
  opacity: 0.38;
}

#game-screen::after,
#gameover-screen::after {
  content: '';
  position: absolute;
  inset: auto -40px -60px -40px;
  height: 240px;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 70%, rgba(32, 209, 158, 0.24), transparent 22%),
    radial-gradient(circle at 88% 80%, rgba(255, 169, 39, 0.22), transparent 24%);
  filter: blur(4px);
}

#game-header {
  position: relative;
  z-index: 2;
  width: min(88vw, 780px);
  max-width: 780px;
  padding: max(20px, env(safe-area-inset-top)) 0 16px;
  margin: 0 auto;
}

#game-header .stat-box {
  min-width: 146px;
  min-height: 96px;
  border-radius: 22px;
  border: 2px solid rgba(86, 239, 169, 0.45);
  background:
    radial-gradient(circle at 48% 20%, rgba(77, 232, 162, 0.16), transparent 44%),
    rgba(7, 31, 26, 0.86);
  box-shadow: 0 0 22px rgba(86,239,169,0.22), inset 0 0 26px rgba(255,255,255,0.026);
}

#game-header .stat-label {
  color: #5deea5;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

#game-header .stat-value {
  color: #f7eedc;
  font-size: 2.8rem;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(45,31,18,0.54), 0 10px 16px rgba(0,0,0,0.48);
}

#btn-game-menu {
  width: 82px;
  height: 82px;
  border-radius: 20px;
  border: 2px solid rgba(185,149,95,0.44);
  background: rgba(8, 18, 17, 0.9);
  color: #f3dfbe;
  font-size: 2.45rem;
  box-shadow: inset 0 0 22px rgba(255,255,255,0.035), 0 14px 26px rgba(0,0,0,0.34);
}

#game-area {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 780px);
  flex: 0 1 auto;
}

#main-board-wrap {
  border-radius: 26px;
  padding: 9px;
  border: 2px solid rgba(80, 239, 168, 0.62);
  background: rgba(3, 19, 16, 0.8);
  box-shadow:
    0 0 28px rgba(80, 239, 168, 0.42),
    inset 0 0 20px rgba(80, 239, 168, 0.08);
}

#game-canvas {
  border-radius: 18px;
}

.game-boot-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  color: #f7eedc;
  background:
    linear-gradient(180deg, rgba(4, 16, 15, 0.96), rgba(1, 6, 7, 0.92)),
    radial-gradient(circle at 50% 42%, rgba(91, 239, 169, 0.18), transparent 42%);
  opacity: 1;
  pointer-events: none;
}

.game-boot-overlay.hidden {
  display: none;
}

.game-boot-overlay.ready {
  opacity: 0;
  transition: opacity 0.22s ease !important;
}

.game-boot-mark {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  grid-template-rows: repeat(2, 34px);
  gap: 8px;
  padding: 14px;
  border-radius: 22px;
  border: 2px solid rgba(91, 239, 169, 0.5);
  background: rgba(5, 28, 23, 0.76);
}

.game-boot-mark span {
  border-radius: 8px;
  background: linear-gradient(145deg, #67f3ad, #14785b);
}

.game-boot-mark span:nth-child(2),
.game-boot-mark span:nth-child(3) {
  background: linear-gradient(145deg, #ffc34a, #a85f08);
}

.game-boot-overlay strong {
  font-size: clamp(1.8rem, 7vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
}

.game-boot-overlay small {
  color: #85dcb5;
  font-size: clamp(0.95rem, 3.5vw, 1.25rem);
  font-weight: 800;
}

#power-ups {
  position: relative;
  z-index: 2;
  gap: 18px;
  margin: 16px 0 14px;
}

.power-up-btn {
  width: 104px;
  height: 104px;
  border-radius: 20px;
  border: 2px solid rgba(185,149,95,0.48);
  background:
    radial-gradient(circle at 50% 36%, rgba(67,230,161,0.15), transparent 46%),
    rgba(7, 27, 24, 0.86);
  box-shadow: inset 0 0 22px rgba(255,255,255,0.035), 0 12px 22px rgba(0,0,0,0.32);
}

.power-up-btn .pu-icon {
  font-size: 2.7rem;
  filter: drop-shadow(0 0 12px rgba(255, 190, 56, 0.32));
}

.power-up-btn .pu-count {
  right: -12px;
  top: -13px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5e55, #b91818);
  border: 2px solid rgba(255,255,255,0.26);
  color: #fff7e8;
  font-size: 1.25rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.34);
}

#piece-tray {
  position: relative;
  z-index: 2;
  min-height: 128px;
  max-width: min(84vw, 660px);
  padding: 18px 22px;
  gap: 26px;
}

.piece-slot {
  min-width: 142px;
  min-height: 118px;
  border-radius: 20px;
  border: 2px solid rgba(185,149,95,0.30);
  background: rgba(8, 29, 24, 0.72);
  box-shadow: inset 0 0 24px rgba(255,255,255,0.028), 0 12px 24px rgba(0,0,0,0.28);
}

.piece-cell {
  border-radius: 6px;
  box-shadow: inset -3px -4px 0 rgba(0,0,0,0.18), 0 3px 8px rgba(0,0,0,0.24);
}

#pause-overlay {
  background: rgba(0, 0, 0, 0.56) !important;
  backdrop-filter: blur(7px);
}

#pause-overlay .glass-panel {
  width: min(78vw, 560px);
  max-width: 560px;
  padding: 48px 54px;
  border-radius: 28px;
  border: 2px solid rgba(91, 239, 169, 0.62);
  background:
    radial-gradient(circle at 50% 10%, rgba(69,226,159,0.14), transparent 35%),
    rgba(5, 22, 19, 0.96);
  box-shadow: 0 0 34px rgba(91,239,169,0.38), inset 0 0 30px rgba(255,255,255,0.026);
}

#pause-title {
  color: #f7eedc;
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin-bottom: 32px;
  text-shadow: 0 5px 0 rgba(49,34,18,0.48), 0 12px 20px rgba(0,0,0,0.52);
}

#pause-overlay .glass-panel::before {
  content: '';
  display: block;
  width: 84px;
  height: 58px;
  margin: -22px auto 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.18), transparent 44%),
    linear-gradient(145deg, #28d58d, #0b5b45);
  clip-path: polygon(0 28%, 50% 0, 100% 28%, 86% 100%, 14% 100%);
  filter: drop-shadow(0 0 18px rgba(62,239,166,0.48));
}

#pause-overlay .btn {
  min-height: 76px;
  border-radius: 18px;
  font-size: 1.65rem;
}

#pause-overlay #btn-resume {
  background: linear-gradient(180deg, #ffc34a, #f0830b) !important;
  color: #2d1700 !important;
  border: 2px solid #ffd967;
  box-shadow: inset 0 -6px 0 rgba(117,52,0,0.38), 0 14px 22px rgba(0,0,0,0.34);
}

#pause-overlay #btn-quit {
  color: #f7eedc;
  border: 0;
  background: transparent;
}

#gameover-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gameover-panel {
  position: relative;
  width: min(86vw, 650px);
  max-width: 650px;
  padding: 72px 44px 42px;
  border-radius: 32px;
  border: 2px solid rgba(185,149,95,0.58);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 4%, rgba(69,226,159,0.16), transparent 32%),
    rgba(5, 22, 19, 0.94);
  background-size: 64px 58px, auto, auto;
  box-shadow: 0 22px 42px rgba(0,0,0,0.48), inset 0 0 32px rgba(255,255,255,0.026);
}

.gameover-panel::before {
  content: '◈';
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #58eea4;
  font-size: 3.2rem;
  background: linear-gradient(180deg, #10352c, #051413);
  border: 2px solid rgba(255,190,56,0.62);
  box-shadow: 0 0 22px rgba(88,238,164,0.45), inset 0 0 22px rgba(255,255,255,0.04);
}

.gameover-title {
  color: #f1c766;
  font-size: clamp(3.1rem, 10vw, 5.6rem);
  line-height: 0.92;
  text-shadow: 0 4px 0 rgba(92,45,0,0.72), 0 12px 24px rgba(0,0,0,0.58);
}

.gameover-stats {
  gap: 0;
  margin: 36px 0 28px;
}

.go-stat {
  flex: 1;
  padding: 0 24px;
}

.go-stat:first-child {
  border-right: 1px solid rgba(91,239,169,0.36);
}

.go-stat-label {
  color: #65eaa4;
  font-size: 1.45rem;
  font-weight: 900;
  text-transform: none;
}

.go-stat-value {
  color: #f7eedc;
  font-size: clamp(3rem, 10vw, 4.6rem);
  text-shadow: 0 6px 0 rgba(49,34,18,0.48), 0 12px 18px rgba(0,0,0,0.52);
}

.gameover-buttons {
  gap: 18px;
}

.gameover-buttons .btn {
  min-height: 78px;
  border-radius: 18px;
  font-size: 1.55rem;
}

#btn-reward-continue {
  background: linear-gradient(180deg, rgba(28,218,139,0.86), rgba(8,91,62,0.94)) !important;
  border: 2px solid #42eda3;
  color: #f7eedc;
}

#btn-play-again {
  background: linear-gradient(180deg, #ffc34a, #f0830b) !important;
  border: 2px solid #ffd967;
  color: #2d1700 !important;
}

#btn-go-menu {
  border: 2px solid rgba(185,149,95,0.36);
  color: #f7eedc;
  background: rgba(6, 17, 16, 0.82);
}

#settings-modal {
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(7px);
}

#settings-modal .settings-panel {
  width: min(86vw, 620px);
  max-width: 620px;
  padding: 42px 34px;
  border-radius: 28px;
  border: 2px solid rgba(91,239,169,0.46);
  background:
    radial-gradient(circle at 25% 18%, rgba(69,226,159,0.12), transparent 36%),
    rgba(5, 22, 19, 0.96);
  box-shadow: 0 0 32px rgba(91,239,169,0.26), inset 0 0 28px rgba(255,255,255,0.026);
}

#settings-modal .quick-shop-title {
  color: #f7eedc;
  font-size: clamp(2rem, 7vw, 3rem);
  text-shadow: 0 5px 0 rgba(49,34,18,0.48), 0 12px 18px rgba(0,0,0,0.52);
}

#settings-modal .quick-shop-close {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 2px solid rgba(91,239,169,0.34);
  background: rgba(16, 50, 38, 0.78);
  color: #43ee9f;
  font-size: 2.8rem;
}

#settings-modal .settings-list {
  gap: 12px;
  margin-top: 28px;
}

#settings-modal .settings-row {
  min-height: 88px;
  grid-template-columns: 72px 1fr auto;
  border-radius: 20px;
  border: 1px solid rgba(91,239,169,0.20);
  background: rgba(8, 30, 25, 0.76);
  padding: 12px 20px;
}

#settings-modal .settings-row span {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  color: #43ee9f;
  font-size: 2rem;
  background: radial-gradient(circle at 42% 30%, rgba(67,238,159,0.22), rgba(4,24,20,0.92));
}

#settings-modal .settings-row strong {
  color: #f7eedc;
  font-size: 1.45rem;
}

#settings-modal .settings-row small {
  color: rgba(232,234,226,0.62);
  font-size: 1rem;
}

#settings-modal .settings-row em,
#settings-modal .settings-row::after {
  color: #62efa6;
  font-size: 1.25rem;
}

#settings-modal .settings-row:not(:has(em))::after {
  content: '>';
  font-weight: 900;
}

#settings-modal .settings-row.danger {
  border-color: rgba(255, 82, 72, 0.32);
}

#settings-modal .settings-row.danger span,
#settings-modal .settings-row.danger strong,
#settings-modal .settings-row.danger::after {
  color: #ff544c;
}

#leaderboard-screen .store-panel,
#profile-screen .store-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(48, 229, 159, 0.13), transparent 31%),
    radial-gradient(circle at 88% 24%, rgba(243, 144, 25, 0.12), transparent 28%),
    #04100f !important;
  background-size: 86px 78px, auto, auto, auto;
}

.leaderboard-cup,
.profile-title-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 8px;
  color: #ffc441;
  font-size: 2.8rem;
  background: rgba(10, 40, 32, 0.76);
  border: 2px solid rgba(255,196,65,0.48);
  box-shadow: 0 0 18px rgba(255,196,65,0.32);
}

.profile-title-icon {
  color: #59eea4;
  border-color: rgba(89,238,164,0.48);
}

.leaderboard-themed-scroll,
.profile-themed-scroll {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

#leaderboard-list.cyber-list {
  max-width: 940px;
  margin: 0 auto;
}

.leaderboard-hero {
  position: relative;
  min-height: 230px;
  margin: 0 0 24px;
  border-radius: 24px;
  border: 2px solid rgba(91,239,169,0.46);
  background:
    radial-gradient(circle at 78% 50%, rgba(91,239,169,0.16), transparent 28%),
    linear-gradient(135deg, rgba(8,72,56,0.78), rgba(7,19,18,0.94));
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.leaderboard-hero::after {
  content: '';
  position: absolute;
  right: 54px;
  top: 68px;
  width: 150px;
  height: 110px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.13), transparent 36%),
    linear-gradient(145deg, #37d692, #075a43);
  clip-path: polygon(0 12%, 36% 0, 44% 36%, 82% 25%, 100% 62%, 60% 73%, 67% 100%, 24% 88%);
  opacity: 0.7;
}

.leaderboard-kicker {
  color: #ffcf5f;
  font-size: clamp(1.4rem, 5vw, 2.1rem);
  text-shadow: 0 4px 0 rgba(77,45,0,0.58);
}

.leaderboard-hero strong {
  color: #f7eedc;
  font-size: clamp(3rem, 10vw, 4.7rem);
  line-height: 0.9;
  text-shadow: 0 6px 0 rgba(49,34,18,0.48), 0 12px 18px rgba(0,0,0,0.52);
}

.leaderboard-hero small {
  color: #65eaa4;
  font-size: clamp(1.2rem, 4vw, 1.75rem);
}

.leaderboard-list {
  gap: 16px;
}

.leaderboard-item {
  min-height: 118px;
  grid-template-columns: 150px minmax(0, 1fr) 120px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 2px solid rgba(91,239,169,0.22);
  background: rgba(7, 22, 20, 0.86);
}

.leaderboard-item.rank-1 { border-color: rgba(255,214,74,0.68); background: rgba(53, 42, 5, 0.62); }
.leaderboard-item.rank-2 { border-color: rgba(200,220,224,0.58); background: rgba(18, 34, 36, 0.62); }
.leaderboard-item.rank-3 { border-color: rgba(255,152,83,0.58); background: rgba(47, 25, 9, 0.62); }
.leaderboard-item.me { border-color: rgba(68,238,160,0.72); background: rgba(5, 60, 46, 0.62); }

.leaderboard-item .rank {
  width: 112px;
  min-height: 84px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #65eaa4;
  font-size: 1.45rem;
  font-weight: 900;
  background: rgba(0,0,0,0.22);
}

.leaderboard-item .rank.rank-1 { color: #ffd64a; }
.leaderboard-item .rank.rank-2 { color: #d9e5e8; }
.leaderboard-item .rank.rank-3 { color: #ff9853; }

.leaderboard-item .player-name {
  color: #f7eedc;
  font-size: clamp(1.55rem, 4vw, 2rem);
  text-shadow: 0 5px 10px rgba(0,0,0,0.52);
}

.leaderboard-item small {
  color: rgba(232,234,226,0.62);
  font-size: 1.05rem;
}

.leaderboard-item .player-score span {
  color: #65eaa4;
  font-size: clamp(2rem, 5vw, 2.8rem);
  text-shadow: 0 0 12px rgba(101,234,164,0.28);
}

.leaderboard-item.rank-1 .player-score span { color: #ffd64a; }
.leaderboard-item.rank-2 .player-score span { color: #d9e5e8; }
.leaderboard-item.rank-3 .player-score span { color: #ff9853; }

.profile-themed-scroll .section-title-cyber {
  margin: 34px 0 22px;
  color: #65eaa4;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  letter-spacing: 5px;
}

.profile-account-card {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 24px;
  border: 2px solid rgba(91,239,169,0.42);
  background:
    radial-gradient(circle at 80% 42%, rgba(255,169,39,0.10), transparent 30%),
    linear-gradient(135deg, rgba(8,72,56,0.72), rgba(7,19,18,0.94));
}

.profile-account-card h2 {
  color: #f7eedc !important;
  font-size: clamp(2.2rem, 7vw, 3.2rem) !important;
  text-shadow: 0 6px 0 rgba(49,34,18,0.38), 0 12px 18px rgba(0,0,0,0.52);
}

.profile-account-card p {
  color: rgba(220,226,224,0.62) !important;
  font-size: clamp(1rem, 3vw, 1.25rem) !important;
}

.profile-stats-grid {
  max-width: 920px;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.profile-stats-grid .cyber-card {
  min-height: 154px;
  padding: 18px 10px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 18px;
  border: 2px solid rgba(185,149,95,0.30);
  background: rgba(7, 22, 20, 0.82);
}

.profile-stats-grid .cyber-card:nth-child(4) {
  grid-column: 2 / span 2;
  justify-self: stretch;
  width: 100%;
}

.profile-stats-grid .cyber-card:nth-child(5) {
  grid-column: 4 / span 2;
  justify-self: stretch;
  width: 100%;
}

.profile-stats-grid .cyber-card:nth-child(1),
.profile-stats-grid .cyber-card:nth-child(2),
.profile-stats-grid .cyber-card:nth-child(3) {
  grid-column: span 2;
}

.profile-stats-grid .cyber-card > span:first-child::before {
  display: block;
  margin: 0 auto 10px;
  font-size: 2rem;
}

.profile-stats-grid .cyber-card:nth-child(1) > span:first-child::before { content: '↗'; color: #17e6e6; }
.profile-stats-grid .cyber-card:nth-child(2) > span:first-child::before { content: '♜'; color: #9a45ff; }
.profile-stats-grid .cyber-card:nth-child(3) > span:first-child::before { content: '♕'; color: #48ee92; }
.profile-stats-grid .cyber-card:nth-child(4) > span:first-child::before { content: '='; color: #ffc738; }
.profile-stats-grid .cyber-card:nth-child(5) > span:first-child::before { content: '✖'; color: #ff544c; }

.profile-stats-grid .cyber-card > span:first-child {
  color: rgba(220,226,224,0.62) !important;
  font-size: 0.95rem !important;
  font-weight: 900;
}

.profile-stats-grid .cyber-card > span:last-child {
  font-size: 2rem !important;
  line-height: 1;
}

#profile-screen #match-history.cyber-list {
  max-width: 940px;
  gap: 14px;
}

#profile-screen .match-history-item {
  min-height: 92px;
  grid-template-columns: 88px minmax(0, 1fr) 110px;
  border-radius: 18px;
  border: 2px solid rgba(91,239,169,0.26);
  background: rgba(7, 22, 20, 0.82);
}

#profile-screen .match-result-badge {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  font-size: 1rem;
}

#profile-screen .match-opponent {
  font-size: 1.18rem;
}

#profile-screen .match-score-pill {
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(185,149,95,0.22);
  color: #f7eedc;
}

@media (max-width: 720px) {
  #game-header {
    width: min(92vw, 620px);
    padding-top: max(14px, env(safe-area-inset-top));
  }

  #game-header .stat-box {
    min-width: 104px;
    min-height: 72px;
    border-radius: 18px;
  }

  #game-header .stat-label {
    color: rgba(125, 242, 172, 0.86);
    font-size: 0.82rem;
    line-height: 1;
    opacity: 1;
    visibility: visible;
  }

  #game-header .stat-value {
    font-size: 2rem;
  }

  #btn-game-menu {
    width: 64px;
    height: 64px;
    border-radius: 17px;
    font-size: 2rem;
  }

  #main-board-wrap {
    padding: 6px;
    border-radius: 20px;
  }

  #power-ups {
    gap: 14px;
    margin: 12px 0 10px;
  }

  .power-up-btn {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .power-up-btn .pu-icon {
    font-size: 2rem;
  }

  .power-up-btn .pu-count {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  #piece-tray {
    max-width: 92vw;
    min-height: 100px;
    gap: 12px;
    padding: 12px;
  }

  .piece-slot {
    min-width: 96px;
    min-height: 82px;
    border-radius: 16px;
    padding: 6px;
  }

  #pause-overlay .glass-panel,
  .gameover-panel,
  #settings-modal .settings-panel {
    width: min(90vw, 520px);
    padding: 34px 22px;
    border-radius: 24px;
  }

  #pause-overlay .btn,
  .gameover-buttons .btn {
    min-height: 62px;
    font-size: 1.18rem;
  }

  .gameover-panel {
    padding-top: 58px;
  }

  .go-stat {
    padding: 0 12px;
  }

  .go-stat-label {
    font-size: 1rem;
  }

  #settings-modal .settings-row {
    min-height: 70px;
    grid-template-columns: 54px 1fr auto;
    padding: 9px 12px;
    border-radius: 16px;
  }

  #settings-modal .settings-row span {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 1.55rem;
  }

  #settings-modal .settings-row strong {
    font-size: 1.05rem;
  }

  #settings-modal .settings-row small {
    font-size: 0.78rem;
  }

  .leaderboard-cup,
  .profile-title-icon {
    width: 54px;
    height: 54px;
    font-size: 2rem;
  }

  .leaderboard-hero {
    min-height: 188px;
  }

  .leaderboard-hero::after {
    right: 16px;
    top: 76px;
    transform: scale(0.7);
    transform-origin: top right;
  }

  .leaderboard-item {
    min-height: 88px;
    grid-template-columns: 78px minmax(0, 1fr) 76px;
    gap: 10px;
    padding: 10px 12px;
  }

  .leaderboard-item .rank {
    width: 64px;
    min-height: 58px;
    font-size: 1rem;
  }

  .leaderboard-item small {
    font-size: 0.78rem;
  }

  .leaderboard-item .player-score span {
    font-size: 1.45rem;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .profile-stats-grid .cyber-card {
    min-height: 118px;
    padding: 12px 6px;
  }

  .profile-stats-grid .cyber-card:nth-child(1),
  .profile-stats-grid .cyber-card:nth-child(2),
  .profile-stats-grid .cyber-card:nth-child(3) {
    grid-column: span 2;
    width: 100%;
  }

  .profile-stats-grid .cyber-card:nth-child(4) {
    grid-column: 2 / span 2;
    width: 100%;
    justify-self: stretch;
  }

  .profile-stats-grid .cyber-card:nth-child(5) {
    grid-column: 4 / span 2;
    width: 100%;
    justify-self: stretch;
  }

  .profile-stats-grid .cyber-card > span:first-child {
    font-size: 0.68rem !important;
  }

  .profile-stats-grid .cyber-card > span:first-child::before {
    font-size: 1.45rem;
    margin-bottom: 8px;
  }

  .profile-stats-grid .cyber-card > span:last-child {
    font-size: 1.55rem !important;
  }

  #profile-screen .match-history-item {
    min-height: 78px;
    grid-template-columns: 58px minmax(0, 1fr) 76px;
    padding: 10px;
  }

  #profile-screen .match-result-badge {
    width: 48px;
    height: 48px;
    font-size: 0.75rem;
  }

  #profile-screen .match-topline {
    flex-wrap: wrap;
  }

  #profile-screen .match-opponent {
    font-size: 0.9rem;
  }
}

/* Bottom nav labels must stay visible across all themed screens */
#bottom-nav {
  position: fixed !important;
  z-index: 1000;
  display: flex !important;
  align-items: stretch !important;
}

#bottom-nav .nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 0;
  overflow: visible !important;
}

#bottom-nav .nav-icon {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto;
  width: 34px !important;
  height: 34px !important;
  font-size: 1.75rem !important;
  line-height: 1 !important;
}

#bottom-nav .nav-item > span {
  display: block !important;
  position: relative;
  z-index: 2;
  max-width: 100%;
  min-height: 16px;
  color: rgba(226, 235, 231, 0.62) !important;
  font-size: 0.78rem !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  letter-spacing: 1.6px !important;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor !important;
}

#bottom-nav .nav-item.active > span {
  color: #58efa5 !important;
  text-shadow: 0 0 12px rgba(88, 239, 165, 0.42);
}

#bottom-nav .nav-label {
  display: block !important;
  flex: 0 0 auto;
  width: 100%;
  min-height: 15px;
  max-width: 72px;
  overflow: visible !important;
  color: rgba(226, 235, 231, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  letter-spacing: 1.1px !important;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  -webkit-text-fill-color: currentColor !important;
}

#bottom-nav .nav-item.active .nav-label {
  color: #58efa5 !important;
}

@media (max-width: 420px) {
  #bottom-nav .nav-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 1.45rem !important;
  }

  #bottom-nav .nav-item > span {
    font-size: 0.68rem !important;
    letter-spacing: 1.1px !important;
  }

  #bottom-nav .nav-label {
    font-size: 0.64rem !important;
    letter-spacing: 0.7px !important;
    max-width: 58px;
  }
}

/* Reference polish: tutorial, auth prompt, and store detail cards */
#tutorial-overlay,
#account-required-modal {
  background: rgba(0, 8, 8, 0.72) !important;
  backdrop-filter: blur(8px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.15) !important;
}

#tutorial-overlay .tutorial-panel,
#account-required-modal .account-required-panel {
  position: relative;
  overflow: hidden;
  width: min(88vw, 650px) !important;
  max-height: calc(100dvh - 34px) !important;
  padding: 38px 28px 30px !important;
  border: 2px solid rgba(91, 239, 166, 0.78) !important;
  border-radius: 26px !important;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 82% 18%, rgba(77, 239, 161, 0.15), transparent 34%),
    linear-gradient(155deg, rgba(5, 45, 36, 0.96), rgba(3, 15, 16, 0.98)) !important;
  background-size: 22px 22px, 22px 22px, auto, auto !important;
  box-shadow:
    0 0 0 1px rgba(255, 190, 60, 0.16) inset,
    0 0 34px rgba(79, 246, 168, 0.26),
    0 32px 80px rgba(0, 0, 0, 0.62) !important;
}

#tutorial-overlay .tutorial-panel {
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 239, 166, 0.72) rgba(4, 24, 22, 0.35);
}

#tutorial-overlay .tutorial-panel::-webkit-scrollbar {
  width: 6px;
}

#tutorial-overlay .tutorial-panel::-webkit-scrollbar-track {
  background: rgba(4, 24, 22, 0.35);
  border-radius: 999px;
}

#tutorial-overlay .tutorial-panel::-webkit-scrollbar-thumb {
  background: rgba(91, 239, 166, 0.72);
  border-radius: 999px;
}

#tutorial-overlay .tutorial-panel::before,
#account-required-modal .account-required-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 82%, rgba(11, 248, 177, 0.14), transparent 28%),
    radial-gradient(circle at 92% 70%, rgba(255, 171, 24, 0.10), transparent 24%);
}

#tutorial-overlay .panel-title,
#account-required-modal .quick-shop-title {
  position: relative;
  color: #fff4df !important;
  font-size: clamp(2.15rem, 7vw, 3.55rem) !important;
  font-weight: 1000 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.42), 0 0 22px rgba(255, 206, 104, 0.2);
}

#tutorial-overlay .panel-title {
  font-size: clamp(2rem, 4.2vw, 3.15rem) !important;
  line-height: 1.04;
}

#tutorial-overlay .panel-title::before,
#tutorial-overlay .panel-title::after {
  content: "";
  display: inline-block;
  width: 58px;
  height: 2px;
  margin: 0 16px 12px;
  background: linear-gradient(90deg, transparent, #ffb229, #53eea6);
}

#tutorial-overlay .panel-title::after {
  background: linear-gradient(90deg, #53eea6, #ffb229, transparent);
}

#tutorial-overlay .tutorial-steps {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 24px 0 24px;
}

#tutorial-overlay .tutorial-step {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 177, 40, 0.58);
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(10, 54, 43, 0.92), rgba(4, 23, 25, 0.92));
  box-shadow: 0 0 20px rgba(0, 255, 164, 0.08) inset;
}

#tutorial-overlay .tutorial-step span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: #ffe1a0;
  font-size: 2.1rem;
  font-weight: 1000;
  background: radial-gradient(circle at 35% 25%, #ffd86c, #b06b12 72%);
  box-shadow: 0 0 0 10px rgba(14, 75, 56, 0.82), 0 0 0 11px rgba(255, 180, 38, 0.46), 0 10px 24px rgba(0, 0, 0, 0.36);
}

#tutorial-overlay .tutorial-step p {
  margin: 0;
  color: #fff8ee !important;
  font-size: clamp(0.98rem, 2.8vw, 1.28rem);
  font-weight: 850;
  line-height: 1.34;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
}

#tutorial-overlay #btn-tutorial-ok,
#account-required-modal #account-required-login {
  min-height: 76px !important;
  border: 2px solid rgba(255, 233, 122, 0.78) !important;
  border-radius: 14px !important;
  color: #271502 !important;
  font-size: clamp(1.35rem, 4.5vw, 2rem) !important;
  font-weight: 1000 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffc94f, #ff950d 72%, #b85c00) !important;
  box-shadow: 0 0 24px rgba(255, 181, 35, 0.36), 0 8px 0 rgba(119, 58, 0, 0.75) !important;
}

#account-required-modal .account-required-panel {
  width: min(84vw, 560px) !important;
  padding-top: 58px !important;
  text-align: left;
}

#account-required-modal .quick-shop-close {
  top: 24px !important;
  right: 24px !important;
  width: 58px !important;
  height: 58px !important;
  border: 1px solid rgba(255, 178, 40, 0.62) !important;
  border-radius: 14px !important;
  color: #7ef4ad !important;
  background: linear-gradient(145deg, rgba(16, 57, 45, 0.98), rgba(4, 22, 24, 0.98)) !important;
  font-size: 2.2rem !important;
}

#account-required-modal .account-required-copy {
  position: relative;
  margin: 20px 0 32px;
  color: rgba(238, 247, 244, 0.82) !important;
  font-size: clamp(1.12rem, 4vw, 1.45rem);
  font-weight: 760;
  line-height: 1.55;
}

#account-required-modal .account-required-actions {
  position: relative;
  display: grid;
  gap: 22px;
}

#account-required-modal #account-required-cancel {
  min-height: 60px !important;
  border: 1px solid rgba(255, 179, 38, 0.42) !important;
  border-radius: 12px !important;
  color: #7df2ac !important;
  background: rgba(4, 22, 20, 0.8) !important;
  font-size: 1.2rem !important;
  font-weight: 1000 !important;
  text-transform: uppercase;
}

#store-screen .section-title-cyber {
  color: #52e99c !important;
  font-size: clamp(2.2rem, 8vw, 3.45rem) !important;
  line-height: 0.98;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.34), 0 0 20px rgba(70, 232, 155, 0.24);
}

#store-screen .store-power-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 20px !important;
}

#store-screen .power-shop-card {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(98px, 30%) minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon desc"
    "icon buy";
  align-items: center;
  column-gap: 18px;
  min-height: 210px !important;
  padding: 24px 22px !important;
  border: 1.5px solid rgba(31, 233, 151, 0.68) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 22% 45%, rgba(54, 238, 159, 0.17), transparent 35%),
    radial-gradient(circle at 91% 21%, rgba(255, 174, 39, 0.08), transparent 25%),
    linear-gradient(145deg, rgba(4, 56, 42, 0.96), rgba(2, 22, 24, 0.98)) !important;
  box-shadow: 0 0 25px rgba(42, 246, 166, 0.13) inset, 0 14px 34px rgba(0, 0, 0, 0.34);
}

#store-screen .power-shop-card .power-shop-icon {
  grid-area: icon;
  position: relative;
  width: clamp(90px, 28vw, 150px) !important;
  height: clamp(90px, 28vw, 150px) !important;
  margin: 0 auto !important;
  color: transparent !important;
  font-size: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

#store-screen .power-shop-card .power-shop-icon::before,
#store-screen .power-shop-card .power-shop-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#store-screen .power-bomb .power-shop-icon::before {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #20382f, #06100d 76%);
  box-shadow: 0 0 0 4px rgba(80, 239, 164, 0.25), 0 0 42px rgba(255, 188, 42, 0.32);
}

#store-screen .power-bomb .power-shop-icon::after {
  width: 26px;
  height: 26px;
  left: 68%;
  top: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbd2 0 18%, #ffbd28 20% 48%, transparent 52%);
  box-shadow: 0 0 24px #ffb21e;
}

#store-screen .power-rotate .power-shop-icon::before {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 20px solid #58e89f;
  border-left-color: rgba(88, 232, 159, 0.25);
  box-shadow: 0 0 30px rgba(84, 238, 164, 0.35), 0 0 0 8px rgba(255, 190, 52, 0.16) inset;
}

#store-screen .power-rotate .power-shop-icon::after {
  width: 0;
  height: 0;
  left: 70%;
  top: 28%;
  border-left: 24px solid #58e89f;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  filter: drop-shadow(0 0 10px rgba(88, 232, 159, 0.8));
}

#store-screen .power-skip .power-shop-icon::before {
  width: 118px;
  height: 82px;
  background:
    linear-gradient(90deg, transparent 0 5%, #ffc33b 6% 31%, transparent 32% 38%, #ffc33b 39% 64%, transparent 65% 70%, #ffc33b 71% 96%, transparent 97%),
    linear-gradient(145deg, #ffe27b, #f29a0b 72%);
  clip-path: polygon(0 0, 28% 50%, 0 100%, 0 0, 34% 0, 62% 50%, 34% 100%, 34% 0, 68% 0, 100% 50%, 68% 100%);
  filter: drop-shadow(0 0 18px rgba(255, 179, 31, 0.72));
}

#store-screen .power-shop-card strong {
  grid-area: title;
  color: #fff3df !important;
  font-size: clamp(1.65rem, 6vw, 2.4rem) !important;
  font-weight: 1000 !important;
  text-align: left !important;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.32);
}

#store-screen .power-shop-card > span {
  grid-area: desc;
  color: rgba(226, 234, 232, 0.72) !important;
  font-size: clamp(0.98rem, 3.8vw, 1.25rem) !important;
  font-weight: 760 !important;
  text-align: left !important;
}

#store-screen .power-shop-card .btn-buy {
  grid-area: buy;
  justify-self: stretch;
  min-height: 60px !important;
  margin-top: 12px;
}

#store-screen #store-themes {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

#store-screen #store-themes .theme-card {
  position: relative;
  min-height: 230px !important;
  padding: 26px 16px 18px !important;
  border: 1.5px solid rgba(48, 232, 151, 0.7) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 50% 28%, rgba(73, 231, 164, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(5, 47, 40, 0.96), rgba(2, 18, 20, 0.98)) !important;
  box-shadow: 0 0 24px rgba(46, 233, 159, 0.10) inset, 0 12px 28px rgba(0, 0, 0, 0.32);
}

#store-screen #store-themes .theme-card > div:first-child {
  width: clamp(72px, 21vw, 112px) !important;
  height: clamp(72px, 21vw, 112px) !important;
  margin: 0 auto 20px !important;
  border-radius: 13px !important;
  box-shadow: 0 18px 22px rgba(0, 0, 0, 0.28), 0 0 28px currentColor !important;
}

#store-screen #store-themes .theme-card > span {
  display: block;
  color: #fff4e5 !important;
  font-size: clamp(1.1rem, 4vw, 1.55rem) !important;
  font-weight: 1000 !important;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

#store-screen .btn-buy {
  min-height: 52px !important;
  border: 1.5px solid rgba(255, 210, 91, 0.72) !important;
  border-radius: 13px !important;
  color: #2b1800 !important;
  font-size: clamp(0.98rem, 3.6vw, 1.35rem) !important;
  font-weight: 1000 !important;
  background: linear-gradient(180deg, #ffc94c, #f99a0d 72%, #b75e05) !important;
  box-shadow: 0 0 18px rgba(255, 178, 30, 0.28), 0 6px 0 rgba(92, 45, 0, 0.72) !important;
}

#store-screen .cosmetic-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

#store-screen .cosmetic-card {
  min-height: 330px !important;
  padding: 22px 14px 18px !important;
  border: 1.5px solid rgba(48, 232, 151, 0.64) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 50% 26%, rgba(79, 239, 166, 0.14), transparent 34%),
    linear-gradient(150deg, rgba(5, 45, 38, 0.96), rgba(2, 17, 19, 0.98)) !important;
}

#store-screen .cosmetic-preview {
  width: min(34vw, 145px) !important;
  height: min(34vw, 145px) !important;
  margin: 0 auto 18px !important;
  border-radius: 50% !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

#store-screen .cosmetic-preview span {
  width: 54px !important;
  height: 54px !important;
  filter: drop-shadow(0 0 22px currentColor);
}

#store-screen .cosmetic-card strong {
  color: #fff4e5 !important;
  font-size: clamp(1.1rem, 4.4vw, 1.55rem) !important;
  font-weight: 1000 !important;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

#store-screen .cosmetic-card small {
  min-height: 42px;
  color: rgba(230, 237, 234, 0.78) !important;
  font-size: clamp(0.84rem, 3.2vw, 1rem) !important;
  font-weight: 760 !important;
}

#store-screen .cosmetic-card .btn-buy:disabled {
  color: #67f2a7 !important;
  background: rgba(7, 51, 37, 0.8) !important;
  box-shadow: 0 0 16px rgba(72, 234, 159, 0.2) inset !important;
}

@media (max-width: 420px) {
  #tutorial-overlay .tutorial-panel,
  #account-required-modal .account-required-panel {
    width: min(92vw, 380px) !important;
    max-height: calc(100dvh - 22px) !important;
    padding: 30px 18px 24px !important;
    border-radius: 22px !important;
  }

  #tutorial-overlay .panel-title {
    font-size: clamp(1.7rem, 9vw, 2.35rem) !important;
  }

  #tutorial-overlay .panel-title::before,
  #tutorial-overlay .panel-title::after {
    width: 34px;
    margin-inline: 8px;
  }

  #tutorial-overlay .tutorial-step {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    min-height: 72px;
    padding: 10px 12px;
  }

  #tutorial-overlay .tutorial-step span {
    width: 44px;
    height: 44px;
    font-size: 1.45rem;
    box-shadow: 0 0 0 7px rgba(14, 75, 56, 0.82), 0 0 0 8px rgba(255, 180, 38, 0.46), 0 8px 18px rgba(0, 0, 0, 0.34);
  }

  #tutorial-overlay .tutorial-step p {
    font-size: clamp(0.88rem, 4.5vw, 1.05rem);
    line-height: 1.32;
  }

  #tutorial-overlay #btn-tutorial-ok {
    min-height: 60px !important;
    font-size: 1.35rem !important;
  }

  #store-screen .power-shop-card {
    min-height: 178px !important;
    grid-template-columns: 92px minmax(0, 1fr);
    column-gap: 12px;
    padding: 18px 14px !important;
  }

  #store-screen #store-themes,
  #store-screen .cosmetic-grid {
    gap: 12px !important;
  }

  #store-screen #store-themes .theme-card {
    min-height: 205px !important;
    padding-inline: 10px !important;
  }

  #store-screen .cosmetic-card {
    min-height: 292px !important;
    padding-inline: 10px !important;
  }
}

@media (max-width: 720px) {
  #game-screen {
    justify-content: flex-start;
    padding: 0 0 calc(84px + env(safe-area-inset-bottom)) !important;
    gap: 0;
    overflow: hidden;
  }

  #game-header {
    width: min(94vw, 620px);
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  #game-header .stat-box {
    min-width: 104px;
    min-height: 68px;
  }

  #btn-game-menu {
    width: 64px;
    height: 64px;
  }

  #game-area {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100vw;
    min-height: auto;
    padding: 0 8px;
    margin-top: 6px;
    overflow: visible;
  }

  #boards-container {
    width: 100%;
    justify-content: center;
  }

  #main-board-wrap {
    padding: 5px;
    border-radius: 20px;
  }

  #power-ups {
    width: min(92vw, 420px);
    justify-content: center;
    gap: 22px;
    margin: 24px auto 0;
  }

  .power-up-btn {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
  }

  #piece-tray {
    max-width: 94vw;
    min-height: 96px;
    gap: 20px;
    padding: 18px 10px 8px;
    margin: 22px auto 0;
  }

  .piece-slot {
    min-width: clamp(86px, 27vw, 108px);
    min-height: 86px;
    padding: 8px;
  }
}

#waiting-screen.room-ready {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(70, 245, 169, 0.14), transparent 24%),
    radial-gradient(circle at 92% 12%, rgba(255, 186, 35, 0.14), transparent 22%),
    linear-gradient(145deg, #000b0e 0%, #001715 46%, #020707 100%) !important;
}

#waiting-screen.room-ready::before,
#waiting-screen.room-ready::after {
  content: "";
  position: absolute;
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.38);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.22), rgba(5, 44, 34, 0.18)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.16) 50%, transparent 51%);
  box-shadow: inset 0 0 26px rgba(91, 239, 169, 0.14), 0 18px 36px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(30deg) skew(-8deg);
}

#waiting-screen.room-ready::before {
  left: 10px;
  bottom: 42px;
}

#waiting-screen.room-ready::after {
  right: 16px;
  top: 62px;
  border-color: rgba(255, 190, 56, 0.52);
  background:
    linear-gradient(135deg, rgba(255, 190, 56, 0.38), rgba(83, 49, 7, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.18) 50%, transparent 51%);
}

#waiting-screen.room-ready .glass-panel {
  position: relative;
  overflow: visible;
  width: min(88vw, 540px) !important;
  padding: clamp(34px, 7vw, 58px) clamp(22px, 6vw, 38px) !important;
  border: 1px solid rgba(91, 239, 169, 0.44) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(55, 230, 164, 0.16), transparent 48%),
    linear-gradient(180deg, rgba(4, 25, 22, 0.86), rgba(1, 9, 11, 0.94)) !important;
  box-shadow:
    inset 0 0 36px rgba(74, 239, 166, 0.08),
    0 28px 68px rgba(0, 0, 0, 0.56),
    0 0 42px rgba(61, 239, 158, 0.12) !important;
}

#waiting-screen.room-ready .glass-panel::before,
#waiting-screen.room-ready .glass-panel::after {
  content: "";
  position: absolute;
  width: 62px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.44);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(67, 239, 164, 0.26), rgba(4, 54, 41, 0.32));
  box-shadow: inset 0 0 22px rgba(91, 239, 169, 0.14), 0 16px 30px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(36deg) skew(-8deg);
}

#waiting-screen.room-ready .glass-panel::before {
  left: -36px;
  bottom: -30px;
}

#waiting-screen.room-ready .glass-panel::after {
  right: -34px;
  bottom: -18px;
  border-color: rgba(91, 239, 169, 0.38);
}

#waiting-screen.room-ready #waiting-title {
  margin: 0 0 14px !important;
  color: #f7eedc !important;
  font-size: clamp(2.25rem, 9vw, 3.3rem) !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center;
  text-shadow: 0 5px 0 rgba(14, 10, 6, 0.52), 0 14px 22px rgba(0, 0, 0, 0.62);
}

#waiting-screen.room-ready #waiting-title::before {
  content: "⌂";
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  border-radius: 18px;
  color: #04271e;
  font-size: 2.5rem;
  background: linear-gradient(145deg, #66f2ad, #10a978);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38), 0 0 28px rgba(91, 239, 169, 0.34);
}

#waiting-screen.room-ready .waiting-subtitle {
  max-width: 430px;
  margin: 0 auto 30px !important;
  color: rgba(239, 244, 238, 0.82) !important;
  font-size: clamp(1rem, 4vw, 1.2rem) !important;
  font-weight: 760 !important;
  line-height: 1.48 !important;
}

#waiting-screen.room-ready #room-code-wrap {
  margin: 0 auto 24px !important;
  padding: 18px 18px 16px !important;
  border: 1px solid rgba(91, 239, 169, 0.18) !important;
  border-radius: 16px !important;
  background: rgba(0, 9, 12, 0.5) !important;
  box-shadow: inset 0 0 24px rgba(43, 239, 169, 0.05) !important;
}

#waiting-screen.room-ready #room-code-wrap > div:first-child {
  margin-bottom: 8px !important;
  color: rgba(125, 242, 172, 0.68) !important;
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  letter-spacing: 2px;
}

#waiting-screen.room-ready #room-code-display {
  color: #43ee9f !important;
  font-size: clamp(2rem, 9vw, 3rem) !important;
  font-weight: 1000 !important;
  letter-spacing: clamp(5px, 1.6vw, 9px) !important;
  text-shadow: 0 0 18px rgba(67, 238, 159, 0.36), 0 8px 20px rgba(0, 0, 0, 0.5) !important;
}

#waiting-screen.room-ready #room-share-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 16px !important;
  margin: 0 0 28px !important;
}

#waiting-screen.room-ready #btn-copy-code,
#waiting-screen.room-ready #btn-copy-link {
  min-height: 58px !important;
  border: 1px solid rgba(67, 238, 159, 0.34) !important;
  border-radius: 14px !important;
  background: rgba(0, 45, 37, 0.55) !important;
  color: rgba(232, 244, 238, 0.86) !important;
  font-size: 1rem !important;
  font-weight: 950 !important;
  box-shadow: inset 0 0 18px rgba(67, 238, 159, 0.06) !important;
}

#waiting-screen.room-ready #waiting-back {
  min-height: 54px !important;
  color: rgba(125, 242, 172, 0.7) !important;
  font-size: 1.08rem !important;
  font-weight: 1000 !important;
  letter-spacing: 1.8px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 420px) {
  #waiting-screen.room-ready .glass-panel {
    width: min(88vw, 390px) !important;
    padding: 32px 20px 24px !important;
  }

  #waiting-screen.room-ready #room-share-actions {
    gap: 12px !important;
  }

  #waiting-screen.room-ready #btn-copy-code,
  #waiting-screen.room-ready #btn-copy-link {
    min-height: 54px !important;
    font-size: 0.9rem !important;
  }
}

#online-screen {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 39%, rgba(53, 239, 167, 0.12), transparent 19%),
    radial-gradient(circle at 95% 28%, rgba(255, 184, 32, 0.13), transparent 18%),
    radial-gradient(circle at 84% 76%, rgba(55, 239, 167, 0.11), transparent 20%),
    linear-gradient(145deg, #00080b 0%, #00120f 48%, #040807 100%) !important;
}

#online-screen::before,
#online-screen::after {
  content: "";
  position: absolute;
  width: 88px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.36);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.26), rgba(5, 44, 34, 0.18)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.15) 50%, transparent 51%);
  box-shadow: inset 0 0 24px rgba(91, 239, 169, 0.14), 0 18px 36px rgba(0, 0, 0, 0.36);
  pointer-events: none;
  transform: rotate(30deg) skew(-8deg);
}

#online-screen::before {
  left: -24px;
  top: 34%;
}

#online-screen::after {
  right: -20px;
  bottom: 18%;
}

#online-screen .online-arena-panel {
  position: relative;
  overflow: visible;
  width: min(84vw, 620px) !important;
  max-height: calc(100dvh - 126px) !important;
  padding: clamp(34px, 5.8vw, 56px) clamp(24px, 6vw, 46px) clamp(26px, 5vw, 40px) !important;
  border: 1px solid rgba(91, 239, 169, 0.5) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(64, 239, 165, 0.16), transparent 40%),
    radial-gradient(circle at 96% 62%, rgba(255, 186, 42, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(5, 29, 24, 0.88), rgba(1, 10, 11, 0.96)) !important;
  box-shadow:
    inset 0 0 42px rgba(74, 239, 166, 0.08),
    0 28px 74px rgba(0, 0, 0, 0.58),
    0 0 38px rgba(61, 239, 158, 0.16) !important;
}

#online-screen .online-arena-panel::before,
#online-screen .online-arena-panel::after {
  content: "";
  position: absolute;
  width: 70px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 190, 56, 0.48);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(255, 190, 56, 0.4), rgba(83, 49, 7, 0.25)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.16) 50%, transparent 51%);
  box-shadow: inset 0 0 24px rgba(255, 190, 56, 0.16), 0 16px 32px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(32deg) skew(-8deg);
}

#online-screen .online-arena-panel::before {
  right: -48px;
  top: 110px;
}

#online-screen .online-arena-panel::after {
  left: -54px;
  bottom: 250px;
  border-color: rgba(91, 239, 169, 0.42);
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.3), rgba(5, 44, 34, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.14) 50%, transparent 51%);
}

#online-screen .panel-title {
  margin: 0 0 34px !important;
  color: #f7eedc !important;
  font-size: clamp(2.6rem, 8.4vw, 4.1rem) !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-shadow: 0 6px 0 rgba(30, 19, 10, 0.58), 0 15px 26px rgba(0, 0, 0, 0.66);
}

#online-screen .panel-title::before,
#online-screen .panel-title::after {
  content: "";
  display: inline-block;
  width: clamp(46px, 15vw, 100px);
  height: 2px;
  margin: 0 18px 0.35em;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 64, 0.82));
  vertical-align: middle;
}

#online-screen .panel-title::after {
  background: linear-gradient(90deg, rgba(255, 196, 64, 0.82), transparent);
}

#online-screen .mode-selector {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 18px !important;
  margin: 0 0 28px !important;
}

#online-screen .mode-btn {
  min-height: 76px;
  border: 2px solid rgba(255, 182, 38, 0.38);
  border-radius: 16px;
  color: rgba(244, 237, 221, 0.7);
  background: rgba(1, 24, 20, 0.72);
  font-size: clamp(1.12rem, 4vw, 1.65rem);
  font-weight: 950;
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 22px rgba(67, 238, 159, 0.04);
}

#online-screen .mode-btn.active {
  color: #78f2b3;
  border-color: rgba(104, 255, 185, 0.9);
  background:
    linear-gradient(180deg, rgba(18, 95, 72, 0.78), rgba(2, 38, 31, 0.86));
  box-shadow:
    inset 0 0 24px rgba(104, 255, 185, 0.12),
    0 0 22px rgba(104, 255, 185, 0.22);
}

#online-screen #btn-quick-match,
#online-screen #btn-join-room {
  min-height: 86px !important;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  border: 2px solid rgba(255, 212, 76, 0.76) !important;
  border-radius: 0 !important;
  color: #fff4dd !important;
  font-size: clamp(1.55rem, 6vw, 2.25rem) !important;
  font-weight: 1000 !important;
  letter-spacing: 1px;
  text-shadow: 0 5px 0 rgba(76, 43, 5, 0.52), 0 14px 22px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 52% 0%, rgba(255, 232, 116, 0.28), transparent 38%),
    linear-gradient(180deg, #f5aa17, #bf6802) !important;
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 170, 22, 0.24) !important;
}

#online-screen .online-room-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 28px 0 !important;
  color: rgba(238, 244, 237, 0.58) !important;
  font-size: clamp(1rem, 4vw, 1.3rem) !important;
  font-weight: 800;
}

#online-screen .online-room-divider::before,
#online-screen .online-room-divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 238, 159, 0.46));
}

#online-screen .online-room-divider::after {
  background: linear-gradient(90deg, rgba(67, 238, 159, 0.46), transparent);
}

#online-screen #btn-create-room {
  min-height: 76px !important;
  border: 2px solid rgba(67, 238, 159, 0.42) !important;
  border-radius: 16px !important;
  color: #fff4df !important;
  background: rgba(0, 45, 37, 0.66) !important;
  font-size: clamp(1.25rem, 5vw, 1.9rem) !important;
  font-weight: 1000 !important;
  text-shadow: 0 5px 0 rgba(26, 14, 5, 0.48), 0 12px 20px rgba(0, 0, 0, 0.54);
  box-shadow: inset 0 0 24px rgba(67, 238, 159, 0.08) !important;
}

#online-screen #room-info {
  margin-top: 24px !important;
}

#online-screen #room-code-input {
  min-height: 74px;
  border: 1px solid rgba(255, 192, 68, 0.24);
  border-radius: 16px;
  background: rgba(0, 5, 7, 0.72);
  color: #efe5d1;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  font-weight: 1000;
  letter-spacing: 11px;
}

#online-screen #room-code-input::placeholder {
  color: rgba(238, 231, 216, 0.5);
  opacity: 1;
}

#online-screen #btn-join-room {
  margin-top: 24px !important;
  border-color: rgba(87, 255, 186, 0.78) !important;
  background:
    radial-gradient(circle at 52% 0%, rgba(166, 255, 215, 0.2), transparent 38%),
    linear-gradient(180deg, #1ed79b, #079778) !important;
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.08),
    0 0 24px rgba(67, 238, 159, 0.2) !important;
}

#online-screen #online-back {
  margin-top: 24px !important;
  min-height: 48px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #49e99c !important;
  font-size: clamp(1.25rem, 5vw, 1.8rem) !important;
  font-weight: 1000 !important;
  letter-spacing: 1.5px;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.56);
}

@media (max-width: 420px) {
  #online-screen .online-arena-panel {
    width: min(88vw, 390px) !important;
    max-height: calc(100dvh - 118px) !important;
    padding: 28px 20px 22px !important;
  }

  #online-screen .panel-title {
    margin-bottom: 24px !important;
  }

  #online-screen .panel-title::before,
  #online-screen .panel-title::after {
    width: 34px;
    margin-inline: 10px;
  }

  #online-screen .mode-selector {
    gap: 12px !important;
    margin-bottom: 22px !important;
  }

  #online-screen .mode-btn {
    min-height: 64px;
  }

  #online-screen #btn-quick-match,
  #online-screen #btn-join-room {
    min-height: 74px !important;
  }

  #online-screen #btn-create-room,
  #online-screen #room-code-input {
    min-height: 66px !important;
  }

  #online-screen .online-room-divider {
    margin: 22px 0 !important;
  }
}

#bottom-nav.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#waiting-screen.active {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: clamp(22px, 5vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 20%, rgba(70, 245, 169, 0.12), transparent 22%),
    radial-gradient(circle at 87% 28%, rgba(255, 186, 35, 0.12), transparent 22%),
    linear-gradient(145deg, #00090d 0%, #050617 48%, #020706 100%) !important;
}

#waiting-screen.active .glass-panel {
  position: relative;
  width: min(86vw, 560px) !important;
  max-width: 560px;
  padding: clamp(38px, 6vw, 58px) clamp(24px, 5vw, 42px) !important;
  border: 1px solid rgba(91, 239, 169, 0.42) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(55, 230, 164, 0.14), transparent 46%),
    linear-gradient(180deg, rgba(6, 25, 24, 0.86), rgba(9, 8, 31, 0.94)) !important;
  box-shadow:
    inset 0 0 36px rgba(74, 239, 166, 0.07),
    0 28px 68px rgba(0, 0, 0, 0.56),
    0 0 42px rgba(61, 239, 158, 0.14) !important;
}

#waiting-screen.active #waiting-title {
  margin: 0 0 18px !important;
  color: #f7eedc !important;
  font-size: clamp(2.15rem, 7vw, 3.3rem) !important;
  font-weight: 1000 !important;
  line-height: 1.05 !important;
  text-align: center;
  text-shadow: 0 5px 0 rgba(14, 10, 6, 0.52), 0 14px 22px rgba(0, 0, 0, 0.62);
}

#waiting-screen.waiting-quick #waiting-title::before,
#waiting-screen.waiting-connecting #waiting-title::before {
  content: "...";
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  border-radius: 18px;
  color: #04271e;
  font-size: 1.75rem;
  line-height: 1;
  background: linear-gradient(145deg, #66f2ad, #10a978);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38), 0 0 28px rgba(91, 239, 169, 0.34);
}

#waiting-screen.active .waiting-subtitle {
  max-width: 440px;
  margin: 0 auto 28px !important;
  color: rgba(239, 244, 238, 0.82) !important;
  font-size: clamp(1rem, 3.2vw, 1.2rem) !important;
  font-weight: 780 !important;
  line-height: 1.48 !important;
}

#waiting-screen.active #quick-waiting-info {
  margin: 0 0 28px !important;
}

#waiting-screen.active .spinner-container {
  margin: 0 !important;
}

#waiting-screen.active .spinner {
  width: 58px;
  height: 58px;
  border-width: 4px;
  border-color: rgba(91, 239, 169, 0.14);
  border-top-color: #43ee9f;
  border-bottom-color: #ffb326;
  box-shadow: 0 0 24px rgba(67, 238, 159, 0.22);
}

#waiting-screen.active #waiting-back {
  min-height: 54px !important;
  color: rgba(125, 242, 172, 0.78) !important;
  font-size: 1.08rem !important;
  font-weight: 1000 !important;
  letter-spacing: 1.8px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 420px) {
  #waiting-screen.active {
    padding: 18px;
  }

  #waiting-screen.active .glass-panel {
    width: min(90vw, 390px) !important;
    padding: 32px 20px 24px !important;
  }
}

#feedback-modal {
  background: rgba(0, 8, 8, 0.72) !important;
  backdrop-filter: blur(7px) saturate(1.14) !important;
  -webkit-backdrop-filter: blur(7px) saturate(1.14) !important;
}

#feedback-modal .feedback-modal-panel {
  position: relative;
  overflow: visible;
  width: min(84vw, 640px) !important;
  max-height: calc(100dvh - 112px) !important;
  padding: clamp(38px, 6vw, 58px) clamp(24px, 5.5vw, 46px) clamp(28px, 5vw, 42px) !important;
  border: 1px solid rgba(91, 239, 169, 0.48) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(55, 230, 164, 0.16), transparent 42%),
    radial-gradient(circle at 98% 52%, rgba(255, 186, 42, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(5, 29, 24, 0.9), rgba(1, 10, 11, 0.96)) !important;
  box-shadow:
    inset 0 0 42px rgba(74, 239, 166, 0.08),
    0 28px 74px rgba(0, 0, 0, 0.58),
    0 0 38px rgba(61, 239, 158, 0.15) !important;
  text-align: center;
}

#feedback-modal .feedback-modal-panel::before,
#feedback-modal .feedback-modal-panel::after {
  content: "";
  position: absolute;
  width: 70px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.42);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.3), rgba(5, 44, 34, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.14) 50%, transparent 51%);
  box-shadow: inset 0 0 24px rgba(91, 239, 169, 0.14), 0 16px 32px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(32deg) skew(-8deg);
}

#feedback-modal .feedback-modal-panel::before {
  left: -48px;
  top: 132px;
}

#feedback-modal .feedback-modal-panel::after {
  right: -46px;
  bottom: 104px;
  border-color: rgba(255, 190, 56, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 190, 56, 0.4), rgba(83, 49, 7, 0.25)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.16) 50%, transparent 51%);
}

#feedback-modal .quick-shop-close {
  top: 22px !important;
  right: 22px !important;
  width: 64px !important;
  height: 64px !important;
  border: 1px solid rgba(255, 190, 56, 0.54) !important;
  border-radius: 14px !important;
  color: #fff4df !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 190, 56, 0.18), transparent 48%),
    rgba(0, 30, 26, 0.72) !important;
  font-size: 2.5rem !important;
  line-height: 1 !important;
  box-shadow: inset 0 0 18px rgba(255, 190, 56, 0.08), 0 0 22px rgba(255, 190, 56, 0.12) !important;
}

#feedback-modal .quick-shop-title {
  margin: 16px 72px 14px !important;
  color: #fff4df !important;
  font-size: clamp(2.4rem, 8vw, 3.8rem) !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  letter-spacing: 3px;
  text-shadow: 0 6px 0 rgba(30, 19, 10, 0.58), 0 15px 26px rgba(0, 0, 0, 0.66);
}

#feedback-modal .feedback-help {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 0 0 30px !important;
  color: rgba(239, 244, 238, 0.78) !important;
  font-size: clamp(1rem, 3.3vw, 1.22rem) !important;
  font-weight: 820 !important;
  line-height: 1.42 !important;
}

#feedback-modal .feedback-help::before,
#feedback-modal .feedback-help::after {
  content: "";
  height: 1px;
  min-width: 38px;
  background: linear-gradient(90deg, transparent, rgba(67, 238, 159, 0.46));
}

#feedback-modal .feedback-help::after {
  background: linear-gradient(90deg, rgba(67, 238, 159, 0.46), transparent);
}

#feedback-modal .feedback-input {
  width: 100%;
  border: 2px solid rgba(67, 238, 159, 0.42) !important;
  border-radius: 16px !important;
  background: rgba(0, 30, 26, 0.62) !important;
  color: #fff4df !important;
  font-size: clamp(1.05rem, 3.8vw, 1.4rem) !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
  box-shadow: inset 0 0 24px rgba(67, 238, 159, 0.06), 0 0 18px rgba(67, 238, 159, 0.06) !important;
}

#feedback-modal select.feedback-input {
  min-height: 76px;
  margin-bottom: 22px !important;
  padding: 0 58px 0 28px !important;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #ffbe38 50%) calc(100% - 30px) 50% / 12px 12px no-repeat,
    linear-gradient(135deg, rgba(4, 55, 42, 0.76), rgba(0, 16, 16, 0.86)) !important;
}

#feedback-modal .feedback-textarea {
  min-height: clamp(190px, 30dvh, 260px) !important;
  margin-bottom: 28px !important;
  padding: 26px 28px !important;
  resize: none;
}

#feedback-modal .feedback-input::placeholder {
  color: rgba(239, 232, 216, 0.5) !important;
  opacity: 1;
}

#feedback-modal .feedback-input:focus {
  border-color: rgba(104, 255, 185, 0.92) !important;
  box-shadow: inset 0 0 24px rgba(67, 238, 159, 0.08), 0 0 22px rgba(67, 238, 159, 0.22) !important;
}

#feedback-modal #btn-send-feedback {
  width: min(92%, 520px);
  min-height: 78px !important;
  margin: 0 auto 14px !important;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  border: 2px solid rgba(255, 212, 76, 0.76) !important;
  border-radius: 0 !important;
  color: #fff4dd !important;
  font-size: clamp(1.6rem, 6vw, 2.35rem) !important;
  font-weight: 1000 !important;
  letter-spacing: 1px;
  text-shadow: 0 5px 0 rgba(76, 43, 5, 0.52), 0 14px 22px rgba(0, 0, 0, 0.55);
  background:
    radial-gradient(circle at 52% 0%, rgba(255, 232, 116, 0.28), transparent 38%),
    linear-gradient(180deg, #f5aa17, #bf6802) !important;
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.1),
    0 0 24px rgba(255, 170, 22, 0.24) !important;
}

#feedback-modal .feedback-status {
  min-height: 22px;
  color: rgba(239, 244, 238, 0.72) !important;
  font-size: 0.94rem !important;
  font-weight: 850 !important;
  text-align: center;
}

#feedback-modal .feedback-status.success {
  color: #67f2a7 !important;
}

@media (max-width: 420px) {
  #feedback-modal .feedback-modal-panel {
    width: min(88vw, 390px) !important;
    max-height: calc(100dvh - 108px) !important;
    padding: 34px 20px 22px !important;
  }

  #feedback-modal .quick-shop-close {
    width: 54px !important;
    height: 54px !important;
    top: 18px !important;
    right: 18px !important;
  }

  #feedback-modal .quick-shop-title {
    margin-inline: 48px !important;
    letter-spacing: 2px;
  }

  #feedback-modal select.feedback-input {
    min-height: 66px;
  }

  #feedback-modal .feedback-textarea {
    min-height: 170px !important;
  }

  #feedback-modal #btn-send-feedback {
    min-height: 70px !important;
  }
}

#waiting-screen.active {
  padding: clamp(28px, 10dvh, 110px) clamp(18px, 5vw, 56px) calc(104px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 17% 33%, rgba(63, 239, 166, 0.12), transparent 22%),
    radial-gradient(circle at 86% 63%, rgba(255, 188, 45, 0.12), transparent 20%),
    linear-gradient(145deg, #00090d 0%, #00120f 48%, #020706 100%) !important;
}

#waiting-screen.active::before,
#waiting-screen.active::after {
  content: "";
  position: absolute;
  width: 90px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.38);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.28), rgba(5, 44, 34, 0.2)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.15) 50%, transparent 51%);
  box-shadow: inset 0 0 24px rgba(91, 239, 169, 0.14), 0 18px 36px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(31deg) skew(-8deg);
}

#waiting-screen.active::before {
  left: clamp(10px, 6vw, 74px);
  top: 42%;
}

#waiting-screen.active::after {
  right: clamp(8px, 7vw, 88px);
  bottom: calc(156px + env(safe-area-inset-bottom));
  border-color: rgba(255, 190, 56, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 190, 56, 0.38), rgba(83, 49, 7, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.17) 50%, transparent 51%);
}

#waiting-screen.active .glass-panel {
  width: min(82vw, 760px) !important;
  max-width: 760px;
  min-height: 420px;
  padding: clamp(48px, 6vw, 70px) clamp(34px, 7vw, 70px) clamp(34px, 5vw, 48px) !important;
  border-color: rgba(104, 255, 185, 0.64) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(circle at 50% 8%, rgba(86, 239, 169, 0.18), transparent 38%),
    radial-gradient(circle at 94% 70%, rgba(255, 190, 56, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(4, 33, 26, 0.91), rgba(1, 11, 11, 0.96)) !important;
  box-shadow:
    inset 0 0 48px rgba(86, 239, 169, 0.08),
    0 30px 78px rgba(0, 0, 0, 0.58),
    0 0 32px rgba(91, 239, 169, 0.22) !important;
}

#waiting-screen.waiting-quick .glass-panel::before,
#waiting-screen.waiting-connecting .glass-panel::before,
#waiting-screen.waiting-quick .glass-panel::after,
#waiting-screen.waiting-connecting .glass-panel::after {
  content: "";
  position: absolute;
  width: 72px;
  aspect-ratio: 1;
  border: 1px solid rgba(91, 239, 169, 0.44);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(91, 239, 169, 0.3), rgba(5, 44, 34, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.14) 50%, transparent 51%);
  box-shadow: inset 0 0 24px rgba(91, 239, 169, 0.14), 0 16px 32px rgba(0, 0, 0, 0.34);
  pointer-events: none;
  transform: rotate(32deg) skew(-8deg);
}

#waiting-screen.waiting-quick .glass-panel::before,
#waiting-screen.waiting-connecting .glass-panel::before {
  left: -52px;
  top: 96px;
}

#waiting-screen.waiting-quick .glass-panel::after,
#waiting-screen.waiting-connecting .glass-panel::after {
  right: -50px;
  bottom: 82px;
  border-color: rgba(255, 190, 56, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 190, 56, 0.38), rgba(83, 49, 7, 0.24)),
    linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.17) 50%, transparent 51%);
}

#waiting-screen.active #waiting-title {
  margin: 0 0 22px !important;
  color: #fff4df !important;
  font-size: clamp(2.55rem, 7vw, 4.25rem) !important;
  letter-spacing: 1px;
  text-shadow: 0 6px 0 rgba(30, 19, 10, 0.58), 0 15px 26px rgba(0, 0, 0, 0.66);
}

#waiting-screen.waiting-quick #waiting-title::before,
#waiting-screen.waiting-connecting #waiting-title::before {
  content: "◆ ◆ ◆";
  display: grid;
  place-items: center;
  width: min(72%, 340px);
  height: 22px;
  margin: 0 auto 22px;
  border-radius: 0;
  color: #43ee9f;
  font-size: 1.2rem;
  letter-spacing: 10px;
  line-height: 1;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255, 190, 56, 0.75) 18% 40%, transparent 40% 60%, rgba(255, 190, 56, 0.75) 60% 82%, transparent 82% 100%);
  box-shadow: none;
}

#waiting-screen.active .waiting-subtitle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  max-width: 600px;
  margin-bottom: 34px !important;
  color: rgba(255, 230, 196, 0.86) !important;
  font-size: clamp(1.22rem, 3.8vw, 1.72rem) !important;
  font-weight: 900 !important;
  text-shadow: 0 5px 14px rgba(0, 0, 0, 0.5);
}

#waiting-screen.active .waiting-subtitle::before,
#waiting-screen.active .waiting-subtitle::after {
  content: "";
  height: 1px;
  min-width: 42px;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 56, 0.58), rgba(67, 238, 159, 0.46));
}

#waiting-screen.active .waiting-subtitle::after {
  background: linear-gradient(90deg, rgba(67, 238, 159, 0.46), rgba(255, 190, 56, 0.58), transparent);
}

#waiting-screen.active .spinner {
  width: 86px;
  height: 86px;
  border-width: 7px;
  border-color: rgba(67, 238, 159, 0.18);
  border-top-color: #ffcc4d;
  border-right-color: #43ee9f;
  border-bottom-color: #16b987;
  box-shadow:
    0 0 28px rgba(67, 238, 159, 0.28),
    inset 0 0 16px rgba(255, 190, 56, 0.08);
}

#waiting-screen.active #waiting-back {
  width: min(48%, 230px);
  min-height: 62px !important;
  margin: 8px auto 0;
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
  border: 2px solid rgba(255, 190, 56, 0.62) !important;
  color: #fff4df !important;
  background: rgba(0, 42, 35, 0.66) !important;
  font-size: clamp(1.1rem, 4vw, 1.45rem) !important;
  text-shadow: 0 5px 0 rgba(26, 14, 5, 0.48), 0 12px 20px rgba(0, 0, 0, 0.54);
  box-shadow: inset 0 0 22px rgba(67, 238, 159, 0.08), 0 0 18px rgba(255, 190, 56, 0.12) !important;
}

@media (max-width: 720px) {
  #waiting-screen.active {
    align-items: center;
    padding-top: clamp(86px, 25dvh, 210px);
  }

  #waiting-screen.active .glass-panel {
    width: min(82vw, 560px) !important;
    min-height: 360px;
  }
}

@media (max-width: 420px) {
  #waiting-screen.active {
    padding: clamp(72px, 21dvh, 160px) 16px calc(96px + env(safe-area-inset-bottom));
  }

  #waiting-screen.active .glass-panel {
    width: min(86vw, 390px) !important;
    min-height: 320px;
    padding: 34px 20px 26px !important;
  }

  #waiting-screen.active .waiting-subtitle {
    grid-template-columns: 1fr;
    gap: 0;
  }

  #waiting-screen.active .waiting-subtitle::before,
  #waiting-screen.active .waiting-subtitle::after {
    display: none;
  }

  #waiting-screen.active .spinner {
    width: 70px;
    height: 70px;
    border-width: 6px;
  }

  #waiting-screen.active #waiting-back {
    width: min(62%, 220px);
  }
}

.drag-piece,
.drag-bomb {
  will-change: transform;
  contain: layout paint style;
}

@media (max-width: 768px) {
  :root {
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    --shadow-glow: 0 0 14px rgba(0, 255, 157, 0.14);
    --accent-glow: rgba(0, 255, 157, 0.18);
  }

  .glass-panel,
  .quick-shop-panel,
  .game-menu-panel,
  .settings-panel,
  .account-required-panel,
  .feedback-modal-panel,
  .online-arena-panel,
  .store-panel,
  .cyber-card,
  .profile-card-cyber {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38), inset 0 0 14px rgba(80, 239, 168, 0.04) !important;
  }

  .quick-shop-modal,
  .game-menu-backdrop,
  #feedback-modal,
  #settings-modal,
  #account-required-modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #game-screen::after,
  #gameover-screen::after,
  #waiting-screen.active::before,
  #waiting-screen.active::after,
  #online-screen::before,
  #online-screen::after,
  #feedback-modal .feedback-modal-panel::before,
  #feedback-modal .feedback-modal-panel::after {
    filter: none !important;
    box-shadow: inset 0 0 10px rgba(91, 239, 169, 0.08) !important;
  }

  .floating-block,
  .menu-gamepad,
  .menu-podium,
  .game-boot-mark,
  #waiting-screen.active .glass-panel::before,
  #waiting-screen.active .glass-panel::after,
  #online-screen .online-arena-panel::before,
  #online-screen .online-arena-panel::after {
    animation: none !important;
    filter: none !important;
  }

  .btn,
  .mode-btn,
  .nav-item,
  .piece-slot,
  .power-up-btn,
  .settings-row,
  .theme-card,
  .cosmetic-card {
    transition: transform 0.12s ease, opacity 0.12s ease, border-color 0.12s ease !important;
    box-shadow: none !important;
  }

  .btn-primary,
  #online-screen #btn-quick-match,
  #online-screen #btn-join-room,
  #feedback-modal #btn-send-feedback,
  #waiting-screen.active #waiting-back {
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.06) !important;
  }

  .drag-piece {
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.34));
  }

  .drag-bomb {
    box-shadow: 0 0 12px rgba(255, 71, 87, 0.26), 0 6px 16px rgba(0, 0, 0, 0.34);
  }
}
