/* ==================================================================
   Phase 6 — Agent META-UI (js/ui-meta.js).
   Leaderboard / run summary / achievements / profile chip / name modal.

   Layers (self-created by js/ui-meta.js, below #help-layer at 70):
     #meta-layer        z 61 — full panels (above #start-layer at 60)
     #meta-modal-layer  z 63 — small modals (promptName)
     #meta-toast-layer  z 65 — achievement toasts + "Copied!" feedback

   Palette per ARCHITECTURE.md §Style + the Pass-3 arcade chrome in
   screens.css: deep space, brass/gold bezels, cyan glow, coral danger.
   Phone-first: works at 320px wide, ≥44px targets, safe-area insets,
   clamp() typography. Vars scoped to our own layers (like trivia.css).
   ================================================================== */
#meta-layer,
#meta-modal-layer,
#meta-toast-layer,
.meta-profile {
  --meta-space-1: #080a24;
  --meta-space-2: #101442;
  --meta-coral: #ff5d6c;
  --meta-gold: #ffc857;
  --meta-cyan: #43d9ff;
  --meta-ink: #f4f7ff;
  --meta-muted: rgba(200, 210, 242, 0.78);
  --meta-brass: rgba(207, 145, 42, 0.86);
  --meta-radius: 14px;
  font-family: 'Baloo 2', 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
}

/* ---- Layers -------------------------------------------------------- */
#meta-layer,
#meta-modal-layer,
#meta-toast-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#meta-layer { z-index: 61; }
#meta-modal-layer { z-index: 63; }
#meta-toast-layer {
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}
#meta-layer.meta-active,
#meta-modal-layer.meta-active { pointer-events: auto; }

/* ---- Backdrop + panel card ----------------------------------------- */
.meta-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    calc(12px + env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px))
    calc(12px + env(safe-area-inset-left, 0px));
  background:
    radial-gradient(circle at 50% 62%, rgba(33, 219, 255, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(1, 4, 13, 0.9), rgba(2, 5, 16, 0.97));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: meta-fade-in 0.28s ease-out;
  touch-action: pan-y;
}
@keyframes meta-fade-in { from { opacity: 0; } to { opacity: 1; } }

