/* ============================================================
   QUIZ MASTER CHAMPS — Latin Vocabulary Meteor Defense
   Design tokens + component styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Type scale */
  --text-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.8rem);
  --text-sm: clamp(0.85rem, 0.8rem + 0.25vw, 0.95rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  --text-lg: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  --text-2xl: clamp(2.2rem, 1.6rem + 2.6vw, 4rem);
  --text-3xl: clamp(2.8rem, 1.8rem + 4vw, 5.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Surfaces — deep space */
  --color-bg: #05060a;
  --color-bg-2: #0b0f1c;
  --color-surface: rgba(232, 224, 200, 0.05);
  --color-surface-2: rgba(232, 224, 200, 0.09);
  --color-border: rgba(201, 162, 39, 0.32);
  --color-border-strong: rgba(201, 162, 39, 0.6);
  --color-divider: rgba(232, 224, 200, 0.12);

  /* Text — warm parchment */
  --color-text: #ece5d4;
  --color-text-muted: #9d97a6;
  --color-text-faint: #6b6678;
  --color-text-inverse: #1a1509;

  /* Accent — Roman gold/bronze */
  --color-primary: #c9a227;
  --color-primary-hover: #e0b93a;
  --color-primary-active: #a9860f;
  --color-primary-highlight: rgba(201, 162, 39, 0.16);

  /* Danger — Roman red */
  --color-danger: #b3432f;
  --color-danger-hover: #cc5540;
  --color-danger-highlight: rgba(179, 67, 47, 0.18);

  /* Success — verdigris */
  --color-success: #4f9d69;
  --color-success-highlight: rgba(79, 157, 105, 0.18);

  /* Warning — amber */
  --color-warning: #d98a2b;

  --radius-sm: 0.375rem;
  --radius-md: 0.6rem;
  --radius-lg: 1rem;
  --radius-xl: 1.4rem;
  --radius-full: 9999px;

  --transition-ui: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(201, 162, 39, 0.35);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'JetBrains Mono', 'Courier New', monospace;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

/* ---------- Canvas ---------- */
#game-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- UI layer ---------- */
#ui-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font-body);
}
#ui-layer button,
#ui-layer input,
#ui-layer textarea,
#ui-layer [data-interactive] {
  pointer-events: auto;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.hidden {
  display: none !important;
}

.veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(11, 15, 28, 0.55) 0%,
    rgba(5, 6, 10, 0.86) 70%
  );
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  padding: var(--space-8) var(--space-8);
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
}

/* ---------- Title screen ---------- */
#screen-title {
  --home-background: linear-gradient(180deg, #ffffff 0%, #f4f4f1 100%);
}
#screen-title[data-home-theme='blue'] {
  --home-background: radial-gradient(circle at 50% 10%, rgba(34, 105, 156, 0.9), rgba(8, 29, 54, 0.98) 72%);
}
#screen-title[data-home-theme='purple'] {
  --home-background: radial-gradient(circle at 50% 10%, rgba(102, 62, 137, 0.9), rgba(35, 18, 53, 0.98) 72%);
}
#screen-title[data-home-theme='green'] {
  --home-background: radial-gradient(circle at 50% 10%, rgba(48, 104, 78, 0.92), rgba(13, 38, 29, 0.98) 72%);
}
#screen-title[data-home-theme='red'] {
  --home-background: radial-gradient(circle at 50% 10%, rgba(137, 57, 58, 0.9), rgba(53, 18, 23, 0.98) 72%);
}
#screen-title[data-home-theme='sand'] {
  --home-background: radial-gradient(circle at 50% 10%, rgba(139, 108, 62, 0.92), rgba(53, 38, 21, 0.98) 72%);
}
#screen-title[data-home-theme='teal'] {
  --home-background: radial-gradient(circle at 50% 10%, #1f948c, #073b3a 72%);
}
#screen-title[data-home-theme='cyan'] {
  --home-background: radial-gradient(circle at 50% 10%, #218eaa, #073443 72%);
}
#screen-title[data-home-theme='orange'] {
  --home-background: radial-gradient(circle at 50% 10%, #c66a2d, #532810 72%);
}
#screen-title[data-home-theme='pink'] {
  --home-background: radial-gradient(circle at 50% 10%, #c45c83, #532137 72%);
}
#screen-title[data-home-theme='magenta'] {
  --home-background: radial-gradient(circle at 50% 10%, #a83d85, #451735 72%);
}
#screen-title[data-home-theme='indigo'] {
  --home-background: radial-gradient(circle at 50% 10%, #4d56a5, #181d53 72%);
}
#screen-title[data-home-theme='slate'] {
  --home-background: radial-gradient(circle at 50% 10%, #66758b, #252d3a 72%);
}
#screen-title[data-home-theme='black'] {
  --home-background: radial-gradient(circle at 50% 10%, #30333a, #050608 72%);
}
#screen-title[data-home-theme='olive'] {
  --home-background: radial-gradient(circle at 50% 10%, #7b8037, #343713 72%);
}
#screen-title[data-home-theme='chocolate'] {
  --home-background: radial-gradient(circle at 50% 10%, #8b4f36, #3b1c13 72%);
}
#screen-title > .veil {
  background: var(--home-background);
  transition: background 260ms ease;
}
.title-panel {
  width: min(1040px, 100%);
}
.home-panel {
  height: min(82vh, 760px);
  max-height: none;
  padding: var(--space-6);
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.home-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  letter-spacing: 0.04em;
  color: var(--color-primary);
  text-shadow: 0 0 30px rgba(201, 162, 39, 0.35);
  line-height: 1;
}

