:root {
  --page-bg: #eef4e6;
  --card-bg: #ffffff;
  --card-border: #d7e2c8;
  --hud-bg: #4a752c;
  --hud-text: #ffffff;
  --panel-text: #1e293b;
  --panel-muted: #64748b;
  --btn-bg: #f4f7f0;
  --btn-hover: #e7efe0;
  --btn-border: #d5e0c7;
  --accent: #4a752c;
  --accent-text: #ffffff;
  --portal-cyan: #06b6d4;
  --portal-orange: #f97316;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--panel-text);
  transition: background-color 0.22s ease, color 0.22s ease;
}

.page-art-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
  background-position: center;
  background-size: 280px 280px;
  opacity: 0.42;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stage {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 12px 12px;
  gap: 8px;
}

.game-stage {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.game-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 100%;
  max-height: 100%;
}

.stage-spacer {
  display: none;
}

@media (min-width: 1360px) {
  .stage-spacer {
    display: block;
    width: 256px;
    flex-shrink: 0;
  }
}

/* Sleek Unified Arcade Chassis with Theme-Colored Border */
.board-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--hud-bg);
  border-radius: 20px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.42), inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.28);
  overflow: hidden;
  border: 3px solid color-mix(in srgb, var(--accent) 72%, #ffffff);
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.border-art-layer {
  display: none;
}

.hud-bar,
.canvas-wrap {
  position: relative;
  z-index: 2;
}

/* Authentic Nokia 3310 Chassis Look */
body.nokia-chrome .board-card {
  background: #272c31;
  border-color: #18202c;
  border-radius: 22px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.42), inset 0 2px 0 rgba(255, 255, 255, 0.16), inset 0 -4px 0 rgba(0, 0, 0, 0.45);
}

body.nokia-chrome .hud-bar {
  background: #8f9e78;
  color: #1b2611;
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid #2b3818;
  border-radius: 0;
  font-family: "Courier New", Courier, monospace;
}

body.nokia-chrome .brand-mark,
body.nokia-chrome .icon-btn {
  background: rgba(27, 38, 17, 0.14);
  border: 0;
  box-shadow: none;
  color: #1b2611;
}

body.nokia-chrome .icon-btn:hover {
  background: rgba(27, 38, 17, 0.24);
}

body.nokia-chrome .stat-pill {
  background: rgba(27, 38, 17, 0.12);
  border: 0;
  box-shadow: none;
  color: #1b2611;
  border-radius: 4px;
}

body.nokia-chrome .apple-dot {
  background: #1b2611;
  border-radius: 2px;
  box-shadow: none;
}

body.nokia-chrome .trophy-dot {
  color: #1b2611;
}

body.nokia-chrome .canvas-wrap {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--hud-bg);
  color: var(--hud-text);
  border-radius: 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.16);
  min-height: 46px;
  flex-shrink: 0;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--hud-text);
  flex-shrink: 0;
}

.brand-mark-img {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

body.nokia-chrome .brand-mark-img {
  filter: grayscale(1) contrast(1.25);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 13px;
  line-height: 1;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.apple-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.22);
}

.trophy-dot {
  color: #fbbf24;
  font-size: 13px;
}

.stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.stat-num {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hud-portal-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #f97316);
  color: #ffffff;
  white-space: nowrap;
}

.bonus-timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 11px;
  font-weight: 800;
  color: #fde047;
}

.bonus-track {
  width: 46px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.bonus-fill {
  height: 100%;
  width: 100%;
  background: #facc15;
  transition: width 0.08s linear;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Nokia Signal & Battery Indicators */
.nokia-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.nokia-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.nokia-signal i {
  display: block;
  width: 3px;
  background: #1b2611;
}

.nokia-signal i:nth-child(1) { height: 4px; }
.nokia-signal i:nth-child(2) { height: 7px; }
.nokia-signal i:nth-child(3) { height: 10px; }
.nokia-signal i:nth-child(4) { height: 13px; }

.nokia-bat {
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 10px;
  border: 2px solid #1b2611;
  padding: 1px;
  position: relative;
}

.nokia-bat::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: #1b2611;
}

.nokia-bat i {
  display: block;
  width: 100%;
  height: 100%;
  background: #1b2611;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--hud-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

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

.canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

#gameCanvas {
  display: block;
}

/* High-Impact Arcade Start & Game Over Overlay */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.65) 0%, rgba(15, 23, 42, 0.88) 100%);
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.2s ease;
  padding: 16px;
  z-index: 5;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-inner {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  padding: 22px 28px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  min-width: 200px;
  max-width: 88%;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

body.dark-chrome .overlay-inner {
  background: rgba(24, 34, 53, 0.96);
  color: #f1f5f9;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

body.nokia-chrome .overlay-inner {
  background: #8f9e78;
  color: #1b2611;
  border: 2px solid #1b2611;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  font-family: "Courier New", Courier, monospace;
}

.overlay-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}

.overlay-sub {
  font-size: 12.5px;
  color: #475569;
  margin: 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
}

body.dark-chrome .overlay-sub {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
}

body.nokia-chrome .overlay-sub {
  color: #1b2611;
  background: rgba(27, 38, 17, 0.14);
}

.play-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.play-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px) scale(1.02);
}