.meta-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(16px, 4vw, 26px) clamp(14px, 4vw, 26px) clamp(18px, 4.5vw, 28px);
  text-align: center;
  color: var(--meta-ink);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 215, 103, 0.13), transparent 28%, rgba(51, 229, 255, 0.09)),
    radial-gradient(circle at 50% 0, rgba(51, 229, 255, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(8, 16, 36, 0.96), rgba(1, 5, 14, 0.99));
  border: 3px solid var(--meta-brass);
  box-shadow:
    0 22px 66px rgba(0, 0, 0, 0.74),
    0 0 42px rgba(51, 229, 255, 0.24),
    inset 0 0 0 3px rgba(1, 4, 12, 0.84),
    inset 0 1px 0 rgba(255, 239, 184, 0.24);
  animation: meta-pop-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.meta-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(51, 229, 255, 0.26);
  border-radius: 5px;
  pointer-events: none;
}
.meta-panel > * { position: relative; z-index: 1; }
@keyframes meta-pop-in {
  0%   { transform: scale(0.84) translateY(16px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.meta-panel-title {
  padding-right: 40px;
  padding-left: 40px;
  font-size: clamp(22px, 5.6vw, 32px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #ffdc68;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.64), 0 0 18px rgba(255, 207, 75, 0.62);
}

.meta-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(67, 217, 255, 0.55);
  background: linear-gradient(180deg, rgba(27, 35, 104, 0.92), rgba(8, 10, 36, 0.95));
  color: #dffaff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(67, 217, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}
.meta-close-btn:hover { transform: translateY(-1px) scale(1.05); }
.meta-close-btn:active { transform: scale(0.94); }
.meta-close-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.9); }

/* Buttons inside meta panels: reuse .btn/.btn-primary/.btn-secondary from
   screens.css; .meta-btn relaxes their fixed min-width for narrow phones. */
.meta-btn {
  min-width: 0;
  margin-top: 0;
  touch-action: manipulation;
}
.meta-btn-primary { width: min(340px, 100%); }

/* ---- Loading / empty / offline states ------------------------------ */
.meta-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(22px, 7vw, 40px) 10px;
}
.meta-state-icon { font-size: clamp(34px, 9vw, 48px); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.meta-state-title {
  font-size: clamp(18px, 4.6vw, 24px);
  font-weight: 900;
  color: #ffdc68;
  text-shadow: 0 0 12px rgba(255, 207, 75, 0.45);
}
.meta-state-text {
  max-width: 380px;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 600;
  color: var(--meta-muted);
  line-height: 1.45;
}
.meta-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(67, 217, 255, 0.18);
  border-top-color: var(--meta-cyan);
  box-shadow: 0 0 14px rgba(67, 217, 255, 0.35);
  animation: meta-spin 0.9s linear infinite;
}
@keyframes meta-spin { to { transform: rotate(360deg); } }

/* ==================================================================
   Leaderboard
   ================================================================== */
.meta-lb-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.meta-lb-tab {
  flex: 1 1 0;
  max-width: 150px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px 6px;
  border-radius: 999px;
  border: 2px solid rgba(67, 217, 255, 0.32);
  background: rgba(6, 10, 34, 0.6);
  color: var(--meta-muted);
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
}
.meta-lb-tab:hover { transform: translateY(-1px); color: #dffaff; }
.meta-lb-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.9); }
.meta-lb-tab.active {
  color: #1a0a12;
  border-color: rgba(255, 233, 154, 0.86);
  background: linear-gradient(180deg, #ffd766, #ffab3d);
  box-shadow: 0 4px 16px rgba(255, 168, 61, 0.45), 0 0 18px rgba(255, 200, 87, 0.35);
  text-shadow: none;
}

/* ---- Campaign bridge + comfort settings --------------------------- */
.meta-coach {
  margin: 12px 0 2px;
  padding: 11px 14px;
  text-align: left;
  border: 1px solid rgba(67, 217, 255, 0.28);
  border-radius: 12px;
  background: rgba(7, 22, 45, 0.68);
}
.meta-coach-title { color: #ffdc68; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.meta-coach-row { margin-top: 5px; color: #dffaff; font-size: 14px; font-weight: 800; }
.meta-coach-practice { color: #ffcf9f; }

.meta-reward-list { display: grid; gap: 10px; margin-top: 18px; }
.meta-reward-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 11px 14px;
  border: 1px solid rgba(67, 217, 255, 0.34);
  border-radius: 14px;
  background: linear-gradient(110deg, rgba(13, 29, 67, .9), rgba(6, 10, 32, .9));
  color: var(--meta-ink);
  cursor: pointer;
  text-align: left;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.meta-reward-card:hover, .meta-reward-card:focus-visible { transform: translateY(-2px); border-color: #ffdc68; box-shadow: 0 8px 22px rgba(0,0,0,.35), 0 0 18px rgba(255,200,87,.2); outline: none; }
.meta-reward-list-locked { pointer-events: none; }
.meta-reward-list-locked .meta-reward-card:not(.meta-reward-card-selected) {
  opacity: .32;
  filter: saturate(.45);
  transform: scale(.985);
}
.meta-reward-card-selected {
  border-color: #ffe58b;
  box-shadow: 0 0 0 2px rgba(255, 229, 139, .28), 0 0 28px rgba(255, 201, 67, .42);
  animation: meta-reward-lock 340ms cubic-bezier(.2, .8, .2, 1) both;
}
.meta-reward-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255, 220, 104, .65); border-radius: 50%; color: #ffdc68; font-size: 25px; background: #071229; box-shadow: 0 0 14px rgba(67,217,255,.22); }
.meta-reward-copy { min-width: 0; }
.meta-reward-title { color: #f5fbff; font-size: 17px; font-weight: 900; }
.meta-reward-detail { margin-top: 2px; color: var(--meta-muted); font-size: 13px; font-weight: 600; line-height: 1.3; }

.meta-sector { overflow: hidden; }
.meta-sector-starfield { position: absolute; inset: 0; opacity: .62; pointer-events: none; background: radial-gradient(circle at 20% 22%, var(--sector-accent, #43d9ff) 0 1px, transparent 2px), radial-gradient(circle at 75% 16%, #fff 0 1px, transparent 2px), radial-gradient(circle at 52% 54%, var(--sector-accent, #43d9ff), transparent 50%); background-size: 86px 96px, 130px 110px, 100% 100%; mask-image: linear-gradient(180deg, #000, transparent 74%); }
.meta-sector-level { margin: 7px 0 14px; color: var(--sector-accent, #43d9ff); font-size: 14px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
/* Commander brief: the objective card. Was a bare "⚠ Commander encounter"
   pill; it now has to actually teach the fight, so it became a card. */
.meta-sector-boss {
  margin: 14px auto 0;
  padding: 12px 14px;
  max-width: 420px;
  border: 1px solid rgba(255, 94, 100, 0.68);
  border-radius: 12px;
  color: #ffd0d3;
  background: rgba(123, 18, 36, 0.34);
  text-align: left;
}
.meta-sector-boss-kicker {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff9aa0;
}
.meta-sector-boss-goal {
  margin-top: 4px;
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--meta-gold);
  text-shadow: 0 0 14px rgba(255, 200, 87, 0.45);
}
/* Preview of the in-game hull pips, so the readout is already familiar. */
.meta-sector-boss-pips { display: flex; gap: 7px; margin: 9px 0 2px; }
.meta-sector-boss-pip {
  width: 13px;
  height: 13px;
  transform: rotate(45deg);
  background: var(--meta-coral);
  border: 2px solid var(--meta-gold);
  box-shadow: 0 0 9px rgba(255, 90, 95, 0.6);
}
.meta-sector-boss-notes {
  margin: 9px 0 0;
  padding-left: 16px;
  display: grid;
  gap: 4px;
  font-size: clamp(11px, 2.9vw, 12.5px);
  font-weight: 700;
  line-height: 1.35;
  color: #ffe0e2;
}
.meta-sector-boss-notes li { list-style: '› '; }
.meta-sector .meta-btn { margin-top: 22px; }

.meta-transitioning { overflow: hidden; }
.meta-transitioning .meta-panel { pointer-events: none; }
.meta-panel-exit {
  animation: meta-panel-exit 340ms cubic-bezier(.4, 0, .2, 1) both !important;
}
.meta-transition-cue {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  width: min(86vw, 430px);
  padding: 12px 18px 11px;
  border: 1px solid rgba(255, 224, 128, .86);
  background:
    linear-gradient(90deg, transparent, rgba(53, 223, 255, .12), transparent),
    rgba(1, 8, 20, .94);
  box-shadow:
    inset 0 0 0 3px rgba(0, 3, 10, .72),
    0 0 26px rgba(53, 223, 255, .28),
    0 0 38px rgba(255, 201, 67, .14);
  color: #fff0b0;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 900;
  letter-spacing: .2em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 207, 75, .58);
  pointer-events: none;
  animation: meta-transition-cue 340ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes meta-reward-lock {
  0% { transform: scale(1); }
  45% { transform: scale(1.018); }
  100% { transform: scale(.985); }
}
@keyframes meta-panel-exit {
  0% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
  28% { transform: scale(1.008) translateY(0); opacity: 1; filter: blur(0); }
  100% { transform: scale(.975) translateY(-18px); opacity: 0; filter: blur(2px); }
}
@keyframes meta-transition-cue {
  0% { transform: translate(-50%, -42%) scale(.92); opacity: 0; }
  24%, 72% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -56%) scale(1.035); opacity: 0; }
}

.meta-settings-list { display: grid; gap: 9px; margin: 18px 0; text-align: left; }
.meta-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid rgba(67,217,255,.23); border-radius: 12px; background: rgba(5, 13, 33, .64); }
.meta-setting-copy { min-width: 0; }
.meta-setting-title { color: #f5fbff; font-size: 15px; font-weight: 900; }
.meta-setting-detail { margin-top: 2px; color: var(--meta-muted); font-size: 12px; font-weight: 600; line-height: 1.25; }
.meta-setting-toggle { position: relative; flex: 0 0 54px; width: 54px; height: 30px; border: 2px solid rgba(67,217,255,.48); border-radius: 999px; background: #060b22; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.meta-setting-toggle::after { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #94a6c9; content: ''; transition: transform .16s ease, background .16s ease; }
.meta-setting-toggle.is-on { border-color: #ffdc68; background: rgba(255, 181, 54, .26); }
.meta-setting-toggle.is-on::after { background: #fff0ba; transform: translateX(24px); }
.meta-setting-toggle:focus-visible { outline: 3px solid #43d9ff; outline-offset: 2px; }

@media (max-width: 390px) {
  .meta-reward-card { min-height: 70px; padding: 9px 10px; }
  .meta-reward-icon { flex-basis: 42px; width: 42px; height: 42px; font-size: 22px; }
  .meta-reward-title { font-size: 15px; }
}

.meta-lb-body { margin-top: 14px; }

.meta-lb-percentile {
  margin: 2px auto 12px;
  font-weight: 900;
}
.meta-lb-pct-big {
  font-size: clamp(24px, 6.4vw, 36px);
  color: var(--meta-cyan);
  text-shadow: 0 0 16px rgba(67, 217, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.7);
}
.meta-lb-pct-word {
  font-size: clamp(13px, 3.6vw, 17px);
  color: var(--meta-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.meta-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(6, 10, 34, 0.6);
  border: 1px solid rgba(67, 217, 255, 0.18);
}
.meta-lb-rank {
  flex: 0 0 2.6em;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 900;
  color: rgba(200, 210, 242, 0.66);
  text-align: center;
}
.meta-lb-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 800;
  color: var(--meta-ink);
}
.meta-lb-level {
  flex: 0 0 auto;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: rgba(125, 220, 255, 0.85);
}
.meta-lb-score {
  flex: 0 0 auto;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 900;
  color: var(--meta-gold);
  text-shadow: 0 0 10px rgba(255, 200, 87, 0.4);
}

/* Top-3 podium styling */
.meta-lb-podium .meta-lb-rank { font-size: clamp(18px, 4.6vw, 22px); color: inherit; }
.meta-lb-rank-1 {
  border-color: rgba(255, 216, 101, 0.75);
  background:
    linear-gradient(135deg, rgba(255, 216, 101, 0.16), transparent 45%),
    rgba(10, 12, 38, 0.85);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.28), inset 0 1px 0 rgba(255, 239, 184, 0.18);
}
.meta-lb-rank-1 .meta-lb-name { color: #ffe9b0; }
.meta-lb-rank-2 {
  border-color: rgba(214, 226, 255, 0.5);
  background:
    linear-gradient(135deg, rgba(214, 226, 255, 0.12), transparent 45%),
    rgba(10, 12, 38, 0.85);
  box-shadow: 0 0 14px rgba(214, 226, 255, 0.16);
}
.meta-lb-rank-3 {
  border-color: rgba(255, 160, 96, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 160, 96, 0.12), transparent 45%),
    rgba(10, 12, 38, 0.85);
  box-shadow: 0 0 14px rgba(255, 160, 96, 0.18);
}

/* Player's own row */
.meta-lb-you {
  border: 2px solid rgba(67, 217, 255, 0.85);
  background:
    linear-gradient(135deg, rgba(67, 217, 255, 0.16), transparent 55%),
    rgba(8, 18, 44, 0.92);
  box-shadow: 0 0 18px rgba(67, 217, 255, 0.38), inset 0 0 14px rgba(67, 217, 255, 0.1);
}
.meta-lb-you .meta-lb-name { color: #dffaff; }

/* "…your neighborhood" pinned block (player outside the top list) */
.meta-lb-hood {
  position: sticky;
  bottom: -1px;
  margin-top: 10px;
  padding: 8px 6px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(4, 9, 24, 0.55), rgba(2, 5, 16, 0.97) 34%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.meta-lb-hood-label {
  margin-bottom: 6px;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(125, 220, 255, 0.8);
  text-align: center;
}

/* ==================================================================
   Run summary
   ================================================================== */
.meta-summary-header {
  display: grid;
  grid-template-columns: clamp(84px, 20vw, 112px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(4px, 1.8vw, 12px);
  text-align: left;
}
.meta-summary-copy { min-width: 0; }
.meta-summary-hero {
  width: 100%;
  aspect-ratio: 1;
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 14px rgba(53, 223, 255, 0.34));
  transform-origin: 50% 88%;
  animation: meta-hero-settle 3.2s ease-in-out 1.8s infinite;
}
.meta-summary-lose .meta-summary-hero {
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 14px rgba(255, 77, 54, 0.28));
}
.meta-summary-victory .meta-victory-stage {
  position: relative;
  isolation: isolate;
  min-height: clamp(184px, 50vw, 224px);
  grid-template-columns: minmax(132px, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2px, 1vw, 8px);
  margin: -4px -2px 0;
  padding: clamp(12px, 3vw, 18px) clamp(10px, 2.6vw, 16px) 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 218, 105, 0.72);
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(1, 7, 18, 0.2), rgba(1, 6, 16, 0.74) 55%, rgba(1, 6, 16, 0.92)),
    radial-gradient(circle at 29% 52%, rgba(53, 223, 255, 0.2), transparent 34%),
    url("../assets/ui/runtime/result-victory-card-v1.jpg") center / cover no-repeat;
  box-shadow:
    inset 0 0 0 3px rgba(0, 3, 10, 0.7),
    inset 0 -42px 48px rgba(0, 4, 12, 0.72),
    0 0 24px rgba(53, 223, 255, 0.13);
}
.meta-summary-victory .meta-victory-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 14px;
  bottom: 21px;
  left: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(53, 223, 255, 0.82), transparent);
  box-shadow: 0 0 8px rgba(53, 223, 255, 0.66);
}
.meta-summary-victory .meta-summary-hero {
  z-index: 2;
  align-self: end;
  justify-self: center;
  width: min(190px, 44vw);
  margin-bottom: -20px;
  filter:
    drop-shadow(0 12px 16px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 18px rgba(53, 223, 255, 0.5))
    drop-shadow(0 0 28px rgba(255, 207, 75, 0.24));
}
.meta-summary-victory .meta-summary-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: 2px 0 10px;
}
.meta-summary-victory .meta-kicker {
  color: #fff0b0;
  text-shadow: 0 0 12px rgba(255, 207, 75, 0.62);
}
.meta-summary-victory .meta-sub {
  margin-top: 7px;
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.34;
}
.meta-victory-radiance {
  position: absolute;
  z-index: 1;
  left: clamp(-14px, -2vw, 2px);
  bottom: -36px;
  width: clamp(178px, 49vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 226, 123, 0.22), rgba(53, 223, 255, 0.1) 38%, transparent 67%);
  box-shadow: 0 0 42px rgba(53, 223, 255, 0.18);
  animation: meta-victory-radiance 3.8s ease-in-out infinite;
}
.meta-victory-orbit {
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(53, 223, 255, 0.32);
  border-radius: 50%;
  box-shadow: 0 0 13px rgba(53, 223, 255, 0.2);
}
.meta-victory-orbit::before,
.meta-victory-orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe58b;
  box-shadow: 0 0 10px #ffe58b;
}
.meta-victory-orbit::after {
  right: -3px;
  left: auto;
}
.meta-victory-orbit-outer {
  animation: meta-victory-orbit 10s linear infinite;
}
.meta-victory-orbit-inner {
  inset: 24%;
  border-color: rgba(255, 220, 111, 0.28);
  animation: meta-victory-orbit 7s linear infinite reverse;
}
.meta-victory-seal {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 7px;
  left: 12px;
  font-size: clamp(8px, 2.25vw, 10px);
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(223, 250, 255, 0.86);
  text-align: center;
  text-shadow: 0 0 9px rgba(53, 223, 255, 0.58);
}
@keyframes meta-victory-radiance {
  0%, 100% { transform: scale(0.97); opacity: 0.72; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes meta-victory-orbit {
  to { transform: rotate(360deg); }
}
@keyframes meta-hero-settle {
  0%, 100% { transform: scale(1) rotate(-0.15deg); }
  50% { transform: scale(1.012, 1.006) rotate(0.15deg); }
}
.meta-kicker {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: rgba(125, 220, 255, 0.9);
  text-shadow: 0 0 10px rgba(67, 217, 255, 0.5);
}
.meta-heading {
  margin-top: 4px;
  font-size: clamp(24px, 6.4vw, 40px);
  font-weight: 900;
  line-height: 1.04;
  text-transform: uppercase;
  color: #ffdc68;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.64), 0 0 18px rgba(255, 207, 75, 0.62);
  animation: meta-cheer 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.meta-heading-lose {
  color: #ff5d4e;
  text-shadow: 0 0 18px rgba(255, 73, 50, 0.72), 0 4px 12px rgba(0, 0, 0, 0.64);
}
@keyframes meta-cheer {
  0%   { transform: scale(0.6) rotate(-3deg); opacity: 0; }
  60%  { transform: scale(1.12) rotate(1.6deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.meta-sub {
  margin: 8px 0 0;
  max-width: 420px;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 700;
  color: #e7faff;
  text-shadow: 0 0 10px rgba(51, 229, 255, 0.3);
}
.meta-summary-lose .meta-panel-title { color: #ff5d4e; }

/* Score box + count-up */
.meta-score-box {
  margin: clamp(12px, 3vw, 18px) auto 0;
  padding: clamp(10px, 2.6vw, 16px) clamp(16px, 5vw, 28px);
  display: inline-block;
  min-width: min(260px, 84%);
  border-radius: var(--meta-radius);
  background:
    linear-gradient(135deg, rgba(51, 229, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(2, 8, 21, 0.82), rgba(0, 2, 8, 0.9));
  border: 2px solid rgba(207, 145, 42, 0.52);
  box-shadow: inset 0 0 28px rgba(51, 229, 255, 0.08), 0 0 18px rgba(0, 0, 0, 0.28);
}
.meta-score-label {
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 900;
  letter-spacing: 0.28em;
  color: rgba(238, 240, 255, 0.7);
}
.meta-score-num {
  margin-top: 2px;
  font-size: clamp(38px, 10vw, 58px);
  font-weight: 900;
  line-height: 0.98;
  color: var(--meta-gold);
  text-shadow: 0 2px 12px rgba(255, 200, 87, 0.6);
  font-variant-numeric: tabular-nums;
}
.meta-score-landed { animation: meta-score-land 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes meta-score-land {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.meta-best-line {
  margin-top: 6px;
  min-height: 1.2em;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 800;
  color: var(--meta-muted);
}
.meta-newbest {
  margin-top: 8px;
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #1a0a12;
  background: linear-gradient(135deg, #ffe27a, #ffab3d);
  border: 2px solid rgba(255, 244, 194, 0.9);
  box-shadow: 0 0 22px rgba(255, 200, 87, 0.75), 0 4px 14px rgba(0, 0, 0, 0.4);
}
.meta-newbest-star { color: #a92f1f; }
.meta-newbest-pop { animation: meta-newbest-pop 0.55s cubic-bezier(0.34, 1.8, 0.64, 1), meta-newbest-glow 1.6s ease-in-out 0.55s infinite; }
@keyframes meta-newbest-pop {
  0%   { transform: scale(0.2) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@keyframes meta-newbest-glow {
  0%, 100% { box-shadow: 0 0 22px rgba(255, 200, 87, 0.75), 0 4px 14px rgba(0, 0, 0, 0.4); }
  50%      { box-shadow: 0 0 34px rgba(255, 216, 101, 1), 0 4px 14px rgba(0, 0, 0, 0.4); }
}

/* Score breakdown — the run's score provenance, one row per lever. */
.meta-breakdown {
  margin: clamp(10px, 2.6vw, 14px) auto 0;
  width: min(400px, 100%);
  padding: 10px 14px 12px;
  border-radius: 12px;
  background: rgba(6, 10, 34, 0.6);
  border: 1px solid rgba(67, 217, 255, 0.18);
  text-align: left;
}
.meta-breakdown-title {
  margin-bottom: 6px;
  font-size: clamp(10px, 2.7vw, 11px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta-cyan);
  text-shadow: 0 0 10px rgba(67, 217, 255, 0.4);
}
.meta-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  font-size: clamp(12px, 3.2vw, 14px);
}
.meta-breakdown-row + .meta-breakdown-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.meta-breakdown-label-wrap { min-width: 0; } /* lets long hints wrap, not overflow */
.meta-breakdown-label { display: block; font-weight: 800; color: var(--meta-ink); }
/* The hint is what actually teaches the system — it names the rule behind the
   number, using the live config constants the scene passes in. */
.meta-breakdown-hint {
  display: block;
  margin-top: 1px;
  font-size: clamp(10px, 2.7vw, 11.5px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--meta-muted);
}
.meta-breakdown-value {
  flex: none;
  font-weight: 900;
  color: var(--meta-gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.35);
}
.meta-breakdown-total {
  margin-top: 2px;
  border-top: 2px solid rgba(255, 200, 87, 0.4) !important;
  padding-top: 7px;
}
.meta-breakdown-total .meta-breakdown-label {
  font-size: clamp(11px, 2.9vw, 12px);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 240, 255, 0.72);
}
.meta-breakdown-total .meta-breakdown-value {
  font-size: clamp(15px, 4vw, 18px);
  text-shadow: 0 0 12px rgba(255, 200, 87, 0.6);
}

/* "How to maximize" — earned vs. the reachable ceiling, plus the one lever
   most worth pulling next run. */
.meta-breakdown-tip {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(67, 217, 255, 0.26);
}
.meta-tip-head {
  font-size: clamp(10.5px, 2.8vw, 12px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--meta-cyan);
  font-variant-numeric: tabular-nums;
}
.meta-tip-meter {
  margin: 5px 0 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(2, 8, 21, 0.9);
  border: 1px solid rgba(67, 217, 255, 0.24);
  overflow: hidden;
}
.meta-tip-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--meta-cyan), var(--meta-gold));
  box-shadow: 0 0 10px rgba(255, 200, 87, 0.5);
  animation: meta-tip-fill 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes meta-tip-fill {
  from { transform: scaleX(0); transform-origin: left center; }
  to   { transform: scaleX(1); transform-origin: left center; }
}
.meta-tip-text {
  font-size: clamp(10.5px, 2.8vw, 12px);
  font-weight: 700;
  line-height: 1.35;
  color: #ffd7a8;
}

/* Stat grid — 2×2 always (reads fine at 320px) */
.meta-stats-grid {
  margin: clamp(10px, 2.6vw, 14px) auto 0;
  width: min(400px, 100%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.meta-stat {
  padding: 10px 6px 8px;
  border-radius: 12px;
  background: rgba(6, 10, 34, 0.6);
  border: 1px solid rgba(67, 217, 255, 0.18);
}
.meta-stat-value {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 900;
  color: var(--meta-cyan);
  text-shadow: 0 0 12px rgba(67, 217, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.meta-stat-label {
  margin-top: 2px;
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(200, 210, 242, 0.62);
}

/* Percentile / streak / daily chips */
.meta-chip-row {
  margin-top: clamp(10px, 2.6vw, 14px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 900;
  background: rgba(6, 10, 34, 0.66);
  border: 1px solid rgba(67, 217, 255, 0.35);
  color: #dffaff;
}
.meta-chip-rank { border-color: rgba(67, 217, 255, 0.6); text-shadow: 0 0 8px rgba(67, 217, 255, 0.4); }
.meta-chip-streak {
  border-color: rgba(255, 160, 96, 0.6);
  color: #ffd9a8;
  text-shadow: 0 0 8px rgba(255, 122, 52, 0.45);
}
.meta-chip-daily { border-color: rgba(255, 216, 101, 0.5); color: #ffe9b0; }

/* Action buttons */
.meta-actions {
  margin-top: clamp(14px, 3.4vw, 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.meta-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.meta-actions-row .meta-btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 10px 18px;
  font-size: clamp(13px, 3.4vw, 16px);
}
.meta-actions-priority {
  margin-top: clamp(10px, 2.4vw, 14px);
  padding-bottom: clamp(10px, 2.4vw, 14px);
  border-bottom: 1px solid rgba(53, 223, 255, 0.2);
}
.meta-actions-priority .meta-btn-primary {
  width: min(100%, 430px);
}

/* Confetti (win outcomes) — same recipe as the win screens */
.meta-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0 !important;
}
.meta-confetti-bit {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: meta-confetti-fall 2.4s linear infinite;
}
.meta-confetti-coral { background: var(--meta-coral); }
.meta-confetti-gold  { background: var(--meta-gold); }
.meta-confetti-cyan  { background: var(--meta-cyan); }
@keyframes meta-confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.95; }
  100% { transform: translateY(560px) rotate(540deg); opacity: 0; }
}

/* ==================================================================
   Achievements gallery
   ================================================================== */
.meta-ach-count {
  margin-top: 4px;
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 220, 255, 0.85);
}
.meta-ach-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 8px;
}
.meta-ach-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 10px;
  border-radius: 12px;
  background: rgba(6, 10, 34, 0.6);
  border: 1px solid rgba(67, 217, 255, 0.18);
}
.meta-ach-card.unlocked {
  border-color: rgba(255, 216, 101, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 216, 101, 0.1), transparent 50%),
    rgba(8, 12, 36, 0.85);
  box-shadow: 0 0 14px rgba(255, 200, 87, 0.18), inset 0 1px 0 rgba(255, 239, 184, 0.14);
}
.meta-ach-icon {
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.15;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
}
/* Locked: dimmed silhouette + hint (desc stays readable as the hint) */
.meta-ach-card.locked { opacity: 0.82; }
.meta-ach-card.locked .meta-ach-icon {
  filter: grayscale(1) brightness(0.28) drop-shadow(0 0 6px rgba(67, 217, 255, 0.25));
  opacity: 0.75;
}
.meta-ach-card.locked .meta-ach-title { color: rgba(200, 210, 242, 0.5); }
.meta-ach-card.locked .meta-ach-desc { color: rgba(200, 210, 242, 0.55); font-style: italic; }
.meta-ach-title {
  font-size: clamp(12px, 3.2vw, 14px);
  font-weight: 900;
  color: #ffe9b0;
}
.meta-ach-card.unlocked .meta-ach-title { text-shadow: 0 0 8px rgba(255, 200, 87, 0.4); }
.meta-ach-desc {
  font-size: clamp(10px, 2.7vw, 12px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--meta-muted);
}

/* ==================================================================
   Achievement toast (queued) + feedback toast
   ================================================================== */
.meta-ach-toast {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(400px, calc(100vw - 24px));
  padding: 10px 18px 10px 12px;
  border-radius: var(--meta-radius);
  background:
    linear-gradient(135deg, rgba(255, 216, 101, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(12, 24, 43, 0.97), rgba(1, 5, 14, 0.99));
  border: 2px solid rgba(255, 216, 101, 0.8);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.62),
    0 0 28px rgba(255, 200, 87, 0.45),
    inset 0 1px 0 rgba(255, 239, 184, 0.28);
  animation: meta-ach-toast-life 4s ease both;
}
.meta-ach-toast-docked {
  position: fixed;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  margin: auto;
  animation-name: meta-ach-toast-docked-life;
}
.meta-ach-toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 24px;
  background: radial-gradient(circle, rgba(255, 216, 101, 0.28), rgba(8, 12, 36, 0.9) 70%);
  border: 2px solid rgba(255, 216, 101, 0.7);
  box-shadow: 0 0 14px rgba(255, 200, 87, 0.5);
  animation: meta-ach-icon-pop 0.6s cubic-bezier(0.34, 1.8, 0.64, 1) 0.15s both;
}
@keyframes meta-ach-icon-pop {
  0%   { transform: scale(0.2) rotate(-14deg); }
  60%  { transform: scale(1.2) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}
.meta-ach-toast-body { min-width: 0; text-align: left; }
.meta-ach-toast-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.26em;
  color: rgba(255, 216, 101, 0.9);
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.5);
}
.meta-ach-toast-title {
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.meta-ach-toast-desc {
  font-size: clamp(11px, 3vw, 12px);
  font-weight: 600;
  color: var(--meta-muted);
}
@keyframes meta-ach-toast-life {
  0%   { transform: translateY(-46px) scale(0.7); opacity: 0; }
  8%   { transform: translateY(0) scale(1.06); opacity: 1; }
  12%  { transform: translateY(0) scale(1); }
  88%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0.92); opacity: 0; }
}
@keyframes meta-ach-toast-docked-life {
  0%   { transform: translateY(46px) scale(0.7); opacity: 0; }
  8%   { transform: translateY(0) scale(1.06); opacity: 1; }
  12%  { transform: translateY(0) scale(1); }
  88%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(30px) scale(0.92); opacity: 0; }
}

.meta-feedback-toast {
  pointer-events: none;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 900;
  color: #dffaff;
  background: linear-gradient(180deg, rgba(27, 35, 104, 0.96), rgba(8, 10, 36, 0.98));
  border: 2px solid rgba(67, 217, 255, 0.6);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 18px rgba(67, 217, 255, 0.35);
  animation: meta-feedback-life 2s ease both;
}
@keyframes meta-feedback-life {
  0%   { transform: translateY(-24px) scale(0.7); opacity: 0; }
  12%  { transform: translateY(0) scale(1.05); opacity: 1; }
  18%  { transform: translateY(0) scale(1); }
  80%  { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-16px); opacity: 0; }
}

/* Offscreen textarea for the execCommand copy fallback */
.meta-copy-shim {
  position: fixed;
  top: -200px;
  left: -200px;
  width: 10px;
  height: 10px;
  opacity: 0;
}

/* ==================================================================
   Profile chip (renders into a caller-provided mount)
   ================================================================== */
.meta-profile {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap; /* Google button drops below the chip on narrow mounts */
  align-items: center;
  gap: 10px;
  max-width: 100%;
  pointer-events: auto;
}
.meta-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: min(260px, 72vw);
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
  border: 2px solid rgba(67, 217, 255, 0.55);
  background: linear-gradient(180deg, rgba(27, 35, 104, 0.92), rgba(8, 10, 36, 0.95));
  color: #dffaff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(67, 217, 255, 0.25);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.meta-profile-signed { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.15s ease; }
.meta-profile-signed:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 18px rgba(67, 217, 255, 0.45); }
.meta-profile-signed:active { transform: scale(0.97); }
.meta-profile-signed:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.9); }
.meta-chip-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  font-size: 18px;
  background: radial-gradient(circle, rgba(67, 217, 255, 0.24), rgba(4, 7, 18, 0.92) 70%);
  border: 2px solid rgba(255, 200, 87, 0.6);
}
.meta-chip-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.meta-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 900;
}
.meta-chip-flame {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: #ffd9a8;
  text-shadow: 0 0 8px rgba(255, 122, 52, 0.55);
}
.meta-chip-caret { flex: 0 0 auto; font-size: 11px; opacity: 0.7; }

/* Signed-in dropdown menu */
.meta-chip-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(27, 35, 104, 0.97), rgba(8, 10, 36, 0.99));
  border: 2px solid rgba(67, 217, 255, 0.46);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 22px rgba(67, 217, 255, 0.2);
  animation: meta-pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.meta-chip-menu[hidden] { display: none; }
.meta-chip-menu-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #eef0ff;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.meta-chip-menu-item:hover { background: rgba(67, 217, 255, 0.14); }
.meta-chip-menu-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(76, 201, 240, 0.9); }

/* Google-branded sign-in button (Google identity branding guidelines:
   white surface, #747775 stroke, #1F1F1F label, standard 4-color G mark). */
.meta-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #747775;
  color: #1f1f1f;
  font-family: Roboto, 'Baloo 2', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  white-space: nowrap;
}
.meta-google-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 255, 255, 0.25); }
.meta-google-btn:active { transform: scale(0.97); }
.meta-google-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.9); }
.meta-google-btn svg { flex: 0 0 auto; }