.game-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-top: 2px;
}

.deck-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  gap: var(--space-3);
  min-height: 210px;
  max-height: calc(82vh - 230px);
  margin-bottom: var(--space-5);
  overflow-y: auto;
  padding: 2px var(--space-2) var(--space-3) 2px;
  text-align: left;
}

.deck-label {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(20, 22, 28, 0.66);
  margin-bottom: var(--space-2);
}
#screen-title[data-home-theme='blue'] .deck-label,
#screen-title[data-home-theme='purple'] .deck-label,
#screen-title[data-home-theme='green'] .deck-label,
#screen-title[data-home-theme='red'] .deck-label,
#screen-title[data-home-theme='sand'] .deck-label,
#screen-title[data-home-theme='teal'] .deck-label,
#screen-title[data-home-theme='cyan'] .deck-label,
#screen-title[data-home-theme='orange'] .deck-label,
#screen-title[data-home-theme='pink'] .deck-label,
#screen-title[data-home-theme='magenta'] .deck-label,
#screen-title[data-home-theme='indigo'] .deck-label,
#screen-title[data-home-theme='slate'] .deck-label,
#screen-title[data-home-theme='black'] .deck-label,
#screen-title[data-home-theme='olive'] .deck-label,
#screen-title[data-home-theme='chocolate'] .deck-label {
  color: rgba(255, 255, 255, 0.72);
}

