@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=JetBrains+Mono:wght@600&display=swap');

:root {
  --bg-top: #050712;
  --bg-bottom: #0b1021;
  --panel: rgba(12, 16, 28, 0.82);
  --accent: #36f1cd;
  --accent-2: #ff5faf;
  --accent-3: #7a7cff;
  --text: #e9edfb;
  --muted: #9fb0c6;
  --focus: rgba(54, 241, 205, 0.22);
  --hero-image: url("./media/game/brokecodermain.png");
  --noise: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 22%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  color: var(--text);
  background: linear-gradient(150deg, var(--bg-top) 0%, var(--bg-bottom) 70%), var(--noise);
  background-attachment: fixed;
  overflow-y: auto;
}

.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#title-screen {
  background:
    linear-gradient(135deg, rgba(5, 7, 18, 0.9) 0%, rgba(6, 10, 24, 0.7) 45%, rgba(9, 14, 28, 0.65) 100%),
    radial-gradient(circle at 20% 20%, rgba(54, 241, 205, 0.08), rgba(0, 0, 0, 0)),
    radial-gradient(circle at 80% 0%, rgba(255, 95, 175, 0.09), rgba(0, 0, 0, 0)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

.title-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  align-items: center;
  width: min(1080px, 96vw);
}

.title-content {
  padding: 26px;
  border-radius: 18px;
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  max-width: 540px;
  width: min(540px, 95vw);
}

.logo {
  margin-bottom: 28px;
  text-shadow: 0 0 20px rgba(77, 224, 217, 0.2);
}

.logo-kicker {
  color: var(--accent-2);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.logo-word {
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: 2px;
  font-weight: 700;
}
.logo-word span {
  color: var(--accent);
}
.hero-blurb {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 18px);
}

.title-hero {
  display: flex;
  justify-content: center;
}

.hero-card {
  position: relative;
  width: min(420px, 90vw);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  background: linear-gradient(160deg, rgba(10, 12, 18, 0.7), rgba(10, 12, 18, 0.5));
}

.hero-image {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(5, 7, 18, 0.25), rgba(5, 7, 18, 0.75)), var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}

.hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #d3d9ec;
  background: linear-gradient(180deg, rgba(5, 7, 18, 0), rgba(5, 7, 18, 0.85));
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 90vw);
  margin-bottom: 20px;
  text-align: left;
}

.menu-item {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(77, 224, 217, 0.3);
  background: linear-gradient(120deg, rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 0.78));
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus), 0 10px 30px rgba(0,0,0,0.35);
  outline: none;
}

.footer {
  position: absolute;
  bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.hidden { display: none !important; pointer-events: none !important; }

#game-screen {
  background:
    linear-gradient(180deg, rgba(5, 7, 18, 0.9), rgba(5, 7, 18, 0.65)),
    radial-gradient(circle at 10% 10%, rgba(255, 95, 175, 0.08), rgba(0, 0, 0, 0)),
    radial-gradient(circle at 90% 20%, rgba(54, 241, 205, 0.08), rgba(0, 0, 0, 0)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow-y: auto;
}

.game-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(900px, 94vw);
  align-items: center;
  text-align: center;
}

.season-pill {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(54, 241, 205, 0.12);
  border: 1px solid rgba(54, 241, 205, 0.25);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.player-hud {
  align-self: flex-start;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px 12px;
  margin-top: 6px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--text);
}

.hud-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
  width: min(900px, 94vw);
}