.play-btn:active {
  transform: scale(0.96);
}

body.nokia-chrome .play-btn {
  background: #1b2611;
  color: #9ead86;
  border: 1px solid #1b2611;
  box-shadow: none;
  border-radius: 6px;
}

/* Side Control Dock Beside Game */
.side-panel {
  width: 256px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* =========================================
   Standalone Brand Header & Slightly Bigger Logo
   (Separated from themes box for clean hierarchy)
   ========================================= */
.site-header {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 2px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.site-logo:hover {
  transform: translateY(-1px);
}

.site-logo-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.site-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.12;
}

.site-logo-name {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--panel-text);
}

.site-logo-x {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 17px;
  font-weight: 900;
  transition: background-color 0.2s ease;
}

.site-logo-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--panel-muted);
  margin-top: 2px;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header-nav a {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--panel-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.site-header-nav a:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* Prominent Portal Toggle Button */
.portal-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 2px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--panel-text);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.portal-toggle:hover {
  background: var(--btn-hover);
}

.portal-toggle.active {
  border-color: var(--portal-cyan);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(249, 115, 22, 0.14));
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.16);
}

.portal-rings {
  position: relative;
  width: 28px;
  height: 22px;
  flex-shrink: 0;
}

.ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid;
  top: 3px;
}

.ring-cyan {
  left: 0;
  border-color: var(--portal-cyan);
}

.ring-orange {
  right: 0;
  border-color: var(--portal-orange);
}

.portal-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.portal-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.portal-hint {
  font-size: 11px;
  color: var(--panel-muted);
  line-height: 1.2;
}

.portal-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.18);
  color: var(--panel-muted);
  letter-spacing: 0.04em;
}

.portal-toggle.active .portal-pill {
  background: linear-gradient(90deg, var(--portal-cyan), var(--portal-orange));
  color: #ffffff;
}

/* Quick Wall, Speed & Maze Toggles */
.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mini-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--panel-text);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mini-toggle:hover {
  background: var(--btn-hover);
}

.mini-toggle.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--btn-bg));
}

.mini-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--panel-muted);
}

.mini-toggle strong {
  font-size: 12px;
  font-weight: 800;
}

/* Theme Picker */
.theme-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.theme-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--panel-muted);
}

.theme-lock-note {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.theme-grid.is-locked .theme-chip {
  opacity: 0.52;
  cursor: not-allowed;
}

.theme-grid.is-locked .theme-chip.active {
  opacity: 0.9;
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.theme-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border-radius: 9px;
  border: 1.5px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--panel-text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  min-width: 0;
}

.theme-chip:hover {
  background: var(--btn-hover);
}

.theme-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--card-bg);
}