.deck-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: rgba(8, 10, 18, 0.64);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: var(--transition-ui);
  text-align: center;
}
.deck-option:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(16, 19, 31, 0.82);
  transform: translateY(-1px);
}
.deck-option.active {
  border-color: var(--color-primary);
  background: rgba(201, 162, 39, 0.2);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.14);
}
#screen-title[data-home-theme='space'] .deck-option {
  border-color: rgba(20, 22, 28, 0.2);
  background: rgba(255, 255, 255, 0.82);
}
#screen-title[data-home-theme='space'] .deck-option:hover {
  border-color: rgba(20, 22, 28, 0.42);
  background: #ffffff;
}
#screen-title[data-home-theme='space'] .deck-option.active {
  border-color: var(--color-primary);
  background: #fff8df;
}
#screen-title[data-home-theme='space'] .deck-option-name {
  color: #20222a;
}
.deck-option-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.custom-deck-options {
  display: contents;
}
.deck-option-wrap {
  position: relative;
  min-width: 0;
}
.deck-option-wrap .deck-option {
  width: 100%;
  height: 100%;
  padding-right: 42px;
}
.deck-trash-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(8, 10, 18, 0.72);
  color: #e7a297;
  cursor: pointer;
  transition: var(--transition-ui);
}
.deck-trash-button:hover,
.deck-trash-button:focus-visible {
  border-color: #c4513d;
  background: #9f3526;
  color: #fff;
  outline: none;
}
.deck-trash-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#screen-title[data-home-theme='space'] .deck-trash-button {
  border-color: rgba(20, 22, 28, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: #a63d2c;
}
#screen-title[data-home-theme='space'] .deck-trash-button:hover,
#screen-title[data-home-theme='space'] .deck-trash-button:focus-visible {
  background: #a63d2c;
  color: #fff;
}
.deck-empty {
  grid-column: 1 / -1;
  padding: var(--space-6) var(--space-4);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--text-sm);
  text-align: center;
}
.btn-row.home-actions {
  justify-content: flex-start;
}
#screen-title[data-home-theme='space'] .home-actions .btn:not(.btn-primary) {
  border-color: rgba(20, 22, 28, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: #20222a;
}
#screen-title[data-home-theme='space'] .home-actions .btn:not(.btn-primary):hover {
  border-color: rgba(20, 22, 28, 0.42);
  background: #ffffff;
}
.home-actions .btn-primary {
  min-width: 112px;
}
.home-settings-wrap {
  position: relative;
}
.home-settings-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: rgba(8, 10, 18, 0.58);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-ui);
}
.home-settings-button:hover,
.home-settings-button[aria-expanded='true'] {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.home-settings-button svg {
  width: 16px;
  height: 16px;
}
#screen-title[data-home-theme='space'] .home-settings-button,
html[data-home-theme='space'] .top-right-controls .login-placeholder-btn,
html[data-home-theme='space'] .top-right-controls .icon-btn {
  border-color: rgba(20, 22, 28, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: #3a3d46;
}
#screen-title[data-home-theme='space'] .home-settings-button svg,
html[data-home-theme='space'] .top-right-controls .icon-btn svg {
  color: #3a3d46;
}
.home-color-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 5;
  width: 210px;
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: rgba(7, 9, 16, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
.home-color-menu > span {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.home-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-2);
}
.home-color-swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.home-color-swatch[aria-pressed='true'] {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
}
.swatch-space { background: #ffffff; }
.swatch-blue { background: #22699c; }
.swatch-purple { background: #663e89; }
.swatch-green { background: #30684e; }
.swatch-red { background: #89393a; }
.swatch-sand { background: #8b6c3e; }
.swatch-teal { background: #1f948c; }
.swatch-cyan { background: #218eaa; }
.swatch-orange { background: #c66a2d; }
.swatch-pink { background: #c45c83; }
.swatch-magenta { background: #a83d85; }
.swatch-indigo { background: #4d56a5; }
.swatch-slate { background: #66758b; }
.swatch-black { background: #111216; }
.swatch-olive { background: #7b8037; }
.swatch-chocolate { background: #8b4f36; }

/* ---------- Settings screen ---------- */
#screen-settings,
#screen-community,
#screen-account-settings,
#screen-account-details,
#screen-recovery-email,
#screen-password-recovery {
  z-index: 25;
}
#screen-settings > .veil,
#screen-community > .veil,
#screen-account-settings > .veil,
#screen-account-details > .veil,
#screen-recovery-email > .veil,
#screen-password-recovery > .veil {
  background: rgba(244, 244, 241, 0.82);
  backdrop-filter: blur(8px);
}
.settings-panel {
  width: min(760px, 100%);
  max-height: min(90vh, 820px);
  border-color: rgba(20, 22, 28, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 60px rgba(31, 32, 38, 0.16);
  color: #20222a;
}

/* ---------- Online community ---------- */
.community-panel {
  width: min(1040px, 100%);
  max-height: min(92vh, 860px);
  border-color: rgba(20, 22, 28, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: #20222a;
}
.community-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.community-header h2 {
  color: #20222a;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.community-header .btn,
.community-panel .btn:not(.btn-primary) {
  border-color: rgba(20, 22, 28, 0.2);
  background: #ffffff;
  color: #20222a;
}
.community-search-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.community-search-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.community-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 470px;
  margin-top: var(--space-5);
}
.community-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 18px;
  border-right: 1px solid rgba(20, 22, 28, 0.16);
}
.community-nav-option {
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #737680;
  font: 750 var(--text-sm)/1.2 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.community-nav-option:hover,
.community-nav-option:focus-visible {
  background: #f3f1ea;
  color: #20222a;
  outline: none;
}
.community-nav-option.active {
  background: #20222a;
  color: #fff;
}
.community-content {
  min-width: 0;
  padding-left: 24px;
  padding-right: 24px;
}
.community-section-title {
  margin: 0 0 var(--space-4);
  color: #20222a;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}
.community-toolbar {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.community-search {
  flex: 1;
  min-height: 46px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(20, 22, 28, 0.2);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #20222a;
  font: var(--text-sm) var(--font-body);
}
.community-search:focus {
  border-color: var(--color-primary-active);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.16);
  outline: none;
}
.community-login-required {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-md);
  background: #fff8df;
  color: #4d431d;
  font-size: var(--text-sm);
}

.community-publish-picker {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid rgba(36, 37, 44, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(31, 33, 40, 0.1);
}

.community-publish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.community-publish-header h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.community-own-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.community-own-deck {
  min-height: 108px;
  padding: 14px;
  border: 1px solid rgba(36, 37, 44, 0.16);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.community-own-deck:hover,
.community-own-deck:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 10px 22px rgba(31, 33, 40, 0.12);
}

.community-own-deck-name {
  display: block;
  font-weight: 800;
  line-height: 1.2;
}

.community-own-deck-count {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}
.community-status {
  min-height: 1.5em;
  margin-bottom: var(--space-3);
  color: #737680;
  font-size: var(--text-xs);
}
.community-status.error {
  color: var(--color-danger);
}
.community-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-4);
}
.community-deck-card {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  padding: var(--space-4);
  border: 1px solid rgba(20, 22, 28, 0.14);
  border-radius: var(--radius-lg);
  background: #f8f7f3;
  box-shadow: var(--shadow-sm);
}
.community-deck-name {
  margin-bottom: var(--space-2);
  color: #20222a;
  font-size: var(--text-base);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.community-deck-count {
  color: #777a83;
  font-size: var(--text-xs);
}
.community-deck-use {
  align-self: flex-start;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  min-height: 36px;
}
.community-deck-author {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(20, 22, 28, 0.1);
  color: #686b74;
  font-size: var(--text-xs);
}
.community-empty {
  grid-column: 1 / -1;
  padding: var(--space-8);
  color: #777a83;
  text-align: center;
}
.community-ranking-row {
  display: grid;
  grid-template-columns: 38px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(20, 22, 28, 0.1);
}
.community-ranking-place {
  color: #737680;
  font-size: 0.78rem;
  font-weight: 850;
}
.community-ranking-row:nth-child(-n + 3) .community-ranking-place {
  color: #a27800;
}
.community-ranking-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(20, 22, 28, 0.14);
  border-radius: 50%;
  background-color: #eeeae0;
}
.community-ranking-name {
  min-width: 0;
  overflow: hidden;
  color: #2a2c33;
  font-size: 0.82rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-ranking-score {
  color: var(--color-primary-active);
  font-size: 0.86rem;
  font-weight: 900;
}
.community-ranking-empty {
  padding: 26px 8px;
  color: #777a83;
  font-size: 0.8rem;
  text-align: center;
}
.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(20, 22, 28, 0.12);
}
.settings-header h2 {
  color: #20222a;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.settings-header .btn,
.settings-panel .btn:not(.btn-primary) {
  border-color: rgba(20, 22, 28, 0.2);
  background: #ffffff;
  color: #20222a;
}
.settings-section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid rgba(20, 22, 28, 0.12);
}
.settings-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.settings-section h3 {
  margin-bottom: var(--space-3);
  color: #20222a;
  font-size: var(--text-base);
}
.settings-color-swatches {
  grid-template-columns: repeat(8, 32px);
  justify-content: start;
}
.settings-color-swatches .home-color-swatch {
  width: 32px;
  height: 32px;
  border-color: rgba(20, 22, 28, 0.2);
}
.settings-color-swatches .home-color-swatch[aria-pressed='true'] {
  border-color: #20222a;
}
.settings-signed-out {
  padding: var(--space-7) 0 0;
  color: #686b74;
}
.settings-signed-out p {
  margin-bottom: var(--space-4);
}
.settings-account-link {
  padding: var(--space-5) 0 0;
}
.account-settings-panel {
  width: min(760px, 100%);
}
.account-email-panel {
  width: min(520px, 100%);
}
.recovery-panel {
  width: min(520px, 100%);
  color: #20222a;
}
.recovery-panel h2 {
  margin-bottom: var(--space-3);
  color: #20222a;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.recovery-link-row {
  margin-top: var(--space-4);
}
.recovery-email-card {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  border: 1px solid rgba(20, 22, 28, 0.14);
  border-radius: var(--radius-lg);
  background: #f7f6f1;
  color: #3a3d46;
  line-height: 1.6;
}
.recovery-code-display {
  margin: var(--space-4) 0;
  color: #20222a;
  font-family: var(--font-body);
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-align: center;
}
.recovery-code-input {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
}
.recovery-actions {
  justify-content: flex-start;
}
.settings-help {
  margin-bottom: var(--space-4);
  color: #686b74;
  font-size: var(--text-xs);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: var(--space-3);
}
.avatar-option {
  display: grid;
  min-height: 94px;
  place-items: center;
  padding: var(--space-2);
  border: 2px solid rgba(20, 22, 28, 0.12);
  border-radius: var(--radius-lg);
  background: #f7f6f1;
  cursor: pointer;
  transition: var(--transition-ui);
}
.avatar-portrait {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background-image: url('./assets/profile-people-v1.png');
  background-repeat: no-repeat;
  background-position: calc(var(--avatar-col) * 25%) calc(var(--avatar-row) * 33.3333%);
  background-size: 500% 400%;
  box-shadow: inset 0 0 0 1px rgba(20, 22, 28, 0.08);
}
.avatar-portrait.avatar-set-2 {
  background-image: url('./assets/profile-people-v2.png');
  background-position: calc(var(--avatar-col) * 25%) calc(var(--avatar-row) * 50%);
  background-size: 500% 300%;
}
.avatar-portrait.avatar-set-3 {
  background-image: url('./assets/profile-people-v3.png');
  background-position: calc(var(--avatar-col) * 25%) calc(var(--avatar-row) * 25%);
  background-size: 500% 500%;
}
.avatar-portrait.avatar-set-4 {
  background-image: url('./assets/profile-people-v4.png');
  background-position: calc(var(--avatar-col) * 25%) calc(var(--avatar-row) * 25%);
  background-size: 500% 500%;
}
.avatar-option:hover {
  border-color: rgba(201, 162, 39, 0.6);
  transform: translateY(-2px);
}
.avatar-option[aria-pressed='true'] {
  border-color: var(--color-primary-active);
  background: rgba(201, 162, 39, 0.13);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.13);
}
.login-avatar {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.settings-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  color: #3a3d46;
  font-size: var(--text-sm);
  cursor: pointer;
}
.settings-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--color-primary-active);
}
.settings-status {
  min-height: 1.5em;
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  color: #737680;
  font-size: var(--text-xs);
}
.settings-status.error {
  color: var(--color-danger);
}

.btn-row {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: var(--transition-ui);
  min-height: 44px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(180deg, var(--color-primary-hover), var(--color-primary));
  color: var(--color-text-inverse);
  border-color: var(--color-primary-active);
  box-shadow: var(--shadow-glow);
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f0cd4c, var(--color-primary-hover));
}
.btn-danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.btn-danger:hover {
  background: var(--color-danger-highlight);
}

.instructions {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.7;
}
.instructions kbd {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-primary);
}

.top-right-controls {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  display: flex;
  gap: var(--space-2);
  z-index: 20;
}

.login-placeholder-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-ui);
}
.login-placeholder-btn:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-height: unset;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.icon-btn:hover {
  border-color: var(--color-border-strong);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-text);
}

/* ---------- Account modal ---------- */
#screen-auth {
  z-index: 30;
}
#screen-auth > .veil {
  background: rgba(244, 244, 241, 0.78);
  backdrop-filter: blur(8px);
}
.auth-panel {
  width: min(460px, 100%);
  border-color: rgba(20, 22, 28, 0.14);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 60px rgba(31, 32, 38, 0.16);
  color: #20222a;
}
.auth-panel h2 {
  margin-bottom: var(--space-2);
  color: #20222a;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.auth-eyebrow,
.auth-label {
  color: #737680;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-eyebrow {
  margin-bottom: var(--space-1);
}
.auth-help {
  margin-bottom: var(--space-5);
  color: #686b74;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.auth-label {
  display: block;
  margin-bottom: var(--space-1);
}
.auth-input {
  width: 100%;
  min-height: 46px;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(20, 22, 28, 0.2);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #20222a;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.auth-input:focus {
  border-color: var(--color-primary-active);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.16);
  outline: none;
}
.auth-password-row {
  position: relative;
}
.auth-password-row .auth-input {
  padding-right: 78px;
}
.auth-show-password {
  position: absolute;
  top: 7px;
  right: 7px;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid rgba(20, 22, 28, 0.18);
  border-radius: var(--radius-sm);
  background: #f4f4f1;
  color: #3a3d46;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
}
.auth-login-hint {
  margin: calc(-1 * var(--space-1)) 0 var(--space-4);
}
.auth-hint-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary-active);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.auth-hint-text {
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: 1px solid rgba(20, 22, 28, 0.14);
  border-radius: var(--radius-md);
  background: #f7f6f1;
  color: #3a3d46;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.auth-error {
  min-height: 1.5em;
  margin-bottom: var(--space-3);
  color: var(--color-danger);
  font-size: var(--text-xs);
}
.auth-actions {
  justify-content: flex-start;
}
.auth-actions .btn:not(.btn-primary):not(.btn-danger) {
  border-color: rgba(20, 22, 28, 0.2);
  background: #ffffff;
  color: #20222a;
}
.auth-guest-button {
  width: 100%;
  margin-top: var(--space-4);
  border-color: rgba(20, 22, 28, 0.2);
  background: #f4f4f1;
  color: #20222a;
}
.auth-guest-button:hover {
  border-color: var(--color-primary-active);
  background: #fff8df;
}
.auth-note {
  margin-top: var(--space-5);
  color: #858790;
  font-size: 0.68rem;
  line-height: 1.5;
}
.auth-signed-in-name {
  margin: var(--space-6) 0 var(--space-1);
  color: var(--color-primary-active);
  font-size: var(--text-xl);
  font-weight: 700;
}
.auth-account-status {
  min-height: 1.5em;
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  color: #737680;
  font-size: var(--text-xs);
}

/* ---------- Editor modal ---------- */
.editor-panel {
  width: min(640px, 100%);
}
.editor-panel h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.editor-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}
.editor-help code {
  color: var(--color-primary);
  background: var(--color-surface-2);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
}
.deck-name-label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.deck-name-input {
  width: 100%;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.deck-name-input:focus {
  border-color: var(--color-primary);
}
textarea#deck-editor {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}
textarea#deck-editor:focus {
  border-color: var(--color-primary);
}

.editor-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: var(--space-3);
  padding-right: var(--space-1);
}
.editor-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}
.editor-field {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.editor-field-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.editor-bar {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  min-height: 44px;
}
.editor-bar:focus {
  border-color: var(--color-primary);
  outline: none;
}
.editor-bar-question {
  border-left: 3px solid var(--color-border-strong);
}
.editor-bar-answer {
  border-left: 3px solid var(--color-primary);
}
.editor-row-remove {
  flex: 0 0 auto;
  width: 36px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-ui);
}
.editor-row-remove:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
  background: var(--color-danger-highlight);
}
.editor-add-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  color: var(--color-primary);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: var(--transition-ui);
}
.editor-add-link:hover {
  text-decoration-color: var(--color-primary);
  color: var(--color-primary-hover);
}
.editor-rows::-webkit-scrollbar {
  width: 6px;
}
.editor-rows::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
}
@media (max-width: 520px) {
  .editor-row {
    flex-wrap: wrap;
  }
  .editor-field {
    flex: 1 1 100%;
  }
  .editor-row-remove {
    margin-left: auto;
  }
}
.editor-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  min-height: 1.4em;
  margin-bottom: var(--space-3);
}
.editor-status {
  font-size: var(--text-xs);
  color: var(--color-success);
  min-height: 1.4em;
}
.editor-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.editor-note strong {
  color: var(--color-text-muted);
}

