:root {
  --primary: #10b981;
  --primary-hover: #059669;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.95);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --danger: #ef4444;
  --border-radius: 16px;
  --font-family: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arcade: 'Press Start 2P', monospace;
  --snake-color: #10b981;
  --theme-bg-gradient: radial-gradient(circle at center, #1e293b 0%, #0a0f1d 100%);
  --grid-line-color: rgba(255, 255, 255, 0.05);
}

/* THEMES */
body.theme-floresta {
  --theme-bg-gradient: radial-gradient(circle at 50% 30%, #1c3d27 0%, #0b1a10 100%);
  --theme-border-color: #22c55e;
  --theme-tile-odd: #1d432b;
  --theme-tile-even: #183723;
  --theme-hud-bg: rgba(14, 38, 22, 0.85);
  --theme-accent: #86efac;
}

body.theme-deserto {
  --theme-bg-gradient: radial-gradient(circle at 50% 30%, #4a2c0c 0%, #1e1103 100%);
  --theme-border-color: #f59e0b;
  --theme-tile-odd: #c2883f;
  --theme-tile-even: #b37b34;
  --theme-hud-bg: rgba(54, 30, 8, 0.85);
  --theme-accent: #fde047;
}

body.theme-cidade {
  --theme-bg-gradient: radial-gradient(circle at 50% 30%, #1e1e2f 0%, #0d0d17 100%);
  --theme-border-color: #06b6d4;
  --theme-tile-odd: #2a2a3d;
  --theme-tile-even: #222232;
  --theme-hud-bg: rgba(26, 26, 40, 0.85);
  --theme-accent: #38bdf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-family);
  background: var(--theme-bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  transition: background 0.6s ease;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  padding: 12px;
}

/* HEADER & HUD */
#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--theme-hud-bg, rgba(30, 41, 59, 0.85));
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  gap: 8px;
  flex-wrap: wrap;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.hud-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.hud-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.player-badge {
  flex-direction: row;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* PROGRESS BAR */
#progress-container {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4, #f59e0b);
  border-radius: 8px;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

/* CANVAS WRAPPER (ENLARGED) */
#canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 780px;
  max-height: 780px;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), inset 0 0 1px 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  background: #000;
  border: 4px solid var(--theme-border-color, #22c55e);
  transition: border-color 0.4s ease;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* FLOATING TEXT (POPUP POINTS) */
#floating-text-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.float-popup {
  position: absolute;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fde047;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px #f59e0b;
  transform: translate(-50%, -50%);
  animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  30% { opacity: 1; transform: translate(-50%, -15px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}

/* 3-SECOND COUNTDOWN OVERLAY */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 29, 0.6);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.countdown-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.countdown-number {
  font-family: var(--font-arcade), monospace;
  font-size: 5.5rem;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.95), 0 4px 16px rgba(0, 0, 0, 0.9);
  display: inline-block;
  transform-origin: center;
}

.countdown-number.pop {
  animation: countdownPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.countdown-label {
  font-family: var(--font-family);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #f8fafc;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

@keyframes countdownPop {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
  70% {
    opacity: 1;
    transform: scale(1.0);
  }
  100% {
    opacity: 0.8;
    transform: scale(0.95);
  }
}

/* FULLSCREEN STYLING */
:fullscreen #game-container,
:-webkit-full-screen #game-container {
  max-width: 95vw;
  height: 98vh;
  justify-content: center;
}

:fullscreen #canvas-wrapper,
:-webkit-full-screen #canvas-wrapper {
  max-height: 78vh;
  max-width: 78vh;
}

/* MOBILE DPAD */
#mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.dpad-row {
  display: flex;
  gap: 8px;
}

.dpad-btn {
  width: 60px;
  height: 52px;
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s, background 0.1s;
}

.dpad-btn:active {
  transform: scale(0.9);
  background: var(--primary);
}

.dpad-btn.center-btn {
  background: rgba(15, 23, 42, 0.7);
  font-size: 1rem;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 24px 22px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* WIDE TWO-COLUMN DASHBOARD MODAL */
.modal-card.modal-card-wide {
  max-width: 940px;
  width: 95%;
  max-height: 92vh;
  padding: 20px 24px;
  gap: 14px;
}

.modal-top-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.modal-col-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-col-left form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* GAME TITLE */
.game-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 1px;
}

.title-snake {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-sub {
  color: var(--accent);
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: -8px;
}

/* FORM STYLES */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
}

input[type="text"], select {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

/* COLOR PRESETS & PREVIEW */
/* COLOR PALETTE BAR & PREVIEW ROW */
.color-palette-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 12px;
}

.color-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.color-btn:hover {
  transform: scale(1.15);
}

.color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 10px var(--c);
  transform: scale(1.15);
}

.custom-color-picker-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.custom-color-picker-wrap input[type="color"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* SNAKE MINI PREVIEW */
.snake-mini-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 0;
  margin: 0;
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

#preview-snake-track {
  display: flex;
  align-items: center;
  gap: 3px;
}

.preview-segment {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--snake-color);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.preview-head {
  border-radius: 6px 10px 10px 6px;
  position: relative;
}

.prev-eye {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
}

.prev-eye::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: #000;
  border-radius: 50%;
  top: 1px;
  right: 1px;
}

.prev-eye-l { top: 2px; right: 4px; }
.prev-eye-r { bottom: 2px; right: 4px; }

/* SCENARIOS */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.scenario-card {
  position: relative;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.scenario-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.scenario-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
}

.scenario-card.active {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.scenario-icon {
  font-size: 1.5rem;
}

.scenario-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.scenario-desc {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.15;
}

/* START GAME CTA BUTTON */
.start-btn-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}

.btn-start-cta {
  width: 100%;
  padding: 13px 20px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-start-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.6);
}
  line-height: 1.2;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-large {
  padding: 14px 24px;
  font-size: 1.15rem;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(16, 185, 129, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* CELEBRATION / LEVEL UP MODAL */
.modal-celebration {
  text-align: center;
  border-color: #fde047;
  box-shadow: 0 0 50px rgba(253, 224, 71, 0.4);
}

.celebration-badge {
  display: inline-block;
  background: #f59e0b;
  color: #000;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.level-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.stat-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-title {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.stat-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

/* GAMEOVER MODAL */
.gameover-title {
  text-align: center;
  color: var(--danger);
  font-size: 1.8rem;
}

.gameover-desc {
  text-align: center;
  color: var(--text-muted);
}

.gameover-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.stat-card strong {
  font-size: 1.1rem;
  color: var(--accent);
}

/* SHARING & COMMUNITY */
.share-card-section {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 6px 0 2px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  letter-spacing: 0.5px;
}

.share-buttons-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1 1 110px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-share:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.btn-share:active {
  transform: translateY(1px);
}

.btn-share-main {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-share-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-share-link {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Start Menu Share Card */
.share-menu-card {
  margin-top: 4px;
}

.share-menu-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.25;
  margin-bottom: 6px;
}

/* TOAST NOTIFICATION */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(45px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 2px solid #10b981;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(16, 185, 129, 0.4);
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-message {
  white-space: nowrap;
}

.gameover-actions, .pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* HIGHSCORES TABLE */
.records-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.records-section h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.highscores-table {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 8px;
  max-height: 120px;
  overflow-y: auto;
}

.record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.record-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.record-rank {
  font-weight: 700;
  width: 24px;
  color: var(--accent);
}

.record-nick {
  flex: 1;
  text-align: left;
  margin: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-score {
  font-weight: 700;
  color: #10b981;
}

.empty-msg {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px 0;
}

/* RIGHT COLUMN INFO CARDS */
.info-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

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

/* Key Guide in Info Card */
.key-guide-layout {
  display: flex;
  align-items: center;
  gap: 14px;
}

.key-caps-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.key-cap-row {
  display: flex;
  gap: 3px;
}

.key-cap {
  width: 30px;
  height: 30px;
  background: #1e293b;
  border: 2px solid #475569;
  border-bottom: 3px solid #334155;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.key-guide-desc {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.key-guide-desc p {
  font-size: 0.8rem;
  color: #f1f5f9;
  line-height: 1.25;
  margin: 0;
}

.extra-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.extra-shortcuts strong {
  color: #fde047;
}

/* Rules Pills Grid */
.rules-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.rule-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.74rem;
}

.rule-pill strong {
  color: #f8fafc;
}

.pill-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.pill-text {
  color: var(--text-muted);
  line-height: 1.15;
}

/* Records Card in Right Column */
.records-card .highscores-table {
  max-height: 110px;
  padding: 6px;
}

/* DESKTOP CONTROLS HINT BANNER */
.controls-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.controls-hint strong {
  color: var(--accent);
}

.countdown-hint {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fef08a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.pause-hint {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: -6px;
}

/* RESPONSIVENESS */
@media (max-width: 820px) {
  .modal-body-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-card.modal-card-wide {
    padding: 18px 16px;
    max-height: 94vh;
  }

  .rules-pills {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  #mobile-controls {
    display: flex;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

  .game-title {
    font-size: 1.8rem;
  }

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

  .hud-item {
    min-width: 50px;
  }

  .level-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-share {
    flex: 1 1 100%;
  }
}
