@font-face {
  font-family: "Fredoka";
  src: url("../assets/fonts/fredoka-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/nunito-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../assets/fonts/nunito-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0f17;
  --surface: #131a26;
  --surface-2: #1b2434;
  --border: #2c384e;
  --ink: #f5efe2;
  --muted: #a6b1c2;
  --gold: #f0c14a;
  --gold-deep: #c9921c;
  --teal: #5ae2c5;
  --danger: #e05a47;
  --accent: #38c98b;
  --accent-soft: rgba(56, 201, 139, 0.16);
  --font-display: "Fredoka", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-body: "Nunito", "PingFang TC", "Hiragino Sans GB", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 60;
  background: var(--gold);
  color: #14110b;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

#app {
  width: min(960px, 100%);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: radial-gradient(720px 380px at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%), var(--bg);
  position: relative;
  overflow: hidden;
}

#app[data-stratum="0"] { --accent: #38c98b; }
#app[data-stratum="1"] { --accent: #f0943a; }
#app[data-stratum="2"] { --accent: #3eb5f0; }
#app[data-stratum="3"] { --accent: #b873f5; }
#app[data-stratum="4"] { --accent: #f468a0; }

#app.is-title .dock,
#app.is-guide .dock {
  display: none;
}

.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* TOP HUD */
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: rgba(14, 19, 29, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -2px 0 var(--accent);
  z-index: 20;
}

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

.depth-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.spark-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px 0 8px;
  border-radius: 999px;
  background: #231c10;
  border: 1px solid rgba(240, 193, 74, 0.45);
  color: var(--gold);
}
.spark-pill strong {
  font-family: var(--font-display);
  font-size: 16px;
}

.pill-btn, .icon-btn {
  min-height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-btn {
  padding: 0 11px;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.icon-btn[aria-pressed="false"] .ico-sound-off { display: none; }
.icon-btn[aria-pressed="true"] .ico-sound-on { display: none; }
.icon-btn[aria-pressed="true"] { color: var(--muted); }

/* MAIN STAGE */
#stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen-scroll {
  overflow-y: auto;
  padding: 14px 14px 24px;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.banner {
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #361e1c;
  border: 1px solid var(--danger);
  color: #ffd9d2;
  font-size: 13px;
}

/* TITLE SCREEN */
.screen-title {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.title-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.72;
}

.title-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  padding: 22px 18px;
  border-radius: 24px;
  background: rgba(17, 23, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.emblem-badge {
  width: 72px;
  height: 72px;
}
.emblem-badge svg { width: 100%; height: 100%; }

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--teal);
}

.title-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 48px);
  line-height: 1;
  color: var(--ink);
}

.title-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 34ch;
}

.feature-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.f-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.resume-pill {
  margin: 2px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.title-cta {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.title-legal {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.title-legal a {
  color: var(--teal);
  font-weight: 700;
  margin-left: 6px;
}

/* BUTTONS */
.btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-lg { min-height: 52px; flex: 1 1 180px; font-size: 16px; }
.btn-sm { min-height: 42px; padding: 0 14px; font-size: 14px; }

.btn-gold {
  background: linear-gradient(180deg, #f7d066, var(--gold));
  color: #191307;
  border-color: #a67814;
  box-shadow: 0 3px 0 #8a620b;
}

.btn-outline {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}

.btn-danger {
  background: #3d1d1a;
  color: #ffb8ae;
  border-color: #7d362d;
}

.btn:focus-visible,
.pill-btn:focus-visible,
.icon-btn:focus-visible,
.dock-btn:focus-visible,
.tile-btn:focus-visible,
.action-tile:focus-visible,
.briefing-x:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* EXCAVATION PIT */
.screen-pit {
  position: relative;
  padding: 8px 12px 10px;
  gap: 7px;
  overflow: hidden;
}

.pit-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meta-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.meta-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.meta-stat strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}

/* FIELD KIT BAR ON PIT */
.kit-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-height: 36px;
  font-size: 12px;
  font-weight: 700;
}

.kit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  white-space: nowrap;
}
.kit-chip.is-low {
  color: #ff9c8a;
}
.kit-supply { color: #90dff7; }
#pit-food-chip { color: #f4cc77; }
#pit-food-chip.is-low, #pit-water-chip.is-low { color: #ff8c78; }

.kit-ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.kit-tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--muted);
}
.kit-tier-dot[data-tier="stamped"] { background: var(--teal); }
.kit-tier-dot[data-tier="brass"] { background: var(--gold); }

.kit-warn {
  padding: 1px 6px;
  border-radius: 999px;
  background: #3d1d1a;
  border: 1px solid var(--danger);
  color: #ffb8ae;
  font-size: 11px;
  white-space: nowrap;
}

