/* ==========================================================================
   Pyria: Return of the Bits — Retro-Modern Dark RPG Stylesheet
   ========================================================================== */

:root {
  --bg-deep: #0b1020;
  --bg-panel: #151c32;
  --bg-panel-alt: #1c2642;
  --bg-code: #0c1222;
  --border-subtle: #2b385c;
  --border-bright: #4b6196;
  --text-main: #eef3ff;
  --text-muted: #9eb0d6;
  --accent-gold: #f6c945;
  --accent-gold-dark: #c99714;
  --accent-emerald: #34d399;
  --accent-emerald-dark: #059669;
  --accent-sky: #38bdf8;
  --accent-rose: #fb7185;
  --accent-violet: #a78bfa;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: radial-gradient(circle at top, #182342 0%, var(--bg-deep) 65%);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button, .btn {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

textarea, input, pre, code {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.pixel-canvas {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden {
  display: none !important;
}

/* ==================== SCREENS ==================== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ==================== CARDS, BUTTONS, PILLS ==================== */
.card {
  background: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  color: var(--text-main);
  background: var(--bg-panel-alt);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--border-bright);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  color: #062118;
  border-color: #6ee7b7;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #4ade80 0%, #10b981 100%);
  border-color: #a7f3d0;
}

.btn-gold {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #1f1300;
  border-color: #fde68a;
}

.btn-sky {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #041b29;
  border-color: #7dd3fc;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
}

.btn-lg {
  padding: 13px 26px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill-muted {
  background: rgba(158, 176, 214, 0.14);
  color: var(--text-muted);
}

.pill-gold {
  background: rgba(246, 201, 69, 0.18);
  color: var(--accent-gold);
  border: 1px solid rgba(246, 201, 69, 0.35);
}

.pill-green {
  background: rgba(52, 211, 153, 0.18);
  color: var(--accent-emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.pill-blue {
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pill-rose {
  background: rgba(251, 113, 133, 0.18);
  color: var(--accent-rose);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.pill-violet {
  background: rgba(167, 139, 250, 0.18);
  color: var(--accent-violet);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.muted-text {
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 0;
}

/* ==================== TITLE SCREEN ==================== */
.title-shell {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.title-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-account-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-account-select {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--bg-code);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  outline: none;
}

.save-owner-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-sky);
}

.title-hero {
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(160deg, rgba(28, 38, 66, 0.92), rgba(16, 23, 42, 0.95));
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.title-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(246, 201, 69, 0.15);
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.game-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  text-shadow: 0 4px 0 #7c4a03, 0 0 28px rgba(246, 201, 69, 0.35);
}

.game-subtitle {
  margin: 2px 0 12px;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent-sky);
  letter-spacing: 0.05em;
}

.title-blurb {
  max-width: 560px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.title-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0 18px;
}

#title-preview-canvas {
  width: 192px;
  height: 128px;
  background: radial-gradient(circle at 50% 70%, rgba(52, 211, 153, 0.18), rgba(11, 16, 32, 0.6));
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.title-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.saves-panel {
  padding: 20px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.saves-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.save-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: var(--bg-panel-alt);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.save-card:hover {
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
}

.save-card-info {
  min-width: 0;
}

.save-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.save-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 22px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

/* ==================== CHARACTER CREATION SCREEN ==================== */
.charcreate-shell {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
}

.screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title h2 {
  margin: 0;
  font-size: 20px;
}

.charcreate-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 860px) {
  .charcreate-grid {
    grid-template-columns: 1fr;
  }
}

.charcreate-preview-card,
.charcreate-editor-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preview-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 65%, #24385c 0%, #0e1628 75%);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.preview-canvas-lg {
  width: 240px;
  height: 168px;
}

.preview-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

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

.summary-chip {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.chip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.spellbook-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent-gold);
}

.hint-sub {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
}

.spell-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spell-pill {
  background: var(--bg-code);
  border: 1px solid var(--border-bright);
  color: var(--accent-sky);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

.spell-pill:hover {
  background: #1b2a4a;
  transform: translateY(-1px);
  color: #bae6fd;
}

.spell-group-label {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==================== VISUAL HERO FORGE & ADVANCED TOGGLE ==================== */
.forge-mode-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.forge-mode-toggle.active {
  background: rgba(167, 139, 250, 0.22);
  border-color: var(--accent-violet);
  color: #ddd6fe;
}

.visual-forge-panel,
.advanced-forge-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.forge-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forge-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
}

.forge-text-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-subtle);
  background: var(--bg-code);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forge-text-input:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.forge-error {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-rose);
}

.picker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.picker-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-panel-alt);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}