/* ---------- Deck ready screen ---------- */
#screen-ready > .veil {
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f1 100%);
}
.ready-panel {
  width: min(520px, 100%);
  padding: var(--space-8);
  border-color: rgba(20, 22, 28, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 60px rgba(31, 32, 38, 0.12);
  text-align: center;
}
.ready-eyebrow {
  margin-bottom: var(--space-2);
  color: #777a83;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ready-deck-name {
  color: #20222a;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
}
.ready-high-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-8) 0;
}
.ready-high-score span {
  color: #777a83;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ready-high-score strong {
  color: var(--color-primary-active);
  font-size: clamp(3rem, 10vw, 5rem);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
}
.ready-leaderboard {
  width: 100%;
  margin: var(--space-6) 0 var(--space-7);
  padding: 18px;
  border: 1px solid rgba(20, 22, 28, 0.14);
  border-radius: var(--radius-lg);
  background: #f8f7f3;
  text-align: left;
}
.ready-leaderboard-label {
  margin: 0;
  color: #777a83;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ready-leaderboard h3 {
  margin: 3px 0 10px;
  color: #20222a;
  font-family: var(--font-display);
  font-size: 1.55rem;
}
.ready-ranking-list {
  max-height: 275px;
  overflow-y: auto;
  padding-right: 6px;
}
.ready-actions .btn:not(.btn-primary) {
  border-color: rgba(20, 22, 28, 0.2);
  background: #ffffff;
  color: #20222a;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  gap: var(--space-4);
}