.swatch-pair {
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.swatch-pair span {
  width: 50%;
  height: 100%;
  display: block;
}

.theme-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Board Area: Holds Board Card + D-Pad */
.board-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

/* Mobile D-Pad (Arrow Buttons) */
.mobile-dpad {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

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

.dpad-btn {
  width: 58px;
  height: 44px;
  border: 1.5px solid var(--btn-border);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--panel-text);
  font-size: 18px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.08s ease, background-color 0.1s ease, color 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.dpad-btn:hover {
  background: var(--btn-hover);
}

.dpad-btn:active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  transform: scale(0.93);
}

/* Dark Chrome adaptation when dark themes are selected */
body.dark-chrome {
  --card-bg: #182235;
  --card-border: #2a3954;
  --panel-text: #f1f5f9;
  --panel-muted: #94a3b8;
  --btn-bg: #1e293b;
  --btn-hover: #283548;
  --btn-border: #334155;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* Responsive No-Scroll Layout for Vertical Screens, Tablets & Mobile */
@media (max-width: 860px), (orientation: portrait) {
  .hero-stage {
    min-height: 100dvh;
    padding: 8px 12px 14px;
    gap: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .app-shell {
    padding: 0;
  }

  .site-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2px 4px;
    flex-shrink: 0;
  }

  .site-header-nav {
    display: none;
  }

  .site-logo {
    gap: 9px;
  }

  .site-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .site-logo-name {
    font-size: 20px;
  }

  .site-logo-x {
    font-size: 16px;
  }

  .site-logo-tag {
    font-size: 10px;
  }

  .game-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 100%;
  }

  .board-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .board-card {
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
    margin: 0 auto;
  }

  .hud-bar {
    padding: 8px 12px;
    min-height: 42px;
    gap: 8px;
    border-radius: 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.16);
  }

  .stat-pill {
    padding: 4px 9px;
    font-size: 12px;
    gap: 5px;
  }

  .stat-label {
    font-size: 9px;
  }

  .stat-num {
    font-size: 14px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Arrow D-Pad is placed below the vertical game screen for users who scroll */
  .mobile-dpad {
    display: flex;
    margin-top: 14px;
    padding: 4px 0;
  }

  .side-panel {
    width: 100%;
    max-width: 480px;
    padding: 16px 0 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 12px;
    margin-top: 16px;
  }

  .quick-row {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    gap: 6px;
  }

  .theme-box {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin-top: 6px;
    width: 100%;
  }

  .theme-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .theme-chip {
    padding: 5px 6px;
    font-size: 10.5px;
  }

  .theme-chip:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .page-art-bg {
    background-size: 210px 210px;
  }
}

@media (max-width: 540px) {
  .hero-stage {
    padding: 6px 10px 10px;
  }

  .site-header {
    justify-content: center;
    text-align: center;
    padding: 2px 0 6px;
  }

  .site-header-nav {
    display: none;
  }

  .site-logo {
    gap: 9px;
  }

  .site-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .site-logo-name {
    font-size: 19px;
  }

  .site-logo-x {
    font-size: 16px;
    padding: 1px 5px;
  }

  .site-logo-tag {
    font-size: 9.5px;
  }

  .hud-bar {
    padding: 6px 10px;
    min-height: 40px;
    gap: 6px;
  }

  .hud-left {
    gap: 5px;
  }

  .brand-mark {
    display: none;
  }

  .stat-pill {
    padding: 3px 8px;
    font-size: 11.5px;
    gap: 4px;
  }

  .stat-label {
    font-size: 8.5px;
  }

  .stat-num {
    font-size: 13.5px;
  }

  .hud-actions {
    gap: 4px;
  }

  .icon-btn {
    width: 29px;
    height: 29px;
    border-radius: 7px;
  }

  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .dpad-btn {
    width: 56px;
    height: 44px;
    font-size: 18px;
    border-radius: 12px;
  }

  .dpad-mid {
    gap: 8px;
  }

  .quick-row {
    max-width: 340px;
    gap: 6px;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .theme-chip {
    padding: 6px 8px;
    font-size: 11px;
  }

  .theme-chip:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .scroll-hint-bar {
    font-size: 11px;
    padding: 4px 8px;
    gap: 5px;
  }

  .scroll-hint-bar a {
    padding: 2px 4px;
  }

  .editorial-card {
    padding: 18px 14px;
  }

  .editorial-card h1 {
    font-size: 1.45rem;
  }

  .editorial-card h2 {
    font-size: 1.25rem;
  }

  .feature-pills {
    gap: 6px;
  }

  .feature-pill {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* ================================
   Editorial, Guide, FAQ, Blog & Compliance Styles
   ================================ */
.scroll-hint-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  font-size: 12.5px;
  color: var(--panel-muted);
}

.scroll-hint-bar a {
  color: var(--panel-text);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.scroll-hint-bar a:hover {
  background: var(--btn-hover);
  color: var(--accent);
}

.scroll-hint-sep {
  opacity: 0.45;
  user-select: none;
}

.seo-content {
  width: 100%;
  max-width: 1080px;
  margin: 6px auto 28px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

.editorial-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
  padding: 28px 30px;
  line-height: 1.72;
  color: var(--panel-text);
}

.editorial-card h1 {
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  line-height: 1.24;
  margin-bottom: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.editorial-card h2 {
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  line-height: 1.3;
  margin-bottom: 14px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.editorial-card h3 {
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--panel-text);
}

.editorial-card p {
  color: var(--panel-text);
  margin-bottom: 13px;
  font-size: 0.98rem;
}

.editorial-card p:last-child {
  margin-bottom: 0;
}

.editorial-card .lead-text {
  font-size: 1.05rem;
  color: var(--panel-text);
}

.editorial-card ul,
.editorial-card ol {
  padding-left: 20px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.96rem;
}

.section-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.feature-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--panel-text);
}

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

.guide-subcard {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 14px;
  padding: 18px 20px;
}

.guide-subcard ul,
.guide-subcard ol {
  margin-bottom: 0;
}

.kbd-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  font-weight: 700;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-item {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.faq-item[open] {
  background: var(--card-bg);
  border-color: var(--accent);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-size: 1.01rem;
  color: var(--panel-text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: var(--panel-muted);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}

.faq-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--btn-border);
  color: var(--panel-text);
  font-size: 0.96rem;
}

.blog-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

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

.blog-teaser-card {
  background: var(--btn-bg);
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.blog-status-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--btn-border);
  color: var(--panel-muted);
}

.blog-teaser-card p {
  font-size: 0.92rem;
  color: var(--panel-muted);
  margin-bottom: 0;
}

.site-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto 32px;
  padding: 0 16px;
}

.footer-inner {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--panel-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--panel-text);
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-nav a {
  color: var(--panel-text);
  text-decoration: none;
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Subpages (About, Privacy, Terms, Contact) */
.subpage-shell {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
  gap: 18px;
}

.subpage-topbar {
  width: 100%;
  max-width: 920px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subpage-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--panel-text);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  transition: transform 0.15s ease;
}

.subpage-brand:hover {
  transform: translateY(-1px);
}

.subpage-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

@media (max-width: 680px) {
  .subpage-shell {
    padding: 14px 10px 30px;
    gap: 14px;
  }

  .subpage-topbar {
    padding: 10px 14px;
    gap: 10px;
    justify-content: center;
    text-align: center;
  }

  .subpage-topbar .footer-nav {
    justify-content: center;
    gap: 10px;
    font-size: 13px;
  }
}

.subpage-main {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
  font-size: 0.92rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--panel-text);
  font: inherit;
}