.picker-pill:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.picker-pill.active {
  border-color: var(--accent-emerald);
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
}

.swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.live-py-preview-box {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.live-py-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-sky);
  margin-bottom: 6px;
}

.live-py-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: #a7f3d0;
  white-space: pre-wrap;
}

/* ==================== CODE EDITOR & PIP CONSOLE ==================== */
.comment-tip-banner {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #dbeafe;
}

.comment-tip-banner code {
  background: rgba(15, 23, 42, 0.85);
  color: var(--accent-gold);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.code-editor-shell {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--accent-sky);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-code);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.code-editor-shell:focus-within {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22);
}

.code-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(16, 24, 43, 0.92));
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
}

.code-editor-cta {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #e0f2fe;
}

.code-editor-sub {
  font-size: 11.5px;
  color: var(--accent-gold);
  font-weight: 600;
}

.code-editor {
  width: 100%;
  min-height: 170px;
  padding: 14px;
  background: var(--bg-code);
  color: #e2f1ff;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  tab-size: 4;
  outline: none;
}

.code-editor::placeholder {
  color: #7c93bd;
  font-style: italic;
}

.code-editor-shell .code-editor {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.code-editor-body {
  display: flex;
  align-items: stretch;
  position: relative;
  background: var(--bg-code);
}

.code-gutter {
  flex: 0 0 46px;
  padding: 14px 6px 14px 4px;
  background: rgba(8, 13, 26, 0.92);
  border-right: 1px solid rgba(56, 189, 248, 0.22);
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 22px;
  text-align: right;
  user-select: none;
  overflow: hidden;
}

.code-gutter-line {
  height: 22px;
  padding-right: 2px;
  white-space: nowrap;
}

.code-gutter-line.hl-error {
  color: #fff1f2;
  background: rgba(244, 63, 94, 0.55);
  border-radius: 4px;
  font-weight: 800;
}

.code-gutter-line.hl-over-after {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.22);
  border-radius: 4px;
}

.code-gutter-line.hl-ok {
  color: #6ee7b7;
}

.code-textarea-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.code-line-highlights {
  position: absolute;
  inset: 0;
  padding: 14px 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.code-hl-line {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
}

.code-hl-line.hl-error {
  background: rgba(244, 63, 94, 0.24);
  box-shadow: inset 3px 0 0 #fb7185;
}

.code-hl-line.hl-over-after {
  background: rgba(244, 63, 94, 0.1);
  box-shadow: inset 3px 0 0 rgba(251, 113, 133, 0.5);
}

.code-hl-line.hl-ok {
  background: rgba(16, 185, 129, 0.08);
}

.code-hl-badge {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.code-hl-line.hl-error .code-hl-badge {
  background: rgba(244, 63, 94, 0.9);
  color: #fff;
}

.code-hl-line.hl-over-after .code-hl-badge {
  background: rgba(244, 63, 94, 0.35);
  color: #fecdd3;
}

.code-hl-line.hl-ok .code-hl-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
}

.code-textarea-wrap .code-editor {
  position: relative;
  z-index: 1;
  background: transparent;
  line-height: 22px;
  white-space: pre;
  overflow-x: auto;
}

.code-editor:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.code-editor-shell .code-editor:focus {
  border: none;
  box-shadow: none;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pip-console {
  background: #10182b;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
}

.pip-console.success {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.pip-console.error {
  border-color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.1);
}

.pip-console-header {
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.pip-console-body {
  color: var(--text-main);
  white-space: pre-wrap;
}

.console-stdout {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #a7f3d0;
  white-space: pre-wrap;
}

.console-traceback {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--accent-rose);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fecdd3;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ==================== OVERWORLD HUD & STAGE ==================== */
#screen-game {
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(15, 22, 40, 0.96);
  border-bottom: 2px solid var(--border-subtle);
  flex-shrink: 0;
  flex-wrap: wrap;
}

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

.hud-portrait-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #1b2847;
  border: 2px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hud-portrait {
  width: 36px;
  height: 36px;
}

.hud-hero-name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
}

.hud-realm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.hud-realm-name {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(246, 201, 69, 0.14);
  border: 1px solid rgba(246, 201, 69, 0.4);
}

.stat-icon {
  color: var(--accent-gold);
  font-size: 15px;
}

.stat-value {
  font-weight: 900;
  font-size: 15px;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

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

.dragon-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.dragon-badge.rescued {
  background: rgba(52, 211, 153, 0.18);
  border-color: var(--accent-emerald);
  color: #a7f3d0;
}

.hud-trials-progress {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-sky);
}

.hud-trials-progress.all-complete {
  background: rgba(52, 211, 153, 0.18);
  border-color: var(--accent-emerald);
  color: #a7f3d0;
}

.hud-secrets-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
}