.kit-basin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid rgba(240, 193, 74, 0.45);
  color: var(--gold);
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.kit-basin.is-catching {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(240, 193, 74, 0.55);
  border-color: var(--gold);
}

.briefing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #17273a;
  border: 1px solid #355980;
  font-size: 12px;
  font-weight: 700;
}
.briefing-bar p { margin: 0; }
.briefing-x {
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid #355980;
  background: #101c2a;
  font-size: 17px;
  line-height: 1;
}

.grid-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strata-grid {
  width: min(100%, 400px, calc(100dvh - 338px));
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.strata-grid.is-pulse-armed {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(90, 226, 197, 0.35), inset 0 0 24px rgba(90, 226, 197, 0.16);
}

.strata-grid.is-surge {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(240, 193, 74, 0.4), inset 0 0 24px rgba(240, 193, 74, 0.18);
}

.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.tile-btn {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #202838;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.tile-btn:active { transform: scale(0.94); }
.tile-btn.is-hit { animation: tile-hit 0.16s ease; }

@keyframes tile-hit {
  50% { transform: scale(0.9); }
}

.tile-btn[data-kind="empty"] {
  background: rgba(9, 13, 20, 0.55);
  border-color: rgba(255, 255, 255, 0.04);
  cursor: default;
}
.tile-btn[data-kind="empty"]:active { transform: none; }

.tile-btn[data-kind="silt"] {
  background: linear-gradient(155deg, #323c4e, #202734);
}
.tile-btn[data-kind="granite"] {
  background: linear-gradient(155deg, #4b5466, #2b313e);
  border-color: #67738a;
}

/* ORE GLOW FOR CRYSTALS & GEODES */
.tile-btn[data-kind="crystal"] {
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 52%, #1d2638), #121f29 78%);
  border-color: var(--accent);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 8px color-mix(in srgb, var(--accent) 32%, transparent);
  animation: ore-pulse 2.2s ease-in-out infinite;
}
.tile-btn[data-kind="geode"] {
  background: radial-gradient(circle at 50% 45%, rgba(240, 193, 74, 0.38), #241b0e 78%);
  border-color: var(--gold);
  box-shadow: inset 0 0 12px rgba(240, 193, 74, 0.42), 0 0 8px rgba(240, 193, 74, 0.28);
  animation: geode-pulse 1.9s ease-in-out infinite;
}

@keyframes ore-pulse {
  50% { box-shadow: inset 0 0 16px color-mix(in srgb, var(--accent) 68%, transparent), 0 0 13px color-mix(in srgb, var(--accent) 48%, transparent); }
}
@keyframes geode-pulse {
  50% { box-shadow: inset 0 0 16px rgba(240, 193, 74, 0.65), 0 0 13px rgba(240, 193, 74, 0.48); }
}

.tile-btn[data-kind="pod"] {
  background: linear-gradient(155deg, #35244d, #1c132b);
  border-color: #c28bff;
}
.tile-btn[data-kind="shaft"] {
  background: linear-gradient(155deg, #16333d, #0d1d24);
  border-color: var(--teal);
}
.tile-btn[data-kind="shaft"].is-unlocked {
  box-shadow: 0 0 12px rgba(90, 226, 197, 0.5);
  animation: shaft-glow 1.6s ease-in-out infinite;
}
@keyframes shaft-glow {
  50% { box-shadow: 0 0 18px rgba(90, 226, 197, 0.85); }
}

.tile-glyph {
  width: 56%;
  height: 56%;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.tile-btn[data-kind="crystal"] .tile-glyph {
  filter: drop-shadow(0 0 4px currentColor);
}
.tile-btn[data-kind="geode"] .tile-glyph {
  filter: drop-shadow(0 0 4px rgba(240, 193, 74, 0.7));
}

.tile-cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.tile-hp {
  position: absolute;
  bottom: 3px;
  left: 5px;
  right: 5px;
  height: 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.tile-hp i {
  display: block;
  height: 100%;
  background: var(--gold);
}
.tile-btn[data-kind="crystal"] .tile-hp i { background: var(--accent); }
.tile-btn[data-kind="granite"] .tile-hp i { background: #a8b7d4; }

.pit-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.action-tile {
  position: relative;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  padding: 5px 8px;
  text-align: center;
}
.action-tile:disabled { opacity: 0.45; cursor: default; }

.action-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(90, 226, 197, 0.22);
  transition: width 0.2s ease;
}

.action-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.action-body strong {
  font-size: 13px;
  line-height: 1.15;
}
.action-body small {
  font-size: 11px;
  color: var(--muted);
}

.pulse-btn.is-ready {
  border-color: var(--teal);
  color: var(--teal);
}
.pulse-btn[aria-pressed="true"] {
  background: #143635;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(90, 226, 197, 0.3);
}
.descend-btn:not(:disabled) {
  border-color: var(--gold);
  background: #2c2210;
  color: var(--gold);
}
.descend-btn:not(:disabled) small { color: #f6dc93; }
.surge-btn.is-ready {
  border-color: var(--accent);
}
.surge-btn.is-active {
  background: #36270e;
  border-color: var(--gold);
  color: var(--gold);
}

/* SHEETS: WORKSHOP / ATLAS / GUIDE */
.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
}
.sheet-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.sec-title {
  margin: 4px 0 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
}
.sec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.sec-meta {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}

.pod-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b1d42, #1b2236);
  border: 1px solid #9e6ce6;
}
.pod-banner p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* WORKSHOP FIELD KIT PANEL */
.kit-panel {
  display: grid;
  gap: 10px;
}

.kit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.kit-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.kit-tier-row h4 { margin: 0; font-size: 16px; }
.kit-tier-row p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.kit-grid {
  display: grid;
  gap: 8px;
}

.kit-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.kit-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
.kit-item-head small {
  font-size: 12px;
  color: var(--muted);
}
.kit-meter {
  margin-top: 5px;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.kit-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.kit-meter.is-water i { background: #48c9f0; }
.kit-meter.is-food i { background: var(--gold); }
.kit-meter.is-low i { background: var(--danger); }

.kit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.kit-regen-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 200px;
}

.card-grid, .stratum-grid, .relic-grid, .milestone-grid {
  display: grid;
  gap: 10px;
}

.mod-card, .stratum-card, .relic-card, .mile-card, .guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.mod-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}
.mod-card h4, .stratum-card h3, .relic-card h4 { margin: 0; font-size: 16px; }
.mod-card p, .stratum-card p, .relic-card p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.mod-eff { color: var(--teal) !important; font-weight: 700; }

.stratum-card {
  border-left: 4px solid var(--biome, var(--accent));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stratum-card.is-current { box-shadow: 0 0 0 1px var(--gold); }
.stratum-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.stratum-mult {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.relic-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
}
.relic-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--rarity, #8a8175);
}
.relic-rar {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rarity, var(--muted));
}

.mile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.mile-card.is-done {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.mile-tag {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.mile-card.is-done .mile-tag { color: var(--accent); }

/* GUIDE SCREEN */
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-card h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.guide-intro { margin: 0; color: var(--muted); font-size: 14px; }
.guide-section {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.guide-section h3 { margin: 0 0 8px; font-size: 14px; color: var(--teal); }
.guide-steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

.lang-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.lang-switch .btn.is-active {
  background: var(--gold);
  color: #191307;
  border-color: #a67814;
}
.lang-switch .btn:not(.is-active) {
  background: var(--surface-2);
  border-color: var(--border);
}

.stats-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stats-grid div {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
}
.stats-grid dt { font-size: 11px; color: var(--muted); }
.stats-grid dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 16px; }

.guide-links {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}
.guide-links a { color: var(--teal); font-weight: 700; }

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

/* BOTTOM DOCK */
.dock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(14, 19, 29, 0.96);
  border-top: 1px solid var(--border);
}

.dock-btn {
  position: relative;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
}

.dock-btn[aria-current="page"] {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--ink);
}

.dock-dot {
  position: absolute;
  top: 7px;
  right: 26%;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--gold);
}

/* OVERLAYS & TOAST */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 9, 14, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.dialog-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dialog-card h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.dialog-card p { margin: 0; color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.reveal-card {
  align-items: center;
  text-align: center;
  border-color: var(--rarity, var(--gold));
}
.pod-emblem {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--rarity, var(--gold));
}
.pod-rarity {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rarity, var(--gold)) !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 45;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1b2a3b;
  border: 1px solid var(--teal);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 680px) {
  .card-grid, .stratum-grid, .milestone-grid, .kit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .screen-pit {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto 1fr;
    align-items: center;
    gap: 6px 8px;
  }
  .pit-meta { grid-column: 1; grid-row: 1; }
  .kit-strip { grid-column: 1; grid-row: 2; }
  .briefing-bar { display: none; }
  .grid-stage { grid-column: 1; grid-row: 3; }
  .strata-grid { width: min(100%, calc(100dvh - 195px)); }
  .pit-controls {
    grid-column: 2;
    grid-row: 1 / 4;
    grid-template-columns: 1fr;
    width: 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