/* ==================================================================
   Name prompt modal
   ================================================================== */
.meta-modal-backdrop { background: rgba(2, 4, 16, 0.78); }
.meta-name-modal { width: min(400px, 100%); }
.meta-name-sub { margin-bottom: 14px; }
.meta-name-input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 2px solid rgba(67, 217, 255, 0.46);
  background: rgba(4, 8, 24, 0.85);
  color: var(--meta-ink);
  font-family: inherit;
  font-size: clamp(16px, 4.4vw, 19px); /* ≥16px: no iOS focus zoom */
  font-weight: 800;
  text-align: center;
  outline: none;
  box-shadow: inset 0 0 18px rgba(67, 217, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.meta-name-input:focus {
  border-color: rgba(255, 216, 101, 0.85);
  box-shadow: 0 0 16px rgba(255, 200, 87, 0.3), inset 0 0 18px rgba(255, 200, 87, 0.08);
}
.meta-name-hint {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(200, 210, 242, 0.55);
}
.meta-name-error {
  margin-top: 6px;
  min-height: 1.2em;
  font-size: 13px;
  font-weight: 800;
  color: var(--meta-coral);
  text-shadow: 0 0 8px rgba(255, 93, 108, 0.4);
}
.meta-name-error[hidden] { visibility: hidden; display: block; }
.meta-name-actions { margin-top: 14px; }
.meta-name-actions .meta-btn { flex: 1 1 0; }

.meta-shake { animation: meta-shake 0.4s ease; }
@keyframes meta-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* ==================================================================
   Small-phone + short-viewport compaction (320px wide must work)
   ================================================================== */
@media (max-width: 380px) {
  .meta-panel { padding: 14px 10px 16px; }
  .meta-lb-tab { font-size: 11px; letter-spacing: 0.02em; }
  .meta-lb-row { padding: 6px 8px; gap: 6px; }
  .meta-lb-rank { flex-basis: 2.1em; }
  .meta-ach-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-actions-row { flex-direction: column; }
  .meta-actions-row .meta-btn { width: 100%; }
  .meta-summary-victory .meta-victory-stage {
    min-height: 176px;
    grid-template-columns: minmax(118px, 0.86fr) minmax(0, 1.14fr);
    padding-right: 8px;
    padding-left: 6px;
  }
  .meta-summary-victory .meta-summary-hero {
    width: min(168px, 47vw);
  }
}

/* Mid-height desktops/laptops (e.g. 1280x800): trim vertical rhythm so the
   full run summary fits without internal scroll. */
@media (min-width: 700px) and (max-height: 860px) {
  .meta-panel { padding-top: 14px; padding-bottom: 16px; }
  .meta-score-box { margin-top: 10px; padding-top: 8px; padding-bottom: 8px; }
  .meta-score-num { font-size: clamp(34px, 6vh, 48px); }
  .meta-breakdown { margin-top: 8px; padding-top: 5px; padding-bottom: 5px; }
  .meta-breakdown-row { padding: 2px 0; }
  .meta-breakdown-hint { font-size: 10.5px; }
  .meta-breakdown-tip { margin-top: 6px; padding-top: 6px; }
  .meta-stats-grid { margin-top: 8px; gap: 6px; }
  .meta-stat { padding: 7px 6px 6px; }
  .meta-chip-row { margin-top: 8px; }
  .meta-actions { margin-top: 10px; gap: 8px; }
  .meta-btn-primary { min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
}

@media (max-height: 620px) {
  .meta-backdrop { align-items: flex-start; }
  .meta-panel { max-height: 100%; }
  .meta-heading { font-size: clamp(20px, 5.4vw, 30px); }
  .meta-score-num { font-size: clamp(30px, 8vw, 44px); }
  .meta-score-box { margin-top: 8px; padding: 8px 18px; }
  .meta-stats-grid, .meta-breakdown, .meta-chip-row, .meta-actions { margin-top: 8px; }
}

/* ---- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .meta-panel,
  .meta-backdrop,
  .meta-heading,
  .meta-newbest-pop,
  .meta-score-landed,
  .meta-confetti-bit,
  .meta-ach-toast,
  .meta-ach-toast-icon,
  .meta-feedback-toast,
  .meta-chip-menu,
  .meta-shake,
  .meta-tip-meter-fill,
  .meta-spinner,
  .meta-victory-radiance,
  .meta-victory-orbit,
  .meta-reward-card-selected,
  .meta-panel-exit,
  .meta-transition-cue {
    animation: none !important;
  }
  .meta-ach-toast, .meta-feedback-toast { opacity: 1; }
}

/* ==================================================================
   Premium meta pass — sub-screens share the raster observatory stage,
   lacquer panels, brass hierarchy, and compact console controls.
   ================================================================== */

.meta-backdrop {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(0, 3, 10, 0.52), rgba(0, 3, 10, 0.93)),
    url("../assets/ui/runtime/observatory-banner-v1.jpg") center 70% / min(1200px, 130vw) auto no-repeat,
    url("../assets/ui/runtime/shield-horizon-banner-v1.jpg") center 84% / min(1200px, 130vw) auto no-repeat,
    url("../assets/ui/runtime/deep-space-banner-v1.jpg") center top / cover no-repeat;
  backdrop-filter: blur(7px) saturate(1.08);
  -webkit-backdrop-filter: blur(7px) saturate(1.08);
  animation: premium-meta-stage-in 320ms ease-out both;
}
.meta-backdrop::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(97, 225, 255, 0.018) 6px);
  box-shadow: inset 0 0 130px rgba(0, 0, 0, 0.82);
}
@keyframes premium-meta-stage-in { from { opacity: 0; } to { opacity: 1; } }