.kit-reward-card {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-violet);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(246, 201, 69, 0.12));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.trial-complete-card {
  text-align: center;
  padding: 20px 18px;
  background: radial-gradient(circle at top, rgba(52, 211, 153, 0.2), rgba(16, 24, 43, 0.85));
  border: 2px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.trial-complete-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #052016;
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.45);
}

.trial-complete-title {
  margin: 0;
  font-size: 20px;
  color: #a7f3d0;
}

.world-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080c17;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.world-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.region-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translate(-50%, -10px);
  padding: 7px 20px;
  background: rgba(14, 19, 32, 0.9);
  border: 2px solid var(--accent-gold);
  border-radius: 999px;
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 6;
}

.region-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.interact-prompt {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: rgba(15, 23, 42, 0.94);
  border: 2px solid var(--accent-emerald);
  border-radius: 999px;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 5;
}

.interact-prompt:hover {
  background: #172544;
}

.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--accent-emerald);
  color: #052016;
  font-weight: 900;
  font-size: 12px;
}

.toast-container {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(21, 28, 50, 0.95);
  border: 2px solid var(--accent-gold);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.2s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== ON-SCREEN VIRTUAL THUMBSTICK & INTERACT ==================== */
.touch-controls {
  position: absolute;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  right: calc(18px + env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 6;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.touch-joystick {
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.touch-joystick.active {
  cursor: grabbing;
}

.joystick-base {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(21, 31, 56, 0.52) 0%, rgba(11, 16, 32, 0.78) 100%);
  border: 2px solid rgba(75, 97, 150, 0.8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(56, 189, 248, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.touch-joystick.active .joystick-base {
  border-color: var(--accent-sky);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(56, 189, 248, 0.28);
}

.joy-tick {
  position: absolute;
  font-size: 11px;
  color: rgba(158, 176, 214, 0.55);
  pointer-events: none;
  line-height: 1;
}

.joy-n { top: 8px; left: 50%; transform: translateX(-50%); }
.joy-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.joy-w { left: 9px; top: 50%; transform: translateY(-50%); }
.joy-e { right: 9px; top: 50%; transform: translateY(-50%); }

.joystick-nub {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dd3fc 0%, #38bdf8 48%, #0284c7 100%);
  border: 2px solid #e0f2fe;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.55);
  transform: translate3d(0, 0, 0);
  transition: transform 0.12s ease-out;
  pointer-events: none;
}

.touch-joystick.active .joystick-nub {
  transition: none;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.85);
}

.touch-interact-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--border-bright);
  background: radial-gradient(circle at 35% 30%, #24355c 0%, #111930 100%);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  touch-action: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  transition: transform 0.14s ease, opacity 0.14s ease, visibility 0.14s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  margin-bottom: 12px;
}

.touch-interact-btn.near-target {
  background: radial-gradient(circle at 35% 30%, #6ee7b7 0%, #10b981 65%, #047857 100%);
  border-color: #d1fae5;
  color: #052016;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.65), 0 8px 22px rgba(0, 0, 0, 0.45);
}

.touch-interact-btn:active,
.touch-interact-btn.pressed {
  transform: scale(0.93);
}

.touch-interact-icon {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.touch-interact-sub {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ==================== PYTHON QUICK-KEYS BAR (iPad Ergonomics) ==================== */
.py-quick-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(12, 18, 34, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.py-qk-btn {
  padding: 6px 10px;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-bright);
  background: var(--bg-panel-alt);
  color: var(--accent-sky);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.py-qk-btn:hover,
.py-qk-btn:active {
  background: #24365e;
  color: #e0f2fe;
  border-color: var(--accent-sky);
}

/* ==================== IDE-STYLE AUTOCOMPLETE DROPDOWN ==================== */
.py-ac-dropdown {
  position: fixed;
  z-index: 300;
  max-height: 230px;
  overflow-y: auto;
  background: #10182d;
  border: 2px solid var(--accent-sky);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  padding: 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.py-ac-row {
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  touch-action: manipulation;
}

.py-ac-row:hover,
.py-ac-row.active {
  background: rgba(56, 189, 248, 0.22);
}

.py-ac-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.py-ac-sig {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #e2f1ff;
}

.py-ac-cat {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.py-ac-cat.cat-fn { background: rgba(56, 189, 248, 0.2); color: var(--accent-sky); }
.py-ac-cat.cat-method { background: rgba(167, 139, 250, 0.22); color: var(--accent-violet); }
.py-ac-cat.cat-keyword { background: rgba(246, 201, 69, 0.2); color: var(--accent-gold); }
.py-ac-cat.cat-workshop { background: rgba(52, 211, 153, 0.2); color: var(--accent-emerald); }
.py-ac-cat.cat-arg { background: rgba(251, 113, 133, 0.2); color: var(--accent-rose); }

.py-ac-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--accent-gold); }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

.touch-interact-btn {
  pointer-events: auto;
  opacity: 0.85;
}

.touch-interact-btn:hover {
  opacity: 1;
}

/* ==================== BOTTOM BAR ==================== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(12, 18, 34, 0.96);
  border-top: 2px solid var(--border-subtle);
  flex-shrink: 0;
  font-size: 13.5px;
}

.pip-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pip-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(246, 201, 69, 0.16);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 12px;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 18, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-card.modal-wide {
  max-width: 980px;
}

.modal-card.modal-compact {
  max-width: 540px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 21px;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dialogue-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-panel-alt);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.npc-portrait-canvas {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: #0e1628;
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-sm);
}

.dialogue-text {
  font-size: 15.5px;
  color: var(--text-main);
  margin: 0;
}

.dialogue-catchphrase {
  margin: 8px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--accent-gold);
}

.objective-box {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.objective-box strong {
  color: var(--accent-sky);
}

.hint-box {
  background: rgba(246, 201, 69, 0.1);
  border: 1px solid rgba(246, 201, 69, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  white-space: pre-wrap;
}

.hint-box-title {
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 4px;
  font-size: 13px;
}

/* Workshop Grid */
.workshop-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 820px) {
  .workshop-grid {
    grid-template-columns: 1fr;
  }
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.ws-balance-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(246, 201, 69, 0.2), rgba(217, 119, 6, 0.16));
  border: 2px solid var(--accent-gold);
  color: #fef08a;
  font-size: 15.5px;
  font-weight: 700;
}

.ws-balance-banner strong {
  font-size: 19px;
  color: var(--accent-gold);
}

.ws-cart-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 24, 43, 0.92);
  border: 1.5px solid var(--border-subtle);
  font-size: 13px;
  color: #dbeafe;
}

.ws-cart-bar.ok {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  color: #d1fae5;
}

.ws-cart-bar.over {
  border-color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.14);
  color: #ffe4e6;
  flex-direction: column;
  align-items: stretch;
}

.ws-cart-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-cart-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(251, 113, 133, 0.3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.ws-cart-line.ok {
  color: #a7f3d0;
}

.ws-cart-line.over-trigger {
  color: #fff1f2;
  background: rgba(244, 63, 94, 0.28);
  border: 1px solid rgba(251, 113, 133, 0.65);
  border-radius: 5px;
  padding: 4px 8px;
}

.ws-cart-line.over-after {
  color: #fda4af;
  opacity: 0.85;
}

.catalog-item.queued {
  border-color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.12);
}

.pill-sky {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-panel-alt);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.catalog-item:hover {
  border-color: var(--accent-gold);
  background: #233052;
}

.catalog-item.owned {
  border-color: rgba(52, 211, 153, 0.65);
  background: rgba(16, 185, 129, 0.08);
}

.catalog-item.affordable {
  border-color: rgba(246, 201, 69, 0.65);
  background: rgba(246, 201, 69, 0.07);
}

.catalog-item.unaffordable {
  opacity: 0.65;
  border-style: dashed;
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(15, 22, 40, 0.65);
}

.catalog-item.unaffordable:hover {
  opacity: 0.85;
  border-color: var(--accent-rose);
}

.catalog-item-badge {
  flex-shrink: 0;
  text-align: right;
}

.ws-insufficient-alert {
  border: 2px solid var(--accent-rose);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.2), rgba(245, 158, 11, 0.14));
  box-shadow: 0 0 18px rgba(251, 113, 133, 0.25);
}

.ws-insufficient-alert .pip-console-header {
  color: #fecdd3;
  font-size: 15px;
}

.catalog-item-title {
  font-weight: 700;
  font-size: 14px;
}

.catalog-item-call {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-sky);
  margin-top: 2px;
}