.soundtrack-bar {
  width: min(900px, 94vw);
  display: grid;
  grid-template-columns: 1.1fr auto 220px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.soundtrack-meta { text-align: left; }
.soundtrack-kicker {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.soundtrack-title { font-weight: 700; font-size: 15px; }

.soundtrack-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.soundtrack-volume {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.soundtrack-volume input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

@media (max-width: 780px) {
  .soundtrack-bar { grid-template-columns: 1fr; }
  .soundtrack-actions { justify-content: flex-start; }
}

.hud-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.hud-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.hud-value {
  font-weight: 700;
  font-size: 16px;
}

.resource-hud {
  align-self: flex-start;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.resource-bar {
  margin-top: 6px;
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(54, 241, 205, 0.25);
}

.resource-fill {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  width: 0%;
  transition: width 150ms ease;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  width: min(900px, 94vw);
  margin-top: 8px;
}

.mode-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.mode-tab.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus), 0 8px 22px rgba(0,0,0,0.3);
  background: linear-gradient(120deg, rgba(54,241,205,0.12), rgba(255,95,175,0.12));
}

.mode-tab:hover,
.mode-tab:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.status-banner {
  width: min(900px, 94vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(54, 241, 205, 0.25);
  background: rgba(54, 241, 205, 0.08);
  color: var(--text);
  font-weight: 600;
  display: none;
}

.status-banner.visible { display: block; }

.panel-block {
  width: min(900px, 94vw);
  background: linear-gradient(160deg, rgba(10, 12, 18, 0.86), rgba(10, 12, 18, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  margin-top: 12px;
  text-align: left;
}

.panel-header h3 {
  margin: 4px 0 8px;
}

.panel-kicker {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.panel-meta {
  color: var(--muted);
  margin-bottom: 0;
}

#city-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-progress {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.location-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-size: cover;
  background-position: center;
  min-height: 150px;
  cursor: pointer;
  isolation: isolate;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.location-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(5, 7, 18, 0.7), rgba(5,7,18,0.5));
  border-radius: inherit;
  pointer-events: none;
}

.location-card:hover,
.location-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  outline: none;
}

.location-card.active {
  border-color: var(--accent);
  box-shadow: 0 10px 32px rgba(0,0,0,0.35);
}

.location-card h4,
.location-card p {
  position: relative;
  margin: 0;
  z-index: 1;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.location-card h4 {
  font-size: 18px;
}

.location-card p {
  color: var(--muted);
  line-height: 1.4;
}

.mission-list {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  align-items: start;
}

.mission-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.mission-card h4 {
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mission-summary {
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mission-card .primary-btn {
  align-self: flex-start;
}

.quest-log {
  display: grid;
  gap: 10px;
}

.quest-entry {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.quest-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.quest-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(54, 241, 205, 0.12);
  border: 1px solid rgba(54, 241, 205, 0.25);
  font-size: 12px;
  margin-right: 6px;
}

.cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.shop-grid,
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.shop-card,
.inventory-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-card h4,
.inventory-card h4 {
  margin: 4px 0 6px;
}

.shop-card .price {
  font-weight: 700;
}

.inventory-meta {
  color: var(--muted);
  font-size: 13px;
}

.game-placeholder {
  max-width: 720px;
  padding: 20px 22px;
  background: linear-gradient(120deg, rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 0.8));
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  font-size: 20px;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

#roster-description {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.character-card {
  background: rgba(18, 22, 33, 0.85);
  border: 1px solid rgba(77, 224, 217, 0.25);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.character-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.character-card h3 {
  margin: 10px 0 4px;
  font-size: 15px;
}

.character-card .character-id {
  color: var(--muted);
  font-size: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(77, 224, 217, 0.05), rgba(0,0,0,0.75));
  padding: 24px;
  z-index: 200;
}

.panel {
  width: min(460px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(77, 224, 217, 0.25);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  text-align: left;
}

.panel h2 { margin-top: 0; }

.field { display: block; margin-bottom: 12px; color: var(--muted); }
.field input[type="range"] { width: 100%; }
.field label { margin-right: 12px; }

.panel-close {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(77, 224, 217, 0.4);
  background: linear-gradient(90deg, rgba(77,224,217,0.15), rgba(255,111,163,0.1));
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.panel-close:hover,
.panel-close:focus-visible { box-shadow: 0 0 0 3px var(--focus); outline: none; }

#loading-screen {
  z-index: 20;
  background: linear-gradient(145deg, rgba(10, 12, 18, 0.7), rgba(10, 12, 18, 0.55)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.loading-content {
  padding: 20px 24px;
  background: rgba(9, 11, 16, 0.78);
  border-radius: 14px;
  border: 1px solid rgba(77, 224, 217, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  width: min(420px, 90vw);
}

.loading-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.loading-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.loading-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(77, 224, 217, 0.25);
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 20px;
  transition: width 200ms ease;
}

.dialogue-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.98), rgba(10, 12, 18, 0.95));
  border: 2px solid rgba(54, 241, 205, 0.4);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(54, 241, 205, 0.1);
  width: min(900px, 92vw);
  max-width: min(900px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
}

.dialogue-container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: -1;
  backdrop-filter: blur(4px);
}

.dialogue-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 95, 175, 0.1);
  color: var(--accent-2);
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialogue-close:hover {
  background: rgba(255, 95, 175, 0.2);
  transform: scale(1.1);
}

.dialogue-reopen {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 1001;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid rgba(54, 241, 205, 0.45);
  color: var(--text);
  background: rgba(10, 12, 18, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(54, 241, 205, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.dialogue-reopen:hover,
.dialogue-reopen:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus), 0 16px 40px rgba(0, 0, 0, 0.55);
  outline: none;
}

#dialogue-portrait {
  width: 86px;
  height: 86px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.dialogue-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

#dialogue-text {
  font-size: 16px;
  line-height: 1.6;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  border: 1px solid rgba(54, 241, 205, 0.35);
  color: var(--text);
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050712;
}

.ghost-btn {
  background: rgba(10, 12, 18, 0.8);
}

.primary-btn:hover,
.primary-btn:focus-visible,
.ghost-btn:hover,
.ghost-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}

.lesson-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(54, 241, 205, 0.12), rgba(0,0,0,0.85));
  backdrop-filter: blur(6px);
}

.lesson-card {
  width: min(660px, 94vw);
  background: linear-gradient(160deg, rgba(10, 12, 18, 0.94), rgba(10, 12, 18, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

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

.lesson-kicker {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-2);
}

.lesson-title {
  font-size: 22px;
  font-weight: 700;
}

.lesson-description {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.lesson-script {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  white-space: pre-wrap;
}

.lesson-input-row {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

#lesson-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 22, 0.9);
  color: var(--text);
  font-size: 15px;
}

#lesson-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

.lesson-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.lesson-progress {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(54, 241, 205, 0.25);
}

#lesson-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 180ms ease;
}

.lesson-reward {
  min-width: 140px;
  text-align: right;
}

.shake {
  animation: shake 0.28s;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.choice-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(54, 241, 205, 0.35);
  background: linear-gradient(120deg, rgba(10, 12, 18, 0.9), rgba(10, 12, 18, 0.75));
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}

.choice-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 820px) {
  .title-layout { width: 100%; }
  .title-content { padding: 20px; }
  .dialogue-container { width: min(94vw, 720px); }
  .mode-tabs,
  .panel-block,
  .status-banner { width: 100%; }
}

@media (max-width: 600px) {
  .logo-word { font-size: clamp(38px, 8vw, 52px); }
  .subtitle { font-size: 15px; }
  .menu { width: min(360px, 100%); }
  .menu-item { font-size: 15px; }
  .dialogue-container { width: 100%; max-width: 720px; }
  #dialogue-portrait { width: 64px; height: 64px; }
  .hero-card { aspect-ratio: 4 / 5; }
  .hud-row { grid-template-columns: 1fr; }
  .mode-tabs { flex-wrap: wrap; }
  .location-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* Music Player */
.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(12, 16, 28, 0.95);
  border: 2px solid rgba(54, 241, 205, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.music-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(54, 241, 205, 0.1);
  color: var(--accent);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn:hover {
  background: rgba(54, 241, 205, 0.2);
  transform: scale(1.05);
}

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

.music-info {
  color: var(--muted);
  font-size: 13px;
  min-width: 120px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