.hud-cluster {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hud-chip {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  backdrop-filter: blur(10px);
  min-width: 84px;
  text-align: center;
}
.hud-chip-label {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: 2px;
}
.hud-chip-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums lining-nums;
}
.hud-chip-value.danger {
  color: var(--color-danger);
}

#shield-wrap {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 82vw);
  text-align: center;
}
.shield-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.shield-track {
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.shield-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-success), #8fc98f);
  transition: width 220ms ease-out, background 300ms ease-out;
}

/* ---------- Input bar ---------- */
#input-bar {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: min(480px, 90vw);
}
.answering-hint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  height: 1.4em;
  letter-spacing: 0.04em;
}
.answering-hint strong {
  color: var(--color-primary);
  font-weight: 600;
}
#answer-input {
  width: 100%;
  background: rgba(5, 6, 10, 0.72);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  text-align: center;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  transition: var(--transition-ui);
}
#answer-input::placeholder {
  color: var(--color-text-faint);
}
#answer-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-highlight);
}
#answer-input.input-match {
  border-color: var(--color-success);
  box-shadow: 0 0 0 4px var(--color-success-highlight);
}

/* ---------- Pause / Game Over ---------- */
.result-panel {
  width: min(560px, 100%);
  text-align: center;
}
.result-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.result-title.danger {
  color: var(--color-danger);
}
.result-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin: var(--space-6) 0;
  flex-wrap: wrap;
}
.result-stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
}
.result-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.missed-list {
  text-align: left;
  margin: var(--space-4) 0 var(--space-6);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
}
.missed-list h3 {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding: var(--space-3) var(--space-4) 0;
}
.missed-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
}
.missed-row:last-child {
  border-bottom: none;
}
.missed-term {
  color: var(--color-primary);
  font-weight: 600;
}
.missed-answer {
  color: var(--color-text-muted);
}
.missed-empty {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  text-align: center;
}