.catalog-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dragon-rescue-banner {
  text-align: center;
  padding: 16px;
  background: radial-gradient(circle, rgba(246, 201, 69, 0.18) 0%, rgba(21, 28, 50, 0.4) 70%);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
}

.dragon-rescue-canvas {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  display: block;
}

.upgrade-callout {
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #ddd6fe;
  font-weight: 600;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== RETRO LETTERBOX CUT-SCENE OVERLAY ==================== */
.cutscene-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: #04060d;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.cutscene-bar {
  background: #04060d;
  padding: 14px 20px;
  flex-shrink: 0;
}

.cutscene-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid rgba(246, 201, 69, 0.35);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
}

.cutscene-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  text-shadow: 0 0 14px rgba(246, 201, 69, 0.45);
}

.cutscene-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cutscene-stage-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: radial-gradient(circle at center, #111930 0%, #04060d 75%);
}

.cutscene-canvas {
  width: min(100%, 760px);
  max-height: 100%;
  aspect-ratio: 320 / 148;
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.cutscene-bottom {
  border-top: 2px solid rgba(75, 97, 150, 0.55);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.cutscene-dialogue-box {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cutscene-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cutscene-progress {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.cutscene-text {
  margin: 0;
  min-height: 52px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
}

.cutscene-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cutscene-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================== MULTIPLE-CHOICE & FIX-THE-BUG TRIALS ==================== */
.mc-code-snippet {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-code);
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  color: #e2f1ff;
  white-space: pre-wrap;
  overflow-x: auto;
}

.mc-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.mc-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-panel-alt);
  color: var(--text-main);
  font-family: var(--font-ui);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.08s ease;
}

.mc-choice-card:hover {
  border-color: var(--accent-sky);
  background: #223055;
  transform: translateY(-1px);
}

.mc-choice-card.correct {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.22);
}