.contact-form button {
  align-self: flex-start;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  cursor: pointer;
}

.contact-status {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 860px) {
  .editorial-card {
    padding: 20px 18px;
  }

  .guide-grid,
  .blog-grid,
  .blog-archive-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Blog Archive Page Styles
   ================================ */
.blog-archive-hero {
  text-align: left;
}

.blog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 6px;
}

.blog-filter-btn {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--panel-text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.blog-filter-btn:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
}

.blog-filter-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.blog-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 1040px) and (min-width: 681px) {
  .blog-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.blog-card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.blog-cat-pill {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--accent);
}

.blog-read-time {
  color: var(--panel-muted);
  font-weight: 600;
}

.blog-card-title {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--panel-text);
  margin: 0;
}

.blog-card-excerpt {
  font-size: 0.92rem;
  color: var(--panel-muted);
  line-height: 1.58;
  margin: 0;
  flex-grow: 1;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-tag-chip {
  font-size: 11px;
  color: var(--panel-muted);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  padding: 2px 7px;
  border-radius: 6px;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--btn-border);
  font-size: 12px;
}

.blog-author-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--panel-muted);
  font-weight: 600;
}

.blog-author-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.blog-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.blog-view-all-btn:hover {
  opacity: 0.92;
  transform: translateX(2px);
}

/* ================================
   Blog Single Article Styles
   ================================ */
.article-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--btn-border);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--panel-muted);
  margin-bottom: 14px;
}

.breadcrumb-nav a {
  color: var(--panel-text);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  color: var(--panel-muted);
  margin-top: 12px;
}

.key-takeaways {
  background: var(--btn-bg);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 20px 0;
}

.key-takeaways h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: var(--accent);
}

.key-takeaways ul {
  margin-bottom: 0;
}

.editorial-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid var(--btn-border);
}

.editorial-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.editorial-table th {
  background: var(--btn-bg);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--panel-text);
  border-bottom: 1.5px solid var(--btn-border);
}

.editorial-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--btn-border);
  color: var(--panel-text);
}

.editorial-table tr:last-child td {
  border-bottom: none;
}

.callout-box {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
}

.callout-box.tip {
  border-left: 4px solid #10b981;
}

.callout-box.note {
  border-left: 4px solid var(--accent);
}

.callout-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--panel-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 18px 0;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-top: 32px;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.author-details h4 {
  margin: 0 0 4px 0;
  font-size: 1.02rem;
  color: var(--panel-text);
}

.author-details p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--panel-muted);
}

.related-articles-section {
  margin-top: 28px;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}

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

.x-contact-btn {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.x-contact-btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
  background: #111 !important;
}