/* ---------- Level up toast ---------- */
#level-toast {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  text-shadow: 0 0 30px rgba(201, 162, 39, 0.6);
  opacity: 0;
  transition: opacity 260ms ease-out, transform 260ms ease-out;
  pointer-events: none;
  text-align: center;
}
#level-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- Debug overlay ---------- */
#debug-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.75);
  color: #4ee08a;
  font: 11px/1.5 'JetBrains Mono', monospace;
  padding: 4px 8px;
  pointer-events: none;
  white-space: pre;
}

/* ---------- Scrollbars ---------- */
.panel::-webkit-scrollbar,
.missed-list::-webkit-scrollbar {
  width: 8px;
}
.panel::-webkit-scrollbar-thumb,
.missed-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .panel {
    padding: var(--space-6) var(--space-5);
  }
  .home-panel {
    height: 88vh;
    padding: var(--space-4) 0;
  }
  .home-header {
    margin-bottom: var(--space-6);
  }
  .home-brand {
    gap: var(--space-2);
  }
  .home-brand .brand-mark {
    display: none;
  }
  .deck-select {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(88vh - 220px);
  }
  .home-actions {
    justify-content: center;
  }
  .home-actions .btn {
    flex: 1 1 120px;
  }
  .game-title {
    font-size: var(--text-2xl);
  }
  #shield-wrap {
    bottom: 84px;
  }
  .hud-chip {
    min-width: 64px;
    padding: var(--space-2) var(--space-2);
  }
  .result-stats {
    gap: var(--space-4);
  }
  .settings-panel {
    padding: var(--space-5);
  }
  .avatar-grid {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }
  .settings-color-swatches {
    grid-template-columns: repeat(4, 32px);
  }
  .community-panel {
    padding: var(--space-5);
  }
  .community-toolbar {
    flex-direction: column;
  }
  .community-layout {
    grid-template-columns: 105px minmax(0, 1fr);
  }
  .community-sidebar {
    padding-right: 10px;
  }
  .community-nav-option {
    padding: 11px 9px;
    font-size: 0.76rem;
  }
  .community-content {
    padding-left: 12px;
    padding-right: 0;
  }
  .community-own-deck-grid,
  .community-deck-grid {
    grid-template-columns: 1fr;
  }
}