.mc-choice-card.wrong {
  border-color: var(--accent-rose);
  background: rgba(251, 113, 133, 0.18);
  opacity: 0.82;
}

.mc-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid var(--accent-sky);
  color: var(--accent-sky);
  font-weight: 900;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mc-choice-body {
  min-width: 0;
  flex: 1;
}

.mc-choice-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.mc-choice-code {
  margin: 6px 0 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #bae6fd;
  white-space: pre-wrap;
}

.bug-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent-rose);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.18), rgba(245, 158, 11, 0.14));
  color: var(--text-main);
  font-size: 14px;
}

.bug-banner-title {
  font-weight: 900;
  color: #fde68a;
  margin-bottom: 3px;
  font-size: 14.5px;
}

/* ==================== ADMIN ERA/REALM JUMP SELECTOR ==================== */
.hud-admin-jump {
  max-width: 195px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent-violet);
  background: rgba(167, 139, 250, 0.14);
  color: #ede9fe;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hud-admin-jump optgroup,
.hud-admin-jump option {
  background: #0f172a;
  color: #e2e8f0;
}

/* ==================== GUEST MODE & HERO CODE UI ==================== */
.title-footer {
  text-align: center;
  padding: 6px 0 12px;
}

.title-footer-link {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.title-footer-link:hover {
  opacity: 1;
  color: var(--accent-sky);
  text-decoration: underline;
}

.save-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.save-guest-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.38);
  color: var(--accent-violet);
}

.hero-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  border: 2px solid var(--accent-gold);
  text-align: center;
}

.hero-code-display {
  font-family: var(--font-mono);
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(246, 201, 69, 0.1);
  border: 1px dashed rgba(246, 201, 69, 0.5);
  word-break: break-all;
}

.hero-code-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-bright);
  background: var(--bg-code);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  outline: none;
}

.hero-code-input:focus {
  border-color: var(--accent-sky);
}

/* ==================== IN-GAME NAVIGATION & PAUSE MENU ==================== */
.hud-back-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.game-menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 22, 40, 0.72);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.game-menu-hero-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.game-menu-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
}

.game-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-menu-actions .btn {
  width: 100%;
  justify-content: center;
}

.game-menu-title-btn {
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.game-menu-title-btn:hover {
  border-color: rgba(251, 113, 133, 0.7);
  background: rgba(251, 113, 133, 0.14);
}

.game-menu-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