.meta-panel {
  --meta-panel-accent: var(--kuriosi-cyan, #35dfff);
  width: min(590px, 100%);
  border: 2px solid var(--kuriosi-gold, #d9a23d);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 225, 143, 0.12), transparent 18% 78%, rgba(51, 223, 255, 0.09)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, rgba(8, 21, 39, 0.99), rgba(1, 6, 15, 0.99));
  box-shadow:
    var(--kuriosi-screen-shadow, 0 28px 80px rgba(0, 0, 0, 0.82)),
    0 0 40px rgba(53, 223, 255, 0.22),
    inset 0 0 0 4px rgba(0, 2, 8, 0.84),
    inset 0 0 0 5px rgba(255, 225, 143, 0.14),
    inset 0 1px 0 rgba(255, 242, 199, 0.34);
  scrollbar-color: rgba(53, 223, 255, 0.62) rgba(0, 0, 0, 0.18);
  animation: premium-meta-console-in 480ms cubic-bezier(0.16, 0.88, 0.24, 1.12) both;
}
.meta-panel::before {
  inset: 9px;
  border-color: rgba(53, 223, 255, 0.3);
  border-radius: 3px;
  box-shadow: inset 0 0 26px rgba(53, 223, 255, 0.04);
}
.meta-panel::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 15%;
  right: 15%;
  height: 16px;
  z-index: 0;
  border: 1px solid rgba(255, 225, 143, 0.82);
  border-radius: 0 0 4px 4px;
  background:
    linear-gradient(90deg, transparent 7%, rgba(255, 224, 138, 0.52) 7% 9%, transparent 9% 91%, rgba(255, 224, 138, 0.52) 91% 93%, transparent 93%),
    linear-gradient(180deg, #a72d22, #34070a);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 239, 188, 0.32);
  pointer-events: none;
}
@keyframes premium-meta-console-in {
  0% { opacity: 0; transform: translateY(24px) scale(0.95); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.006); }
  100% { opacity: 1; transform: none; }
}

.meta-panel-title,
.meta-heading,
.meta-state-title,
.meta-reward-title,
.meta-setting-title,
.meta-ach-title { font-family: var(--kuriosi-ui-font, 'Trebuchet MS', system-ui, sans-serif); }
.meta-panel-title {
  color: var(--kuriosi-gold-hot, #ffe08a);
  letter-spacing: 0.055em;
  text-shadow: 0 3px 0 rgba(76, 34, 8, 0.72), 0 0 20px rgba(255, 205, 75, 0.44);
}
.meta-close-btn {
  top: 12px;
  right: 12px;
  border: 1px solid rgba(255, 222, 132, 0.78);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(20, 42, 66, 0.98), rgba(2, 10, 22, 0.99));
  color: #dffbff;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.58), inset 0 0 0 2px rgba(0, 3, 10, 0.78), 0 0 14px rgba(53, 223, 255, 0.16);
}
.meta-close-btn:focus-visible { outline: 3px solid var(--kuriosi-cyan, #35dfff); outline-offset: 2px; box-shadow: none; }

.meta-lb-tab {
  border: 1px solid rgba(53, 223, 255, 0.48);
  border-radius: 5px;
  color: rgba(215, 246, 255, 0.74);
  background: linear-gradient(180deg, rgba(12, 31, 53, 0.94), rgba(2, 9, 21, 0.98));
  box-shadow: inset 0 0 0 2px rgba(0, 3, 10, 0.62);
}
.meta-lb-tab.active {
  color: #fff4cc;
  border-color: rgba(255, 222, 126, 0.94);
  background: linear-gradient(180deg, #b83a25, #6d120e 62%, #31070a);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.48), 0 0 18px rgba(255, 80, 45, 0.25), inset 0 0 0 2px rgba(43, 5, 7, 0.72);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.meta-lb-row,
.meta-breakdown,
.meta-stat,
.meta-coach,
.meta-setting-row,
.meta-ach-card,
.meta-reward-card {
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(52, 219, 255, 0.055), transparent 48%), rgba(1, 8, 20, 0.82);
  border-color: rgba(53, 223, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(205, 248, 255, 0.035);
}
.meta-lb-row { transition: transform 150ms ease, border-color 150ms ease, background 150ms ease; }
.meta-lb-row:hover { transform: translateX(2px); border-color: rgba(53, 223, 255, 0.5); }
.meta-lb-rank-1,
.meta-ach-card.unlocked {
  border-color: rgba(255, 218, 105, 0.58);
  background: linear-gradient(90deg, rgba(255, 211, 88, 0.14), transparent 52%), rgba(4, 10, 24, 0.9);
  box-shadow: 0 0 18px rgba(255, 201, 67, 0.15), inset 0 1px 0 rgba(255, 244, 199, 0.1);
}
.meta-lb-you {
  border: 1px solid rgba(53, 223, 255, 0.86);
  background: linear-gradient(90deg, rgba(53, 223, 255, 0.17), transparent 60%), rgba(2, 12, 28, 0.94);
  box-shadow: 0 0 19px rgba(53, 223, 255, 0.25), inset 0 0 16px rgba(53, 223, 255, 0.055);
}

.meta-summary-win,
.meta-summary-daily,
.meta-summary-levelcomplete,
.meta-summary-victory {
  --meta-panel-accent: var(--kuriosi-cyan, #35dfff);
  background-image:
    linear-gradient(180deg, rgba(3, 13, 25, 0.86), rgba(1, 6, 15, 0.99) 44%),
    url("../assets/ui/runtime/result-victory-card-v1.jpg");
  background-position: center, center top;
  background-size: 100% 100%, 100% auto;
  background-repeat: no-repeat;
}
.meta-summary-lose,
.meta-summary-gameover {
  --meta-panel-accent: var(--kuriosi-danger, #ff4d36);
  border-color: rgba(225, 94, 51, 0.92);
  background-image:
    linear-gradient(180deg, rgba(18, 4, 9, 0.78), rgba(1, 6, 15, 0.99) 44%),
    url("../assets/ui/runtime/result-breach-card-v1.jpg");
  background-position: center, center top;
  background-size: 100% 100%, 100% auto;
  background-repeat: no-repeat;
}
.meta-heading {
  color: var(--kuriosi-gold-hot, #ffe08a);
  letter-spacing: 0.025em;
  text-shadow: 0 3px 0 rgba(76, 34, 8, 0.74), 0 0 20px rgba(255, 205, 75, 0.45);
  animation: premium-meta-heading 580ms cubic-bezier(0.18, 0.9, 0.23, 1.18) both;
}
.meta-heading-lose { color: #ff735d; text-shadow: 0 3px 0 rgba(72, 6, 8, 0.82), 0 0 22px rgba(255, 66, 40, 0.54); }
@keyframes premium-meta-heading {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.meta-sub,
.meta-state-text,
.meta-reward-detail,
.meta-setting-detail,
.meta-ach-desc { color: #cde9f2; line-height: 1.4; }
.meta-score-box {
  border: 1px solid rgba(218, 162, 61, 0.78);
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(53, 223, 255, 0.08), transparent 42%), linear-gradient(180deg, rgba(3, 13, 27, 0.94), rgba(0, 4, 11, 0.98));
  box-shadow: inset 0 0 0 3px rgba(0, 2, 8, 0.76), inset 0 0 22px rgba(53, 223, 255, 0.07);
}
.meta-score-num { color: var(--kuriosi-gold-hot, #ffe08a); }
.meta-newbest,
.meta-chip { border-radius: 5px; }
.meta-newbest {
  color: #fff4ce;
  border-color: rgba(255, 225, 132, 0.9);
  background: linear-gradient(180deg, #b63a23, #72130f 64%, #35070a);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.86);
}

.meta-sector-starfield {
  opacity: 0.72;
  background: linear-gradient(180deg, rgba(53, 223, 255, 0.06), transparent 74%), url("../assets/ui/runtime/deep-space-banner-v1.jpg") center top / cover no-repeat;
  mask-image: linear-gradient(180deg, #000, transparent 82%);
}
.meta-sector-level { color: var(--sector-accent, var(--kuriosi-cyan, #35dfff)); }
.meta-sector-boss { border-radius: 5px; }
.meta-setting-toggle { border-radius: 5px; background: #020916; box-shadow: inset 0 0 0 2px rgba(0, 2, 8, 0.66); }
.meta-setting-toggle::after { border-radius: 2px; }
.meta-reward-card:hover,
.meta-reward-card:focus-visible {
  border-color: var(--kuriosi-gold-hot, #ffe08a);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.48), 0 0 20px rgba(255, 201, 67, 0.16), inset 0 1px 0 rgba(255, 244, 199, 0.1);
}
.meta-reward-icon,
.meta-ach-icon { filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 8px rgba(53, 223, 255, 0.2)); }

.meta-profile-chip,
.meta-chip-menu {
  border: 1px solid rgba(255, 220, 122, 0.76);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(16, 36, 60, 0.97), rgba(2, 10, 22, 0.99));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(0, 3, 10, 0.7), 0 0 14px rgba(53, 223, 255, 0.13);
}
.meta-chip-avatar { border-color: rgba(255, 218, 103, 0.72); }
.meta-chip-menu-item { border-radius: 3px; }
.meta-name-input {
  border: 1px solid rgba(53, 223, 255, 0.62);
  border-radius: 5px;
  background: rgba(1, 7, 18, 0.94);
  box-shadow: inset 0 0 0 2px rgba(0, 2, 8, 0.72), inset 0 0 18px rgba(53, 223, 255, 0.07);
}
.meta-spinner {
  border-radius: 4px;
  border-color: rgba(53, 223, 255, 0.18);
  border-top-color: var(--kuriosi-gold-hot, #ffe08a);
  box-shadow: 0 0 18px rgba(53, 223, 255, 0.28);
  animation: premium-meta-spinner 900ms linear infinite;
}
@keyframes premium-meta-spinner { to { transform: rotate(360deg); } }
.meta-ach-toast,
.meta-feedback-toast {
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 220, 112, 0.1), transparent 50%), linear-gradient(180deg, rgba(10, 24, 42, 0.99), rgba(1, 6, 15, 0.99));
}

@media (max-width: 480px) {
  .meta-panel { padding-inline: 12px; }
  .meta-panel::after { left: 18%; right: 18%; }
  .meta-panel-title { padding-inline: 36px; font-size: clamp(20px, 7vw, 28px); }
  .meta-leaderboard .meta-lb-tabs {
    position: sticky;
    top: -14px;
    z-index: 3;
    gap: 5px;
    margin-inline: -4px;
    padding: 8px 4px;
    background: linear-gradient(180deg, rgba(4, 10, 25, 0.98), rgba(4, 10, 25, 0.9));
    box-shadow: 0 8px 12px rgba(1, 4, 13, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .meta-lb-tab { font-size: 11px; }
  .meta-ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-summary-header { grid-template-columns: 76px minmax(0, 1fr); gap: 5px; }
  .meta-heading { font-size: clamp(22px, 7vw, 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .meta-backdrop,
  .meta-panel,
  .meta-heading,
  .meta-spinner,
  .meta-summary-hero { animation: none !important; }
  .meta-lb-row { transition: none !important; }
}

/* Saved accessibility preferences — scoped to the DOM meta surfaces so the
   standard console art and Phaser scene remain untouched. */
html.large-text-mode .meta-state-text,
html.large-text-mode .meta-sub,
html.large-text-mode .meta-reward-detail,
html.large-text-mode .meta-setting-detail,
html.large-text-mode .meta-ach-desc {
  font-size: clamp(14px, 3.6vw, 17px);
}
html.large-text-mode .meta-setting-title,
html.large-text-mode .meta-reward-title,
html.large-text-mode .meta-ach-title {
  font-size: clamp(16px, 4vw, 19px);
}
html.large-text-mode .meta-kicker,
html.large-text-mode .meta-score-label,
html.large-text-mode .meta-best-line,
html.large-text-mode .meta-breakdown-title,
html.large-text-mode .meta-breakdown-hint,
html.large-text-mode .meta-tip-head,
html.large-text-mode .meta-tip-text,
html.large-text-mode .meta-stat-label,
html.large-text-mode .meta-ach-count,
html.large-text-mode .meta-lb-hood-label {
  font-size: clamp(12px, 3vw, 14px);
}
html.large-text-mode .meta-breakdown-row,
html.large-text-mode .meta-chip,
html.large-text-mode .meta-lb-tab,
html.large-text-mode .meta-chip-menu-item {
  font-size: clamp(14px, 3.5vw, 17px);
}
html.large-text-mode .meta-summary-header:not(.meta-victory-stage) {
  grid-template-columns: clamp(72px, 18vw, 96px) minmax(0, 1fr);
}
html.large-text-mode .meta-panel-title {
  overflow-wrap: anywhere;
}
html.large-text-mode .meta-summary-copy,
html.large-text-mode .meta-setting-copy,
html.large-text-mode .meta-reward-copy,
html.large-text-mode .meta-breakdown-label-wrap,
html.large-text-mode .meta-ach-card {
  overflow-wrap: anywhere;
}
html.large-text-mode .meta-actions-row .meta-btn {
  min-height: 48px;
  white-space: normal;
}

html.large-text-mode .meta-setting-toggle,
html.high-contrast-mode .meta-setting-toggle {
  height: 44px;
  min-height: 44px;
}
html.large-text-mode .meta-setting-toggle::after,
html.high-contrast-mode .meta-setting-toggle::after {
  top: 11px;
}

html.high-contrast-mode .meta-backdrop {
  background: rgba(0, 0, 0, 0.97);
}
html.high-contrast-mode .meta-panel {
  color: #fff;
  border-color: #ffe08a;
  background: #020711;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #8eefff;
}
html.high-contrast-mode .meta-sub,
html.high-contrast-mode .meta-state-text,
html.high-contrast-mode .meta-reward-detail,
html.high-contrast-mode .meta-setting-detail,
html.high-contrast-mode .meta-ach-desc,
html.high-contrast-mode .meta-breakdown-hint,
html.high-contrast-mode .meta-tip-text,
html.high-contrast-mode .meta-stat-label,
html.high-contrast-mode .meta-best-line {
  color: #fff;
  text-shadow: 0 2px 4px #000;
}
html.high-contrast-mode .meta-lb-row,
html.high-contrast-mode .meta-breakdown,
html.high-contrast-mode .meta-stat,
html.high-contrast-mode .meta-setting-row,
html.high-contrast-mode .meta-ach-card,
html.high-contrast-mode .meta-reward-card,
html.high-contrast-mode .meta-score-box,
html.high-contrast-mode .meta-chip {
  color: #fff;
  border-color: #8eefff;
  background: #000;
}
html.high-contrast-mode .meta-heading,
html.high-contrast-mode .meta-panel-title,
html.high-contrast-mode .meta-score-num,
html.high-contrast-mode .meta-breakdown-value,
html.high-contrast-mode .meta-stat-value {
  color: #fff0a8;
  text-shadow: 0 2px 4px #000, 0 0 6px #000;
}
html.high-contrast-mode .meta-lb-tab,
html.high-contrast-mode .meta-close-btn,
html.high-contrast-mode .meta-setting-toggle,
html.high-contrast-mode .meta-chip-menu-item {
  color: #fff;
  border-color: #8eefff;
  background: #020711;
}
html.high-contrast-mode .meta-lb-tab.active {
  color: #000;
  border-color: #fff;
  background: #ffe08a;
  text-shadow: none;
}
html.high-contrast-mode .meta-close-btn:focus-visible,
html.high-contrast-mode .meta-lb-tab:focus-visible,
html.high-contrast-mode .meta-setting-toggle:focus-visible,
html.high-contrast-mode .meta-chip-menu-item:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: none;
}
