body {
  font-family: "Press Start 2P", cursive;
  color: #0f0;
  background-color: #1a1a2e;
  margin: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
}
#game-container {
  position: relative;
  width: 100%;
  height: 100vh;
  cursor: pointer;
}
#renderer-container {
  width: 100%;
  height: 100%;
  display: block;
}
#blocker {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#instructions {
  width: 80%;
  max-width: 680px;
  color: #0f0;
  font-size: 1.2em;
  text-shadow: 2px 2px #050;
  line-height: 1.5;
}
#minetris-title {
  font-size: 2.8em;
  margin-bottom: 10px;
  letter-spacing: 4px;
  color: #00ff88;
  text-shadow:
    0 0 8px #00ff88,
    0 0 20px #00ff88,
    0 0 40px #00cc66,
    3px 3px 0 #004422;
  animation: title-pulse 3s ease-in-out infinite;
}
@keyframes title-pulse {
  0%, 100% { text-shadow: 0 0 8px #00ff88, 0 0 20px #00ff88, 0 0 40px #00cc66, 3px 3px 0 #004422; }
  50%       { text-shadow: 0 0 14px #00ff88, 0 0 35px #00ff88, 0 0 60px #00cc66, 3px 3px 0 #004422; }
}
.tagline {
  font-size: 0.6em;
  color: #aaffcc;
  margin-bottom: 24px;
  text-shadow: 1px 1px #033;
}
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 20px;
  text-align: left;
}
.col-header {
  font-size: 0.6em;
  color: #ff0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 0, 0.3);
  padding-bottom: 4px;
}
.controls-col p {
  font-size: 0.55em;
  margin-bottom: 8px;
  color: #ccffcc;
  text-shadow: 1px 1px #050;
}
#instructions .click-info {
  font-size: 1em;
  font-weight: bold;
  color: #ff0;
  margin-top: 20px;
}
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background-color: #0f0;
  border: 1px solid black;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}
#crosshair.target-locked {
  background-color: #ff0;
}

/* ── Material HUD tooltip ── */
#material-tooltip {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #fff;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 100ms ease;
}
#material-tooltip.visible {
  opacity: 1;
}
#material-tooltip-pickaxe {
  color: #88ccff;
}
#material-tooltip-name {
  color: #ffdd88;
}
#material-tooltip-bar {
  color: #88ff88;
  letter-spacing: 1px;
}
#material-tooltip-hits {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Inventory HUD ── */
#inventory-hud {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
#inventory-total {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 1px 1px 2px #000;
}
#inventory-slots {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 6px 8px;
}
.inv-slot {
  position: relative;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}
.inv-slot-color {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}
.inv-slot-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
}
.inv-slot-num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 1px 1px 1px #000;
}
.inv-slot.selected {
  border-color: #ff0;
  box-shadow: 0 0 8px rgba(255, 255, 0, 0.65);
}

/* ── Score HUD ── */
/* ── Top-right HUD container (score + next-piece preview) ── */
#top-right-hud {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  pointer-events: none;
}

#score-display {
  font-family: "Press Start 2P", cursive;
  color: #0f0;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 4px;
  padding: 10px 14px;
  line-height: 2;
}

/* ── Next-piece preview panel ── */
#next-pieces-panel {
  font-family: "Press Start 2P", cursive;
  pointer-events: none;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
}
.np-label {
  font-size: 6px;
  color: rgba(0, 255, 0, 0.85);
  text-shadow: 1px 1px 2px #000;
  text-align: center;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 1px;
}
.np-pieces-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.np-piece {
  display: flex;
  flex-direction: column;
}
.np-row {
  display: flex;
}
.np-cell {
  width: 8px;
  height: 8px;
  margin: 1px;
  border-radius: 1px;
}
.np-empty {
  background: transparent;
}
.hud-score {
  font-size: 20px;
  color: #ff0;
  text-shadow: 1px 1px 3px #000;
  margin-bottom: 4px;
  display: block;
}
.hud-stat {
  font-size: 8px;
  color: rgba(0, 255, 0, 0.85);
  display: block;
}

/* ── Line-clear flash overlay ── */
#line-clear-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Press Start 2P", cursive;
  font-size: 24px;
  color: #ff0;
  text-shadow: 2px 2px 4px #000;
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

/* ── Combo multiplier banner ── */
@keyframes combo-pulse {
  0%   { transform: translate(-50%, -50%) scale(1.0); }
  40%  { transform: translate(-50%, -50%) scale(1.15); }
  70%  { transform: translate(-50%, -50%) scale(0.95); }
  100% { transform: translate(-50%, -50%) scale(1.0); }
}
#combo-banner {
  position: absolute;
  top: 40%;
  left: 75%;
  transform: translate(-50%, -50%);
  font-family: "Press Start 2P", cursive;
  font-size: 20px;
  color: #f80;
  text-shadow: 2px 2px 4px #000, 0 0 10px currentColor;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  animation: combo-pulse 0.35s ease-out;
}

/* ── Speed-up banner ── */
#speed-up-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Press Start 2P", cursive;
  font-size: 20px;
  color: #f80;
  text-shadow: 2px 2px 4px #000, 0 0 12px #f80;
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

/* ── Danger warning overlay ── */
@keyframes danger-pulse {
  from { opacity: 0.35; }
  to   { opacity: 1.0; }
}
#danger-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  display: none;
  border: 10px solid #f00;
  box-shadow: inset 0 0 50px rgba(255, 0, 0, 0.35);
  animation: danger-pulse 0.55s ease-in-out infinite alternate;
}
#danger-text {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #f00;
  text-shadow: 0 0 10px #f00, 1px 1px 2px #000;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  animation: danger-pulse 0.55s ease-in-out infinite alternate;
}

/* ── Line-clear screen flash overlay (triple / Tetris) ── */
#lc-flash-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

/* ── Level-up flash on speed level indicator ── */
@keyframes level-up-flash {
  0%   { color: #fff; text-shadow: 0 0 8px #f80, 0 0 16px #f80; transform: scale(1.4); }
  40%  { color: #f80; text-shadow: 0 0 6px #f80; transform: scale(1.1); }
  100% { color: rgba(0, 255, 0, 0.85); text-shadow: none; transform: scale(1.0); }
}
#hud-level.level-up-flash {
  animation: level-up-flash 0.6s ease-out forwards;
}

/* ── Score-slam bounce animation (Tetris clear) ── */
@keyframes score-slam {
  0%   { transform: scale(1.0); }
  25%  { transform: scale(1.7); }
  55%  { transform: scale(0.88); }
  75%  { transform: scale(1.12); }
  100% { transform: scale(1.0); }
}
#score-display.score-slam {
  animation: score-slam 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

/* ── Game Over screen ── */
@keyframes go-flicker {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}
#game-over-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}
#game-over-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2.4em;
  color: #f00;
  text-shadow: 3px 3px #600;
  margin-bottom: 36px;
  animation: go-flicker 1.5s infinite;
}
#game-over-stats {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #0f0;
  line-height: 3.2;
  margin-bottom: 36px;
  text-align: center;
}
#game-over-stats .go-label {
  color: rgba(0, 255, 0, 0.6);
  font-size: 8px;
}
#play-again-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#play-again-btn:hover { background: #ff0; }
.key-hint {
  font-size: 0.7em;
  opacity: 0.6;
  margin-left: 6px;
}
#go-main-menu-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#go-main-menu-btn:hover { background: #c0f; color: #fff; }
#first-game-teaser {
  margin: 12px 0 4px;
  padding: 10px 16px;
  background: rgba(0, 200, 255, 0.15);
  border: 1px solid rgba(0, 200, 255, 0.4);
  border-radius: 6px;
  text-align: center;
}
.first-game-teaser-text {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #0cf;
  line-height: 1.6;
  margin-bottom: 10px;
}
#first-game-explore-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0cf;
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#first-game-explore-btn:hover { background: #ff0; }
#go-share-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0cf;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 4px;
  transition: background 0.15s;
}
#go-share-btn:hover { background: #0af; }
#go-share-feedback {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0cf;
  height: 18px;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}
#go-share-feedback.visible { opacity: 1; }
#go-share-fallback-wrap {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#go-share-fallback-wrap label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 204, 255, 0.7);
}
#go-share-fallback-input {
  font-family: monospace;
  font-size: 11px;
  background: rgba(0,0,0,0.6);
  color: #0cf;
  border: 1px solid rgba(0, 204, 255, 0.4);
  border-radius: 4px;
  padding: 6px 10px;
  width: 340px;
  text-align: center;
}

/* ── Sprint complete screen ── */
#sprint-complete-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}
#sprint-complete-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2em;
  color: #0ff;
  text-shadow: 3px 3px #066;
  margin-bottom: 32px;
}
#sprint-complete-time-label {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(0, 255, 255, 0.55);
  letter-spacing: 4px;
  margin-bottom: 6px;
}
#sprint-final-time {
  font-family: "Press Start 2P", cursive;
  font-size: 2.6em;
  color: #fff;
  text-shadow: 2px 2px #0aa;
  margin-bottom: 22px;
}
#sprint-personal-best {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  margin-bottom: 36px;
}
#sprint-personal-best.sprint-new-best {
  color: #ffd700;
  text-shadow: 0 0 12px #ffd700;
}
#sprint-personal-best.sprint-pb-line {
  color: rgba(255, 255, 255, 0.55);
}
#sprint-play-again-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0ff;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#sprint-play-again-btn:hover { background: #ff0; }
#sprint-main-menu-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#sprint-main-menu-btn:hover { background: #c0f; color: #fff; }

/* ── Blitz complete screen ── */
#blitz-complete-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}
#blitz-complete-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2em;
  color: #ffd700;
  text-shadow: 3px 3px #664400;
  margin-bottom: 32px;
}
#blitz-complete-score-label {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(255, 215, 0, 0.55);
  letter-spacing: 4px;
  margin-bottom: 6px;
}
#blitz-final-score {
  font-family: "Press Start 2P", cursive;
  font-size: 2.6em;
  color: #fff;
  text-shadow: 2px 2px #aa6600;
  margin-bottom: 22px;
}
#blitz-personal-best {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  margin-bottom: 36px;
}
#blitz-personal-best.blitz-new-best {
  color: #ffd700;
  text-shadow: 0 0 12px #ffd700;
}
#blitz-personal-best.blitz-pb-line {
  color: rgba(255, 255, 255, 0.55);
}
#blitz-play-again-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #ffd700;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#blitz-play-again-btn:hover { background: #fff; }
#blitz-main-menu-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#blitz-main-menu-btn:hover { background: #c0f; color: #fff; }

/* ── Crafting panel ── */
#crafting-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 18px 22px;
  min-width: 320px;
  max-width: 420px;
  pointer-events: all;
  z-index: 150;
}
#crafting-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}
#crafting-title {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #ff0;
  text-shadow: 1px 1px 3px #000;
}
#crafting-pickaxe-tier {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
}
#crafting-recipes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.craft-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 10px 12px;
}
.craft-row.craft-row-ready {
  border-color: rgba(0, 255, 0, 0.35);
  background: rgba(0, 255, 0, 0.04);
}
.craft-name {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #fff;
}
.craft-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.5);
}
.craft-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.craft-chip {
  display: flex;
  align-items: center;
  gap: 5px;
}
.craft-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  flex-shrink: 0;
}
.craft-chip-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
}
.craft-output {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}
.craft-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #000;
  background: rgba(0, 255, 0, 0.5);
  border: 1px solid rgba(0, 255, 0, 0.6);
  border-radius: 3px;
  padding: 6px 12px;
  cursor: pointer;
  margin-top: 4px;
  align-self: flex-start;
  transition: background 0.1s;
}
.craft-btn:disabled {
  background: rgba(80, 80, 80, 0.5);
  border-color: rgba(120, 120, 120, 0.4);
  color: rgba(0, 0, 0, 0.5);
  cursor: not-allowed;
}
.craft-btn:not(:disabled):hover { background: rgba(0, 255, 0, 0.8); }
.craft-empty {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 12px 0;
}

/* ── High score — start screen (top-3 summary) ── */
#hs-start-panel {
  margin-top: 18px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(0, 255, 0, 0.75);
  text-shadow: 1px 1px 2px #000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.hs-start-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.hs-start-rank {
  color: rgba(255, 255, 0, 0.7);
  min-width: 24px;
}
.hs-start-score {
  color: #ff0;
  min-width: 56px;
  text-align: right;
}
.hs-start-time {
  color: rgba(0, 255, 0, 0.6);
}
.hs-none {
  color: rgba(255, 255, 255, 0.35);
  font-size: 7px;
}

/* ── High score — game-over full table ── */
#hs-go-table {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(0, 255, 0, 0.8);
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  max-height: 240px;
  overflow-y: auto;
}
#hs-go-label {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: rgba(0, 255, 0, 0.55);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.hs-go-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.hs-go-new {
  color: #ff0;
  text-shadow: 0 0 8px #ff0;
}
.hs-go-rank {
  min-width: 28px;
  color: rgba(255, 255, 0, 0.6);
}
.hs-go-new .hs-go-rank {
  color: #ff0;
}
.hs-go-score {
  min-width: 60px;
  text-align: right;
}
.hs-go-time {
  min-width: 48px;
}
.hs-go-date {
  color: rgba(0, 255, 0, 0.45);
  font-size: 7px;
}

/* ── Achievement toast ── */
#achievement-toast {
  position: absolute;
  bottom: 120px;
  right: -320px;
  width: 280px;
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid #ffd700;
  border-radius: 4px;
  padding: 10px 14px;
  z-index: 300;
  transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
#achievement-toast.ach-toast-visible {
  right: 16px;
}
.ach-toast-header {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ffd700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.ach-toast-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ach-toast-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.ach-toast-name {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #fff;
  margin-bottom: 4px;
}
.ach-toast-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
}

/* ── Nudge hint ── */
#nudge-hint {
  position: absolute;
  bottom: 80px;
  right: 16px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 0, 0.85);
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 0, 0.3);
  border-radius: 3px;
  padding: 6px 10px;
}

/* ── Crafted banner ── */
#crafted-banner {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Press Start 2P", cursive;
  font-size: 18px;
  color: #0f0;
  text-shadow: 2px 2px 4px #000, 0 0 12px #0f0;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  z-index: 160;
}

/* ── Pause screen ── */
#pause-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 210;
  pointer-events: all;
}
#pause-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2.8em;
  color: #ff0;
  text-shadow: 3px 3px #a00, 0 0 18px #ff0;
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}
#pause-resume-btn,
#pause-restart-btn,
#pause-settings-btn,
#pause-main-menu-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 14px 42px;
  cursor: pointer;
  border-radius: 4px;
  width: 220px;
  transition: background 0.15s;
}
#pause-resume-btn:hover  { background: #ff0; }
#pause-restart-btn:hover { background: #f80; }
#pause-settings-btn:hover { background: #08f; color: #fff; }
#pause-main-menu-btn:hover { background: #c0f; color: #fff; }

/* ── Audio settings overlay ── */
#settings-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#settings-panel {
  background: #111;
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-width: 360px;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}
#settings-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.4em;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  letter-spacing: 0.1em;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.settings-label {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ff0;
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}
.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #0f0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px #0f0;
}
.vol-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #0f0;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px #0f0;
}
.vol-val {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0f0;
  width: 30px;
  text-align: left;
  flex-shrink: 0;
}
#settings-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 12px 36px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 8px;
  transition: background 0.15s;
}
#settings-close-btn:hover { background: #ff0; }

/* ── Colorblind toggle row ── */
.settings-section-divider {
  width: 100%;
  height: 1px;
  background: #333;
  margin: 10px 0 6px;
}
.settings-row-toggle {
  justify-content: space-between;
  gap: 0;
}
.settings-label-toggle {
  width: auto;
  flex: 1;
}
.settings-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #666;
  text-align: left;
  width: 100%;
  margin-bottom: 4px;
}
/* Toggle switch (pill style) */
.cb-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  flex-shrink: 0;
}
.cb-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cb-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #333;
  border: 1px solid #555;
  border-radius: 22px;
  transition: background 0.2s;
}
.cb-toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.cb-toggle-switch input:checked + .cb-toggle-slider {
  background: #0f0;
  border-color: #0f0;
}
.cb-toggle-switch input:checked + .cb-toggle-slider::before {
  transform: translateX(22px);
  background: #000;
}

/* ── Start screen settings button ── */
/* ── Resume game button — special green CTA in play group ── */
#start-resume-btn {
  color: #000;
  background: #4ade80;
  border-color: #4ade80;
  font-size: 10px;
  padding: 10px 20px;
}
#start-resume-btn:hover { background: #6ee7a0; color: #000; border-color: #6ee7a0; }

/* ── Main menu button groups ── */
.start-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.menu-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.menu-group-play {
  gap: 10px;
  margin-bottom: 8px;
}
/* ── Collapsible secondary menu ── */
.menu-more-toggle {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255,255,255,0.4);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 18px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
  margin-top: 4px;
}
.menu-more-toggle:hover {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.25);
}
.menu-more-toggle.open {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.2);
}
.menu-secondary {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.menu-secondary.open {
  display: flex;
}
.menu-group-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 2px;
  user-select: none;
}
.menu-group-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Standardized menu button base */
.menu-group button {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.menu-group button:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
/* Play group — CTA stays prominent */
#start-random-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  font-weight: bold;
  color: #ff0;
  cursor: pointer;
  text-shadow: 0 0 12px rgba(255,255,0,0.4);
}

#daily-challenge-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0cf;
  text-shadow: 0 0 8px #0cf;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 150;
}

#weekly-challenge-badge {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #00dc8c;
  text-shadow: 0 0 8px #00dc8c;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 150;
}

/* ── Tutorial overlay ── */
#tutorial-overlay {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.80);
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 14px 20px 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 195;
  min-width: 300px;
  max-width: 460px;
  pointer-events: none;
}
#tutorial-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
#tutorial-text {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #ff0;
  text-shadow: 1px 1px 0 #000, 0 0 10px #ff0;
  margin: 0;
  line-height: 1.6;
}
#tutorial-subtext {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #aaa;
  margin: 0;
  line-height: 1.6;
  display: none;
}
#tutorial-dismiss-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 3px;
  margin-top: 4px;
  pointer-events: all;
  display: none;
  transition: background 0.15s;
}
#tutorial-dismiss-btn:hover { background: #ff0; }
#tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}
#tutorial-step-count {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #555;
}
#tutorial-skip-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #888;
  background: transparent;
  border: 1px solid #444;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 3px;
  pointer-events: all;
  transition: color 0.15s, border-color 0.15s;
}
#tutorial-skip-btn:hover { color: #f44; border-color: #f44; }

/* Pulsing C-key icon shown during crafting tutorial step */
@keyframes ckey-pulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 6px #0f0; }
  50%       { transform: scale(1.2); box-shadow: 0 0 18px #0f0, 0 0 30px #0f08; }
}
#tutorial-ckey-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}
#tutorial-ckey-label {
  font-family: "Press Start 2P", cursive;
  font-size: 18px;
  color: #0f0;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #0f0;
  border-radius: 6px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ckey-pulse 1s ease-in-out infinite;
}

/* Tutorial arrow indicators */
@keyframes tutorial-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(12px); }
}
@keyframes tutorial-pulse-left {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%      { transform: translateX(-6px); opacity: 0.7; }
}
#tutorial-arrow-down {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
  color: #0f0;
  text-shadow: 0 0 12px #0f0, 0 0 24px #0f08;
  animation: tutorial-bounce 1s ease-in-out infinite;
  pointer-events: none;
  z-index: 196;
}
#tutorial-arrow-crosshair {
  position: absolute;
  top: 50%;
  left: calc(50% + 30px);
  transform: translateY(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #ff0;
  text-shadow: 0 0 8px #ff0, 0 0 16px #ff08;
  animation: tutorial-pulse-left 0.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 196;
}

/* Context-sensitive crafting hint toast */
#craft-hint-toast {
  display: none;
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 10px 18px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #0f0;
  text-shadow: 0 0 8px #0f0;
  z-index: 194;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Contextual game tooltips (first Classic game) ─────────────────────────── */
#game-tooltip {
  display: none;
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.88);
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
  z-index: 195;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

@keyframes gt-pulse-anim {
  0%, 100% { border-color: #ffd700; box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
  50% { border-color: #fff8dc; box-shadow: 0 0 16px rgba(255, 215, 0, 0.6); }
}

#game-tooltip.gt-pulse {
  animation: gt-pulse-anim 1.2s ease-in-out infinite;
}

/* ── Post-tutorial coach mark toasts (first 3 games) ──────────────────────── */
#coach-mark-toast {
  display: none;
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.90);
  border: 2px solid #4fc3f7;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #e0f7fa;
  text-shadow: 0 0 6px rgba(79, 195, 247, 0.6);
  z-index: 196;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

@keyframes cm-slide-in-anim {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  85%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

#coach-mark-toast.cm-slide-in {
  animation: cm-slide-in-anim 4.5s ease-in-out forwards;
}


#daily-go-section {
  margin: 14px 0;
  text-align: center;
  font-family: "Press Start 2P", cursive;
}
#daily-go-label {
  font-size: 8px;
  color: #0cf;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.daily-best-score {
  font-size: 18px;
  color: #0cf;
}
.daily-best-score.daily-best-new {
  color: #ff0;
  text-shadow: 0 0 10px #ff0;
  animation: go-flicker 1.2s infinite;
}

#weekly-go-section {
  margin: 14px 0;
  text-align: center;
  font-family: "Press Start 2P", cursive;
}
#weekly-go-label {
  font-size: 8px;
  color: #00dc8c;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

/* ── Mode select screen ── */
#mode-select {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 250;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 32px 0;
}
#mode-select-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 90%;
  max-width: 860px;
}
#mode-select-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.4em;
  color: #00ff88;
  letter-spacing: 4px;
  text-shadow: 0 0 10px #00ff88, 0 0 24px #00cc66;
  margin: 0;
}
#mode-cards {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}
.mode-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.mode-section-header {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: rgba(0, 255, 136, 0.5);
  letter-spacing: 6px;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0, 255, 136, 0.15);
}
.mode-section-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(0, 20, 10, 0.75);
  border: 2px solid rgba(0, 255, 136, 0.45);
  border-radius: 8px;
  padding: 28px 22px 22px;
  width: 200px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.08);
}
.mode-card:not(.mode-card-locked):hover {
  border-color: #00ff88;
  box-shadow: 0 0 22px rgba(0, 255, 136, 0.35);
  transform: translateY(-4px);
}
.mode-card-locked {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: rgba(120, 120, 120, 0.3);
}
.mode-card-icon {
  font-size: 2.2em;
  line-height: 1;
}
.mode-card-name {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  color: #0f0;
  text-shadow: 0 0 6px #0f0;
  letter-spacing: 1px;
}
.mode-card-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #aaffcc;
  text-align: center;
  line-height: 1.6;
}
.mode-card-pb {
  font-family: "Press Start 2P", cursive;
  font-size: 0.42em;
  color: #ff0;
  text-align: center;
  min-height: 1.2em;
  text-shadow: 0 0 6px rgba(255, 255, 0, 0.5);
}
.mode-card-coming {
  font-family: "Press Start 2P", cursive;
  font-size: 0.42em;
  color: rgba(180, 180, 180, 0.65);
  letter-spacing: 1px;
}
.mode-card-lock {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.9em;
  opacity: 0.7;
}
/* Per-mode leaderboard button */
.mode-card-lb-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.75em;
  padding: 3px 5px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, border-color 0.15s;
  z-index: 3;
  line-height: 1;
}
.mode-card:not(.mode-card-locked) .mode-card-lb-btn:hover {
  opacity: 1;
  border-color: rgba(0, 255, 136, 0.5);
}
.mode-card-locked .mode-card-lb-btn {
  display: none;
}

/* Season banner action buttons */
#season-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.season-banner-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.25);
  color: rgba(0, 255, 136, 0.7);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.season-banner-btn:hover {
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.15);
}
/* Daily Challenge card — gold/amber accent */
.mode-card-daily {
  border-color: rgba(255, 180, 0, 0.5);
  box-shadow: 0 0 14px rgba(255, 180, 0, 0.1);
}
.mode-card-daily .mode-card-name {
  color: #ffb400;
  text-shadow: 0 0 6px #ffb400;
}
.mode-card-daily .mode-card-desc {
  color: #ffe08a;
}
.mode-card-daily:hover {
  border-color: #ffb400 !important;
  box-shadow: 0 0 22px rgba(255, 180, 0, 0.4) !important;
}
.mode-card-daily.mode-card-highlighted {
  border-color: #ffb400;
  box-shadow: 0 0 28px rgba(255, 180, 0, 0.55);
}

/* Weekly Challenge card — emerald/teal accent */
.mode-card-weekly {
  border-color: rgba(0, 220, 140, 0.5);
  box-shadow: 0 0 14px rgba(0, 220, 140, 0.1);
}
.mode-card-weekly .mode-card-name {
  color: #00dc8c;
  text-shadow: 0 0 6px #00dc8c;
}
.mode-card-weekly .mode-card-desc {
  color: #80f0c8;
}
.mode-card-weekly:hover {
  border-color: #00dc8c !important;
  box-shadow: 0 0 22px rgba(0, 220, 140, 0.4) !important;
}
.mode-card-weekly.mode-card-highlighted {
  border-color: #00dc8c;
  box-shadow: 0 0 28px rgba(0, 220, 140, 0.55);
}

.mode-card-puzzle {
  border-color: rgba(180, 100, 255, 0.5);
  box-shadow: 0 0 14px rgba(180, 100, 255, 0.1);
}
.mode-card-puzzle .mode-card-name {
  color: #c060ff;
  text-shadow: 0 0 6px #c060ff;
}
.mode-card-puzzle .mode-card-desc {
  color: #d8a0ff;
}
.mode-card-puzzle:hover {
  border-color: #c060ff !important;
  box-shadow: 0 0 22px rgba(180, 100, 255, 0.4) !important;
}
.mode-card-puzzle.mode-card-highlighted {
  border-color: #c060ff;
  box-shadow: 0 0 28px rgba(180, 100, 255, 0.55);
}

/* ── Survival World Card (stats panel inside the Survival mode card) ── */
.survival-world-card {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(74, 140, 44, 0.1);
  border: 1px solid rgba(74, 140, 44, 0.3);
  border-radius: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  text-align: left;
}
.survival-world-card .wc-title {
  color: #55c059;
  text-shadow: 0 0 6px rgba(74, 140, 44, 0.6);
  margin-bottom: 5px;
  letter-spacing: 1px;
}
.survival-world-card .wc-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
  line-height: 1.5;
}
.survival-world-card .wc-label {
  color: rgba(130, 200, 130, 0.75);
}
.survival-world-card .wc-val {
  color: #fff;
  text-align: right;
}
.survival-world-card .wc-new {
  color: rgba(130, 200, 130, 0.6);
  text-align: center;
  padding: 2px 0;
}
/* Prominent Day N heading inside world card */
.survival-world-card .wc-day-age {
  font-family: "Press Start 2P", cursive;
  font-size: 1.5em;
  color: #55c059;
  text-shadow: 0 0 10px rgba(74, 140, 44, 0.8), 0 0 20px rgba(74, 140, 44, 0.4);
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
/* "Begin a new world" CTA inside world card */
.survival-world-card .wc-cta-title {
  color: #55c059;
  text-shadow: 0 0 6px rgba(74, 140, 44, 0.6);
  text-align: center;
  margin-bottom: 5px;
  letter-spacing: 1px;
}
.survival-world-card .wc-cta-desc {
  color: rgba(130, 200, 130, 0.7);
  text-align: center;
  line-height: 1.7;
}

/* Event journal inside world card */
.survival-world-card .wc-journal {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
  margin-bottom: 2px;
}
.survival-world-card .wc-journal-entry {
  font-size: 0.72em;
  color: rgba(150, 220, 150, 0.8);
  background: rgba(74, 140, 44, 0.12);
  border: 1px solid rgba(74, 140, 44, 0.25);
  border-radius: 3px;
  padding: 1px 5px;
}

/* ── Survival mode card — Creeper green accent ── */
.mode-card-survival {
  border-color: rgba(74, 140, 44, 0.5);
  box-shadow: 0 0 14px rgba(74, 140, 44, 0.15);
}
.mode-card-survival .mode-card-name {
  color: #55c059;
  text-shadow: 0 0 6px #4a8c2c;
}
.mode-card-survival .mode-card-desc {
  color: #8fce8f;
}
.mode-card-survival:hover {
  border-color: #55c059 !important;
  box-shadow: 0 0 22px rgba(74, 140, 44, 0.45) !important;
}
.mode-card-survival.mode-card-highlighted {
  border-color: #55c059;
  box-shadow: 0 0 28px rgba(74, 140, 44, 0.55);
}
/* Creeper face icon */
.survival-creeper-face {
  font-size: 1em;
  image-rendering: pixelated;
}
.survival-creeper-face svg {
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
}

/* ── Co-op mode card ── */
.mode-card-coop {
  border-color: rgba(0, 180, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 180, 255, 0.1);
}
.mode-card-coop .mode-card-name {
  color: #00ccff;
  text-shadow: 0 0 6px #00ccff;
}
.mode-card-coop .mode-card-desc {
  color: #99eeff;
}
.mode-card-coop:hover {
  border-color: #00ccff !important;
  box-shadow: 0 0 22px rgba(0, 180, 255, 0.4) !important;
}
.mode-card-coop.mode-card-highlighted {
  border-color: #00ccff;
  box-shadow: 0 0 28px rgba(0, 180, 255, 0.55);
}

/* ── Co-op lobby overlay ── */
#coop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
}
#coop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(0, 15, 25, 0.95);
  border: 2px solid rgba(0, 180, 255, 0.5);
  border-radius: 10px;
  padding: 40px 48px;
  min-width: 320px;
  max-width: 460px;
  box-shadow: 0 0 40px rgba(0, 180, 255, 0.2);
  text-align: center;
}
#coop-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.1em;
  color: #00ccff;
  text-shadow: 0 0 10px #00ccff, 0 0 24px #0088cc;
  letter-spacing: 3px;
  margin-bottom: 4px;
}
#coop-subtitle {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #99eeff;
  line-height: 1.7;
}
#coop-choice-btns {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}
#coop-create-btn,
#coop-join-btn-choice {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  padding: 14px 24px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
#coop-create-btn {
  background: rgba(0, 180, 255, 0.15);
  border: 2px solid rgba(0, 180, 255, 0.6);
  color: #00ccff;
}
#coop-create-btn:hover {
  background: rgba(0, 180, 255, 0.3);
  box-shadow: 0 0 14px rgba(0, 180, 255, 0.4);
}
#coop-join-btn-choice {
  background: rgba(0, 255, 136, 0.1);
  border: 2px solid rgba(0, 255, 136, 0.4);
  color: #00ff88;
}
#coop-join-btn-choice:hover {
  background: rgba(0, 255, 136, 0.22);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.35);
}
#coop-room-code-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #99eeff;
  letter-spacing: 2px;
  margin-bottom: -8px;
}
#coop-room-code {
  font-family: "Press Start 2P", cursive;
  font-size: 2.4em;
  color: #00ccff;
  text-shadow: 0 0 14px #00ccff, 0 0 28px #0066aa;
  letter-spacing: 10px;
  padding: 8px 16px;
  border: 2px solid rgba(0, 180, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 180, 255, 0.05);
  min-width: 160px;
}
#coop-copy-link-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.4);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
}
#coop-copy-link-btn:hover {
  background: rgba(0, 255, 136, 0.22);
}
#coop-copy-feedback {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: #00ff88;
  min-height: 1.4em;
}
#coop-waiting-spinner {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #99eeff;
  letter-spacing: 1px;
  animation: coop-blink 1.2s step-end infinite;
}
@keyframes coop-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
#coop-status-msg,
#coop-join-status-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: #ff8888;
  min-height: 1.4em;
  letter-spacing: 0.5px;
}
#coop-join-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 0.42em;
  color: #99eeff;
  line-height: 1.7;
}
#coop-code-input {
  font-family: "Press Start 2P", cursive;
  font-size: 1.8em;
  color: #00ccff;
  background: rgba(0, 20, 40, 0.8);
  border: 2px solid rgba(0, 180, 255, 0.5);
  border-radius: 6px;
  text-align: center;
  width: 160px;
  padding: 10px;
  letter-spacing: 8px;
  text-transform: uppercase;
  caret-color: #00ccff;
}
#coop-code-input:focus {
  outline: none;
  border-color: #00ccff;
  box-shadow: 0 0 12px rgba(0, 180, 255, 0.35);
}
#coop-join-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
}
#coop-join-confirm-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.62em;
  padding: 12px 28px;
  background: rgba(0, 180, 255, 0.2);
  border: 2px solid rgba(0, 180, 255, 0.6);
  border-radius: 5px;
  color: #00ccff;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
#coop-join-confirm-btn:hover {
  background: rgba(0, 180, 255, 0.35);
  box-shadow: 0 0 14px rgba(0, 180, 255, 0.4);
}
#coop-ready-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 0.62em;
  color: #00ff88;
  text-shadow: 0 0 8px #00ff88;
  letter-spacing: 1px;
}
#coop-ready-code {
  font-family: "Press Start 2P", cursive;
  font-size: 0.42em;
  color: #99eeff;
  letter-spacing: 2px;
}
#coop-diff-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  width: 100%;
}
.coop-diff-heading {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: rgba(0, 255, 221, 0.6);
  letter-spacing: 2px;
  margin-bottom: 2px;
}
#coop-diff-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.coop-diff-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  padding: 8px 12px;
  background: rgba(0, 40, 40, 0.5);
  border: 1px solid rgba(0, 255, 221, 0.3);
  border-radius: 5px;
  color: rgba(0, 255, 221, 0.55);
  cursor: pointer;
  text-align: center;
  line-height: 1.7;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-width: 90px;
}
.coop-diff-btn:hover {
  background: rgba(0, 255, 221, 0.12);
  border-color: rgba(0, 255, 221, 0.6);
  color: #00ffdd;
}
.coop-diff-btn.coop-diff-selected {
  background: rgba(0, 255, 221, 0.18);
  border-color: #00ffdd;
  color: #00ffdd;
  text-shadow: 0 0 6px #00ffdd88;
}
.coop-diff-btn:disabled {
  cursor: default;
}
.coop-diff-stats {
  font-size: 0.75em;
  color: rgba(0, 255, 221, 0.45);
}
#coop-diff-guest-display {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #00ffdd;
  letter-spacing: 2px;
  padding: 6px 14px;
  border: 1px solid rgba(0, 255, 221, 0.35);
  border-radius: 4px;
  background: rgba(0, 40, 40, 0.5);
}
#coop-ready-status {
  display: flex;
  gap: 18px;
  margin: 6px 0 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  color: rgba(180, 180, 180, 0.6);
}
#coop-host-ready-indicator.ready,
#coop-guest-ready-indicator.ready {
  color: #00ff88;
  text-shadow: 0 0 6px #00ff88;
}
#coop-start-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  padding: 16px 36px;
  background: rgba(0, 255, 136, 0.15);
  border: 2px solid rgba(0, 255, 136, 0.6);
  border-radius: 6px;
  color: #00ff88;
  cursor: pointer;
  letter-spacing: 2px;
  text-shadow: 0 0 6px #00ff88;
  transition: background 0.15s, box-shadow 0.15s;
  margin-top: 8px;
}
#coop-start-btn:hover {
  background: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.45);
}
/* Shared cancel/back buttons in coop overlay */
#coop-choice-cancel-btn,
#coop-create-cancel-btn,
#coop-join-cancel-btn,
#coop-ready-cancel-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.48em;
  color: #888;
  background: transparent;
  border: 1px solid rgba(136, 136, 136, 0.35);
  border-radius: 4px;
  padding: 8px 18px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: color 0.15s, border-color 0.15s;
  margin-top: 4px;
}
#coop-choice-cancel-btn:hover,
#coop-create-cancel-btn:hover,
#coop-join-cancel-btn:hover,
#coop-ready-cancel-btn:hover {
  color: #ccc;
  border-color: rgba(200, 200, 200, 0.5);
}

/* ── Battle mode card ── */
.mode-card-battle {
  border-color: rgba(255, 60, 60, 0.5);
  box-shadow: 0 0 14px rgba(255, 60, 60, 0.1);
}
.mode-card-battle .mode-card-name {
  color: #ff4444;
  text-shadow: 0 0 6px #ff4444;
}
.mode-card-battle .mode-card-desc {
  color: #ffaaaa;
}
.mode-card-battle:hover {
  border-color: #ff4444 !important;
  box-shadow: 0 0 22px rgba(255, 60, 60, 0.4) !important;
}
.mode-card-battle.mode-card-highlighted {
  border-color: #ff4444;
  box-shadow: 0 0 28px rgba(255, 60, 60, 0.55);
}

/* ── Battle lobby overlay ── */
#battle-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
}
#battle-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: rgba(25, 5, 5, 0.97);
  border: 2px solid rgba(255, 60, 60, 0.5);
  border-radius: 10px;
  padding: 40px 48px;
  min-width: 320px;
  max-width: 460px;
  font-family: "Press Start 2P", cursive;
  text-align: center;
}
#battle-title {
  font-size: 1.3em;
  color: #ff4444;
  text-shadow: 0 0 12px rgba(255, 60, 60, 0.7);
  letter-spacing: 2px;
}
#battle-subtitle {
  font-size: 0.55em;
  color: #ff9999;
  letter-spacing: 1px;
}
#battle-choice-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
#battle-create-btn,
#battle-join-btn-choice {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  padding: 14px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
#battle-create-btn {
  background: rgba(255, 60, 60, 0.18);
  border: 2px solid rgba(255, 60, 60, 0.7);
  color: #ff6666;
}
#battle-create-btn:hover {
  background: rgba(255, 60, 60, 0.32);
  border-color: #ff4444;
}
#battle-join-btn-choice {
  background: rgba(255, 140, 60, 0.12);
  border: 2px solid rgba(255, 140, 60, 0.5);
  color: #ff9966;
}
#battle-join-btn-choice:hover {
  background: rgba(255, 140, 60, 0.25);
  border-color: #ff8844;
}
#battle-qm-divider {
  font-size: 0.5em;
  color: #886666;
  letter-spacing: 1px;
}
#battle-quickmatch-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  padding: 14px 20px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 200, 60, 0.12);
  border: 2px solid rgba(255, 200, 60, 0.5);
  color: #ffcc44;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}
#battle-quickmatch-btn:hover {
  background: rgba(255, 200, 60, 0.25);
  border-color: #ffcc44;
}
#battle-room-code-label {
  font-size: 0.5em;
  color: #ff9999;
  letter-spacing: 1px;
}
#battle-room-code {
  font-size: 2.4em;
  color: #ff4444;
  letter-spacing: 12px;
  text-shadow: 0 0 20px rgba(255, 60, 60, 0.8);
  padding: 10px 0;
  min-width: 120px;
  text-align: center;
}
#battle-copy-link-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.52em;
  padding: 10px 16px;
  border-radius: 5px;
  cursor: pointer;
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.4);
  color: #ff9999;
  transition: background 0.15s;
}
#battle-copy-link-btn:hover { background: rgba(255, 60, 60, 0.22); }
#battle-copy-feedback {
  font-size: 0.45em;
  color: #ff9999;
  min-height: 1em;
}
#battle-waiting-spinner {
  font-size: 0.5em;
  color: #ffaaaa;
  animation: battle-blink 1.2s step-end infinite;
}
@keyframes battle-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
#battle-status-msg,
#battle-join-status-msg {
  font-size: 0.45em;
  color: #ff8888;
  min-height: 1em;
  text-align: center;
}
#battle-join-hint {
  font-size: 0.5em;
  color: #ffaaaa;
  margin-bottom: 4px;
}
#battle-code-input {
  font-family: "Press Start 2P", cursive;
  font-size: 1.6em;
  width: 140px;
  text-align: center;
  background: rgba(30, 5, 5, 0.9);
  border: 2px solid rgba(255, 60, 60, 0.5);
  border-radius: 6px;
  color: #ff4444;
  padding: 10px 8px;
  letter-spacing: 8px;
  text-transform: uppercase;
  outline: none;
}
#battle-code-input:focus {
  border-color: #ff4444;
  box-shadow: 0 0 10px rgba(255, 60, 60, 0.4);
}
#battle-join-btns {
  display: flex;
  gap: 14px;
}
#battle-join-confirm-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 60, 60, 0.2);
  border: 2px solid rgba(255, 60, 60, 0.7);
  color: #ff6666;
  transition: background 0.15s;
}
#battle-join-confirm-btn:hover { background: rgba(255, 60, 60, 0.35); }
#battle-ready-msg {
  font-size: 0.55em;
  color: #ff9999;
  letter-spacing: 1px;
}
#battle-ready-code {
  font-size: 0.5em;
  color: #ff8888;
}
#battle-ready-status {
  display: flex;
  gap: 32px;
  font-size: 0.52em;
  color: #886666;
}
#battle-host-ready-indicator.ready,
#battle-guest-ready-indicator.ready {
  color: #ff4444;
}
#battle-start-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  padding: 16px 32px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 60, 60, 0.22);
  border: 2px solid rgba(255, 60, 60, 0.8);
  color: #ff4444;
  text-shadow: 0 0 6px rgba(255, 60, 60, 0.5);
  transition: background 0.15s, box-shadow 0.15s;
  width: 100%;
}
#battle-start-btn:hover {
  background: rgba(255, 60, 60, 0.38);
  box-shadow: 0 0 16px rgba(255, 60, 60, 0.4);
}
/* Shared cancel/back buttons in battle overlay */
#battle-choice-cancel-btn,
#battle-create-cancel-btn,
#battle-join-cancel-btn,
#battle-ready-cancel-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.52em;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(150, 100, 100, 0.4);
  color: #886666;
  transition: color 0.15s, border-color 0.15s;
}
#battle-choice-cancel-btn:hover,
#battle-create-cancel-btn:hover,
#battle-join-cancel-btn:hover,
#battle-ready-cancel-btn:hover {
  color: #ccc;
  border-color: rgba(200, 150, 150, 0.5);
}

/* ── Battle countdown overlay ────────────────────────────────────────────── */
#battle-countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 250;
  pointer-events: none;
}
#battle-countdown-number {
  font-family: "Press Start 2P", cursive;
  font-size: 8em;
  color: #ff4444;
  text-shadow: 0 0 30px rgba(255, 60, 60, 0.9), 4px 4px #600;
  animation: battle-countdown-pop 0.7s ease-out forwards;
}
@keyframes battle-countdown-pop {
  0%   { transform: scale(1.8); opacity: 0; }
  30%  { transform: scale(1.0); opacity: 1; }
  80%  { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; }
}
#battle-countdown-number.go {
  color: #44ff88;
  text-shadow: 0 0 30px rgba(60, 255, 120, 0.9), 4px 4px #060;
}

/* ── Battle result screen ────────────────────────────────────────────────── */
/* ── Battle post-match summary screen ────────────────────────────────────── */
#battle-result-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 24px 16px 32px;
  background: rgba(0, 0, 0, 0.92);
  z-index: 220;
  font-family: "Press Start 2P", cursive;
  gap: 14px;
  box-sizing: border-box;
}

/* Mode label */
#battle-result-screen .brs-mode {
  font-size: 0.38em;
  color: #ff8844;
  letter-spacing: 3px;
  margin-bottom: 2px;
}

/* Result banner */
#battle-result-screen .brs-banner {
  font-size: 2.6em;
  text-shadow: 4px 4px #000;
  margin-bottom: 6px;
}
#battle-result-screen .brs-banner.win  { color: #44ff88; text-shadow: 0 0 18px rgba(60,255,120,0.7), 4px 4px #060; }
#battle-result-screen .brs-banner.loss { color: #ff4444; text-shadow: 0 0 18px rgba(255,60,60,0.7),  4px 4px #600; }
#battle-result-screen .brs-banner.draw { color: #ffcc44; text-shadow: 0 0 18px rgba(255,200,60,0.7), 4px 4px #640; }

/* Two-column stats */
#battle-result-screen .brs-columns {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 560px;
}
#battle-result-screen .brs-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#battle-result-screen .brs-player-label {
  font-size: 0.4em;
  color: #aaa;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
#battle-result-screen .brs-col-divider {
  width: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0 10px;
  align-self: stretch;
}
#battle-result-screen .brs-stat-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#battle-result-screen .brs-stat-label {
  font-size: 0.28em;
  color: #666;
  letter-spacing: 1px;
}
#battle-result-screen .brs-stat-val {
  font-size: 0.44em;
  color: #ddd;
}

/* MVP Badges */
#battle-result-screen .brs-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
}
#battle-result-screen .brs-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  min-width: 80px;
}
#battle-result-screen .brs-badge-icon {
  font-size: 0.5em;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #aaa;
}
/* Icon pseudo-symbols using CSS pseudo-content */
#battle-result-screen .brs-bi-l::before { content: "\25A4"; }
#battle-result-screen .brs-bi-m::before { content: "\26CF"; }
#battle-result-screen .brs-bi-a::before { content: "\2694"; }
#battle-result-screen .brs-bi-s::before { content: "\1F6E1"; }
#battle-result-screen .brs-badge-label {
  font-size: 0.26em;
  color: #888;
  letter-spacing: 1px;
}
#battle-result-screen .brs-badge-winner {
  font-size: 0.36em;
  font-weight: bold;
}
#battle-result-screen .brs-badge.brs-badge-you   .brs-badge-winner { color: #44ff88; }
#battle-result-screen .brs-badge.brs-badge-opp   .brs-badge-winner { color: #ff7766; }
#battle-result-screen .brs-badge.brs-badge-both  .brs-badge-winner { color: #ffcc44; }

/* XP row */
#battle-result-screen .brs-xp {
  display: flex;
  align-items: center;
  gap: 14px;
}
#battle-result-screen .brs-xp-earned {
  font-size: 0.5em;
  color: #ffe066;
}
#battle-result-screen .brs-level-up {
  font-size: 0.4em;
  color: #44ff88;
  animation: brs-pulse 0.8s ease-in-out infinite alternate;
}
#battle-result-screen .brs-level-cur {
  font-size: 0.4em;
  color: #888;
}
@keyframes brs-pulse {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.07); }
}

/* Action buttons */
#battle-result-screen .brs-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
#battle-result-screen .brs-actions button {
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  padding: 10px 18px;
  background: rgba(255, 80, 80, 0.12);
  color: #ff9999;
  border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
#battle-result-screen .brs-actions button:hover { background: rgba(255, 60, 60, 0.3); }

/* ── Battle rank badges ──────────────────────────────────────────────────── */
.battle-rank-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: bold;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.battle-rank-stone    { color: #a0a0a0; background: rgba(160,160,160,0.15); border: 1px solid #a0a0a0; }
.battle-rank-iron     { color: #b0c8d0; background: rgba(176,200,208,0.15); border: 1px solid #b0c8d0; }
.battle-rank-gold     { color: #ffd700; background: rgba(255,215,0,0.15);   border: 1px solid #ffd700; }
.battle-rank-diamond  { color: #44ddff; background: rgba(68,221,255,0.15);  border: 1px solid #44ddff; }
.battle-rank-obsidian { color: #cc88ff; background: rgba(204,136,255,0.15); border: 1px solid #cc88ff; }

/* Battle lobby player rank display */
#battle-player-rank {
  font-size: 0.5em;
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ccc;
}
.battle-rank-pts    { color: #aaa; }
.battle-rank-record { color: #888; }

/* Battle result screen — rating row */
#battle-result-screen .brs-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 0.65em;
}
#battle-result-screen .brs-rating-val  { color: #fff; font-weight: bold; }
#battle-result-screen .brs-rating-gain { color: #44ff88; }
#battle-result-screen .brs-rating-loss { color: #ff6644; }

/* Battle leaderboard — W/L/D column */
.lb-table .lb-wld { color: #aaa; font-size: 0.85em; }

/* ── Battle mode selector (in ready view) ─────────────────────────────────── */
#battle-mode-selector {
  margin: 10px 0 6px;
  text-align: center;
}
.battle-mode-selector-label {
  font-size: 0.44em;
  color: #aaa;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
#battle-mode-toggle-host {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.battle-mode-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.46em;
  padding: 7px 14px;
  background: rgba(255, 80, 80, 0.08);
  color: #888;
  border: 1px solid rgba(255, 60, 60, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.battle-mode-btn.active {
  background: rgba(255, 80, 80, 0.25);
  color: #ff9999;
  border-color: rgba(255, 60, 60, 0.7);
}
.battle-mode-btn:hover { background: rgba(255, 60, 60, 0.2); color: #ffbbbb; }
#battle-mode-display-guest {
  font-size: 0.46em;
  color: #ff9999;
  letter-spacing: 1px;
}

/* ── Score Race in-game HUD ──────────────────────────────────────────────── */
#battle-score-race-hud {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 150, 50, 0.5);
  border-radius: 4px;
  padding: 6px 14px;
  z-index: 100;
  pointer-events: none;
  text-align: center;
  min-width: 140px;
}
#battle-score-race-timer {
  font-size: 0.9em;
  color: #ffcc44;
  text-shadow: 0 0 8px rgba(255,200,50,0.6);
  letter-spacing: 2px;
}
#battle-score-race-timer.danger {
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255,50,50,0.8);
  animation: battle-blink 0.5s step-end infinite;
}
#battle-score-race-scores {
  font-size: 0.4em;
  color: #ccc;
  margin-top: 4px;
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.sr-label { color: #888; font-size: 0.85em; }
.sr-sep   { color: #666; }
#battle-score-race-mine { color: #44ff88; }
#battle-score-race-opp  { color: #ff6666; }

/* ── Battle HUD mode badge ───────────────────────────────────────────────── */
#battle-mode-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #ff4444;
  background: rgba(20, 0, 0, 0.75);
  border: 1px solid rgba(255, 60, 60, 0.5);
  border-radius: 4px;
  padding: 4px 10px;
  z-index: 100;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(255,60,60,0.6);
}

/* ── Battle opponent mini-map HUD ─────────────────────────────────────────── */
#battle-opponent-hud {
  font-family: "Press Start 2P", cursive;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 60, 60, 0.4);
  border-radius: 4px;
  padding: 6px 8px;
  pointer-events: none;
  display: none;
}

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

.boh-label {
  font-size: 6px;
  color: rgba(255, 100, 100, 0.9);
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px #000;
}

.boh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.boh-dot-green  { background: #44ff44; box-shadow: 0 0 4px #44ff44; }
.boh-dot-yellow { background: #ffcc00; box-shadow: 0 0 4px #ffcc00; }
.boh-dot-red    { background: #ff4444; box-shadow: 0 0 4px #ff4444; }

.boh-canvas {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 2px;
  image-rendering: pixelated;
}

.boh-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

.boh-score {
  font-size: 6px;
  color: #ffee55;
  text-shadow: 1px 1px 2px #000;
}

.boh-level {
  font-size: 6px;
  color: rgba(150, 200, 255, 0.9);
  text-shadow: 1px 1px 2px #000;
}

.boh-garbage {
  margin-top: 5px;
  font-size: 5px;
  color: #ff3333;
  text-align: center;
  background: rgba(180, 0, 0, 0.35);
  border: 1px solid rgba(255, 60, 60, 0.6);
  border-radius: 2px;
  padding: 3px 4px;
  animation: boh-garbage-flash 0.5s ease-in-out infinite alternate;
  text-shadow: 0 0 4px rgba(255,80,80,0.8);
}

@keyframes boh-garbage-flash {
  from { opacity: 0.65; }
  to   { opacity: 1.0; }
}

/* Outgoing attack preview badge — shown briefly after we send an attack */
.boh-outgoing {
  margin-top: 3px;
  font-size: 5px;
  color: #44ddff;
  text-align: center;
  background: rgba(0, 120, 180, 0.30);
  border: 1px solid rgba(60, 180, 255, 0.55);
  border-radius: 2px;
  padding: 3px 4px;
  animation: boh-outgoing-fade 2s ease-out forwards;
  text-shadow: 0 0 4px rgba(80, 200, 255, 0.7);
}

@keyframes boh-outgoing-fade {
  0%   { opacity: 1.0; }
  60%  { opacity: 0.9; }
  100% { opacity: 0.0; }
}

/* Reset World button inside the survival card */
.survival-reset-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.36em;
  color: #ff4444;
  background: rgba(255, 50, 50, 0.1);
  border: 1px solid rgba(255, 50, 50, 0.4);
  border-radius: 3px;
  padding: 4px 8px;
  margin-top: 6px;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.5px;
  transition: background 0.15s, border-color 0.15s;
}
.survival-reset-btn:hover {
  background: rgba(255, 50, 50, 0.22);
  border-color: rgba(255, 50, 50, 0.7);
}

/* Survival world reset confirmation dialog */
#survival-reset-confirm {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 900;
}
#survival-reset-confirm-box {
  background: #111;
  border: 2px solid #ff4444;
  border-radius: 6px;
  padding: 28px 32px;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 0 30px rgba(255, 50, 50, 0.5);
}
#survival-reset-confirm-title {
  font-family: "Press Start 2P", cursive;
  font-size: 0.9em;
  color: #ff4444;
  margin-bottom: 14px;
  letter-spacing: 1px;
}
#survival-reset-confirm-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 0.52em;
  color: #ffaaaa;
  line-height: 1.8;
  margin-bottom: 20px;
}
#survival-reset-confirm-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}
#survival-reset-confirm-yes,
#survival-reset-confirm-no {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}
#survival-reset-confirm-yes {
  background: #ff4444;
  color: #fff;
}
#survival-reset-confirm-yes:hover {
  background: #ff2222;
}
#survival-reset-confirm-no {
  background: #333;
  color: #aaa;
  border: 1px solid #555;
}
#survival-reset-confirm-no:hover {
  background: #444;
  color: #fff;
}

/* ── Puzzle badge (top-center HUD during puzzle runs) ── */
#puzzle-badge {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #c060ff;
  text-shadow: 0 0 8px #c060ff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 150;
  white-space: nowrap;
}

/* ── World modifier HUD badge ── */
#world-modifier-badge {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #ffcc44;
  text-shadow: 0 0 8px #ffcc44;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 150;
  white-space: nowrap;
}

/* ── World modifier mode-select slot ── */
#mode-worldmod-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 200, 50, 0.2);
}
#mode-worldmod-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.58em;
  color: #ffcc44;
  letter-spacing: 2px;
  text-shadow: 0 0 8px #ffcc44;
}
#mode-worldmod-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.worldmod-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(10, 10, 0, 0.75);
  border: 2px solid rgba(255, 200, 50, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 80px;
  font-family: "Press Start 2P", cursive;
  color: inherit;
  outline: none;
}
.worldmod-pick-btn:hover {
  border-color: #ffcc44;
  box-shadow: 0 0 10px rgba(255, 200, 50, 0.3);
}
.worldmod-pick-btn.wm-selected {
  border-color: #ffcc44;
  box-shadow: 0 0 16px rgba(255, 200, 50, 0.5);
}
.wm-swatch {
  width: 28px;
  height: 8px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}
.wm-icon { font-size: 1.3em; }
.wm-name {
  font-size: 0.34em;
  color: #ffeeaa;
}
.wm-mult {
  font-size: 0.38em;
  color: #ffd700;
  text-shadow: 0 0 5px #ffd700;
}

/* ── World modifier game-over badge ── */
.go-modifier-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffcc44;
  text-shadow: 0 0 8px #ffaa00;
  background: rgba(30, 20, 0, 0.7);
  border: 1px solid rgba(255, 200, 50, 0.5);
  border-radius: 4px;
  padding: 5px 12px;
  margin-bottom: 10px;
  display: inline-block;
}
.go-modifier-mult {
  color: #ffd700;
}

/* ── Puzzle select screen ── */
#puzzle-select-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
}
#puzzle-select-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  width: 420px;
}
#puzzle-select-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.4em;
  color: #c060ff;
  text-shadow: 3px 3px #602080;
  margin-bottom: 10px;
}
#puzzle-select-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(200, 160, 255, 0.6);
  margin-bottom: 18px;
}
#puzzle-select-list {
  width: 100%;
  overflow-y: auto;
  max-height: 55vh;
  margin-bottom: 16px;
}
.puzzle-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: rgba(96, 32, 128, 0.2);
  border: 1px solid rgba(180, 100, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.puzzle-list-item:hover {
  background: rgba(180, 100, 255, 0.25);
  border-color: #c060ff;
}
.puzzle-locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.puzzle-list-num {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #c060ff;
  min-width: 24px;
  text-align: center;
}
.puzzle-list-info {
  flex: 1;
}
.puzzle-list-name {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #fff;
  margin-bottom: 4px;
}
.puzzle-list-diff {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
}
.puzzle-diff-tutorial { color: #7bf07b; }
.puzzle-diff-medium   { color: #ffd700; }
.puzzle-diff-hard     { color: #ff6060; }
.puzzle-list-stars {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #ffd700;
  white-space: nowrap;
}
#puzzle-select-back {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  background: transparent;
  border: 1px solid rgba(180, 100, 255, 0.4);
  color: #d8a0ff;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#puzzle-select-back:hover {
  color: #fff;
  border-color: #c060ff;
}

/* ── Puzzle complete screen ── */
#puzzle-complete-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}
#puzzle-complete-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2em;
  color: #c060ff;
  text-shadow: 3px 3px #602080;
  margin-bottom: 18px;
}
#puzzle-complete-name {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: rgba(200, 160, 255, 0.8);
  margin-bottom: 20px;
}
.puzzle-stars {
  font-family: "Press Start 2P", cursive;
  font-size: 2.2em;
  margin-bottom: 16px;
  letter-spacing: 6px;
}
.puzzle-stars-3 { color: #ffd700; text-shadow: 0 0 14px #ffd700; }
.puzzle-stars-2 { color: #e0e0e0; }
.puzzle-stars-1 { color: #a0a0a0; }
.puzzle-stars-0 { color: #555; }
#puzzle-complete-pb {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  margin-bottom: 10px;
}
.puzzle-new-best {
  color: #ffd700;
  text-shadow: 0 0 12px #ffd700;
}
.puzzle-pb-line {
  color: rgba(255, 255, 255, 0.5);
}
#puzzle-complete-remain {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(200, 160, 255, 0.7);
  margin-bottom: 12px;
}
#puzzle-complete-time {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(180, 220, 255, 0.8);
  margin-bottom: 6px;
}
#puzzle-complete-score {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(180, 220, 255, 0.8);
  margin-bottom: 28px;
}
#puzzle-next-btn, #puzzle-retry-btn, #puzzle-select-btn, #puzzle-main-menu-btn,
#puzzle-complete-share-btn, #puzzle-complete-edit-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #c060ff;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  margin-bottom: 10px;
}
#puzzle-next-btn:hover { background: #ffd700; }
#puzzle-retry-btn { background: #7060a0; color: #fff; }
#puzzle-retry-btn:hover { background: #c060ff; color: #000; }
#puzzle-complete-share-btn { background: rgba(0, 160, 220, 0.85); color: #fff; }
#puzzle-complete-share-btn:hover { background: #00c8ff; color: #000; }
#puzzle-complete-edit-btn { background: rgba(50, 140, 80, 0.85); color: #fff; }
#puzzle-complete-edit-btn:hover { background: #40e080; color: #000; }
#puzzle-select-btn { background: rgba(80, 40, 100, 0.8); color: #d8a0ff; border: 1px solid rgba(180,100,255,0.4); }
#puzzle-select-btn:hover { background: #c060ff; color: #000; }
#puzzle-main-menu-btn { background: transparent; color: rgba(200, 160, 255, 0.5); border: 1px solid rgba(180,100,255,0.25); font-size: 10px; }
#puzzle-main-menu-btn:hover { color: #fff; border-color: #c060ff; }

/* ── Puzzle vote area ── */
#puzzle-vote-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
#puzzle-vote-label {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(200, 160, 255, 0.8);
}
#puzzle-vote-buttons {
  display: flex;
  gap: 12px;
}
#puzzle-vote-up, #puzzle-vote-down {
  font-size: 22px;
  background: rgba(40, 20, 60, 0.7);
  border: 1px solid rgba(180, 100, 255, 0.35);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}
#puzzle-vote-up:hover  { background: rgba(0, 200, 80, 0.25);  border-color: #00c860; }
#puzzle-vote-down:hover { background: rgba(200, 50, 50, 0.25); border-color: #c84040; }
#puzzle-vote-up.voted-active  { background: rgba(0, 200, 80, 0.4);  border-color: #00ff88; transform: scale(1.1); }
#puzzle-vote-down.voted-active { background: rgba(200, 50, 50, 0.4); border-color: #ff4444; transform: scale(1.1); }
#puzzle-vote-up:disabled, #puzzle-vote-down:disabled { cursor: default; opacity: 0.7; }
#puzzle-vote-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(180, 255, 180, 0.7);
  min-height: 12px;
}

#mode-select-back {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  background: transparent;
  border: 1px solid rgba(0, 255, 136, 0.4);
  color: #aaffcc;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#mode-select-back:hover {
  color: #00ff88;
  border-color: #00ff88;
}

/* ── Stats button (start screen) ── */
/* Stats + achievements — use group defaults, no overrides needed */

/* ── Achievements overlay ── */
#achievements-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#achievements-panel {
  background: #111;
  border: 2px solid #ffd700;
  border-radius: 6px;
  padding: 30px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 680px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}
#achievements-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.4em;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
#achievements-progress {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(255, 215, 0, 0.65);
  margin-bottom: 8px;
}
#achievements-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.ach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 4px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.ach-card.ach-unlocked {
  border-color: rgba(255, 215, 0, 0.55);
  background: rgba(255, 215, 0, 0.06);
}
.ach-card.ach-locked {
  opacity: 0.45;
}
.ach-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.ach-card-info {
  flex: 1;
  min-width: 0;
}
.ach-card-name {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-card-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 5.5px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
}
.ach-card-status {
  font-size: 14px;
  flex-shrink: 0;
}
#achievements-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #000;
  background: #ffd700;
  border: none;
  padding: 12px 36px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 8px;
  transition: background 0.15s;
}
#achievements-close-btn:hover { background: #fff; }
/* Achievement filter buttons */
.ach-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.ach-filter-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: transparent;
  color: rgba(255, 215, 0, 0.6);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ach-filter-btn.active {
  background: rgba(255, 215, 0, 0.18);
  color: #ffd700;
  border-color: #ffd700;
}
.ach-filter-btn:hover { background: rgba(255, 215, 0, 0.1); }
/* CO-OP badge on achievement cards */
.ach-coop-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: #00e0c8;
  background: rgba(0, 180, 180, 0.12);
  border: 1px solid rgba(0, 200, 200, 0.4);
  border-radius: 2px;
  padding: 2px 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
/* Co-op achievement count on mode-select card */
.mode-coop-ach-count {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 210, 200, 0.8);
  margin-top: 4px;
}

/* ── Stats overlay ── */
#stats-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#stats-panel {
  background: #111;
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 360px;
  max-width: 480px;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}
#stats-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.4em;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
#stats-panel-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 255, 0, 0.1);
  padding-bottom: 8px;
}
.stats-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 0, 0.6);
  letter-spacing: 0.05em;
}
.stats-value {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ff0;
}
#stats-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 12px 36px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 8px;
  transition: background 0.15s;
}
#stats-close-btn:hover { background: #ff0; }

/* ── Profile page overlay ── */
#profile-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#profile-panel {
  background: #111;
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 400px;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}
#profile-page-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.3em;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 4px;
}
#profile-page-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-header {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 255, 0, 0.15);
}
.profile-header-border-animated {
  border: 2px solid #ffd740;
  border-radius: 6px;
  padding: 12px;
  animation: profileBorderGlow 2s ease-in-out infinite alternate;
}
@keyframes profileBorderGlow {
  from { border-color: #ffd740; box-shadow: 0 0 8px rgba(255, 215, 64, 0.3); }
  to   { border-color: #ff6f00; box-shadow: 0 0 18px rgba(255, 111, 0, 0.5); }
}
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.profile-player-name {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #0f0;
  text-shadow: 0 0 8px #0f0;
}
.profile-prestige-stars {
  font-size: 14px;
}
.profile-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd740;
  margin-top: 4px;
}
.profile-stats-row {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 255, 0, 0.1);
}
.profile-stat-item {
  text-align: center;
  flex: 1;
}
.profile-stat-label {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 255, 0, 0.5);
  margin-bottom: 4px;
}
.profile-stat-value {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ff0;
}
.profile-xp-bar-wrap {
  padding: 4px 0 8px;
}
.profile-xp-bar-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 0, 0.6);
  margin-bottom: 4px;
}
.profile-xp-bar-track {
  width: 100%;
  height: 10px;
  background: #222;
  border: 1px solid rgba(0, 255, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}
.profile-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f0, #0c0);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.profile-xp-bar-text {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 255, 0, 0.5);
  margin-top: 3px;
  text-align: right;
}
.profile-section-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0f0;
  text-shadow: 0 0 6px rgba(0, 255, 0, 0.3);
  margin-top: 4px;
}
.profile-equipped-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 6px 0;
}
.profile-equipped-item {
  text-align: center;
  padding: 8px 4px;
  background: rgba(0, 255, 0, 0.04);
  border: 1px solid rgba(0, 255, 0, 0.1);
  border-radius: 4px;
}
.profile-equipped-icon { font-size: 18px; margin-bottom: 4px; }
.profile-equipped-name {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  margin-bottom: 2px;
}
.profile-equipped-cat {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: rgba(255, 255, 255, 0.3);
}
.profile-mastery-placeholder {
  text-align: center;
  padding: 14px;
  border: 1px dashed rgba(0, 255, 0, 0.2);
  border-radius: 4px;
  color: rgba(0, 255, 0, 0.4);
}
.profile-mastery-icon { font-size: 24px; margin-bottom: 6px; }
.profile-mastery-text {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(0, 255, 0, 0.5);
}
.profile-mastery-sub {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 255, 0, 0.3);
  margin-top: 4px;
}

/* ── Profile — Mastery grid ─────────────────────────────────────────────────── */
.profile-mastery-score {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}
.profile-mastery-score-val {
  color: #fff;
}
.profile-mastery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.profile-mastery-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  padding: 6px 4px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  gap: 3px;
}
.profile-mastery-card:hover,
.profile-mastery-card-active {
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
  transform: translateY(-2px);
}
.profile-mastery-card-icon {
  font-size: 20px;
  line-height: 1;
}
.profile-mastery-card-tier-icon {
  font-size: 13px;
  line-height: 1;
}
.profile-mastery-card-name {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: #aaffcc;
  text-align: center;
  white-space: nowrap;
}

/* ── Profile — Mastery detail panel ──────────────────────────────────────────── */
.profile-mastery-detail {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}
.pmd-header {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  margin-bottom: 8px;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}
.pmd-challenges {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pmd-ch {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  padding: 4px 6px;
  border-radius: 3px;
}
.pmd-ch-done {
  background: rgba(0, 200, 80, 0.12);
  color: #7fffaa;
}
.pmd-ch-next {
  background: rgba(255, 215, 0, 0.12);
  color: #ffd700;
}
.pmd-ch-locked {
  color: rgba(180, 180, 180, 0.4);
}
.pmd-ch-status { flex-shrink: 0; }
.pmd-ch-tier   { flex-shrink: 0; min-width: 60px; }
.pmd-ch-desc   { line-height: 1.5; }

/* ── Mastery unlock full-screen overlay ─────────────────────────────────────── */
#mastery-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#mastery-unlock-overlay.muo-visible {
  display: flex;
  pointer-events: all;
}
.muo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  animation: muo-fade-in 0.3s ease;
}
.muo-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 40px;
  background: rgba(10, 10, 20, 0.97);
  border: 3px solid #ffd700;
  border-radius: 10px;
  min-width: 260px;
  max-width: 340px;
  animation: muo-pop-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.25);
}
.muo-mode-icon {
  font-size: 42px;
  line-height: 1;
}
.muo-tier-icon {
  font-size: 28px;
  line-height: 1;
}
.muo-header {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  text-align: center;
  letter-spacing: 1px;
}
.muo-tier-label {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #fff;
  text-align: center;
}
.muo-mode-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #aaffcc;
  text-align: center;
}
.muo-reward {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ce93d8;
  text-align: center;
  min-height: 1em;
}
.muo-dismiss-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  margin-top: 6px;
  transition: color 0.15s, border-color 0.15s;
}
.muo-dismiss-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
@keyframes muo-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes muo-pop-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Mode card mastery badge ────────────────────────────────────────────────── */
.mode-card-mastery-badge {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}

/* ── Leaderboard mastery badge ──────────────────────────────────────────────── */
.lb-mastery-badge {
  display: inline-block;
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.75em;
  color: #c4b5fd;
  margin-left: 2px;
  vertical-align: middle;
}

.profile-wardrobe-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
}
.profile-tab-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 255, 0, 0.5);
  background: transparent;
  border: 1px solid rgba(0, 255, 0, 0.2);
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}
.profile-tab-btn:hover { border-color: #0f0; color: #0f0; }
.profile-tab-active {
  background: rgba(0, 255, 0, 0.1);
  border-color: #0f0;
  color: #0f0;
}
.profile-wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px 0;
}
.profile-wardrobe-card {
  background: rgba(0, 255, 0, 0.04);
  border: 1px solid rgba(0, 255, 0, 0.15);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.profile-wardrobe-card:hover { border-color: #0f0; background: rgba(0, 255, 0, 0.08); }
.profile-wardrobe-locked {
  opacity: 0.4;
  cursor: default;
}
.profile-wardrobe-locked:hover { border-color: rgba(0, 255, 0, 0.15); background: rgba(0, 255, 0, 0.04); }
.profile-wardrobe-equipped {
  border-color: #ffd740;
  background: rgba(255, 215, 64, 0.08);
}
.profile-wardrobe-equipped:hover { border-color: #ffd740; }
.profile-wardrobe-card-name {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  margin-bottom: 3px;
}
.profile-wardrobe-card-rarity {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 4px;
}
.profile-wardrobe-card-lock {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: rgba(255, 255, 255, 0.3);
}
.profile-wardrobe-card-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ffd740;
}
.profile-wardrobe-card-equip {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: rgba(0, 255, 0, 0.5);
}
.profile-wardrobe-empty {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 0, 0.3);
  text-align: center;
  padding: 16px;
  grid-column: 1 / -1;
}
#profile-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 12px 36px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 4px;
  transition: background 0.15s;
  align-self: center;
}
#profile-close-btn:hover { background: #ff0; }

/* ── Lifetime stats on game-over screen ── */
#go-lifetime-stats {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0cf;
  display: flex;
  gap: 24px;
  justify-content: center;
  text-align: center;
  line-height: 2.4;
  margin-bottom: 8px;
}
#go-lifetime-stats .go-label {
  color: rgba(0, 204, 255, 0.55);
  font-size: 7px;
}
/* ── XP earned display (shown on all completion screens) ── */
.xp-earned-display {
  font-family: "Press Start 2P", cursive;
  font-size: 14px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.7), 2px 2px #7a5000;
  margin-bottom: 12px;
  min-height: 22px;
  text-align: center;
  animation: xp-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.xp-earned-display:empty { animation: none; }
.xp-earned-display.xp-streak {
  color: #ff0;
  text-shadow: 0 0 12px rgba(255, 255, 0, 0.9), 2px 2px #806000;
}
@keyframes xp-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

#go-stats-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #0cf;
  background: transparent;
  border: 1px solid rgba(0, 204, 255, 0.4);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 12px;
  transition: background 0.15s, color 0.15s;
}
#go-stats-btn:hover { background: rgba(0, 204, 255, 0.15); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE HUD — small viewports (<600px / <480px)
   Applied via .vp-small / .vp-xs body classes set by
   applyResponsiveHUD() in main.js on every resize event.
   ═══════════════════════════════════════════════════════════ */

/* ── Shared scale variable (set inline by JS, fallback 1) ── */
:root { --hud-scale: 1; }

/* ── Small viewport (<600px) ── */
@media (max-width: 599px) {
  /* Score HUD */
  .hud-score        { font-size: calc(20px * var(--hud-scale)); }
  .hud-stat         { font-size: calc(8px  * var(--hud-scale)); }
  #top-right-hud    { top: 8px; right: 8px; }
  #score-display    { padding: 6px 10px; }

  /* Next-piece panel */
  #next-pieces-panel { padding: 6px 8px; }
  .np-cell           { width: 6px; height: 6px; }

  /* Inventory HUD — shrink slots */
  #inventory-hud  { bottom: 8px; gap: 4px; }
  #inventory-slots { gap: 4px; padding: 4px 6px; }
  .inv-slot        { width: 36px; height: 36px; }
  .inv-slot-color  { width: 22px; height: 22px; }
  .inv-slot-count  { font-size: 6px; }
  .inv-slot-num    { font-size: 5px; }
  #inventory-total { font-size: 6px; }

  /* Material tooltip — move up with smaller inventory */
  #material-tooltip { bottom: 80px; font-size: 6px; padding: 4px 10px; }

  /* Banners */
  #line-clear-banner { font-size: 16px; }
  #combo-banner      { font-size: 14px; }
  #speed-up-banner   { font-size: 14px; }

  /* Crafting panel — full-width, scrollable */
  #crafting-panel {
    min-width: unset;
    max-width: calc(100vw - 24px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 12px 14px;
  }
  #crafting-title { font-size: 10px; }
  .craft-name     { font-size: 8px; }
  .craft-desc     { font-size: 6px; }

  /* Stats / Achievements / Settings / Profile overlays — full screen friendly */
  #stats-overlay,
  #achievements-overlay,
  #settings-overlay,
  #profile-overlay {
    padding: 12px 8px;
  }
  #stats-panel,
  #achievements-panel,
  #settings-panel,
  #profile-panel {
    width: calc(100vw - 24px);
    max-width: unset;
    max-height: 85vh;
    overflow-y: auto;
    padding: 12px 14px;
  }

  .profile-equipped-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-wardrobe-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-stats-row { flex-wrap: wrap; }

  /* Game-over screen — tighter spacing */
  #go-lifetime-stats {
    gap: 12px;
    font-size: 7px;
  }
  #go-lifetime-stats .go-label { font-size: 6px; }

  /* Danger overlay text */
  #danger-text { font-size: 10px; }
}

/* ── Extra-small viewport (<480px) ── */
@media (max-width: 479px) {
  .hud-score { font-size: calc(14px * var(--hud-scale)); }
  .hud-stat  { font-size: calc(6px  * var(--hud-scale)); }

  /* Stack inventory slots in two rows on very narrow screens */
  #inventory-slots {
    flex-wrap: wrap;
    max-width: calc(100vw - 24px);
    justify-content: center;
  }
  .inv-slot { width: 30px; height: 30px; }
  .inv-slot-color { width: 18px; height: 18px; }

  /* Material tooltip — keep it above wrapped inventory */
  #material-tooltip { bottom: 110px; }

  /* Mode-select cards — single column */
  .mode-section-cards {
    flex-direction: column;
    align-items: center;
  }
}

/* ── Theme selector (settings panel) ── */
.settings-label-section {
  font-size: 8px;
  margin-bottom: 6px;
  width: 100%;
  text-align: left;
}
#theme-selector {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 6px;
}
.theme-btn {
  flex: 1;
  font-family: "Press Start 2P", cursive;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #444;
  border-radius: 6px;
  padding: 8px 4px;
  cursor: pointer;
  color: #aaa;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, color 0.15s;
}
.theme-btn:hover:not(:disabled) {
  border-color: #888;
  color: #fff;
}
.theme-btn-selected {
  border-color: #0f0;
  color: #0f0;
}
.theme-btn-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.theme-btn-icon {
  font-size: 18px;
  line-height: 1;
}
.theme-btn-name {
  font-size: 7px;
}
.theme-btn-sub {
  font-size: 5px;
  color: #888;
}
.theme-btn-hint {
  color: #ff6600;
}

/* ── Nether theme HUD overrides ── */
body.theme-nether #score-display {
  color: #ff6600;
  border-color: rgba(255, 80, 0, 0.4);
}
body.theme-nether .hud-score {
  color: #ffaa00;
}
body.theme-nether .hud-stat {
  color: rgba(255, 120, 0, 0.85);
}
body.theme-nether #next-pieces-panel {
  border-color: rgba(255, 80, 0, 0.4);
}
body.theme-nether .np-label {
  color: rgba(255, 120, 0, 0.85);
}
body.theme-nether #crosshair {
  background-color: #ff4400;
}
body.theme-nether #crosshair.target-locked {
  background-color: #ffaa00;
}
body.theme-nether .inv-slot.selected {
  border-color: #ffaa00;
  box-shadow: 0 0 8px rgba(255, 170, 0, 0.65);
}

/* ── Ocean theme HUD overrides ── */
body.theme-ocean #score-display {
  color: #88e8ff;
  border-color: rgba(0, 153, 119, 0.4);
}
body.theme-ocean .hud-score {
  color: #44ccff;
}
body.theme-ocean .hud-stat {
  color: rgba(136, 232, 255, 0.85);
}
body.theme-ocean #next-pieces-panel {
  border-color: rgba(0, 153, 119, 0.4);
}
body.theme-ocean .np-label {
  color: rgba(68, 204, 255, 0.85);
}
body.theme-ocean #crosshair {
  background-color: #009977;
}
body.theme-ocean #crosshair.target-locked {
  background-color: #88e8ff;
}
body.theme-ocean .inv-slot.selected {
  border-color: #44ccff;
  box-shadow: 0 0 8px rgba(68, 204, 255, 0.65);
}

/* ── Candy theme HUD overrides ── */
body.theme-candy #score-display {
  color: #ff99cc;
  border-color: rgba(224, 168, 255, 0.5);
}
body.theme-candy .hud-score {
  color: #ff77bb;
}
body.theme-candy .hud-stat {
  color: rgba(255, 153, 204, 0.9);
}
body.theme-candy #next-pieces-panel {
  border-color: rgba(224, 168, 255, 0.5);
}
body.theme-candy .np-label {
  color: rgba(255, 119, 187, 0.9);
}
body.theme-candy #crosshair {
  background-color: #d4a8ff;
}
body.theme-candy #crosshair.target-locked {
  background-color: #ff99cc;
}
body.theme-candy .inv-slot.selected {
  border-color: #ff99cc;
  box-shadow: 0 0 8px rgba(255, 153, 204, 0.65);
}

/* ── Leaderboard: display name modal ── */
#lb-name-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
}
#lb-name-box {
  background: #0d1117;
  border: 2px solid #00ff88;
  border-radius: 6px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.3);
}
#lb-name-title {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #00ff88;
  letter-spacing: 2px;
  text-shadow: 0 0 8px #00ff88;
}
#lb-name-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 136, 0.55);
}
#lb-name-input {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  background: rgba(0, 255, 136, 0.07);
  border: 1px solid rgba(0, 255, 136, 0.45);
  border-radius: 4px;
  color: #0f0;
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  outline: none;
}
#lb-name-input:focus { border-color: #00ff88; box-shadow: 0 0 8px rgba(0,255,136,0.3); }
#lb-name-error {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #f55;
  min-height: 14px;
  text-align: center;
}
#lb-name-actions {
  display: flex;
  gap: 12px;
}
#lb-name-save-btn, #lb-name-cancel-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
#lb-name-save-btn   { background: #0f0; color: #000; }
#lb-name-save-btn:hover   { background: #ff0; }
#lb-name-cancel-btn { background: rgba(255,255,255,0.1); color: #aaa; }
#lb-name-cancel-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Leaderboard: panel overlay ── */
#lb-panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 400;
}
#lb-panel {
  background: #0d1117;
  border: 2px solid #00ff88;
  border-radius: 6px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 28px rgba(0, 255, 136, 0.25);
}
#lb-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  justify-content: center;
}
#lb-panel-title {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #00ff88;
  letter-spacing: 3px;
  text-shadow: 0 0 10px #00ff88;
}
#lb-panel-refresh-btn {
  font-size: 16px;
  background: transparent;
  border: 1px solid rgba(0,255,136,0.35);
  border-radius: 4px;
  color: #00ff88;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
  transition: background 0.15s;
}
#lb-panel-refresh-btn:hover { background: rgba(0,255,136,0.15); }
#lb-tabs {
  display: flex;
  gap: 8px;
}
.lb-tab {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: transparent;
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 4px;
  color: rgba(0,255,136,0.5);
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.lb-tab:hover  { color: #00ff88; border-color: #00ff88; }
.lb-tab-active { color: #00ff88; border-color: #00ff88; background: rgba(0,255,136,0.1); }
#lb-panel-body {
  width: 100%;
  min-height: 80px;
}
.lb-loading, .lb-error, .lb-empty {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(0,255,136,0.6);
  text-align: center;
  padding: 24px 0;
}
.lb-error { color: #f55; }
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #0f0;
}
.lb-table thead th {
  color: rgba(0,255,0,0.55);
  font-size: 7px;
  padding: 4px 8px;
  border-bottom: 1px solid rgba(0,255,0,0.2);
  text-align: left;
}
.lb-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0,255,0,0.08);
}
.lb-row-me td { color: #ff0; }
#lb-panel-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  background: transparent;
  border: 1px solid rgba(0,255,136,0.4);
  border-radius: 4px;
  color: #aaffcc;
  padding: 10px 22px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}
#lb-panel-close-btn:hover { color: #00ff88; border-color: #00ff88; }

/* ── Leaderboard: game-over submit button ── */
#lb-submit-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #ffb400;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#lb-submit-btn:hover:not(:disabled) { background: #ffd040; }
#lb-submit-btn:disabled { opacity: 0.5; cursor: default; }
.lb-submit-feedback {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  height: 18px;
  margin-bottom: 4px;
  text-align: center;
}
.lb-submit-ok  { color: #0f0; }
.lb-submit-err { color: #f55; }
#go-lb-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #000;
  background: #00ff88;
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
#go-lb-btn:hover { background: #00ddaa; }
#mode-select-lb-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  background: transparent;
  border: 1px solid rgba(0, 255, 136, 0.4);
  color: #aaffcc;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#mode-select-lb-btn:hover { color: #00ff88; border-color: #00ff88; }

/* ── Settings: display name row ── */
#settings-displayname-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
#settings-displayname-input {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  background: rgba(0,255,136,0.07);
  border: 1px solid rgba(0,255,136,0.35);
  border-radius: 4px;
  color: #0f0;
  padding: 7px 10px;
  width: 140px;
  outline: none;
  text-align: center;
}
#settings-displayname-input:focus { border-color: #00ff88; }
#settings-displayname-save-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: #0f0;
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
#settings-displayname-save-btn:hover { background: #ff0; }
#settings-displayname-feedback {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #0f0;
  height: 14px;
  text-align: center;
  width: 100%;
}

/* ── Share card landing modal ── */
#share-card-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9000;
}
#share-card-inner {
  position: relative;
  background: #0a0a0a;
  border: 2px solid #00ff88;
  border-radius: 6px;
  padding: 36px 40px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.25);
}
#sc-dismiss-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
#sc-dismiss-btn:hover { color: #0f0; }
#sc-logo {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #00ff88;
  letter-spacing: 2px;
  margin-bottom: 18px;
  opacity: 0.7;
}
#sc-headline {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.6;
}
#sc-subline {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0f0;
  margin-bottom: 22px;
}
#sc-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  background: rgba(0, 255, 136, 0.05);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: 4px;
  padding: 14px 10px;
}
#sc-stats > div {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #fff;
  min-width: 60px;
}
.sc-label {
  font-size: 7px;
  color: #0f0;
  display: block;
  margin-bottom: 5px;
}
#sc-lb-link {
  display: block;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #0af;
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 18px;
  transition: color 0.15s;
}
#sc-lb-link:hover { color: #fff; }
#sc-play-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  background: #00ff88;
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
#sc-play-btn:hover {
  background: #0f0;
  transform: scale(1.04);
}

/* ── Player level badge (HUD top-left) ────────────────────────────────────── */
#hud-player-level-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #0f0;
  color: #0f0;
  pointer-events: none;
  z-index: 20;
  min-width: 28px;
  text-align: center;
}
#hud-player-level-badge.level-badge-fossil    { border-color: #d4952e; color: #d4952e; }
#hud-player-level-badge.level-badge-storm     { border-color: #88bbff; color: #88bbff; }
#hud-player-level-badge.level-badge-void      { border-color: #bb88ff; color: #bb88ff; }
#hud-player-level-badge.level-badge-legendary {
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px #ffd700, 0 0 16px #aa8800;
  animation: legendary-pulse 2s ease-in-out infinite;
}
@keyframes legendary-pulse {
  0%, 100% { box-shadow: 0 0 6px #ffd700, 0 0 14px #aa8800; }
  50%       { box-shadow: 0 0 14px #ffd700, 0 0 28px #cc9900; }
}

/* ── Streak HUD badge (top-left, below level badge) ───────────────────────── */
#hud-streak-badge {
  position: absolute;
  top: 42px;
  left: 12px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #ff6600;
  color: #ff6600;
  pointer-events: none;
  z-index: 20;
  text-align: center;
}

/* ── Level-up toast (bottom-center) ───────────────────────────────────────── */
#level-up-toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #ffd700;
  border-radius: 6px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 900;
  min-width: 220px;
  max-width: 320px;
}
#level-up-toast.lu-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lu-toast-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.lu-toast-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lu-toast-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
  letter-spacing: 1px;
}
.lu-toast-body {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #cccccc;
  line-height: 1.4;
}

/* Streak milestone variant of level-up toast */
#level-up-toast.streak-toast { border-color: #ff6600; }
#level-up-toast.streak-toast .lu-toast-title { color: #ff6600; }

/* ── Game-over level badge ────────────────────────────────────────────────── */
#go-level-badge-row {
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.go-level-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid #0f0;
  color: #0f0;
}
.go-level-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
}

/* ── Leaderboard level badge ──────────────────────────────────────────────── */
.lb-level-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid #0f0;
  color: #0f0;
  vertical-align: middle;
  margin-left: 4px;
}
.lb-level-title {
  font-size: 8px;
  color: #ffd700;
  vertical-align: middle;
}

/* High-score level badge (game-over table) */
.hs-level-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.15);
  border: 1px solid #0f0;
  color: #0f0;
  margin-right: 4px;
}
.hs-level-title {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  margin-right: 4px;
}

/* ── Level-gated theme buttons ────────────────────────────────────────────── */
/* Fossil theme button accent */
#theme-btn-fossil:not(.theme-btn-locked) { border-color: #d4952e; }
#theme-btn-fossil:not(.theme-btn-locked) .theme-btn-icon { filter: none; }
/* Storm theme button accent */
#theme-btn-storm:not(.theme-btn-locked)  { border-color: #88bbff; }
/* Void theme button accent */
#theme-btn-void:not(.theme-btn-locked)   { border-color: #bb88ff; }
/* Legendary theme button accent */
#theme-btn-legendary:not(.theme-btn-locked) {
  border-color: #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

/* ── HUD accent overrides for new themes ─────────────────────────────────── */
body.theme-fossil  #score-display { border-color: #d4952e; }
body.theme-storm   #score-display { border-color: #88bbff; }
body.theme-void    #score-display { border-color: #bb88ff; }
body.theme-legendary #score-display {
  border-color: #ffd700;
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

/* ── Daily Missions overlay ─────────────────────────────────────────────── */
#missions-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#missions-panel {
  background: #111;
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 380px;
  max-width: 520px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}
#missions-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.3em;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
#missions-panel-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.missions-date {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0,255,0,0.5);
  text-align: center;
}
.missions-xp-summary {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #ffd700;
  text-align: center;
}
.missions-xp-summary strong { color: #fff; }
.missions-loading {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(0,255,0,0.5);
  text-align: center;
  padding: 20px 0;
}
.mission-card {
  background: rgba(0,255,0,0.05);
  border: 1px solid rgba(0,255,0,0.25);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mission-card-done {
  background: rgba(0,255,0,0.1);
  border-color: rgba(0,255,0,0.5);
  opacity: 0.75;
}
.mission-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mission-diff-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  letter-spacing: 0.05em;
  font-weight: bold;
}
.mission-xp-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  margin-left: auto;
}
.mission-done-check {
  font-size: 14px;
  color: #4ade80;
  margin-left: 6px;
}
.mission-text {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #ccc;
  line-height: 1.6;
}
.mission-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mission-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.mission-progress-fill {
  height: 100%;
  background: #0f0;
  border-radius: 4px;
  transition: width 0.3s ease;
}
.mission-card-done .mission-progress-fill { background: #4ade80; }
.mission-progress-val {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
#missions-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #000;
  background: #0f0;
  border: none;
  padding: 12px 32px;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 4px;
  transition: background 0.15s;
}
#missions-close-btn:hover { background: #ff0; }

/* ── Mission complete toast (top-center) ─────────────────────────────────── */
#mission-complete-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: rgba(0, 20, 0, 0.95);
  border: 2px solid #4ade80;
  border-radius: 6px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 500;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.4);
  min-width: 220px;
  text-align: center;
}
#mission-complete-toast.mct-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.mct-title {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #4ade80;
  letter-spacing: 0.05em;
}
.mct-text {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ccc;
  line-height: 1.5;
}
.mct-xp {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
}

/* ── Start screen missions button ────────────────────────────────────────── */
/* Missions — use group defaults, no overrides needed */

/* ── Inline missions panel (main menu) ───────────────────────────────────── */
#menu-missions-panel {
  width: 100%;
  background: rgba(0,255,0,0.04);
  border: 1px solid rgba(0,255,0,0.3);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  margin-bottom: 4px;
}
#menu-missions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#menu-missions-title {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #0f0;
  text-shadow: 0 0 8px rgba(0,255,0,0.5);
  letter-spacing: 0.08em;
}
#menu-missions-countdown {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(255,255,255,0.4);
}
#menu-missions-body {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
}
.menu-mission-card {
  flex: 1;
  min-width: 140px;
  background: rgba(0,255,0,0.04);
  border: 1px solid rgba(0,255,0,0.2);
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.menu-mission-card-done {
  background: rgba(74,222,128,0.08);
  border-color: rgba(74,222,128,0.45);
}
.menu-mission-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-mission-xp {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ffd700;
  margin-left: auto;
}
.menu-mission-done-check {
  font-size: 11px;
  color: #4ade80;
  margin-left: 4px;
}
.menu-mission-text {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #bbb;
  line-height: 1.7;
}
.menu-mission-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-mission-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.menu-mission-fill {
  height: 100%;
  background: #0f0;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.menu-mission-card-done .menu-mission-fill { background: #4ade80; }
.menu-mission-val {
  font-family: "Press Start 2P", cursive;
  font-size: 5px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}
/* All done celebration */
#menu-missions-alldone {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #4ade80;
  text-align: center;
  text-shadow: 0 0 12px rgba(74,222,128,0.7);
  padding: 4px 0 2px;
  animation: missions-glow 2s ease-in-out infinite;
}
@keyframes missions-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(74,222,128,0.5); }
  50%       { text-shadow: 0 0 18px rgba(74,222,128,0.9); }
}
#menu-missions-alldone-sub {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  text-align: center;
}
/* First-time tooltip */
#missions-first-tooltip {
  background: rgba(0,40,0,0.9);
  border: 1px solid rgba(74,222,128,0.5);
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#missions-tooltip-text {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ccc;
  text-align: center;
  line-height: 1.8;
}
#missions-tooltip-ok {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #000;
  background: #4ade80;
  border: none;
  padding: 6px 20px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}
#missions-tooltip-ok:hover { background: #86efac; }

/* ── Mode select: power-up equip slot ── */
#mode-powerup-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 255, 136, 0.2);
}
#mode-powerup-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.58em;
  color: #00ff88;
  letter-spacing: 2px;
  text-shadow: 0 0 8px #00ff88;
}
#mode-powerup-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.powerup-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(0, 20, 10, 0.75);
  border: 2px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 86px;
  font-family: "Press Start 2P", cursive;
  color: inherit;
  outline: none;
}
.powerup-pick-btn:hover {
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}
.powerup-pick-btn.pu-equipped {
  border-color: #ffd700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
}
.powerup-pick-btn.pu-equipped .ppu-name {
  color: #ffd700;
  text-shadow: 0 0 6px #ffd700;
}
.ppu-icon { font-size: 1.5em; }
.ppu-name {
  font-size: 0.38em;
  color: #aaffcc;
}
.ppu-qty {
  font-size: 0.4em;
  color: #ff0;
}
.powerup-pick-none {
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  color: rgba(150, 200, 150, 0.45);
  text-align: center;
  padding: 6px 12px;
}

/* ── In-game equipped power-up HUD (bottom-right) ── */
#powerup-hud {
  position: absolute;
  bottom: 80px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.55);
  border-radius: 6px;
  padding: 8px 12px;
  pointer-events: none;
  z-index: 150;
}
#powerup-hud-icon {
  font-size: 1.8em;
  animation: powerup-pulse 1.5s ease-in-out infinite;
}
#powerup-hud-icon.pu-used {
  animation: none;
  opacity: 0.35;
  filter: grayscale(1);
}
#powerup-hud-name {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700;
  white-space: nowrap;
}
#powerup-hud-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
@keyframes powerup-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%       { transform: scale(1.15); opacity: 0.8; }
}

/* ── Power-up activation overlays ── */

/* One-shot flash on activation */
#powerup-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
}
#powerup-flash.row-bomb  { background: radial-gradient(circle, rgba(255,160,0,0.75) 0%, rgba(255,40,0,0.35) 55%, transparent 100%); }
#powerup-flash.slow-down { background: radial-gradient(ellipse at center, transparent 35%, rgba(0,100,255,0.5) 100%); }
#powerup-flash.shield    { background: radial-gradient(ellipse at center, transparent 35%, rgba(0,220,90,0.55) 100%); }
#powerup-flash.magnet      { background: radial-gradient(ellipse at center, transparent 45%, rgba(255,215,0,0.45) 100%); }
#powerup-flash.time-freeze { background: radial-gradient(ellipse at center, rgba(140,220,255,0.55) 0%, rgba(80,180,255,0.3) 55%, transparent 100%); }
#powerup-flash.active    { animation: pu-flash-out 0.45s ease-out forwards; }
@keyframes pu-flash-out {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Slow Down: persistent blue vignette while active */
#slowdown-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 185;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(0,80,220,0.28) 100%);
  box-shadow: inset 0 0 60px rgba(0,100,255,0.35);
  animation: slowdown-breathe 2.2s ease-in-out infinite;
}
@keyframes slowdown-breathe {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1.0;  }
}

/* Shield: persistent green aura while active */
#shield-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 185;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,200,80,0.22) 100%);
  box-shadow: inset 0 0 55px rgba(0,255,100,0.3);
  animation: shield-breathe 2.8s ease-in-out infinite;
}
@keyframes shield-breathe {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1.0;  }
}
/* Shield absorption burst */
#shield-overlay.absorb {
  animation: shield-absorb 0.6s ease-out forwards;
}
@keyframes shield-absorb {
  0%   { opacity: 1; background: radial-gradient(ellipse at center, transparent 20%, rgba(0,255,100,0.75) 100%); box-shadow: inset 0 0 80px rgba(0,255,100,0.6); }
  100% { opacity: 0; }
}

/* Magnet: golden ring pulse while active */
#magnet-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 185;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(220,170,0,0.22) 100%);
  box-shadow: inset 0 0 50px rgba(255,200,0,0.25);
  animation: magnet-ring 1.1s ease-in-out infinite;
}
@keyframes magnet-ring {
  0%, 100% { opacity: 0.55; transform: scale(1);     }
  50%       { opacity: 1.0;  transform: scale(1.004); }
}

/* Time Freeze: ice-blue shimmer vignette while active */
#time-freeze-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 185;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(80,180,255,0.22) 100%);
  box-shadow: inset 0 0 60px rgba(140,220,255,0.35);
  animation: time-freeze-shimmer 1.5s ease-in-out infinite;
}
@keyframes time-freeze-shimmer {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1.0;  }
}

/* ── Piece Storm event ──────────────────────────────────────────────────────── */

/* Atmospheric red tint — full-screen vignette while storm is active */
#storm-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 183;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(200,0,0,0.20) 100%);
  box-shadow: inset 0 0 90px rgba(255,30,0,0.26);
  animation: storm-breathe 1.4s ease-in-out infinite;
}
@keyframes storm-breathe {
  0%, 100% { opacity: 0.70; }
  50%       { opacity: 1.00; }
}

/* Lightning strike flash — brief red burst on each piece spawn */
#lightning-flash.active {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 191;
  background: rgba(255, 60, 60, 0.68);
  animation: lightning-strike 0.32s ease-out forwards;
}
@keyframes lightning-strike {
  0%   { opacity: 1.0; }
  35%  { opacity: 0.55; }
  100% { opacity: 0.0; }
}

/* Storm countdown HUD — centered below the top HUD row */
#storm-hud {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #ff4444;
  text-shadow: 0 0 10px #ff0000, 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  animation: storm-hud-pulse 1.0s ease-in-out infinite;
}
@keyframes storm-hud-pulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1.00; }
}


/* ── Golden Hour World Event ─────────────────────────────────────────────── */

/* Warm golden ambient tint — full-screen vignette while Golden Hour is active */
#golden-hour-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 183;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(255,180,0,0.18) 100%);
  box-shadow: inset 0 0 100px rgba(255,200,0,0.22);
  animation: golden-hour-breathe 2.0s ease-in-out infinite;
}
@keyframes golden-hour-breathe {
  0%, 100% { opacity: 0.75; }
  50%       { opacity: 1.00; }
}

/* Golden shimmer flash — brief warm burst on each golden line clear */
#golden-hour-flash.active {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 191;
  background: rgba(255, 215, 0, 0.55);
  animation: golden-hour-strike 0.40s ease-out forwards;
}
@keyframes golden-hour-strike {
  0%   { opacity: 1.0; }
  40%  { opacity: 0.45; }
  100% { opacity: 0.0; }
}

/* Golden Hour countdown HUD — centered below the top HUD row */
#golden-hour-hud {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #ffd700;
  text-shadow: 0 0 12px #ffaa00, 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  animation: golden-hour-hud-pulse 1.2s ease-in-out infinite;
}
@keyframes golden-hour-hud-pulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1.00; }
}

/* ── Earthquake World Event ──────────────────────────────────────────────── */

#earthquake-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 183;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(160,80,0,0.18) 100%);
  box-shadow: inset 0 0 90px rgba(200,100,0,0.22);
  animation: earthquake-breathe 0.9s ease-in-out infinite;
}
@keyframes earthquake-breathe {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 1.00; }
}

/* Earthquake mining bonus HUD — centered below top HUD row, shown for full event */
#earthquake-hud {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #ff8c00;
  text-shadow: 0 0 10px rgba(255, 100, 0, 0.9), 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  z-index: 184;
  animation: earthquake-hud-pulse 0.9s ease-in-out infinite;
}
@keyframes earthquake-hud-pulse {
  0%, 100% { opacity: 0.88; }
  50%       { opacity: 1.00; }
}

/* ── Creeper World Event ────────────────────────────────────────────────── */

/* Green atmospheric tint — full-screen vignette while Creeper is active */
#creeper-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 183;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,180,0,0.15) 100%);
  box-shadow: inset 0 0 100px rgba(100,255,100,0.20);
  animation: creeper-breathe 1.2s ease-in-out infinite;
}
@keyframes creeper-breathe {
  0%, 100% { opacity: 0.65; }
  50%       { opacity: 0.85; }
}

/* Creeper directional indicator — green chevron at screen edge */
#creeper-direction {
  position: absolute;
  pointer-events: none;
  z-index: 185;
  font-size: 28px;
  color: #00dd00;
  text-shadow: 0 0 8px rgba(0,220,0,0.8), 0 0 16px rgba(0,180,0,0.5);
  filter: drop-shadow(0 0 4px rgba(0,255,0,0.6));
  animation: creeper-arrow-pulse 1s ease-in-out infinite;
  transition: opacity 0.15s;
}
@keyframes creeper-arrow-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) rotate(var(--arrow-rot, 0deg)) scale(1); }
  50%      { opacity: 1.0; transform: translate(-50%, -50%) rotate(var(--arrow-rot, 0deg)) scale(1.15); }
}

/* ── Event Announcement Card ─────────────────────────────────────────────── */

/* Full-screen backdrop */
#event-announcement {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  animation: event-announce-backdrop-in 0.25s ease-out forwards;
}
@keyframes event-announce-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#event-announcement.dismissing {
  animation: event-announce-backdrop-out 0.35s ease-in forwards;
}
@keyframes event-announce-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Inner card */
#event-announcement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 48px;
  border-radius: 12px;
  border: 3px solid var(--event-accent, #ffffff);
  background: var(--event-bg, rgba(20, 20, 20, 0.95));
  box-shadow: 0 0 40px var(--event-glow, rgba(255,255,255,0.3)),
              0 0 80px var(--event-glow, rgba(255,255,255,0.1)),
              inset 0 0 20px rgba(0,0,0,0.5);
  animation: event-card-in 0.30s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  max-width: 420px;
  text-align: center;
}
@keyframes event-card-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1.0); opacity: 1; }
}
#event-announcement.dismissing #event-announcement-card {
  animation: event-card-out 0.30s ease-in forwards;
}
@keyframes event-card-out {
  from { transform: scale(1.0); opacity: 1; }
  to   { transform: scale(0.85); opacity: 0; }
}

#event-announcement-icon {
  font-size: 3.2em;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--event-glow, rgba(255,255,255,0.5)));
  animation: event-icon-bounce 0.5s ease-out 0.2s both;
}
@keyframes event-icon-bounce {
  0%   { transform: scale(0.5) rotate(-15deg); }
  60%  { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1.0) rotate(0deg); }
}

#event-announcement-name {
  font-family: "Press Start 2P", cursive;
  font-size: 18px;
  color: var(--event-accent, #ffffff);
  text-shadow: 0 0 16px var(--event-glow, rgba(255,255,255,0.8)),
               2px 2px 4px rgba(0,0,0,0.9);
  letter-spacing: 2px;
  line-height: 1.4;
}

#event-announcement-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.80);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
  line-height: 1.6;
  max-width: 320px;
}

/* ── Event Countdown HUD (corner timer) ──────────────────────────────────── */

#event-countdown-hud {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.70);
  border: 2px solid var(--event-hud-color, #ffffff);
  border-radius: 8px;
  padding: 8px 14px;
  pointer-events: none;
  z-index: 185;
  box-shadow: 0 0 12px var(--event-hud-glow, rgba(255,255,255,0.25));
  animation: event-hud-appear 0.3s ease-out forwards;
}
@keyframes event-hud-appear {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#event-countdown-icon {
  font-size: 1.1em;
  line-height: 1;
}

#event-countdown-timer {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: var(--event-hud-color, #ffffff);
  text-shadow: 0 0 8px var(--event-hud-glow, rgba(255,255,255,0.6)),
               1px 1px 2px rgba(0,0,0,0.9);
  letter-spacing: 1px;
  white-space: nowrap;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* Timer color states (applied via JS on the #event-countdown-hud element) */
#event-countdown-hud.timer-green {
  --event-hud-color: #44ff88;
  --event-hud-glow: rgba(68, 255, 136, 0.5);
}
#event-countdown-hud.timer-yellow {
  --event-hud-color: #ffdd00;
  --event-hud-glow: rgba(255, 221, 0, 0.5);
}
#event-countdown-hud.timer-red {
  --event-hud-color: #ff4444;
  --event-hud-glow: rgba(255, 68, 68, 0.5);
  animation: event-hud-urgent 0.6s ease-in-out infinite;
}
@keyframes event-hud-urgent {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 1.00; }
}

/* ── Event End Toast ─────────────────────────────────────────────────────── */

#event-end-toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.90);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 10px 18px;
  pointer-events: none;
  z-index: 190;
  white-space: nowrap;
  opacity: 0;
}
#event-end-toast.toast-visible {
  animation: event-end-toast-show 3.0s ease forwards;
}
@keyframes event-end-toast-show {
  0%   { opacity: 0;    transform: translateX(-50%) translateY(10px); }
  12%  { opacity: 1;    transform: translateX(-50%) translateY(0);    }
  70%  { opacity: 1;    transform: translateX(-50%) translateY(0);    }
  100% { opacity: 0;    transform: translateX(-50%) translateY(-8px); }
}

/* ── Season Banner (mode-select screen) ───────────────────────────────────── */
#season-banner {
  display: none; /* shown by JS when season is active */
  align-items: center;
  gap: 14px;
  width: 100%;
  background: rgba(0, 20, 10, 0.7);
  border: 2px solid var(--season-accent, #00ff88);
  border-radius: 8px;
  padding: 12px 20px;
  box-sizing: border-box;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.15);
}
#season-banner-icon {
  font-size: 1.6em;
  flex-shrink: 0;
}
#season-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
#season-banner-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#season-banner-name {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: var(--season-accent, #00ff88);
  text-shadow: 0 0 8px var(--season-accent, #00ff88);
  letter-spacing: 0.06em;
}
#season-banner-days {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  text-align: right;
}

/* ── Season leaderboard badges ────────────────────────────────────────────── */
.lb-season-badge {
  font-size: 1.1em;
  line-height: 1;
}
.lb-season-badge-1 { filter: drop-shadow(0 0 4px gold); }
.lb-season-badge-2 { filter: drop-shadow(0 0 4px silver); }
.lb-season-badge-3 { filter: drop-shadow(0 0 4px #cd7f32); }

/* ── Co-op leaderboard ───────────────────────────────────────────────────── */
.lb-coop-label {
  text-align: center;
  font-size: 0.8em;
  color: #88ddaa;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.lb-diff-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  letter-spacing: 0.04em;
}
.lb-diff-casual    { background: #1a4a2a; color: #7dffb3; border: 1px solid #2a7a4a; }
.lb-diff-normal    { background: #1a2a4a; color: #7db3ff; border: 1px solid #2a4a7a; }
.lb-diff-challenge { background: #4a1a1a; color: #ffaa7d; border: 1px solid #7a2a2a; }

/* ── Co-op lobby daily divider & best ───────────────────────────────────── */
#coop-daily-divider {
  color: #557755;
  font-size: 0.85em;
  margin: 10px 0 6px;
}
#coop-daily-btn {
  background: #1a3a2a;
  border: 1px solid #2a6a4a;
  color: #7dffb3;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
  margin-bottom: 6px;
}
#coop-daily-btn:hover { background: #224433; border-color: #00ff88; }
#coop-daily-best-display {
  font-size: 0.78em;
  color: #88ccaa;
  margin-bottom: 4px;
}

/* ── Co-op game-over rank ────────────────────────────────────────────────── */
#coop-go-rank {
  font-size: 1.2em;
  color: #00ff88;
  margin: 8px 0 4px;
  font-weight: bold;
}
#coop-go-lb-feedback {
  font-size: 0.8em;
  color: #99ccaa;
  margin-bottom: 4px;
}

/* ── End-of-season summary overlay ───────────────────────────────────────── */
#season-end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(4px);
}
#season-end-panel {
  background: #0a160e;
  border: 2px solid var(--season-end-accent, #00ff88);
  border-radius: 10px;
  padding: 28px 32px 24px;
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.2), 0 0 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#season-end-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
#season-end-icon {
  font-size: 2.6em;
  filter: drop-shadow(0 0 12px gold);
}
#season-end-title {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.1em;
}
#season-end-name {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: var(--season-end-accent, #00ff88);
  text-shadow: 0 0 10px var(--season-end-accent, #00ff88);
  letter-spacing: 0.06em;
}
#season-end-subtitle {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
#season-end-body {
  width: 100%;
}
#season-end-body .season-end-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
}
#season-end-body .season-end-table th {
  color: rgba(255, 255, 255, 0.35);
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#season-end-body .season-end-table td {
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#season-end-body .season-end-row-me td {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.06);
}
#season-end-body .season-end-row-1 td:first-child { color: gold; }
#season-end-body .season-end-row-2 td:first-child { color: silver; }
#season-end-body .season-end-row-3 td:first-child { color: #cd7f32; }
#season-end-your-result {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
  text-align: center;
}
#season-end-your-rank {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.5);
}
.season-end-your-summary {
  background: rgba(0,255,136,0.07);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.season-end-your-summary-title {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.season-end-your-rating {
  font-size: 0.9em;
  color: #e0e0e0;
}
.season-end-your-record {
  font-size: 0.8em;
  color: rgba(255,255,255,0.6);
}
#season-end-close-btn {
  align-self: center;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  background: var(--season-end-accent, #00ff88);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 10px 28px;
  cursor: pointer;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
#season-end-close-btn:hover {
  filter: brightness(1.15);
}

/* ── Editor mode HUD ─────────────────────────────────────────────────────── */
#editor-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 200;
}
#editor-hud-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700, 0 0 20px #b8860b;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid #ffd70066;
  letter-spacing: 2px;
}
#editor-controls-hint {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ccc;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 12px;
  border-radius: 4px;
  letter-spacing: 1px;
}
#editor-exit-btn {
  pointer-events: all;
  margin-top: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #fff;
  background: rgba(80, 80, 80, 0.75);
  border: 1px solid #888;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 1px;
}
#editor-exit-btn:hover {
  background: rgba(120, 120, 120, 0.85);
  border-color: #ccc;
}

/* ── Editor palette strip ─────────────────────────────────────────────────── */
#editor-palette {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  pointer-events: none;
}
.editor-palette-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,0.15);
  min-width: 44px;
  transition: border-color 0.1s;
}
.editor-palette-selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
}
.editor-palette-swatch {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.editor-palette-key {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ffd700;
  line-height: 1;
}
.editor-palette-name {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  color: #ccc;
  line-height: 1;
  white-space: nowrap;
}

/* ── Editor HUD action row (exit + clear draft) ───────────────────────────── */
#editor-hud-actions {
  display: flex;
  gap: 8px;
  pointer-events: all;
  margin-top: 4px;
}

#editor-clear-draft-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #fff;
  background: rgba(140, 40, 40, 0.75);
  border: 1px solid #c06060;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 1px;
}
#editor-clear-draft-btn:hover {
  background: rgba(180, 60, 60, 0.85);
  border-color: #e08080;
}

/* Override pointer-events on exit btn now that it sits inside #editor-hud-actions */
#editor-hud-actions #editor-exit-btn {
  margin-top: 0;
  pointer-events: all;
}

/* ── Editor draft prompt overlay ─────────────────────────────────────────── */
#editor-draft-prompt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 500;
}
#editor-draft-prompt-inner {
  background: rgba(20, 20, 20, 0.95);
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  text-align: center;
}
#editor-draft-prompt-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  color: #ffd700;
  text-shadow: 0 0 10px #b8860b;
}
#editor-draft-prompt-sub {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  color: #ccc;
  line-height: 1.6;
}
#editor-draft-prompt-btns {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}
#editor-draft-load-btn,
#editor-draft-fresh-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1px;
  border: 1px solid;
}
#editor-draft-load-btn {
  color: #111;
  background: #ffd700;
  border-color: #b8860b;
}
#editor-draft-load-btn:hover {
  background: #ffe44d;
}
#editor-draft-fresh-btn {
  color: #fff;
  background: rgba(80, 80, 80, 0.8);
  border-color: #888;
}
#editor-draft-fresh-btn:hover {
  background: rgba(120, 120, 120, 0.9);
  border-color: #ccc;
}

/* ── Editor Test + Share buttons ─────────────────────────────────────────── */
#editor-test-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #111;
  background: #ffd700;
  border: 1px solid #b8860b;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 1px;
  pointer-events: all;
}
#editor-test-btn:hover {
  background: #ffe44d;
}
#editor-share-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #fff;
  background: rgba(30, 90, 160, 0.8);
  border: 1px solid #4488cc;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 1px;
  pointer-events: all;
}
#editor-share-btn:hover {
  background: rgba(50, 120, 200, 0.9);
  border-color: #66aaee;
}

/* ── Win condition builder panel ─────────────────────────────────────────── */
#editor-win-condition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  pointer-events: all;
  margin-top: 4px;
}
.editor-wc-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ffd700;
  letter-spacing: 2px;
}
.editor-wc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.editor-wc-select {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #fff;
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid #666;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
.editor-wc-select:focus {
  outline: none;
  border-color: #ffd700;
}
.editor-wc-n {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #fff;
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid #666;
  border-radius: 4px;
  padding: 4px 8px;
  width: 70px;
  text-align: center;
}
.editor-wc-n:focus {
  outline: none;
  border-color: #ffd700;
}
.editor-wc-preview {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: #88ff88;
  letter-spacing: 1px;
  text-align: center;
}

/* ── Editor metadata panel ────────────────────────────────────────────────── */
#editor-metadata {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  pointer-events: all;
  margin-top: 4px;
  min-width: 340px;
}
.editor-meta-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ffd700;
  letter-spacing: 2px;
}
.editor-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.editor-meta-field-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: #ccc;
  min-width: 44px;
  text-align: right;
  white-space: nowrap;
}
.editor-meta-required {
  color: #ff6666;
}
.editor-meta-field-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.editor-meta-input {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  color: #fff;
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid #666;
  border-radius: 4px;
  padding: 4px 8px;
  flex: 1;
  min-width: 0;
}
.editor-meta-input-wide {
  flex: 2;
}
.editor-meta-input:focus {
  outline: none;
  border-color: #ffd700;
}
.editor-meta-counter {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}
.editor-meta-stars {
  display: flex;
  gap: 4px;
}
.editor-meta-star {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.1s, transform 0.1s;
  line-height: 1;
}
.editor-meta-star:hover {
  color: #ffd700;
  transform: scale(1.2);
}
.editor-meta-star-on {
  color: #ffd700;
}

/* ── Editor piece sequence panel ──────────────────────────────────────────── */
#editor-piece-sequence {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  pointer-events: all;
  margin-top: 4px;
  min-width: 340px;
}
.editor-seq-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ffd700;
  letter-spacing: 2px;
}
.editor-seq-toggle {
  display: flex;
  gap: 6px;
}
.editor-seq-mode-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  background: rgba(40, 40, 40, 0.9);
  border: 1px solid #666;
  border-radius: 4px;
  color: #aaa;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.editor-seq-mode-btn:hover {
  border-color: #ffd700;
  color: #fff;
}
.editor-seq-mode-active {
  border-color: #ffd700 !important;
  color: #ffd700 !important;
}
.editor-seq-picker {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.editor-seq-piece-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  transition: transform 0.1s, border-color 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-seq-piece-btn:hover {
  transform: scale(1.18);
  border-color: #fff;
}
.editor-seq-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 320px;
  max-height: 72px;
  overflow-y: auto;
  padding: 2px;
}
.editor-seq-empty {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  color: #666;
}
.editor-seq-item {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  opacity: 0.85;
  transition: opacity 0.1s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editor-seq-item:hover {
  opacity: 1;
  transform: scale(1.15);
  border-color: #ff6666;
}
.editor-seq-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}
.editor-seq-count {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  color: #888;
}
.editor-seq-clear-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  background: rgba(180, 0, 0, 0.5);
  border: 1px solid #aa0000;
  border-radius: 4px;
  color: #ffaaaa;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.editor-seq-clear-btn:hover {
  background: rgba(220, 0, 0, 0.7);
}
.editor-seq-preview {
  display: flex;
  gap: 5px;
  align-items: center;
}
.editor-seq-preview-item {
  font-family: "Press Start 2P", cursive;
  font-size: 0.4em;
  width: 26px;
  height: 26px;
  border: 2px solid;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.editor-seq-preview-more {
  font-family: "Press Start 2P", cursive;
  font-size: 0.35em;
  color: #aaa;
}
.editor-seq-random-note {
  font-family: "Press Start 2P", cursive;
  font-size: 0.38em;
  color: #88ff88;
  text-align: center;
}

/* ── Custom puzzle load screen ────────────────────────────────────────────── */
#custom-puzzle-load-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  z-index: 350;
}
#cpls-inner {
  background: rgba(15, 15, 25, 0.97);
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 36px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  text-align: center;
}
#cpls-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #ffd700;
  letter-spacing: 3px;
  text-shadow: 0 0 8px #ffd70088;
}
#cpls-name {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  color: #fff;
  letter-spacing: 1px;
  word-break: break-word;
}
#cpls-difficulty {
  font-family: "Press Start 2P", cursive;
  font-size: 0.9em;
  color: #ffd700;
  letter-spacing: 2px;
}
#cpls-author {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #aaa;
  letter-spacing: 1px;
}
#cpls-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 0.45em;
  color: #ccc;
  line-height: 1.6;
  letter-spacing: 0.5px;
  word-break: break-word;
}
#cpls-play-btn {
  margin-top: 8px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.7em;
  color: #000;
  background: #ffd700;
  border: none;
  border-radius: 6px;
  padding: 12px 32px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: background 0.15s, transform 0.1s;
}
#cpls-play-btn:hover {
  background: #ffe84d;
  transform: scale(1.04);
}

/* ── Puzzle Share Modal ────────────────────────────────────────────────────── */
#puzzle-share-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
  z-index: 9000;
}
#psm-inner {
  position: relative;
  background: #1a1a2e;
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 300px;
  max-width: 95vw;
  box-shadow: 0 0 32px #ffd70044;
}
#psm-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
#psm-close-btn:hover { color: #fff; }
#psm-title {
  font-family: "Press Start 2P", cursive;
  font-size: 0.85em;
  color: #ffd700;
  letter-spacing: 3px;
}
#psm-qr-canvas {
  border: 3px solid #fff;
  border-radius: 4px;
  background: #fff;
  image-rendering: pixelated;
}
#psm-url-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}
#psm-url-input {
  flex: 1;
  font-family: monospace;
  font-size: 0.65em;
  background: #0d0d1a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #ccc;
  padding: 6px 8px;
  min-width: 0;
}
#psm-copy-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  color: #000;
  background: #ffd700;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s;
}
#psm-copy-btn:hover { background: #ffe84d; transform: scale(1.04); }
#psm-copy-feedback {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  color: #4caf50;
  letter-spacing: 1px;
  height: 1em;
}

/* ── CPLS loading spinner ──────────────────────────────────────────────────── */
#cpls-spinner {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #ffd700;
  letter-spacing: 2px;
  animation: cpls-pulse 1s ease-in-out infinite;
}
@keyframes cpls-pulse {
  0%,100% { opacity:1; } 50% { opacity:0.3; }
}

/* ── Community button (main menu) ─────────────────────────────────────────── */
/* Community — use group defaults, no overrides needed */

/* ── Community browser screen ─────────────────────────────────────────────── */
#community-browser-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  justify-content: center;
  align-items: flex-start;
  z-index: 300;
  overflow-y: auto;
}
#cb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
  max-width: 680px;
  padding: 28px 0 40px;
  gap: 18px;
}
#cb-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
#cb-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.3em;
  color: #00ffcc;
  text-shadow: 0 0 10px #00ffcc, 0 0 24px #00c8a0;
  letter-spacing: 3px;
}
#cb-total {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 200, 160, 0.6);
}
#cb-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
#cb-search {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #0f0;
  background: rgba(0, 30, 20, 0.9);
  border: 1px solid rgba(0, 200, 160, 0.4);
  border-radius: 4px;
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  caret-color: #00ffcc;
}
#cb-search::placeholder { color: rgba(0, 200, 160, 0.35); }
#cb-search:focus { border-color: #00ffcc; box-shadow: 0 0 8px rgba(0, 200, 160, 0.3); }
#cb-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.cb-filter-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 200, 160, 0.7);
  background: transparent;
  border: 1px solid rgba(0, 200, 160, 0.3);
  border-radius: 4px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cb-filter-btn:hover {
  color: #00ffcc;
  border-color: #00ffcc;
}
.cb-filter-active {
  color: #000 !important;
  background: #00c8a0 !important;
  border-color: #00ffcc !important;
}

/* ── Puzzle list ── */
#cb-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cb-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 30, 22, 0.85);
  border: 1px solid rgba(0, 200, 160, 0.22);
  border-radius: 6px;
  padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cb-card:hover {
  border-color: rgba(0, 200, 160, 0.5);
  box-shadow: 0 0 14px rgba(0, 200, 160, 0.12);
}
.cb-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.cb-card-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ccffee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cb-card-author {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(0, 200, 160, 0.6);
}
.cb-card-stars {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ffd700;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
  letter-spacing: 1px;
}
.cb-card-plays {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(160, 200, 180, 0.5);
}
.cb-card-rating {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: rgba(200, 180, 160, 0.6);
}
.cb-card-play {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #000;
  background: #00c8a0;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cb-card-play:hover { background: #00ffcc; }
.cb-card-play:disabled { background: #555; color: #888; cursor: default; }

/* ── Featured section ── */
#cb-featured-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#cb-featured-title {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 0 16px rgba(255, 215, 0, 0.3);
  letter-spacing: 2px;
}
#cb-featured-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cb-section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 200, 160, 0.25), transparent);
  margin-top: 4px;
}
.cb-card-featured {
  border-color: rgba(255, 215, 0, 0.35) !important;
  background: rgba(20, 18, 0, 0.88) !important;
}
.cb-card-featured:hover {
  border-color: rgba(255, 215, 0, 0.65) !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.1) !important;
}
.cb-card-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 3px;
  padding: 2px 6px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ── Load more button ── */
#cb-load-more {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(0, 200, 160, 0.7);
  background: transparent;
  border: 1px solid rgba(0, 200, 160, 0.3);
  border-radius: 4px;
  padding: 10px 22px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#cb-load-more:hover { color: #00ffcc; border-color: #00ffcc; }

/* ── Spinner, empty, error states ── */
#cb-spinner {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  color: #00ffcc;
  letter-spacing: 2px;
  animation: cb-pulse 1s ease-in-out infinite;
}
@keyframes cb-pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}
#cb-error, #cb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 0;
}
#cb-error-msg, #cb-empty-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(200, 160, 160, 0.7);
}
#cb-empty-sub {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 200, 160, 0.45);
  text-align: center;
  line-height: 1.7;
}
#cb-retry-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #000;
  background: rgba(200, 80, 80, 0.8);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
#cb-retry-btn:hover { background: #f44; }

/* ── Back button ── */
#cb-back-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.6em;
  background: transparent;
  border: 1px solid rgba(0, 200, 160, 0.3);
  color: rgba(0, 200, 160, 0.7);
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-top: 4px;
}

/* ── Editor first-time onboarding tutorial ───────────────────────────────────── */

/* Spotlight element: transparent box positioned over the target UI element.
   The enormous box-shadow darkens everything outside its bounds, creating the
   spotlight effect. pointer-events:none lets clicks pass through to the target. */
#editor-tutorial-spotlight {
  position: fixed;
  background: transparent;
  z-index: 251;
  border: 2px solid #ff0;
  border-radius: 6px;
  pointer-events: none;
  animation: etut-pulse 1.5s ease-in-out infinite;
}

@keyframes etut-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.62), 0 0 12px #ff0, 0 0 24px rgba(255,255,0,0.3); }
  50%       { box-shadow: 0 0 0 9999px rgba(0,0,0,0.68), 0 0 26px #ff0, 0 0 48px rgba(255,255,0,0.2); }
}

/* Info panel: bottom-center floating card with step text and skip link. */
#editor-tutorial-panel {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid #ff0;
  border-radius: 6px;
  padding: 16px 22px 14px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 252;
  min-width: 260px;
  max-width: 420px;
  pointer-events: none;
  text-align: center;
}

#editor-tut-header {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

#editor-tut-count {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #555;
}

#editor-tut-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ff0;
  text-shadow: 1px 1px 0 #000, 0 0 10px #ff0;
  line-height: 1.6;
  white-space: pre-line;
}

#editor-tut-text {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ddd;
  line-height: 1.8;
  white-space: pre-line;
}

#editor-tut-subtext {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #0f0;
  line-height: 1.6;
  display: none;
}

#editor-tut-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

#editor-tut-skip-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  color: #777;
  background: transparent;
  border: 1px solid #444;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 3px;
  pointer-events: all;
  transition: color 0.15s, border-color 0.15s;
}

#editor-tut-skip-btn:hover { color: #f44; border-color: #f44; }
#cb-back-btn:hover { color: #00ffcc; border-color: #00ffcc; }

/* ── Co-op HUD ────────────────────────────────────────────────────────────── */

#coop-mode-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #00ffdd;
  text-shadow: 0 0 8px #00ffdd;
  background: rgba(0, 40, 40, 0.75);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #00ffdd44;
  pointer-events: none;
  z-index: 150;
  display: none;
  align-items: center;
  gap: 6px;
}
#coop-difficulty-label {
  font-size: 7px;
  color: rgba(0, 255, 221, 0.7);
  letter-spacing: 0.5px;
}
#coop-bonus-overlay {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", cursive;
  font-size: 1.1em;
  color: #00ffdd;
  text-shadow: 0 0 18px #00ffdd, 0 0 30px #00ffdd88;
  pointer-events: none;
  z-index: 200;
  opacity: 1;
  transition: opacity 1s ease-out;
  white-space: nowrap;
}

#coop-score-display {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 150;
}

.coop-combined-score {
  font-family: "Press Start 2P", cursive;
  font-size: 2.2em;
  color: #00ffdd;
  text-shadow: 0 0 12px #00ffdd88;
  line-height: 1.2;
}

.coop-score-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 221, 0.55);
  letter-spacing: 1px;
  margin-top: 2px;
}

.coop-score-sub {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(0, 255, 221, 0.75);
  margin-top: 4px;
}

#coop-partner-status {
  position: absolute;
  bottom: 120px;
  left: 14px;
  display: none;
  align-items: center;
  gap: 6px;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #aaa;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 150;
}

#coop-partner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  flex-shrink: 0;
}

/* Co-op partner-left choice dialog */
#coop-partner-left-dialog {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  background: rgba(0,0,0,0.55);
}

.coop-dialog-box {
  background: rgba(0, 20, 20, 0.95);
  border: 1px solid #00ffdd55;
  border-radius: 8px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 340px;
  text-align: center;
}

.coop-dialog-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.1em;
  color: #00ffdd;
  text-shadow: 0 0 8px #00ffdd66;
}

.coop-dialog-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #aaa;
  line-height: 1.7;
}

.coop-dialog-timer {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #666;
}

.coop-dialog-btns {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.coop-dialog-btns button {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

#coop-partner-left-continue {
  background: #00443a;
  color: #00ffdd;
  border: 1px solid #00ffdd66;
}
#coop-partner-left-continue:hover { background: #005a4e; }

#coop-partner-left-quit {
  background: #440000;
  color: #ff6666;
  border: 1px solid #ff666644;
}
#coop-partner-left-quit:hover { background: #660000; }

/* Co-op Game Over screen */
#coop-game-over-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
  gap: 14px;
  overflow-y: auto;
  padding: 20px 0;
}

#coop-game-over-title {
  font-family: "Press Start 2P", cursive;
  font-size: 2em;
  color: #00ffdd;
  text-shadow: 3px 3px #006655;
  animation: go-flicker 1.5s infinite;
}

#coop-go-combined-score {
  font-family: "Press Start 2P", cursive;
  font-size: 13px;
  color: #fff;
  letter-spacing: 1px;
}

#coop-go-time {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: rgba(0,255,221,0.6);
}

#coop-go-mvp-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 4px;
  padding: 6px 14px;
}

/* Contribution table */
#coop-go-contribution-panel {
  border: 1px solid rgba(0, 255, 221, 0.25);
  border-radius: 4px;
  background: rgba(0, 20, 20, 0.6);
  padding: 10px 16px;
}

#coop-go-table {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  border-collapse: collapse;
  color: #00ffdd;
}

#coop-go-table th {
  font-size: 9px;
  color: rgba(0,255,221,0.75);
  padding: 4px 14px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(0,255,221,0.2);
}

#coop-go-table th:first-child { text-align: left; }

.coop-go-stat-label {
  color: rgba(0,255,221,0.55);
  font-size: 8px;
  padding: 5px 0 5px 0;
  padding-right: 20px;
  white-space: nowrap;
}

.coop-go-stat-val {
  text-align: center;
  padding: 5px 14px;
  font-size: 9px;
  color: #fff;
}

/* Action buttons */
#coop-go-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

#coop-go-actions button {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 9px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

#coop-go-play-again-btn {
  background: #00443a;
  color: #00ffdd;
  border: 1px solid #00ffdd66;
}
#coop-go-play-again-btn:hover { background: #005a4e; }

#coop-go-change-diff-btn {
  background: #1a3a1a;
  color: #7fff7f;
  border: 1px solid #7fff7f55;
}
#coop-go-change-diff-btn:hover { background: #234a23; }

#coop-go-share-btn {
  background: #1a1a40;
  color: #aaaaff;
  border: 1px solid #aaaaff55;
}
#coop-go-share-btn:hover { background: #252550; }

#coop-go-main-menu-btn {
  background: #222;
  color: #aaa;
  border: 1px solid #444;
}
#coop-go-main-menu-btn:hover { background: #333; }

/* ── Co-op trade offer panel ─────────────────────────────────────────────── */
#coop-trade-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 15, 20, 0.93);
  border: 1px solid rgba(0, 255, 221, 0.3);
  border-radius: 6px;
  padding: 18px 22px;
  min-width: 300px;
  max-width: 380px;
  pointer-events: all;
  z-index: 160;
}

#coop-trade-title {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #00ffdd;
  text-shadow: 0 0 8px rgba(0, 255, 221, 0.4);
  text-align: center;
  border-bottom: 1px solid rgba(0, 255, 221, 0.2);
  padding-bottom: 8px;
}

#coop-trade-subtitle {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #666;
  text-align: center;
}

#coop-trade-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
}

.trade-inv-slot {
  width: 46px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.12s, background 0.12s;
}

.trade-inv-slot:hover {
  border-color: rgba(0, 255, 221, 0.5);
  background: rgba(0, 255, 221, 0.07);
}

.trade-inv-slot.selected {
  border-color: #00ffdd;
  background: rgba(0, 255, 221, 0.13);
}

.trade-inv-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.trade-inv-count {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ccc;
}

#coop-trade-qty-row {
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#coop-trade-selected-swatch {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

#coop-trade-selected-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #aaa;
  flex: 1;
}

#coop-trade-qty-input {
  width: 52px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 221, 0.4);
  border-radius: 3px;
  color: #00ffdd;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  padding: 3px 5px;
  text-align: center;
}

#coop-trade-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#coop-trade-offer-btn,
#coop-trade-cancel-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

#coop-trade-offer-btn {
  background: #00443a;
  color: #00ffdd;
  border: 1px solid rgba(0, 255, 221, 0.4);
}

#coop-trade-offer-btn:hover:not(:disabled) { background: #005a4e; }
#coop-trade-offer-btn:disabled { opacity: 0.4; cursor: default; }

#coop-trade-cancel-btn {
  background: #330000;
  color: #ff9999;
  border: 1px solid rgba(255, 102, 102, 0.3);
}

#coop-trade-cancel-btn:hover { background: #440000; }

/* ── Co-op incoming trade toast ─────────────────────────────────────────── */
#coop-incoming-trade-toast {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0, 20, 15, 0.91);
  border: 1px solid rgba(0, 255, 170, 0.35);
  color: #00ffaa;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  padding: 10px 18px;
  border-radius: 5px;
  z-index: 9999;
  pointer-events: none;
  text-align: center;
}

#coop-incoming-trade-hint {
  font-size: 7px;
  color: #00cc88;
  margin-top: 2px;
}

#coop-incoming-trade-timer {
  font-size: 7px;
  color: #555;
}

/* ── Co-op trade first-run hint ─────────────────────────────────────────── */
#coop-trade-hint {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  background: rgba(0, 0, 0, 0.76);
  color: #00ffdd;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Co-op emote local feedback (bounce above crosshair) ── */
#coop-emote-feedback {
  position: fixed;
  left: 50%;
  top: calc(50% - 60px);
  transform: translateX(-50%);
  display: none;
  font-size: 28px;
  line-height: 1;
  z-index: 9999;
  pointer-events: none;
}

@keyframes coop-emote-bounce {
  0%   { transform: translateX(-50%) translateY(0)    scale(1);    opacity: 1; }
  30%  { transform: translateX(-50%) translateY(-14px) scale(1.2); opacity: 1; }
  60%  { transform: translateX(-50%) translateY(-4px)  scale(1);   opacity: 1; }
  80%  { transform: translateX(-50%) translateY(-9px)  scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0)    scale(1);    opacity: 1; }
}

.coop-emote-bounce {
  animation: coop-emote-bounce 0.5s ease-out forwards;
}

/* ── Co-op emote toast (bottom-right) ── */
#coop-emote-toast {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: none;
  background: rgba(0, 0, 0, 0.78);
  color: #00ffdd;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  padding: 7px 14px;
  border-radius: 4px;
  z-index: 9999;
  pointer-events: none;
}

/* ── Co-op emote keybinding HUD row ── */
#coop-emote-hud {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: row;
  gap: 8px;
  z-index: 9990;
  pointer-events: none;
  align-items: center;
}

.coop-emote-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.60);
  border: 1px solid rgba(0, 255, 220, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
}

.coop-emote-key-label {
  color: rgba(0, 255, 220, 0.65);
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  white-space: nowrap;
}

.coop-emote-key-icon {
  font-size: 14px;
  line-height: 1;
}

/* ── Battle FX overlays ─────────────────────────────────────────────────────── */

/* Incoming attack — red vignette flash at screen edges */
#battle-incoming-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 192;
  display: none;
}
#battle-incoming-flash.bfx-in-subtle {
  background: radial-gradient(ellipse at center, transparent 50%, rgba(220,0,0,0.30) 100%);
  box-shadow: inset 0 0 70px rgba(255,30,0,0.35);
  animation: bfx-incoming-pulse 0.5s ease-out forwards;
}
#battle-incoming-flash.bfx-in-medium {
  background: radial-gradient(ellipse at center, transparent 38%, rgba(220,0,0,0.52) 100%);
  box-shadow: inset 0 0 85px rgba(255,30,0,0.58);
  animation: bfx-incoming-pulse 0.5s ease-out forwards;
}
#battle-incoming-flash.bfx-in-intense {
  background: radial-gradient(ellipse at center, transparent 22%, rgba(220,0,0,0.75) 100%);
  box-shadow: inset 0 0 110px rgba(255,30,0,0.80);
  animation: bfx-incoming-pulse 0.5s ease-out forwards;
}
@keyframes bfx-incoming-pulse {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Outgoing attack particle streak — canvas overlay */
#battle-streak-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 193;
  display: none;
}

/* Camera shake classes on #game-container */
@keyframes bfx-shake-light {
  0%, 100% { transform: translate(0, 0); }
  25%       { transform: translate(-2px, 1px); }
  75%       { transform: translate(2px, -1px); }
}
@keyframes bfx-shake-medium {
  0%, 100% { transform: translate(0, 0); }
  20%       { transform: translate(-4px, 2px); }
  40%       { transform: translate(4px, -2px); }
  60%       { transform: translate(-3px, 3px); }
  80%       { transform: translate(3px, -1px); }
}
@keyframes bfx-shake-strong {
  0%, 100% { transform: translate(0, 0); }
  15%       { transform: translate(-6px, 3px); }
  30%       { transform: translate(6px, -3px); }
  45%       { transform: translate(-5px, 4px); }
  60%       { transform: translate(5px, -2px); }
  75%       { transform: translate(-4px, 2px); }
  90%       { transform: translate(3px, -1px); }
}
#game-container.bfx-shake-light  { animation: bfx-shake-light  0.08s ease-out forwards; }
#game-container.bfx-shake-medium { animation: bfx-shake-medium 0.10s ease-out forwards; }
#game-container.bfx-shake-strong { animation: bfx-shake-strong 0.15s ease-out forwards; }

/* Creeper explosion shake — longer and stronger than battle shakes */
@keyframes creeper-shake {
  0%, 100% { transform: translate(0, 0); }
  10%      { transform: translate(-5px, 3px); }
  20%      { transform: translate(6px, -2px); }
  30%      { transform: translate(-4px, 4px); }
  40%      { transform: translate(5px, -3px); }
  50%      { transform: translate(-3px, 2px); }
  60%      { transform: translate(4px, -2px); }
  70%      { transform: translate(-3px, 1px); }
  80%      { transform: translate(2px, -1px); }
  90%      { transform: translate(-1px, 1px); }
}
#game-container.creeper-shake { animation: creeper-shake 0.3s ease-out forwards; }

/* KO / Victory pre-result overlay */
#battle-ko-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
}
#battle-ko-overlay.bfx-ko-win  { background: rgba(0, 10, 5, 0.88); }
#battle-ko-overlay.bfx-ko-loss { background: rgba(10, 0, 0, 0.88); }
#battle-ko-overlay.bfx-ko-draw { background: rgba(8, 8, 0, 0.88); }
#battle-ko-title {
  font-family: "Press Start 2P", cursive;
  letter-spacing: 6px;
  position: relative;
  z-index: 1;
}
#battle-ko-overlay.bfx-ko-win  #battle-ko-title {
  font-size: clamp(2.5em, 6vw, 4.5em);
  color: #ffd700;
  text-shadow: 0 0 30px rgba(255,200,0,0.9), 0 0 60px rgba(255,160,0,0.6), 4px 4px 0 #442200;
}
#battle-ko-overlay.bfx-ko-loss #battle-ko-title {
  font-size: clamp(3em, 8vw, 6em);
  color: #ff2222;
  text-shadow: 0 0 30px rgba(255,30,30,0.9), 0 0 60px rgba(255,0,0,0.6), 4px 4px 0 #220000;
}
#battle-ko-overlay.bfx-ko-draw #battle-ko-title {
  font-size: clamp(2.5em, 6vw, 4.5em);
  color: #ffcc44;
  text-shadow: 0 0 30px rgba(255,200,60,0.9), 0 0 60px rgba(255,160,0,0.5), 4px 4px 0 #443300;
}
#battle-ko-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

/* Combo feed toast — shown above playfield in battle mode */
#battle-combo-feed {
  position: absolute;
  bottom: 80px;
  left: 50%;
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #ffcc00;
  text-shadow: 0 0 8px rgba(255,200,0,0.7), 1px 1px 0 #440;
  white-space: nowrap;
  pointer-events: none;
  z-index: 195;
  display: none;
  animation: bfx-combo-toast 1.5s ease-out forwards;
}
@keyframes bfx-combo-toast {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0);   }
  70%  { opacity: 1; transform: translateX(-50%) translateY(0);   }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

}

/* ── Tournament lobby overlay ── */
#tournament-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}
#tournament-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(20, 14, 0, 0.97);
  border: 2px solid rgba(255, 200, 0, 0.45);
  border-radius: 10px;
  padding: 36px 44px;
  width: 560px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  font-family: "Press Start 2P", cursive;
  text-align: center;
}

/* ── List view ── */
#tourn-list-title {
  font-size: 1.1em;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 200, 0, 0.7), 0 0 28px rgba(255, 160, 0, 0.4);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
#tourn-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}
.tourn-tab {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 200, 0, 0.35);
  color: #aa8800;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, color 0.15s;
}
.tourn-tab:hover {
  background: rgba(255, 200, 0, 0.1);
  color: #ffd700;
}
.tourn-tab-active {
  background: rgba(255, 200, 0, 0.18);
  border-color: rgba(255, 200, 0, 0.7);
  color: #ffd700;
}

/* ── Tournament list items ── */
#tourn-list-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.tourn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 200, 0, 0.05);
  border: 1px solid rgba(255, 200, 0, 0.2);
  border-radius: 6px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  gap: 12px;
}
.tourn-item:hover {
  border-color: rgba(255, 200, 0, 0.55);
  background: rgba(255, 200, 0, 0.1);
}
.tourn-item-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.tourn-item-name {
  font-size: 0.65em;
  color: #ffd700;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tourn-item-meta {
  font-size: 0.45em;
  color: #998855;
  letter-spacing: 0.5px;
}
.tourn-item-prize {
  font-size: 0.5em;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
  flex-shrink: 0;
}
.tourn-status-badge {
  font-size: 0.42em;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tourn-status-open        { color: #00ff88; border: 1px solid rgba(0,255,136,0.4); background: rgba(0,255,136,0.08); }
.tourn-status-in_progress { color: #ffaa00; border: 1px solid rgba(255,170,0,0.4); background: rgba(255,170,0,0.08); }
.tourn-status-completed   { color: #888;    border: 1px solid rgba(136,136,136,0.3); background: rgba(100,100,100,0.06); }
.tourn-registered-badge   { font-size: 0.42em; color: #00ff88; margin-top: 2px; }

.tourn-empty-msg {
  font-size: 0.5em;
  color: #665533;
  padding: 28px 0;
  line-height: 2;
}

/* ── Close / back buttons ── */
#tourn-list-close-btn,
#tourn-bracket-back-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.55em;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid rgba(255, 200, 0, 0.35);
  color: #aa8800;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 1px;
  margin-top: 4px;
  transition: background 0.15s, color 0.15s;
  align-self: center;
}
#tourn-list-close-btn:hover,
#tourn-bracket-back-btn:hover {
  background: rgba(255, 200, 0, 0.12);
  color: #ffd700;
}

/* ── Bracket view ── */
#tourn-bracket-view {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
#tourn-bracket-title {
  font-size: 0.9em;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255,200,0,0.6);
}
#tourn-bracket-status-badge {
  font-size: 0.45em;
  color: #aa8822;
  letter-spacing: 1px;
}

/* ── Bracket tree ── */
#tourn-bracket-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.tourn-round-label {
  font-size: 0.45em;
  color: #aa8822;
  letter-spacing: 2px;
  text-align: left;
  margin-bottom: -4px;
}
.tourn-round {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.tourn-match-slot {
  display: flex;
  flex-direction: column;
  background: rgba(255,200,0,0.05);
  border: 1px solid rgba(255,200,0,0.2);
  border-radius: 5px;
  overflow: hidden;
  min-width: 160px;
  flex: 1;
  max-width: 220px;
  position: relative;
}
.tourn-match-slot.live {
  border-color: rgba(255,100,0,0.7);
  box-shadow: 0 0 10px rgba(255,100,0,0.3);
  animation: tourn-pulse 1.5s ease-in-out infinite;
}
@keyframes tourn-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,100,0,0.3); }
  50%       { box-shadow: 0 0 18px rgba(255,100,0,0.6); }
}
.tourn-match-slot.mine {
  border-color: rgba(0,255,136,0.55);
  box-shadow: 0 0 10px rgba(0,255,136,0.2);
}
.tourn-live-dot {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 0.4em;
  color: #ff6600;
  animation: tourn-blink 1s step-end infinite;
}
@keyframes tourn-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.tourn-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 0.44em;
  color: #ccaa44;
  border-bottom: 1px solid rgba(255,200,0,0.1);
  gap: 6px;
}
.tourn-player-row:last-child { border-bottom: none; }
.tourn-player-row.winner { color: #ffd700; font-weight: bold; }
.tourn-player-row.loser  { color: #554422; text-decoration: line-through; }
.tourn-player-row.is-me  { color: #00ff88; }
.tourn-player-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tourn-player-rating { color: #887744; font-size: 0.85em; }
.tourn-player-result { font-size: 1em; margin-left: 4px; }
.tourn-slot-tbd {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  font-size: 0.4em;
  color: #554422;
  letter-spacing: 1px;
}

/* ── Registration panel (inside bracket view) ── */
#tourn-reg-panel {
  background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.25);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#tourn-reg-info {
  font-size: 0.46em;
  color: #99ddaa;
  line-height: 1.9;
}
#tourn-register-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.6em;
  padding: 12px 28px;
  background: rgba(0,255,136,0.15);
  border: 2px solid rgba(0,255,136,0.55);
  color: #00ff88;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
#tourn-register-btn:hover:not(:disabled) {
  background: rgba(0,255,136,0.28);
  box-shadow: 0 0 14px rgba(0,255,136,0.4);
}
#tourn-register-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
#tourn-reg-feedback {
  font-size: 0.45em;
  color: #ffd700;
  line-height: 1.8;
  min-height: 1em;
}

/* ── Match entry panel ── */
#tourn-match-entry {
  background: rgba(0,200,255,0.06);
  border: 1px solid rgba(0,200,255,0.35);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: tourn-pulse-entry 2s ease-in-out infinite;
}
@keyframes tourn-pulse-entry {
  0%, 100% { box-shadow: 0 0 8px rgba(0,200,255,0.2); }
  50%       { box-shadow: 0 0 20px rgba(0,200,255,0.5); }
}
#tourn-match-entry-label {
  font-size: 0.52em;
  color: #00ccff;
  letter-spacing: 1px;
}
#tourn-match-countdown {
  font-size: 1.4em;
  color: #ff8800;
  text-shadow: 0 0 10px rgba(255,136,0,0.7);
  letter-spacing: 2px;
}
#tourn-join-match-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  padding: 14px 32px;
  background: rgba(0,200,255,0.18);
  border: 2px solid rgba(0,200,255,0.65);
  color: #00ccff;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
#tourn-join-match-btn:hover {
  background: rgba(0,200,255,0.32);
  box-shadow: 0 0 16px rgba(0,200,255,0.45);
}

/* ── Tournament badge in main menu ── */
/* Tournament — use group defaults, no overrides needed */

/* ── Players count bar ── */
.tourn-player-count-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.tourn-count-pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255,200,0,0.2);
  border: 1px solid rgba(255,200,0,0.3);
}
.tourn-count-pip.filled {
  background: rgba(255,200,0,0.7);
  border-color: rgba(255,200,0,0.9);
}
.tourn-count-pip.mine {
  background: rgba(0,255,136,0.7);
  border-color: rgba(0,255,136,0.9);
}

/* ── Tournament archive / history styles ───────────────────────────────────── */

/* Champion banner shown at top of bracket view for completed tournaments */
#tourn-champion-banner {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.06));
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 5px;
  padding: 7px 14px;
  margin-bottom: 10px;
  text-align: center;
  color: #ffd700;
  font-size: 0.62em;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

/* Trophy icon rendered inline in bracket rows and champion banner */
.tourn-champ-trophy {
  font-size: 1.1em;
  margin-right: 2px;
  display: inline-block;
}

/* Game mode badge shown below each match slot in archived brackets */
.tourn-match-mode {
  font-size: 0.58em;
  color: #887744;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* Past tournament card: champion name line */
.tourn-past-champion {
  font-size: 0.62em;
  color: #ffd700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Past tournament card subtle tint */
.tourn-item-past {
  background: rgba(255,215,0,0.03);
}
.tourn-item-past:hover {
  background: rgba(255,215,0,0.08);
}

/* Tournament Win badge in stats panel */
.tourn-win-badge {
  display: inline-block;
  font-size: 0.65em;
  background: rgba(255,215,0,0.14);
  border: 1px solid rgba(255,215,0,0.35);
  color: #ffd700;
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0;
}

/* Stats panel section divider/header for tournament section */
.stats-section-title {
  font-size: 0.55em;
  color: #887744;
  letter-spacing: 0.12em;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(255,215,0,0.15);
  margin-top: 6px;
  text-align: left;
}

/* ── Season in-game HUD badge (shown when < 14 days remain) ──────────────── */
#season-game-hud {
  display: none;
  position: absolute;
  top: 74px;
  left: 12px;
  align-items: center;
  gap: 5px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 20, 10, 0.7);
  border: 1px solid #00ff88;
  color: #00ff88;
  pointer-events: none;
  z-index: 20;
}
.season-game-hud-icon { font-size: 1.1em; }
.season-game-hud-name { color: #ccffee; }
.season-game-hud-days { color: #ffcc00; margin-left: 3px; }

/* ── Season rank badges (profile / stats panel) ───────────────────────────── */
.season-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  font-weight: bold;
  vertical-align: middle;
}
.season-rank-pts { font-size: 0.85em; opacity: 0.8; }
.season-bronze  { color: #cd7f32; background: rgba(205,127,50,0.15);   border: 1px solid #cd7f32; }
.season-silver  { color: #c0c0c0; background: rgba(192,192,192,0.15);  border: 1px solid #c0c0c0; }
.season-gold    { color: #ffd700; background: rgba(255,215,0,0.15);    border: 1px solid #ffd700; }
.season-platinum{ color: #a0d8ef; background: rgba(160,216,239,0.15);  border: 1px solid #a0d8ef; }
.season-diamond { color: #44ddff; background: rgba(68,221,255,0.15);   border: 1px solid #44ddff; }

/* ── Stats panel season rank section ─────────────────────────────────────── */
#stats-season-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}
.stats-season-rank-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stats-season-rank-badge { font-size: 1em; }

/* ── Season Rating leaderboard tab ───────────────────────────────────────── */
.lb-season-rating-header {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #00ff88;
  text-align: center;
  padding: 6px 0 10px;
  letter-spacing: 0.05em;
}
.lb-row-me-pinned {
  border-top: 2px solid rgba(0, 255, 136, 0.4);
  position: sticky;
  bottom: 0;
  background: rgba(0,20,10,0.95);
}

/* ── Hall of Fame overlay ─────────────────────────────────────────────────── */
#hof-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hof-panel {
  background: #0a1a0f;
  border: 2px solid var(--hof-accent, #00ff88);
  border-radius: 8px;
  padding: 20px 24px;
  min-width: 340px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#hof-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
#hof-icon { font-size: 1.6em; }
#hof-title {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #00ff88;
  letter-spacing: 0.1em;
}
#hof-season-select {
  background: #0a2a18;
  border: 1px solid rgba(0,255,136,0.3);
  color: #e0e0e0;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.hof-season-title {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: var(--hof-accent, #00ff88);
  padding: 4px 0 8px;
}
.hof-season-date {
  color: rgba(255,255,255,0.5);
  font-size: 7px;
}
.hof-champion-icon {
  font-size: 1.1em;
  filter: drop-shadow(0 0 4px gold);
}
#hof-close-btn {
  align-self: center;
  margin-top: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 8px 20px;
  background: rgba(0,255,136,0.15);
  border: 1px solid rgba(0,255,136,0.4);
  color: #00ff88;
  cursor: pointer;
  border-radius: 4px;
}
#hof-close-btn:hover { background: rgba(0,255,136,0.25); }
#hof-open-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 7px 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEASON PASS — panel, tier track, cosmetic effects
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Season Pass overlay & panel ─────────────────────────────────────────── */
#season-pass-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
}

#season-pass-panel {
  background: rgba(10,14,10,0.97);
  border: 2px solid #00ff88;
  border-radius: 8px;
  padding: 24px;
  width: min(540px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 0 40px rgba(0,255,136,0.2);
}

#season-pass-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,255,136,0.25);
}

#season-pass-icon {
  font-size: 28px;
}

#season-pass-title {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #00ff88;
  text-shadow: 0 0 10px #00ff88;
}

#season-pass-header-info {
  font-size: 11px;
  color: #ccc;
}

.sp-season-name {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #fff;
  margin-bottom: 6px;
}

.sp-season-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sp-days-left {
  color: #aaa;
  font-size: 10px;
}

.sp-no-season {
  color: #888;
  font-size: 10px;
  font-style: italic;
}

/* ── Tier track rows ──────────────────────────────────────────────────────── */
#season-pass-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-tier-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  transition: background 0.2s, border-color 0.2s;
}

.sp-tier-row.sp-tier-reachable {
  border-color: rgba(255,200,50,0.35);
  background: rgba(255,200,50,0.06);
}

.sp-tier-row.sp-tier-earned {
  border-color: rgba(0,255,136,0.35);
  background: rgba(0,255,136,0.06);
}

.sp-tier-row.sp-tier-equipped {
  border-color: #00ff88;
  background: rgba(0,255,136,0.10);
  box-shadow: inset 0 0 12px rgba(0,255,136,0.08);
}

.sp-tier-status {
  font-size: 18px;
  text-align: center;
}

.sp-tier-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sp-tier-name-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}

.sp-reward-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-reward-icon {
  font-size: 16px;
}

.sp-reward-name {
  font-size: 10px;
  color: #ddd;
  font-family: "Press Start 2P", cursive;
}

.sp-reward-desc {
  font-size: 9px;
  color: #888;
  line-height: 1.5;
}

.sp-tier-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sp-claim-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 6px 12px;
  background: rgba(0,255,136,0.15);
  border: 1px solid #00ff88;
  color: #00ff88;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
.sp-claim-btn:hover { background: rgba(0,255,136,0.3); }

.sp-equip-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 6px 12px;
  background: rgba(100,100,100,0.2);
  border: 1px solid #666;
  color: #ccc;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}
.sp-equip-btn:hover  { background: rgba(100,100,100,0.35); }
.sp-equip-btn-active {
  background: rgba(0,255,136,0.15);
  border-color: #00ff88;
  color: #00ff88;
}

.sp-pending-label {
  font-size: 8px;
  color: #f5c518;
  font-style: italic;
  white-space: nowrap;
}

.sp-locked-label {
  font-size: 8px;
  color: #555;
  white-space: nowrap;
}

#season-pass-close-btn {
  align-self: center;
  margin-top: 4px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 8px 20px;
  background: rgba(0,255,136,0.15);
  border: 1px solid rgba(0,255,136,0.4);
  color: #00ff88;
  cursor: pointer;
  border-radius: 4px;
}
#season-pass-close-btn:hover { background: rgba(0,255,136,0.25); }

#mode-season-pass-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  padding: 7px 14px;
  cursor: pointer;
}

/* ── Reward notification in season-end screen ────────────────────────────── */
.season-reward-notification {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0,200,100,0.10);
  border: 1px solid rgba(0,255,136,0.4);
  border-radius: 6px;
}

.season-reward-notif-title {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #00ff88;
  margin-bottom: 8px;
}

.season-reward-notif-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
}

.season-reward-notif-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.season-reward-notif-hint {
  margin-top: 8px;
  font-size: 9px;
  color: #aaa;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEASON COSMETIC EFFECTS — applied via body classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Bronze HUD frame — animated bronze border on score/HUD panel ─────────── */
@keyframes bronze-pulse {
  0%, 100% { box-shadow: 0 0 6px #cd7f32, inset 0 0 4px rgba(205,127,50,0.2); }
  50%       { box-shadow: 0 0 14px #cd7f32, inset 0 0 8px rgba(205,127,50,0.3); }
}

body.season-cosmetic-bronze #score-display,
body.season-cosmetic-bronze #hud-panel {
  border-color: #cd7f32 !important;
  animation: bronze-pulse 2.5s ease-in-out infinite;
}

body.season-cosmetic-bronze #inventory-hud {
  border-color: #cd7f32 !important;
  box-shadow: 0 0 8px rgba(205,127,50,0.4);
}

/* ── Silver Trail — silver shimmer on piece placements (CSS aura tint) ──────
   Actual particle trail logic checks getEquippedSeasonCosmetic() at runtime.
   We apply a subtle CSS shimmer to the next-pieces preview as a visible cue. */
@keyframes silver-shimmer {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(192,192,192,0.5)); }
  50%       { filter: drop-shadow(0 0 8px rgba(220,220,220,0.8)); }
}

body.season-cosmetic-silver #next-pieces-panel {
  animation: silver-shimmer 1.8s ease-in-out infinite;
}

body.season-cosmetic-silver #score-display,
body.season-cosmetic-silver #hud-panel {
  border-color: #c0c0c0 !important;
}

/* ── Gold Frame & Ghost — gold HUD frame + gold tint on ghost/shadow ─────── */
@keyframes gold-glow {
  0%, 100% { box-shadow: 0 0 8px #ffd700, inset 0 0 4px rgba(255,215,0,0.15); }
  50%       { box-shadow: 0 0 18px #ffd700, inset 0 0 10px rgba(255,215,0,0.25); }
}

body.season-cosmetic-gold #score-display,
body.season-cosmetic-gold #hud-panel {
  border-color: #ffd700 !important;
  animation: gold-glow 2s ease-in-out infinite;
}

body.season-cosmetic-gold #crosshair {
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700;
}

/* Gold piece ghost — tint the shadow/ghost preview elements gold */
body.season-cosmetic-gold #renderer-container canvas {
  filter: none; /* block-level effect is via JS; CSS tint here is cosmetic only */
}

body.season-cosmetic-gold #inventory-hud {
  border-color: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255,215,0,0.35);
}

body.season-cosmetic-gold #next-pieces-panel {
  border-color: #ffd700 !important;
  box-shadow: 0 0 8px rgba(255,215,0,0.3);
}

/* ── Platinum Board & Badge — animated platinum board border + nameplate ───── */
@keyframes platinum-border-spin {
  0%   { border-color: #e8e8e8; box-shadow: 0 0 12px #e0e0e0; }
  25%  { border-color: #b0c4de; box-shadow: 0 0 18px #b0c4de; }
  50%  { border-color: #e8e8e8; box-shadow: 0 0 24px #ffffff; }
  75%  { border-color: #c8c8d8; box-shadow: 0 0 18px #c8c8d8; }
  100% { border-color: #e8e8e8; box-shadow: 0 0 12px #e0e0e0; }
}

@keyframes platinum-nameplate {
  0%, 100% { background: rgba(200,200,220,0.15); }
  50%       { background: rgba(200,200,220,0.3); }
}

body.season-cosmetic-platinum #score-display,
body.season-cosmetic-platinum #hud-panel {
  border-color: #e8e8e8 !important;
  animation: platinum-border-spin 3s ease-in-out infinite;
}

body.season-cosmetic-platinum #inventory-hud {
  animation: platinum-border-spin 3s ease-in-out infinite;
}

/* Platinum nameplate badge on display name / HUD elements */
body.season-cosmetic-platinum #stats-season-rank::before,
body.season-cosmetic-platinum .season-rank-badge {
  animation: platinum-nameplate 2s ease-in-out infinite;
}

body.season-cosmetic-platinum #crosshair {
  color: #e8e8e8;
  text-shadow: 0 0 10px #e8e8e8;
}

body.season-cosmetic-platinum #next-pieces-panel {
  border-color: #e0e0e0 !important;
  animation: platinum-border-spin 3s ease-in-out infinite;
}

/* ── Diamond Full Skin — body class activates HUD + title effects ────────── */
/* Block colors are handled by JS (_applyDiamondSeasonTheme).
   CSS covers HUD accent, title glow, and animated title. */
@keyframes diamond-sparkle {
  0%   { text-shadow: 0 0 8px #00e5ff, 0 0 20px #7fffff; color: #00e5ff; }
  33%  { text-shadow: 0 0 12px #b8eaff, 0 0 30px #00bfff; color: #b8eaff; }
  66%  { text-shadow: 0 0 8px #7fffff, 0 0 20px #00e5ff; color: #7fffff; }
  100% { text-shadow: 0 0 8px #00e5ff, 0 0 20px #7fffff; color: #00e5ff; }
}

@keyframes diamond-border-glow {
  0%, 100% { border-color: #00e5ff; box-shadow: 0 0 12px #00e5ff, inset 0 0 6px rgba(0,229,255,0.15); }
  50%       { border-color: #7fffff; box-shadow: 0 0 24px #7fffff, inset 0 0 12px rgba(127,255,255,0.2); }
}

body.season-cosmetic-diamond #score-display,
body.season-cosmetic-diamond #hud-panel {
  border-color: #00e5ff !important;
  animation: diamond-border-glow 2.5s ease-in-out infinite;
}

body.season-cosmetic-diamond #inventory-hud {
  border-color: #00e5ff !important;
  animation: diamond-border-glow 2.5s ease-in-out infinite;
}

body.season-cosmetic-diamond #next-pieces-panel {
  border-color: #7fffff !important;
  animation: diamond-border-glow 2.5s ease-in-out infinite;
}

body.season-cosmetic-diamond #crosshair {
  color: #00e5ff;
  text-shadow: 0 0 12px #00e5ff, 0 0 24px #7fffff;
}

/* Animated diamond title on game-over / mode-select screens */
body.season-cosmetic-diamond #mode-select-title,
body.season-cosmetic-diamond .game-over-title,
body.season-cosmetic-diamond h1,
body.season-cosmetic-diamond h2 {
  animation: diamond-sparkle 3s ease-in-out infinite;
}

body.theme-diamond-season #score-display { border-color: #00e5ff; }

/* ── Silver Trail runtime hook (applied by trails.js / pieces.js if present) ─
   The equipped cosmetic ID is queryable via getEquippedSeasonCosmetic().
   This @keyframes is available for JS-driven particle color. */
@keyframes silver-trail-particle {
  from { opacity: 0.9; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.6) translateY(-8px); }
}

/* ── Platinum nameplate badge (floated above player name in HUD) ─────────── */
.season-platinum-nameplate {
  display: inline-block;
  padding: 1px 5px;
  background: linear-gradient(135deg, #c8c8d8, #e8e8ff, #c8c8d8);
  color: #222;
  font-size: 8px;
  border-radius: 3px;
  font-family: "Press Start 2P", cursive;
  animation: platinum-nameplate 2s ease-in-out infinite;
}

/* ── Spectator Engagement: Hype Bar, Reactions, Chat ────────────────────── */

/* Floating emoji animation */
@keyframes spec-emoji-float {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  80%  { opacity: 0.7; transform: translateY(-120px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-160px) scale(0.9); }
}
.spec-floating-emoji {
  position: absolute;
  font-size: 2em;
  pointer-events: none;
  animation: spec-emoji-float 1.8s ease-out forwards;
  z-index: 9100;
}

/* Hype bar */
#spec-hype-wrap {
  width: 100%;
  max-width: 800px;
  margin-bottom: 8px;
}
#spec-hype-label {
  font-size: 0.65em;
  letter-spacing: 2px;
  color: #ffd700;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#spec-hype-track {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,215,0,0.3);
}
#spec-hype-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f0a500, #ffd700, #ff6b00);
  border-radius: 4px;
  transition: width 0.15s linear;
}

/* Electric banner at 100% hype */
#spec-electric-banner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #ffd700, #ff6b00);
  color: #000;
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 10px 24px;
  border-radius: 6px;
  z-index: 9200;
  white-space: nowrap;
  box-shadow: 0 0 30px #ffd700, 0 0 60px #ff6b00;
  animation: spec-electric-pulse 0.4s ease-in-out infinite alternate;
  font-family: monospace;
}
@keyframes spec-electric-pulse {
  from { box-shadow: 0 0 20px #ffd700, 0 0 40px #ff6b00; }
  to   { box-shadow: 0 0 40px #ffd700, 0 0 80px #ff6b00, 0 0 100px rgba(255,107,0,0.6); }
}

/* Screen edge glow at 100% hype */
#spectator-overlay.hype-electric {
  box-shadow: inset 0 0 60px rgba(255,215,0,0.35), inset 0 0 120px rgba(255,107,0,0.2);
}

/* Emoji reaction buttons */
#spec-reactions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.spec-react-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 1.4em;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: sans-serif;
  line-height: 1;
}
.spec-react-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.15);
}
.spec-react-btn:active {
  transform: scale(0.9);
}
.spec-react-btn.rate-limited {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Spectator chat panel */
#spec-chat-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 240px;
  background: rgba(0,0,0,0.7);
  border-left: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  font-family: monospace;
  font-size: 0.78em;
  box-sizing: border-box;
  transition: width 0.2s;
}
#spec-chat-panel.collapsed {
  width: 36px;
  overflow: hidden;
}
#spec-chat-toggle {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.9em;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
}
#spec-chat-header {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
  font-size: 0.85em;
  line-height: 1.4;
  flex-shrink: 0;
}
#spec-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spec-chat-msg {
  word-break: break-word;
  line-height: 1.4;
  color: #ddd;
}
.spec-chat-msg .spec-chat-name {
  color: #4db8ff;
  margin-right: 4px;
}
#spec-chat-input-row {
  display: flex;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
#spec-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #fff;
  padding: 6px 8px;
  font-size: 0.85em;
  font-family: monospace;
  outline: none;
  min-width: 0;
}
#spec-chat-send {
  background: rgba(0,180,255,0.2);
  border: none;
  color: #4db8ff;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 0.85em;
}
#spec-chat-send:hover {
  background: rgba(0,180,255,0.35);
}

/* Player hype indicator (visible to in-game players) */
#battle-spectator-hype {
  display: none;
  font-size: 0.65em;
  color: #ffd700;
  margin-top: 3px;
  text-align: center;
  letter-spacing: 1px;
}

/* ── Season Recap Card overlay ─────────────────────────────────────────────── */
#season-recap-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9100;
}
#season-recap-panel {
  --recap-accent: #00ff88;
  position: relative;
  background: #0a0a0a;
  border: 2px solid var(--recap-accent);
  border-radius: 6px;
  padding: 30px 28px 24px;
  max-width: 640px;
  width: 94%;
  box-shadow: 0 0 40px color-mix(in srgb, var(--recap-accent) 30%, transparent);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#season-recap-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
}
#season-recap-close-btn:hover { color: #ccc; }
#season-recap-canvas-container {
  width: 100%;
  text-align: center;
}
#season-recap-canvas-container canvas {
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}
#season-recap-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
#season-recap-export-btn,
#season-recap-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--recap-accent);
  color: var(--recap-accent);
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
#season-recap-export-btn:hover,
#season-recap-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
#season-recap-share-row {
  width: 100%;
}
#season-recap-share-url {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #666;
  font-family: monospace;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: text;
}

/* "View Season Card" button in season-end panel */
#season-end-view-recap-btn {
  display: none;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--season-end-accent, #00ff88);
  color: var(--season-end-accent, #00ff88);
  font-family: monospace;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
#season-end-view-recap-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ── Season Cards section in stats panel ─────────────────────────────────── */
#stats-season-cards {
  margin-top: 14px;
}
.season-recap-section-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: #777;
  text-align: center;
  margin-bottom: 10px;
}
.season-recap-carousel {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.season-recap-thumb {
  --recap-accent: #00ff88;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--recap-accent);
  border-radius: 5px;
  padding: 10px 14px;
  min-width: 120px;
  max-width: 160px;
  flex: 1;
  position: relative;
  transition: background 0.15s;
}
.season-recap-thumb:hover {
  background: rgba(255,255,255,0.09);
}
.season-recap-thumb-pinned {
  border-width: 2px;
}
.season-recap-pinned-badge {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--recap-accent);
  margin-bottom: 4px;
}
.season-recap-thumb-season {
  font-size: 11px;
  font-weight: bold;
  color: #ccc;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.season-recap-thumb-rank {
  font-size: 13px;
  font-weight: bold;
}
.season-recap-thumb-tier {
  font-size: 11px;
  margin-top: 2px;
}
.season-recap-thumb-matches {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}
.season-recap-thumb-cta {
  font-size: 10px;
  color: var(--recap-accent);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* ── Season Missions overlay ─────────────────────────────────────────────── */
#season-missions-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 300;
  pointer-events: all;
}
#season-missions-panel {
  background: #111;
  border: 2px solid #f0a500;
  border-radius: 6px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 90vw;
  max-width: 820px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(240, 165, 0, 0.25);
}
#season-missions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
#season-missions-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.1em;
  color: #f0a500;
  text-shadow: 0 0 10px #f0a500;
  letter-spacing: 0.08em;
}
#season-missions-reset {
  font-size: 0.75em;
  color: #aaa;
}
#season-missions-subtitle {
  font-size: 0.78em;
  color: #888;
  text-align: center;
  width: 100%;
}
#season-missions-tracks {
  display: flex;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}
.sm-track {
  flex: 1 1 300px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sm-track-complete {
  border-color: #f0a500;
  box-shadow: 0 0 12px rgba(240, 165, 0, 0.2);
}
.sm-track-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sm-track-icon {
  font-size: 1.3em;
}
.sm-track-name {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  color: #f0a500;
  flex: 1;
}
.sm-track-count {
  font-size: 0.8em;
  color: #aaa;
}
.sm-track-desc {
  font-size: 0.72em;
  color: #666;
  margin-top: -4px;
}
.sm-bonus-badge {
  background: rgba(240, 165, 0, 0.15);
  border: 1px solid #f0a500;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.75em;
  color: #f0a500;
  text-align: center;
}
.sm-mission {
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sm-mission-done {
  border-color: #4ade80;
  opacity: 0.75;
}
.sm-mission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sm-mission-text {
  font-size: 0.78em;
  color: #ccc;
  line-height: 1.3;
}
.sm-mission-check {
  color: #4ade80;
  font-size: 1em;
  flex-shrink: 0;
}
.sm-mission-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sm-mission-bar {
  flex: 1;
  height: 5px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}
.sm-mission-fill {
  height: 100%;
  background: #f0a500;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.sm-mission-done .sm-mission-fill {
  background: #4ade80;
}
.sm-mission-val {
  font-size: 0.68em;
  color: #888;
  white-space: nowrap;
}
#season-missions-close-btn {
  margin-top: 8px;
  padding: 8px 28px;
  background: #222;
  color: #f0a500;
  border: 1px solid #f0a500;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  letter-spacing: 0.05em;
}
#season-missions-close-btn:hover {
  background: rgba(240, 165, 0, 0.15);
}

/* ── Guild Panel ─────────────────────────────────────────────────────────── */

#guild-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  gap: 0;
  background: rgba(0, 8, 18, 0.95);
  border: 1px solid rgba(255, 170, 0, 0.35);
  border-radius: 6px;
  min-width: 340px;
  max-width: 440px;
  max-height: 80vh;
  overflow: hidden;
  pointer-events: all;
  z-index: 160;
  font-family: "Press Start 2P", cursive;
}

#guild-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255, 170, 0, 0.25);
  background: rgba(255, 170, 0, 0.05);
}

#guild-panel-title {
  font-size: 11px;
  color: #ffaa00;
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

#guild-panel-close {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
#guild-panel-close:hover { color: #ffaa00; }

#guild-panel-content {
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Loading / empty / error states */
.guild-loading, .guild-empty, .guild-error {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #555;
  text-align: center;
  padding: 16px 0;
}
.guild-error { color: #f55; }

/* Section titles */
.guild-section-title {
  font-size: 8px;
  color: #888;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 4px;
  margin-top: 4px;
}

/* Status message */
.guild-status-msg {
  font-size: 7px;
  color: #aaa;
  min-height: 14px;
}

/* ── Home view ── */
.guild-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.guild-emblem {
  font-size: 28px;
  line-height: 1;
}
.guild-name-tag {
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.guild-tag {
  color: #ffaa00;
  font-size: 9px;
}
.guild-meta {
  font-size: 7px;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
}
.guild-desc {
  font-size: 7px;
  color: #aaa;
  line-height: 1.6;
  font-family: "Press Start 2P", cursive;
}

.guild-members-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 160px;
  overflow-y: auto;
}
.guild-member-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.07);
}
.guild-member-icon { font-size: 12px; flex-shrink: 0; }
.guild-member-name {
  font-size: 8px;
  color: #ddd;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-kick-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  background: rgba(180,0,0,0.25);
  border: 1px solid rgba(255,60,60,0.4);
  color: #f88;
  border-radius: 3px;
  padding: 3px 7px;
  cursor: pointer;
}
.guild-kick-btn:hover { background: rgba(180,0,0,0.5); }

.guild-invite-row {
  display: flex;
  gap: 6px;
}
.guild-invite-row input {
  flex: 1;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  color: #eee;
  padding: 6px 8px;
  outline: none;
}
.guild-invite-row input:focus { border-color: rgba(255,170,0,0.5); }

/* ── Browse view ── */
.guild-search-row {
  display: flex;
  gap: 6px;
}
.guild-search-row input {
  flex: 1;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  color: #eee;
  padding: 6px 8px;
  outline: none;
}
.guild-search-row input:focus { border-color: rgba(255,170,0,0.5); }

.guild-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.guild-result-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
}
.guild-result-emblem { font-size: 18px; flex-shrink: 0; }
.guild-result-info { flex: 1; min-width: 0; }
.guild-result-name {
  font-size: 8px;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guild-result-meta {
  font-size: 7px;
  color: #888;
  margin-top: 3px;
}
.guild-join-req-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: rgba(0,150,80,0.25);
  border: 1px solid rgba(0,220,100,0.4);
  color: #4ef;
  border-radius: 3px;
  padding: 5px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.guild-join-req-btn:hover:not(:disabled) { background: rgba(0,150,80,0.5); }
.guild-join-req-btn:disabled { opacity: 0.5; cursor: default; }
.guild-private-badge {
  font-size: 7px;
  color: #888;
  flex-shrink: 0;
}

/* ── Create view ── */
.guild-create-title {
  font-size: 10px;
  color: #ffaa00;
  margin-bottom: 8px;
}
.guild-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.guild-form-row label {
  font-size: 7px;
  color: #888;
}
.guild-hint { color: #555; }
.guild-form-row input[type="text"],
.guild-form-row textarea {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  color: #eee;
  padding: 6px 8px;
  outline: none;
  resize: none;
  width: 100%;
  box-sizing: border-box;
}
.guild-form-row input:focus,
.guild-form-row textarea:focus { border-color: rgba(255,170,0,0.5); }
.guild-form-inline {
  flex-direction: row;
  gap: 12px;
  align-items: flex-end;
}
.guild-form-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Join requests view ── */
.guild-req-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
}
.guild-req-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
}
.guild-req-name {
  flex: 1;
  font-size: 8px;
  color: #ddd;
}
.guild-approve-btn,
.guild-deny-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  border-radius: 3px;
  padding: 4px 7px;
  cursor: pointer;
}
.guild-approve-btn {
  background: rgba(0,130,60,0.25);
  border: 1px solid rgba(0,220,100,0.4);
  color: #4f8;
}
.guild-approve-btn:hover:not(:disabled) { background: rgba(0,130,60,0.5); }
.guild-deny-btn {
  background: rgba(150,0,0,0.25);
  border: 1px solid rgba(255,60,60,0.4);
  color: #f88;
}
.guild-deny-btn:hover:not(:disabled) { background: rgba(150,0,0,0.5); }
.guild-approve-btn:disabled,
.guild-deny-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Shared action buttons ── */
.guild-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.guild-primary-btn,
.guild-secondary-btn,
.guild-danger-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  border-radius: 3px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid;
}
.guild-primary-btn {
  background: rgba(255,170,0,0.2);
  border-color: rgba(255,170,0,0.5);
  color: #ffaa00;
}
.guild-primary-btn:hover:not(:disabled) { background: rgba(255,170,0,0.35); }
.guild-primary-btn:disabled { opacity: 0.4; cursor: default; }
.guild-secondary-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.25);
  color: #aaa;
}
.guild-secondary-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.guild-danger-btn {
  background: rgba(180,0,0,0.2);
  border-color: rgba(255,60,60,0.4);
  color: #f88;
}
.guild-danger-btn:hover { background: rgba(180,0,0,0.4); }

/* search / invite shared button (no class) */
#guild-search-btn,
#guild-invite-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: rgba(255,170,0,0.15);
  border: 1px solid rgba(255,170,0,0.4);
  color: #ffaa00;
  border-radius: 3px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
#guild-search-btn:hover,
#guild-invite-btn:hover { background: rgba(255,170,0,0.3); }

/* ── Guild invite toast ── */
#guild-invite-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0, 8, 18, 0.96);
  border: 1px solid rgba(255, 170, 0, 0.5);
  border-radius: 6px;
  padding: 18px 24px;
  min-width: 260px;
  text-align: center;
  pointer-events: all;
  z-index: 200;
  font-family: "Press Start 2P", cursive;
}
#git-header {
  font-size: 10px;
  color: #ffaa00;
  text-shadow: 0 0 8px rgba(255,170,0,0.4);
  border-bottom: 1px solid rgba(255,170,0,0.2);
  padding-bottom: 8px;
  width: 100%;
  text-align: center;
}
#git-guild-name {
  font-size: 10px;
  color: #fff;
  margin-top: 4px;
}
#git-guild-meta {
  font-size: 7px;
  color: #aaa;
}
#git-inviter {
  font-size: 7px;
  color: #888;
}
#git-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
#git-accept-btn,
#git-decline-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  border-radius: 3px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid;
}
#git-accept-btn {
  background: rgba(0,130,60,0.25);
  border-color: rgba(0,220,100,0.5);
  color: #4f8;
}
#git-accept-btn:hover { background: rgba(0,130,60,0.5); }
#git-decline-btn {
  background: rgba(100,0,0,0.25);
  border-color: rgba(255,60,60,0.5);
  color: #f88;
}
#git-decline-btn:hover { background: rgba(150,0,0,0.5); }

/* ── Guild joined / error toasts ── */
#guild-joined-toast,
#guild-error-toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 8px 14px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 210;
  text-align: center;
  white-space: nowrap;
}
#guild-joined-toast {
  background: rgba(0,80,30,0.9);
  border: 1px solid rgba(0,220,80,0.5);
  color: #4f8;
}
#guild-error-toast {
  background: rgba(80,0,0,0.9);
  border: 1px solid rgba(255,60,60,0.5);
  color: #f88;
}

/* ── Guild XP progress bar ── */
.guild-xp-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
  width: 100%;
}
.guild-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffaa00, #ff6600);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.guild-xp-label {
  font-size: 7px;
  color: rgba(255,200,100,0.7);
  margin-top: 3px;
}
.guild-next-milestone {
  font-size: 7px;
  color: rgba(160,220,255,0.65);
  margin-top: 2px;
}

/* ── Enhanced member row ── */
.guild-member-row--clickable {
  cursor: pointer;
  border-radius: 4px;
}
.guild-member-row--clickable:hover {
  background: rgba(255,170,0,0.07);
}
.guild-member-row--clickable:focus {
  outline: 1px solid rgba(255,170,0,0.4);
}
.guild-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #ffaa00;
  flex-shrink: 0;
  font-family: "Press Start 2P", cursive;
}
.guild-member-info {
  flex: 1;
  min-width: 0;
}
.guild-member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.guild-member-stats {
  font-size: 7px;
  color: #777;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guild-me-badge {
  font-size: 7px;
  color: #888;
}
.guild-role-badge {
  font-size: 7px;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.guild-role-badge--owner  { background: rgba(255,170,0,0.15); color: #ffaa00; }
.guild-role-badge--officer { background: rgba(100,100,255,0.15); color: #8888ff; }
.guild-role-badge--member  { background: rgba(255,255,255,0.07); color: #999; }

/* ── Description inline edit ── */
.guild-desc-wrap { padding: 6px 0; }
.guild-desc-edit-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 10px;
  cursor: pointer;
  padding: 0 3px;
  vertical-align: middle;
}
.guild-desc-edit-btn:hover { color: #ffaa00; }
.guild-desc-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,170,0,0.3);
  color: #eee;
  font-size: 9px;
  padding: 6px 8px;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  min-height: 54px;
}
.guild-desc-textarea:focus { outline: none; border-color: rgba(255,170,0,0.5); }
.guild-desc-save-btn,
.guild-desc-cancel-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid;
}
.guild-desc-save-btn {
  background: rgba(255,170,0,0.15);
  border-color: rgba(255,170,0,0.4);
  color: #ffaa00;
}
.guild-desc-save-btn:hover { background: rgba(255,170,0,0.3); }
.guild-desc-save-btn:disabled { opacity: 0.5; cursor: default; }
.guild-desc-cancel-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: #aaa;
}
.guild-desc-cancel-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Member card overlay ── */
.guild-member-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 6px;
}
.guild-member-card {
  background: rgba(10,12,24,0.98);
  border: 1px solid rgba(255,170,0,0.3);
  border-radius: 8px;
  padding: 20px 16px 16px;
  width: 85%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.guild-member-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,170,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #ffaa00;
  font-family: "Press Start 2P", cursive;
}
.guild-member-card-name {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  text-align: center;
}
.guild-member-card-meta { display: flex; gap: 6px; }
.guild-member-card-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  padding: 8px 10px;
}
.guild-member-card-stat {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
}
.guild-member-card-stat span { color: #888; }
.guild-member-card-stat strong { color: #ddd; }
.guild-member-card-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guild-card-action-btn {
  width: 100%;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid;
  text-align: center;
}
.guild-card-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: #888;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 2px;
}
.guild-card-close-btn:hover { background: rgba(255,255,255,0.07); color: #ccc; }

/* ── Join request row: date column ── */
.guild-req-date {
  font-size: 7px;
  color: #666;
  flex: 1;
  text-align: right;
  white-space: nowrap;
}

/* ── Manage view ── */
.guild-manage { display: flex; flex-direction: column; gap: 2px; }
.guild-manage-danger-zone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,60,60,0.2);
}
.guild-disband-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: rgba(180,0,0,0.15);
  border: 1px solid rgba(200,0,0,0.4);
  color: #f55;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 6px;
}
.guild-disband-btn:hover { background: rgba(180,0,0,0.35); }

/* ── Guild Home Tabs ─────────────────────────────────────────────────────── */
.guild-home-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0;
}
.guild-tab-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  color: #888;
  padding: 6px 10px;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.guild-tab-btn:hover { background: rgba(255,255,255,0.07); color: #ccc; }
.guild-tab-btn--active {
  background: rgba(255,170,0,0.1);
  border-color: rgba(255,170,0,0.35);
  color: #ffaa00;
}

/* ── Guild Leaderboard ───────────────────────────────────────────────────── */
.guild-leaderboard-loading { color: #666; font-size: 8px; padding: 10px 0; }

.guild-lb-heroes {
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.2);
  border-radius: 4px;
  padding: 8px;
  margin: 8px 0;
}
.guild-lb-heroes-title {
  font-size: 7px;
  color: #ffaa00;
  margin-bottom: 6px;
}
.guild-lb-week {
  color: #666;
  font-size: 7px;
}
.guild-lb-hero-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 8px;
  color: #ccc;
}
.guild-lb-hero-rank { width: 16px; text-align: center; flex-shrink: 0; }
.guild-lb-hero-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-lb-hero-xp { color: #ffaa00; white-space: nowrap; }

.guild-lb-current-week { margin-top: 4px; }
.guild-lb-week-label {
  font-size: 7px;
  color: #888;
  margin: 6px 0 4px;
}
.guild-lb-empty { font-size: 8px; color: #555; padding: 8px 0; }

.guild-lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  border-radius: 3px;
  font-size: 8px;
  color: #ccc;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.guild-lb-row--me {
  outline: 1px solid rgba(255,170,0,0.4);
  background: rgba(255,170,0,0.05) !important;
}
.guild-lb-medal { font-size: 14px; width: 22px; text-align: center; flex-shrink: 0; }
.guild-lb-rank {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: #555;
  font-size: 7px;
}
.guild-lb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.guild-lb-info { flex: 1; min-width: 0; }
.guild-lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ddd;
}
.guild-lb-role { font-size: 10px; }
.guild-lb-stats { font-size: 7px; color: #666; margin-top: 2px; }
.guild-lb-stats strong { color: #ffaa00; }

/* ── Guild Weekly Summary Toast ──────────────────────────────────────────── */
#guild-weekly-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.97);
  border: 1px solid rgba(255,170,0,0.5);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #ddd;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
#guild-weekly-toast .gwt-header {
  color: #ffaa00;
  font-size: 8px;
  letter-spacing: 0.5px;
}
#guild-weekly-toast .gwt-body {
  color: #ccc;
  font-size: 7px;
  line-height: 1.6;
}
#guild-weekly-toast .gwt-body strong { color: #ffaa00; }
#gwt-close-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #888;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  align-self: flex-end;
  margin-top: 2px;
}
#gwt-close-btn:hover { background: rgba(255,255,255,0.12); color: #ccc; }

/* ── Guild Cosmetics ─────────────────────────────────────────────────────── */

/* Board skin overlay — rendered over the 3D canvas during a match */
.guild-board-skin-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.20;
}

.guild-board-skin--stone_brick {
  background-color: #888;
  background-image:
    /* Horizontal mortar lines */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 30px,
      rgba(60,60,60,0.7) 30px,
      rgba(60,60,60,0.7) 32px
    ),
    /* Vertical mortar lines — even rows */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(60,60,60,0.7) 60px,
      rgba(60,60,60,0.7) 62px
    );
}

.guild-board-skin--nether_brick {
  background-color: #3a0a0a;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 22px,
      rgba(20,4,4,0.75) 22px,
      rgba(20,4,4,0.75) 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 44px,
      rgba(20,4,4,0.75) 44px,
      rgba(20,4,4,0.75) 46px
    );
}

/* Legendary emblem — animated sparkle ring around guild tag */
@keyframes guild-legendary-pulse {
  0%   { text-shadow: 0 0 6px #ffcc00, 0 0 14px #ffaa00; opacity: 1; }
  50%  { text-shadow: 0 0 14px #ffdd44, 0 0 30px #ffcc00; opacity: 0.85; }
  100% { text-shadow: 0 0 6px #ffcc00, 0 0 14px #ffaa00; opacity: 1; }
}

.guild-emblem--legendary {
  animation: guild-legendary-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px #ffcc00);
}

/* ── Cosmetics view ────────────────────────────────────────────────────────── */
.guild-cosmetics {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guild-cosmetics-section {
  margin-top: 4px;
}

/* Banner palette */
.guild-color-palette {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.guild-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guild-palette-label {
  font-size: 9px;
  color: #888;
  min-width: 56px;
}

.guild-color-swatches {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.guild-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  padding: 0;
}

.guild-color-swatch:hover:not(:disabled) {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.5);
}

.guild-color-swatch--active {
  border-color: #fff !important;
  transform: scale(1.15);
}

.guild-color-swatch--locked {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

/* Board skin picker */
.guild-skin-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.guild-skin-card {
  position: relative;
  width: 80px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  background: rgba(0,0,0,0.3);
  transition: border-color 0.15s, background 0.15s;
}

.guild-skin-card:hover:not(.guild-skin-card--locked) {
  border-color: rgba(255,170,0,0.5);
  background: rgba(255,170,0,0.07);
}

.guild-skin-card--active {
  border-color: #ffaa00;
  background: rgba(255,170,0,0.12);
}

.guild-skin-card--locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.guild-skin-preview {
  width: 64px;
  height: 40px;
  border-radius: 3px;
  margin: 0 auto 4px;
  background: rgba(255,255,255,0.05);
}

.guild-skin-preview--none {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.04) 4px,
    transparent 4px,
    transparent 8px
  );
}

.guild-skin-preview--stone_brick {
  background-color: #7a7a7a;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(50,50,50,0.6) 8px, rgba(50,50,50,0.6) 9px),
    repeating-linear-gradient(90deg, transparent, transparent 16px, rgba(50,50,50,0.6) 16px, rgba(50,50,50,0.6) 17px);
}

.guild-skin-preview--nether_brick {
  background-color: #3a0a0a;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(20,4,4,0.8) 6px, rgba(20,4,4,0.8) 7px),
    repeating-linear-gradient(90deg, transparent, transparent 12px, rgba(20,4,4,0.8) 12px, rgba(20,4,4,0.8) 13px);
}

.guild-skin-label {
  font-size: 7px;
  color: #ccc;
}

.guild-skin-lock {
  font-size: 7px;
  color: #888;
  margin-top: 2px;
}

.guild-skin-active-badge {
  position: absolute;
  top: 3px; right: 5px;
  font-size: 9px;
  color: #ffaa00;
}

/* Cosmetics preview */
.guild-cosmetics-preview {
  margin-top: 6px;
}

.guild-cosmetics-preview-card {
  border-radius: 6px;
  overflow: hidden;
}

.guild-cosmetics-preview-banner {
  min-height: 54px;
}

/* Legendary emblem section */
.guild-legendary-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255,200,0,0.08);
  border: 1px solid rgba(255,200,0,0.25);
  border-radius: 6px;
  margin-top: 4px;
}

.guild-legendary-emblem {
  font-size: 22px;
  animation: guild-legendary-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 6px #ffcc00);
}

.guild-legendary-sparkle {
  font-size: 9px;
  color: #ffcc00;
}

.guild-legendary-locked {
  font-size: 9px;
  color: #666;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  margin-top: 4px;
}

/* ── Battle HUD — opponent guild emblem ──────────────────────────────────── */
.boh-opponent-emblem {
  font-size: 12px;
  margin-left: 4px;
  line-height: 1;
}

.boh-opponent-emblem--legendary {
  animation: guild-legendary-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #ffcc00);
}

/* ── Leaderboard — guild emblem on my row ──────────────────────────────── */
.lb-guild-emblem {
  font-size: 11px;
}

.lb-guild-emblem--legendary {
  animation: guild-legendary-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 4px #ffcc00);
}

/* ── Clan War UI ─────────────────────────────────────────────────────────── */

.war-challenge-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}
.war-challenge-cta-text { font-size: 11px; color: #aaa; }

.war-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.war-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.war-card-vs { font-size: 11px; color: #ccc; }
.war-card-vs strong { color: #fff; }
.war-card-time { font-size: 9px; color: #888; margin-top: 4px; }
.war-card-result { font-size: 10px; font-weight: bold; margin-top: 4px; }
.war-card-result--win  { color: #4ade80; }
.war-card-result--loss { color: #f87171; }
.war-card-result--draw { color: #facc15; }
.war-detail-btn { margin-top: 8px; font-size: 9px; padding: 3px 10px; }

.war-status-badge {
  font-size: 8px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.war-status-badge--pending   { background: rgba(250,204,21,0.15); color: #facc15; border: 1px solid rgba(250,204,21,0.3); }
.war-status-badge--scheduled { background: rgba(96,165,250,0.15); color: #60a5fa; border: 1px solid rgba(96,165,250,0.3); }
.war-status-badge--roster    { background: rgba(167,139,250,0.15); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.war-status-badge--active    { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); animation: war-pulse 1.4s ease-in-out infinite; }
.war-status-badge--done      { background: rgba(255,255,255,0.07); color: #888; border: 1px solid rgba(255,255,255,0.1); }
.war-status-badge--cancelled { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }

@keyframes war-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* Challenge form */
.war-challenge-form { padding: 4px 0; }
.war-target-results { margin-top: 6px; max-height: 180px; overflow-y: auto; }
.war-target-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 4px;
  font-size: 10px;
}
.war-target-emblem { font-size: 14px; }
.war-target-name   { flex: 1; color: #eee; }
.war-target-meta   { font-size: 9px; color: #777; }
.war-selected-hint { font-size: 10px; color: #ffaa00; padding: 6px 0; }
.war-selected-guild { padding-top: 4px; }

.war-time-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 10px;
}
.war-time-picker label { color: #aaa; }
.war-time-picker input[type="date"],
.war-time-picker select {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #eee;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
}

/* Detail view */
.war-detail { display: flex; flex-direction: column; gap: 8px; }
.war-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.war-detail-title { flex: 1; font-size: 12px; font-weight: bold; color: #fff; }
.war-detail-time   { font-size: 10px; color: #ccc; }
.war-detail-format { font-size: 9px; color: #666; }

.war-response-section { background: rgba(255,170,0,0.06); border: 1px solid rgba(255,170,0,0.2); border-radius: 8px; padding: 10px; }

.war-roster-section { background: rgba(167,139,250,0.06); border: 1px solid rgba(167,139,250,0.2); border-radius: 8px; padding: 10px; }
.war-roster-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.war-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 10px;
  color: #eee;
}
.war-remove-nominee-btn,
.guild-danger-btn--sm {
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.35);
  color: #f87171;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 9px;
  cursor: pointer;
}
.war-remove-nominee-btn:hover { background: rgba(220,38,38,0.4); }

.war-nominate-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.war-nominate-row select {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #eee;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
}

.war-rosters-locked { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 10px; }
.war-rosters-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.war-roster-col-title { font-size: 9px; font-weight: bold; color: #ffaa00; margin-bottom: 4px; }
.war-roster-player    { font-size: 10px; color: #ccc; padding: 2px 0; }

.war-result-banner {
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
}
.war-result-banner--win  { background: rgba(74,222,128,0.15);  color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.war-result-banner--loss { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.war-result-banner--draw { background: rgba(250,204,21,0.10);  color: #facc15; border: 1px solid rgba(250,204,21,0.3); }

/* ── Clan War Command Center ─────────────────────────────────────────────── */

.wcc-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.wcc-header {
  font-size: 11px;
  font-weight: bold;
  color: #ffaa00;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,170,0,0.2);
}
.wcc-scoreboard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px;
}
.wcc-score-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.wcc-score-side--mine .wcc-score-guild { color: #60a5fa; }
.wcc-score-guild { font-size: 9px; color: #aaa; text-align: center; }
.wcc-score-num {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  line-height: 1;
}
.wcc-score-num--win { color: #4ade80; }
.wcc-score-sep { font-size: 10px; color: #555; }
.wcc-time-limit { font-size: 9px; color: #888; text-align: center; }

.wcc-result-banner {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 10px;
  border-radius: 8px;
}
.wcc-result-banner--win  { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.wcc-result-banner--loss { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.wcc-result-banner--draw { background: rgba(250,204,21,0.10); color: #facc15; border: 1px solid rgba(250,204,21,0.3); }

.wcc-slots { display: flex; flex-direction: column; gap: 6px; }

.wcc-slot-row {
  display: grid;
  grid-template-columns: 24px 1fr auto 70px;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 6px 8px;
}
.wcc-slot-row--mine {
  background: rgba(96,165,250,0.07);
  border-color: rgba(96,165,250,0.25);
}
.wcc-slot-num { font-size: 9px; color: #666; text-align: center; }
.wcc-slot-players { font-size: 10px; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcc-slot-vs { color: #555; margin: 0 4px; }
.wcc-slot-player { color: #ddd; }
.wcc-slot-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.wcc-slot-result { font-size: 9px; color: #facc15; }

.wcc-slot-badge {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.wcc-slot-badge--waiting   { background: rgba(250,204,21,0.15); color: #facc15; border: 1px solid rgba(250,204,21,0.3); }
.wcc-slot-badge--active    { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); animation: war-pulse 1.4s ease-in-out infinite; }
.wcc-slot-badge--done      { background: rgba(255,255,255,0.07); color: #888; border: 1px solid rgba(255,255,255,0.1); }
.wcc-slot-badge--forfeited { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }

.wcc-slot-action { display: flex; justify-content: flex-end; }
.wcc-spectate-btn {
  font-size: 9px;
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  color: #60a5fa;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
}
.wcc-spectate-btn:hover { background: rgba(96,165,250,0.25); }
.wcc-join-btn { font-size: 9px; padding: 3px 8px; }

/* Join section (shown for the local player's pending slot) */
.wcc-join-section {
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.25);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.wcc-join-title  { font-size: 12px; font-weight: bold; color: #ffaa00; }
.wcc-join-sub    { font-size: 9px; color: #aaa; }
.wcc-join-countdown {
  font-size: 26px;
  font-weight: bold;
  color: #facc15;
  font-variant-numeric: tabular-nums;
}
.wcc-join-main-btn { font-size: 11px; padding: 7px 20px; }
.wcc-forfeit-btn   { font-size: 9px; }

/* ── War Match Starting modal ────────────────────────────────────────────── */

#war-match-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(4px);
}
#war-match-modal-inner {
  background: linear-gradient(160deg, #0e1a2b 0%, #0b1520 100%);
  border: 1px solid rgba(255,170,0,0.35);
  border-radius: 12px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255,170,0,0.12);
  font-family: 'Press Start 2P', monospace;
  text-align: center;
}
#wmm-title {
  font-size: 14px;
  color: #ffaa00;
  letter-spacing: 0.5px;
}
#wmm-sub   { font-size: 9px; color: #aaa; }
#wmm-timer { font-size: 10px; color: #888; }

.guild-primary-btn {
  background: rgba(255,170,0,0.15);
  border: 1px solid rgba(255,170,0,0.4);
  color: #ffaa00;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}
.guild-primary-btn:hover { background: rgba(255,170,0,0.28); }
.guild-primary-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Clan War: Post-War Result Screen ─────────────────────────────────────── */

#war-result-screen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9100;
}

#war-result-screen-inner {
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 340px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 0 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.wrs-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; }

.wrs-banner {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 2px;
}
.wrs-banner--win  { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.wrs-banner--loss { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.wrs-banner--draw { background: rgba(250,204,21,0.10);  color: #facc15; border: 1px solid rgba(250,204,21,0.3); }

.wrs-score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px;
}
.wrs-score-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.wrs-score-guild { font-size: 9px; color: #aaa; text-align: center; word-break: break-word; }
.wrs-score-num   { font-size: 30px; font-weight: bold; color: #fff; line-height: 1; }
.wrs-score-num--win { color: #4ade80; }
.wrs-score-sep   { font-size: 10px; color: #555; }

.wrs-rating-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #ccc;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 7px 10px;
}
.wrs-rating-label { color: #888; margin-right: 2px; }
.wrs-rating-old   { color: #aaa; }
.wrs-rating-arrow { color: #555; }
.wrs-rating-new   { color: #fff; font-weight: bold; }
.wrs-rating-up    { color: #4ade80; font-weight: bold; }
.wrs-rating-down  { color: #f87171; font-weight: bold; }

.wrs-section-title {
  font-size: 9px;
  font-weight: bold;
  color: #666;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.wrs-slots { display: flex; flex-direction: column; gap: 4px; }

.wrs-slot-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  color: #ccc;
}
.wrs-slot-row--mvp {
  background: rgba(250,204,21,0.07);
  border-color: rgba(250,204,21,0.25);
}
.wrs-slot-num   { font-size: 9px; color: #555; text-align: center; }
.wrs-slot-vs    { color: #444; margin: 0 4px; }
.wrs-slot-result { font-size: 9px; white-space: nowrap; }
.wrs-slot-win   { color: #4ade80; }
.wrs-slot-loss  { color: #f87171; }
.wrs-slot-draw  { color: #facc15; }

.wrs-mvp {
  text-align: center;
  font-size: 11px;
  color: #facc15;
  background: rgba(250,204,21,0.07);
  border: 1px solid rgba(250,204,21,0.2);
  border-radius: 6px;
  padding: 6px 10px;
}

.wrs-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 2px;
}

/* ── Clan War: Inline rating display (war detail view) ────────────────────── */

.war-rating-display {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
}
.war-rating-row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex-wrap: wrap;
}
.war-rating-label-sm { color: #888; }
.war-rating-value    { color: #fff; font-size: 13px; }
.war-rating-hist     { display: flex; gap: 6px; font-size: 9px; color: #666; margin-left: 4px; }
.war-rating-hist-up  { color: #4ade80; }
.war-rating-hist-down { color: #f87171; }

/* ── Clan War: Standings Screen ─────────────────────────────────────────────── */

#war-standings-screen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3500;
  padding: 16px;
}
#war-standings-inner {
  background: #0e1117;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: monospace;
  color: #e5e7eb;
}
#wss-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  padding: 14px 16px 0;
  color: #facc15;
}
#war-standings-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.wss-tab-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  align-items: center;
}
.wss-tab-btn {
  background: none;
  border: none;
  color: #888;
  font-family: monospace;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  text-transform: uppercase;
}
.wss-tab-btn:hover { color: #fff; }
.wss-tab-btn--active { color: #facc15; border-bottom: 2px solid #facc15; }
.wss-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.wss-close-btn:hover { color: #f87171; }
.wss-season-label {
  font-size: 9px;
  color: #666;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 14px 4px;
}
.wss-loading, .wss-empty, .wss-error {
  font-size: 11px;
  padding: 24px;
  text-align: center;
  color: #888;
}
.wss-error { color: #f87171; }
.wss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  overflow-y: auto;
  display: block;
  max-height: calc(88vh - 140px);
}
.wss-table thead tr { position: sticky; top: 0; background: #0e1117; }
.wss-table th {
  padding: 6px 8px;
  color: #666;
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
.wss-row td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.wss-row:hover td { background: rgba(255,255,255,0.04); }
.wss-row--mine td { background: rgba(250,204,21,0.06); }
.wss-row--mine:hover td { background: rgba(250,204,21,0.1); }
.wss-rank { color: #facc15; font-weight: bold; font-size: 11px; white-space: nowrap; }
.wss-guild-cell { display: flex; align-items: center; gap: 5px; }
.wss-emblem { font-size: 13px; }
.wss-guild-name { color: #fff; font-weight: bold; }
.wss-guild-tag { color: #888; font-size: 9px; }
.wss-guild-level { color: #555; font-size: 8px; }
.wss-rating { color: #60a5fa; font-weight: bold; }
.wss-wins { color: #4ade80; }
.wss-losses { color: #f87171; }
.wss-draws { color: #facc15; }
.wss-winrate { color: #c084fc; }
.wss-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.wss-page-label { font-size: 9px; color: #666; }

/* HoF */
.wss-hof-entry {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wss-hof-season { font-size: 11px; font-weight: bold; color: #facc15; }
.wss-hof-date { font-size: 8px; color: #555; margin-bottom: 6px; }
.wss-hof-champion {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}
.wss-hof-crown { font-size: 15px; }
.wss-hof-name { color: #fff; font-weight: bold; }
.wss-hof-tag { color: #888; font-size: 9px; }
.wss-hof-rating { color: #60a5fa; font-size: 9px; margin-left: auto; }
.wss-hof-top10 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  overflow-y: auto;
  max-height: 240px;
}
.wss-hof-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wss-hof-row .wss-rank { min-width: 24px; }
.wss-hof-row .wss-record { color: #666; font-size: 8px; margin-left: auto; }
.wss-hof-expand-btn {
  font-size: 8px;
  padding: 3px 8px;
}

/* ── War History Tab Additions ──────────────────────────────────────────────── */

.war-rating-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.war-rating-val {
  font-size: 15px;
  font-weight: bold;
  color: #60a5fa;
}
.war-rating-val .war-rating-label {
  font-size: 8px;
  color: #666;
  font-weight: normal;
  margin-left: 2px;
}
.war-rating-stats { font-size: 9px; color: #888; }
.war-standings-btn { font-size: 8px; padding: 3px 8px; margin-left: auto; }

.war-history-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.war-history-card:hover { background: rgba(255,255,255,0.05); }
.war-history-card--win  { border-left: 3px solid #4ade80; }
.war-history-card--loss { border-left: 3px solid #f87171; }
.war-history-card--draw { border-left: 3px solid #facc15; }
.war-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.war-history-vs { font-size: 11px; color: #ccc; }
.war-history-vs strong { color: #fff; }
.war-history-result {
  font-size: 10px;
  font-weight: bold;
  display: flex;
  gap: 5px;
  align-items: center;
}
.war-history-card--win  .war-history-result { color: #4ade80; }
.war-history-card--loss .war-history-result { color: #f87171; }
.war-history-card--draw .war-history-result { color: #facc15; }
.war-score { color: #888; font-weight: normal; font-size: 9px; }
.war-rating-up   { color: #4ade80; font-size: 9px; }
.war-rating-down { color: #f87171; font-size: 9px; }
.war-history-meta {
  font-size: 8px;
  color: #555;
  margin-top: 3px;
}
.war-expand-hint { color: #444; }
.war-slots-detail {
  margin-top: 6px;
  padding: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.war-slot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: #888;
}
.war-slot-row.slot-win  { color: #4ade80; }
.war-slot-row.slot-loss { color: #f87171; }
.war-slot-row.slot-draw { color: #facc15; }
.slot-num { min-width: 18px; color: #555; }
.slot-player { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-vs { color: #444; }
.slot-result { min-width: 18px; text-align: center; }
.war-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 0 0;
}
.war-page-label { font-size: 9px; color: #666; }

/* ── Expedition Map ─────────────────────────────────────────────────────────── */

#expedition-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
}

#expedition-map-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  box-shadow: 0 0 40px #0ea5e944, 0 8px 32px #000c;
  display: flex;
  flex-direction: column;
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  color: #e2e8f0;
  font-family: 'Segoe UI', monospace, sans-serif;
}

#expedition-map-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid #1e3a5f;
  background: #0a1628;
  flex-shrink: 0;
}

#expedition-map-icon {
  font-size: 26px;
}

#expedition-map-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7dd3fc;
  text-shadow: 0 0 10px #38bdf880;
}

#expedition-map-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

#expedition-map-loading {
  padding: 40px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

#expedition-map-content {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#expedition-map-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#expedition-map-canvas {
  position: relative;
}

/* Biome node cards */
.exp-node {
  position: absolute;
  border: 2px solid #4b5563;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  user-select: none;
  height: 88px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.exp-node:hover:not(.exp-node-locked) {
  transform: scale(1.06);
}

.exp-node-locked {
  opacity: 0.45;
  cursor: default;
}

.exp-node-selected {
  transform: scale(1.08);
  z-index: 2;
}

.exp-node-done .exp-node-score {
  color: #4ade80;
}

.exp-node-icon {
  font-size: 22px;
  line-height: 1;
}

.exp-node-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #e2e8f0;
  white-space: nowrap;
}

.exp-node-score {
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
}

/* Info panel */
#expedition-map-info {
  width: 200px;
  flex-shrink: 0;
  border-left: 1px solid #1e3a5f;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #0a1628;
}

.exp-info-icon {
  font-size: 36px;
}

.exp-info-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #e2e8f0;
  text-align: center;
}

.exp-info-status {
  font-size: 11px;
  text-align: center;
  min-height: 30px;
}

.exp-locked-label { color: #64748b; }
.exp-done-label   { color: #4ade80; }
.exp-avail-label  { color: #7dd3fc; }

.exp-play-btn {
  margin-top: 6px;
  padding: 9px 18px;
  background: #0369a1;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
  width: 100%;
}
.exp-play-btn:hover { background: #0284c7; }

/* Footer */
#expedition-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid #1e3a5f;
  background: #0a1628;
  flex-shrink: 0;
}

.exp-hint {
  font-size: 10px;
  color: #475569;
  letter-spacing: 0.3px;
}

#expedition-map-close-btn {
  padding: 6px 16px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
}
#expedition-map-close-btn:hover { background: #334155; color: #e2e8f0; }

.exp-error {
  color: #f87171;
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
}

/* ── Biome expedition HUD accents ─────────────────────────────────────────── */
/* Stone biome: grey cave */
body.biome-stone #score-display,
body.biome-stone #next-pieces-display {
  border-color: #666666;
  color: #cccccc;
}
body.biome-stone #inventory-hud { border-color: #444; }

/* Forest biome: earthy green */
body.biome-forest #score-display,
body.biome-forest #next-pieces-display {
  border-color: #2d6b22;
  color: #7dda6e;
}
body.biome-forest #inventory-hud { border-color: #2d6b22; }

/* Nether biome: fiery red */
body.biome-nether #score-display,
body.biome-nether #next-pieces-display {
  border-color: #cc2200;
  color: #ff6644;
}
body.biome-nether #inventory-hud { border-color: #cc2200; }

/* Ice biome: frosty blue */
body.biome-ice #score-display,
body.biome-ice #next-pieces-display {
  border-color: #4499dd;
  color: #aaddff;
}
body.biome-ice #inventory-hud { border-color: #4499dd; }

/* Biome banner shown at game start (injected by biome-themes.js) */
#biome-entry-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 16px 32px;
  text-align: center;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#biome-entry-banner.visible { opacity: 1; }
#biome-entry-banner .biome-banner-icon { font-size: 32px; display: block; margin-bottom: 8px; }
#biome-entry-banner .biome-banner-name { font-size: 14px; letter-spacing: 1px; }

/* ── Expedition Lore Intro overlay ──────────────────────────────────────────── */

#expedition-lore-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001; /* above biome-transition-overlay (9999) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

#expedition-lore-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 14px;
  box-shadow: 0 0 48px #0ea5e944, 0 12px 40px #000c;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(520px, 94vw);
  padding: 32px 36px 28px;
  color: #e2e8f0;
  font-family: 'Segoe UI', monospace, sans-serif;
  text-align: center;
}

#exp-lore-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#exp-lore-biome-icon {
  font-size: 40px;
  line-height: 1;
}

#exp-lore-biome-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #7dd3fc;
  text-shadow: 0 0 12px #38bdf880;
}

#exp-lore-body {
  font-size: 13px;
  line-height: 1.7;
  color: #94a3b8;
  max-width: 420px;
}

#exp-lore-body p {
  margin: 0 0 6px;
}

#exp-lore-body p:last-child {
  margin-bottom: 0;
}

#exp-lore-progress {
  width: 100%;
  height: 3px;
  background: #1e3a5f;
  border-radius: 2px;
  overflow: hidden;
}

#exp-lore-progress-fill {
  height: 100%;
  width: 0%;
  background: #7dd3fc;
  border-radius: 2px;
}

#exp-lore-begin-btn {
  padding: 10px 28px;
  background: #1e3a5f;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

#exp-lore-begin-btn:hover {
  background: #0369a1;
  border-color: #0ea5e9;
  color: #fff;
}

#exp-lore-begin-btn.exp-lore-ready {
  background: #0369a1;
  border-color: #38bdf8;
  color: #fff;
  animation: exp-lore-pulse 1.2s ease-in-out infinite;
}

@keyframes exp-lore-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #38bdf840; }
  50%       { box-shadow: 0 0 0 8px #38bdf800; }
}

/* ── Expedition Results overlay ──────────────────────────────────────────────── */

#expedition-results-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

#expedition-results-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 14px;
  box-shadow: 0 0 48px #0ea5e944, 0 12px 40px #000c;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(480px, 94vw);
  padding: 28px 32px 24px;
  color: #e2e8f0;
  font-family: 'Segoe UI', monospace, sans-serif;
  text-align: center;
}

#exp-results-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#exp-results-biome-icon {
  font-size: 36px;
  line-height: 1;
}

#exp-results-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #4ade80;
  text-shadow: 0 0 12px #4ade8066;
}

#exp-results-biome-name {
  font-size: 12px;
  letter-spacing: 2px;
  color: #64748b;
  margin-top: 2px;
}

#exp-results-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.exp-res-stat {
  background: #0a1628;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exp-res-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #475569;
  text-transform: uppercase;
}

.exp-res-val {
  font-size: 22px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1;
}

/* Reward track */
#exp-results-track {
  width: 100%;
  background: #0a1628;
  border: 1px solid #1e3a5f;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exp-res-track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exp-res-tier-name {
  font-size: 13px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.5px;
}

.exp-res-xp-delta {
  font-size: 12px;
  color: #4ade80;
  font-weight: 600;
}

.exp-res-tier-up {
  font-size: 12px;
  color: #facc15;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.exp-res-reward-claim {
  font-size: 12px;
  color: #a78bfa;
  font-weight: 600;
}

.exp-res-material-bonus {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #34d399;
  font-weight: 600;
  font-size: 11px;
}

.exp-res-material-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.exp-res-track-bar-wrap {
  height: 8px;
  background: #1e3a5f;
  border-radius: 4px;
  overflow: hidden;
}

.exp-res-track-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.exp-res-track-next {
  font-size: 10px;
  color: #475569;
}

.exp-res-track-max {
  color: #facc15;
}

/* Action buttons */
#exp-results-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

#exp-results-play-again-btn {
  flex: 1;
  padding: 11px 16px;
  background: #0369a1;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}

#exp-results-play-again-btn:hover { background: #0284c7; }

#exp-results-map-btn {
  flex: 1;
  padding: 11px 16px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}

#exp-results-map-btn:hover {
  background: #334155;
  color: #e2e8f0;
}

/* ── Story fragment card (expedition results) ────────────────────────────── */

#exp-results-fragment {
  width: 100%;
  background: #0a1628;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fragmentReveal 0.5s ease forwards;
}

#exp-results-fragment.fragment-common   { border: 1px solid #475569; }
#exp-results-fragment.fragment-rare     { border: 1px solid #7c3aed; box-shadow: 0 0 16px #7c3aed33; }
#exp-results-fragment.fragment-legendary {
  border: 1px solid #ca8a04;
  box-shadow: 0 0 24px #ca8a0455, 0 0 8px #fbbf2422;
}

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

.exp-frag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exp-frag-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #4ade80;
  text-transform: uppercase;
}

.exp-frag-rarity {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
}

.exp-frag-rarity-common    { background: #1e293b; color: #94a3b8; }
.exp-frag-rarity-rare      { background: #2e1065; color: #a78bfa; }
.exp-frag-rarity-legendary { background: #422006; color: #fbbf24; }

.exp-frag-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  text-align: left;
  letter-spacing: 0.3px;
}

.exp-frag-lore {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
  text-align: left;
  font-style: italic;
}

.exp-frag-progress {
  font-size: 9px;
  color: #475569;
  letter-spacing: 0.5px;
  text-align: right;
}

/* Reward track in biome detail card (expedition map info panel) */
.exp-info-lore-teaser {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  padding: 0 4px;
}

.exp-info-track {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 2px;
}

.exp-info-track-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.exp-info-tier-label {
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
}

.exp-info-tier-xp {
  font-size: 10px;
  color: #475569;
}

.exp-info-track-bar-wrap {
  height: 5px;
  background: #1e3a5f;
  border-radius: 3px;
  overflow: hidden;
}

.exp-info-track-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 3px;
}

/* ── Expedition Map footer button group ────────────────────────────────────── */

.exp-footer-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

#expedition-codex-open-btn {
  padding: 6px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #7dd3fc;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
#expedition-codex-open-btn:hover { background: #0f3460; color: #e2e8f0; }

/* ── Expedition Codex overlay ──────────────────────────────────────────────── */

#expedition-codex-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
}

#expedition-codex-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  box-shadow: 0 0 40px #0ea5e944, 0 8px 32px #000c;
  display: flex;
  flex-direction: column;
  width: min(780px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  color: #e2e8f0;
  font-family: 'Segoe UI', monospace, sans-serif;
  position: relative;
}

#expedition-codex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid #1e3a5f;
  background: #0a1628;
  flex-shrink: 0;
}

#expedition-codex-icon {
  font-size: 26px;
}

#expedition-codex-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7dd3fc;
  text-shadow: 0 0 10px #38bdf880;
}

#expedition-codex-subtitle {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

/* Tabs */
#expedition-codex-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1e3a5f;
  background: #0a1628;
  flex-shrink: 0;
  overflow-x: auto;
}

.codex-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex: 1;
}

.codex-tab:hover { color: #94a3b8; }

.codex-tab-active {
  color: #7dd3fc;
  border-bottom-color: #0ea5e9;
}

.codex-tab-icon {
  font-size: 18px;
  line-height: 1;
}

.codex-tab-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.codex-tab-pct {
  font-size: 9px;
  color: #475569;
}
.codex-tab-active .codex-tab-pct { color: #4ade80; }

.codex-tab-new-dot {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade8088;
}

/* Grid wrap (scrollable area) */
#expedition-codex-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  min-height: 0;
}

/* Biome header (completion bar) */
#expedition-codex-biome-header {
  margin-bottom: 14px;
}

.codex-biome-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.codex-biome-icon { font-size: 18px; }

.codex-biome-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  flex: 1;
}

.codex-biome-pct {
  font-size: 11px;
  color: #4ade80;
  font-weight: 700;
}

.codex-progress-bar-wrap {
  height: 5px;
  background: #1e3a5f;
  border-radius: 3px;
  overflow: hidden;
}

.codex-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #4ade80);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Fragment grid */
#expedition-codex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* Fragment cards */
.codex-card {
  position: relative;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
  box-sizing: border-box;
  transition: transform 0.12s, box-shadow 0.15s;
}

.codex-card-collected {
  background: #0d1f3c;
  cursor: pointer;
}
.codex-card-collected:hover {
  transform: translateY(-2px);
}

/* Rarity borders */
.codex-card-common    { border: 1px solid #334155; }
.codex-card-rare      { border: 1px solid #7c3aed; box-shadow: 0 0 12px #7c3aed22; }
.codex-card-legendary {
  border: 1px solid #ca8a04;
  box-shadow: 0 0 20px #ca8a0455, 0 0 8px #fbbf2422;
  background: linear-gradient(135deg, #0d1f3c 60%, #1a1200 100%);
}
.codex-card-legendary:hover {
  box-shadow: 0 0 28px #ca8a0477, 0 0 10px #fbbf2433;
}

/* Locked silhouette */
.codex-card-locked {
  background: #0d1b2a;
  border: 1px solid #1e293b;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  cursor: default;
}

.codex-locked-icon {
  font-size: 22px;
  color: #334155;
}

.codex-locked-label {
  font-size: 11px;
  color: #334155;
  letter-spacing: 1px;
}

/* Card contents */
.codex-card-rarity {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 99px;
  width: fit-content;
}

.codex-rarity-common    { background: #1e293b; color: #94a3b8; }
.codex-rarity-rare      { background: #2e1065; color: #a78bfa; }
.codex-rarity-legendary { background: #422006; color: #fbbf24; }

.codex-card-legendary-star {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
  filter: drop-shadow(0 0 4px #fbbf24aa);
}

.codex-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.3;
}

.codex-card-lore-preview {
  font-size: 10px;
  color: #64748b;
  line-height: 1.5;
  font-style: italic;
  flex: 1;
}

.codex-card-tap-hint {
  font-size: 9px;
  color: #334155;
  text-align: right;
  margin-top: 2px;
}
.codex-card-collected:hover .codex-card-tap-hint { color: #475569; }

/* NEW badge */
.codex-new-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #16a34a;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 99px;
  box-shadow: 0 0 8px #16a34a88;
}

/* Codex footer */
#expedition-codex-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid #1e3a5f;
  background: #0a1628;
  flex-shrink: 0;
}

.codex-hint {
  font-size: 10px;
  color: #475569;
  letter-spacing: 0.3px;
}

#expedition-codex-close-btn {
  padding: 6px 16px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
}
#expedition-codex-close-btn:hover { background: #334155; color: #e2e8f0; }

/* ── Fragment detail view ───────────────────────────────────────────────────── */

#expedition-codex-detail {
  position: absolute;
  inset: 0;
  background: #0a1628ee;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: codexDetailSlideUp 0.22s ease forwards;
}

@keyframes codexDetailSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.codex-detail-inner {
  width: 100%;
  max-height: 90%;
  background: #0f172a;
  border-top: 1px solid #1e3a5f;
  border-radius: 12px 12px 0 0;
  padding: 20px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.codex-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.codex-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.codex-detail-biome {
  font-size: 12px;
  color: #64748b;
}

.codex-detail-close-btn {
  background: none;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #64748b;
  font-size: 14px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1;
}
.codex-detail-close-btn:hover { background: #1e293b; color: #e2e8f0; }

.codex-detail-legendary-bar {
  height: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, transparent);
  border-radius: 1px;
  margin: -6px 0 0;
}

.codex-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.codex-detail-art-wrap {
  display: flex;
  justify-content: center;
}

.codex-detail-art {
  width: 180px;
  height: 120px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1628;
  border: 1px solid #1e3a5f;
}

.codex-detail-art-common    { border-color: #334155; }
.codex-detail-art-rare      { border-color: #7c3aed; box-shadow: 0 0 16px #7c3aed33; }
.codex-detail-art-legendary {
  border-color: #ca8a04;
  box-shadow: 0 0 24px #ca8a0455;
  background: linear-gradient(135deg, #0a1628, #1a1200);
}

.codex-detail-art-placeholder {
  font-size: 42px;
  opacity: 0.5;
}

.codex-detail-lore {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.7;
  font-style: italic;
}

/* ── Biome Cosmetics Panel ─────────────────────────────────────────────────── */

#biome-cosmetics-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

#biome-cosmetics-panel {
  background: #0f172a;
  border: 1px solid #1e3a5f;
  border-radius: 14px;
  box-shadow: 0 0 48px #f59e0b33, 0 12px 40px #000c;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(560px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  color: #e2e8f0;
  font-family: 'Segoe UI', monospace, sans-serif;
}

#biome-cosmetics-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid #1e3a5f;
  flex-shrink: 0;
}

#biome-cosmetics-icon {
  font-size: 32px;
  line-height: 1;
}

#biome-cosmetics-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fbbf24;
  text-shadow: 0 0 12px #f59e0b80;
}

#biome-cosmetics-subtitle {
  font-size: 12px;
  color: #64748b;
  letter-spacing: 0.5px;
}

#biome-cosmetics-panel-body {
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

#biome-cosmetics-panel-body::-webkit-scrollbar { width: 5px; }
#biome-cosmetics-panel-body::-webkit-scrollbar-track { background: #0f172a; }
#biome-cosmetics-panel-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.bc-biome-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bc-biome-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7dd3fc;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e3a5f;
}

.bc-cosmetic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #0d1b2a;
  transition: border-color 0.15s, background 0.15s;
}

.bc-cosmetic-row.bc-cosmetic-unlocked {
  background: #0f1e32;
  border-color: #1e3a5f;
}

.bc-cosmetic-row.bc-cosmetic-equipped {
  background: #0c2340;
  border-color: #0ea5e9;
  box-shadow: 0 0 12px #0ea5e922;
}

.bc-cosmetic-row.bc-cosmetic-locked {
  opacity: 0.55;
}

.bc-cosmetic-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  width: 34px;
  text-align: center;
}

.bc-cosmetic-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bc-cosmetic-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bc-cosmetic-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.bc-type-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.bc-type-board {
  background: #1e3a5f;
  color: #7dd3fc;
}

.bc-type-piece {
  background: #2d1b54;
  color: #c4b5fd;
}

.bc-lock-hint {
  font-size: 10px;
  color: #64748b;
}

.bc-cosmetic-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.bc-cosmetic-actions {
  flex-shrink: 0;
}

.bc-equip-btn {
  padding: 6px 14px;
  background: #1e3a5f;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bc-equip-btn:hover {
  background: #0369a1;
  border-color: #0ea5e9;
  color: #fff;
}

.bc-equip-btn.bc-equip-btn-active {
  background: #0369a1;
  border-color: #38bdf8;
  color: #fff;
}

.bc-locked-label {
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
}

#biome-cosmetics-close-btn {
  margin: 12px 20px 16px;
  padding: 9px 20px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

#biome-cosmetics-close-btn:hover {
  background: #334155;
  color: #e2e8f0;
}


/* ── Biome Weekly Leaderboard ─────────────────────────────────────────────── */

#biome-lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 500;
}

#biome-lb-panel {
  background: #0d1117;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 500px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.3);
}

#biome-lb-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

#biome-lb-title {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  color: #f59e0b;
  letter-spacing: 2px;
  text-shadow: 0 0 10px #f59e0b;
}

#biome-lb-refresh-btn {
  font-size: 15px;
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  color: #f59e0b;
  cursor: pointer;
  padding: 2px 7px;
  line-height: 1;
  transition: background 0.15s;
}
#biome-lb-refresh-btn:hover { background: rgba(245, 158, 11, 0.15); }

#biome-lb-biome-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.biome-lb-biome-tab {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  color: rgba(245, 158, 11, 0.5);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
}
.biome-lb-biome-tab:hover { color: #f59e0b; border-color: #f59e0b; }

#biome-lb-week-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.biome-lb-week-tab {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 4px;
  color: rgba(148, 163, 184, 0.5);
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
}
.biome-lb-week-tab:hover { color: #94a3b8; border-color: #94a3b8; }
.biome-lb-tab-active {
  color: #f59e0b !important;
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.1) !important;
}

#biome-lb-body {
  width: 100%;
  min-height: 80px;
}

.biome-lb-loading, .biome-lb-error, .biome-lb-empty {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(245, 158, 11, 0.6);
  text-align: center;
  padding: 24px 0;
}
.biome-lb-error { color: #f55; }

.biome-lb-week-label {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(245, 158, 11, 0.7);
  text-align: center;
  margin-bottom: 8px;
}

.biome-lb-table { width: 100%; }
.biome-lb-table.lb-table thead th { color: rgba(245, 158, 11, 0.6); }
.biome-lb-table.lb-table tbody tr:hover { background: rgba(245, 158, 11, 0.06); }

.biome-lb-top10-badge {
  font-size: 11px;
}

.biome-lb-own-rank {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #94a3b8;
  text-align: center;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  margin-top: 6px;
}
.biome-lb-own-rank-hint { color: rgba(148, 163, 184, 0.5); }

#biome-lb-close-btn {
  margin-top: 6px;
  padding: 9px 20px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  transition: background 0.15s, color 0.15s;
}
#biome-lb-close-btn:hover { background: #334155; color: #e2e8f0; }

/* Biome info panel: action row with play + leaderboard buttons */
.exp-info-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.exp-info-actions .exp-play-btn {
  flex: 2;
  margin-top: 0;
}
.exp-lb-btn {
  flex: 1;
  padding: 9px 10px;
  background: #1e293b;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
}
.exp-lb-btn:hover { background: rgba(245, 158, 11, 0.15); }

/* Weekly rank result in expedition results screen */
#exp-results-weekly-rank {
  width: 100%;
  text-align: center;
}
.exp-res-weekly-top10 {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #f59e0b;
  text-shadow: 0 0 8px #f59e0b;
  padding: 10px 0 4px;
  letter-spacing: 0.5px;
}
.exp-res-weekly-xp {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #fbbf24;
  padding-bottom: 4px;
}
.exp-res-weekly-rank {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(148, 163, 184, 0.8);
  padding: 8px 0 2px;
}

/* ── Guild Expedition ─────────────────────────────────────────────────────── */

/* Expedition tab panel */
.gexp-active-banner {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #22c55e;
  margin-bottom: 10px;
  text-align: center;
}
.gexp-rules {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 11px;
  color: rgba(203,213,225,0.85);
  line-height: 1.8;
}
.gexp-rules div { margin-bottom: 2px; }
.gexp-start-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.gexp-biome-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gexp-biome-label {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: rgba(148,163,184,0.9);
  white-space: nowrap;
}
.gexp-biome-select {
  flex: 1;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 12px;
  padding: 5px 8px;
  cursor: pointer;
}
.gexp-biome-select:focus { outline: none; border-color: rgba(99,102,241,0.7); }
.gexp-start-btn { align-self: flex-start; }
.gexp-start-error {
  font-size: 10px;
  color: #ef4444;
  padding: 4px 0;
}
.gexp-hist-sub {
  font-size: 7px;
  color: rgba(148,163,184,0.6);
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
}

/* History cards */
.gexp-hist-card {
  border-radius: 6px;
  border: 1px solid rgba(100,116,139,0.25);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.03);
}
.gexp-hist-card--success { border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.05); }
.gexp-hist-card--fail    { border-color: rgba(239,68,68,0.25); }
.gexp-hist-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.gexp-hist-biome {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #e2e8f0;
  flex: 1;
}
.gexp-hist-result {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #94a3b8;
}
.gexp-hist-card--success .gexp-hist-result { color: #22c55e; }
.gexp-hist-card--fail    .gexp-hist-result { color: #ef4444; }
.gexp-hist-date {
  font-size: 10px;
  color: rgba(148,163,184,0.6);
}
.gexp-hist-score {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #cbd5e1;
  margin-bottom: 5px;
}
.gexp-hist-pct { color: rgba(148,163,184,0.6); margin-left: 4px; }
.gexp-hist-bar-wrap {
  height: 4px;
  background: rgba(100,116,139,0.25);
  border-radius: 2px;
  margin-bottom: 7px;
  overflow: hidden;
}
.gexp-hist-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.4s;
  max-width: 100%;
}
.gexp-hist-card--fail .gexp-hist-bar-fill { background: #94a3b8; }
.gexp-hist-players {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gexp-hist-player {
  font-size: 9px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  padding: 2px 6px;
  color: #94a3b8;
}
.gexp-hist-player--dropped { text-decoration: line-through; opacity: 0.5; }

/* Lobby overlay */
.guild-expedition-lobby-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", cursive;
}
.gexp-lobby-panel {
  background: #0f172a;
  border: 1px solid rgba(99,102,241,0.5);
  border-radius: 10px;
  padding: 20px 24px;
  width: 360px;
  max-width: 94vw;
  box-shadow: 0 0 30px rgba(99,102,241,0.2);
}
.gexp-lobby-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(100,116,139,0.2);
  padding-bottom: 10px;
}
.gexp-lobby-biome-icon { font-size: 22px; }
.gexp-lobby-title {
  font-size: 10px;
  color: #e2e8f0;
  letter-spacing: 1px;
  flex: 1;
}
.gexp-lobby-biome-name { font-size: 8px; color: #6366f1; }
.gexp-lobby-info { margin-bottom: 10px; }
.gexp-lobby-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.gexp-lobby-count { font-size: 9px; color: #94a3b8; }
.gexp-lobby-timer { font-size: 9px; color: #f59e0b; }
.gexp-lobby-target { font-size: 8px; color: #22c55e; margin-bottom: 8px; }
.gexp-lobby-section-title {
  font-size: 7px;
  color: rgba(148,163,184,0.6);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.gexp-lobby-players {
  min-height: 40px;
  margin-bottom: 10px;
}
.gexp-lobby-player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 9px;
  border-bottom: 1px solid rgba(100,116,139,0.1);
}
.gexp-lobby-icon { color: #6366f1; width: 12px; text-align: center; }
.gexp-lobby-name { flex: 1; color: #e2e8f0; }
.gexp-lobby-score { color: #22c55e; font-size: 8px; }
.gexp-lobby-rules {
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 8px;
  color: rgba(148,163,184,0.8);
  line-height: 1.9;
  margin-bottom: 10px;
}
.gexp-lobby-host-note {
  font-size: 8px;
  color: rgba(148,163,184,0.6);
  margin-bottom: 10px;
  text-align: center;
}
.gexp-lobby-cancel-btn {
  width: 100%;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 5px;
  color: #ef4444;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.gexp-lobby-cancel-btn:hover { background: rgba(239,68,68,0.22); }

/* In-game HUD widget */
.guild-expedition-hud {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(99,102,241,0.5);
  border-radius: 8px;
  padding: 8px 14px;
  min-width: 220px;
  max-width: 340px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.2);
  flex-direction: column;
  gap: 4px;
  font-family: "Press Start 2P", cursive;
}
.gexp-hud-label {
  font-size: 7px;
  color: #6366f1;
  letter-spacing: 1px;
  margin-bottom: 2px;
  text-align: center;
}
.gexp-hud-scores {
  text-align: center;
  font-size: 10px;
  color: #e2e8f0;
}
.gexp-hud-total  { color: #22c55e; }
.gexp-hud-sep    { color: rgba(148,163,184,0.5); }
.gexp-hud-target { color: rgba(148,163,184,0.7); }
.gexp-hud-bar-wrap {
  height: 5px;
  background: rgba(100,116,139,0.3);
  border-radius: 3px;
  overflow: hidden;
  margin: 3px 0;
}
.gexp-hud-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.5s;
  max-width: 100%;
}
.gexp-hud-bar-full { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.gexp-hud-players {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.gexp-hud-player {
  font-size: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  padding: 2px 5px;
  color: #94a3b8;
}
.gexp-hud-player--done    { color: #22c55e; }
.gexp-hud-player--dropped { color: #ef4444; text-decoration: line-through; }

/* Toast notification */
.guild-expedition-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9100;
  background: #1e293b;
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 6px;
  padding: 10px 16px;
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #e2e8f0;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  line-height: 1.6;
}

/* ── Featured Biome — World Map Highlight ─────────────────────────────────── */

.exp-node-featured {
  animation: fp-node-pulse 2.5s ease-in-out infinite;
}

@keyframes fp-node-pulse {
  0%, 100% { box-shadow: 0 0 18px #facc1566, 0 0 6px #fbbf2488; }
  50%       { box-shadow: 0 0 28px #facc1599, 0 0 12px #fbbf24bb; }
}

.exp-node-featured-badge {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #92400e;
  border: 1px solid #facc15;
  border-radius: 4px;
  color: #facc15;
  font-family: "Press Start 2P", cursive;
  font-size: 6px;
  padding: 2px 5px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px #fbbf24;
}

/* relative positioning on node needed for the absolute badge */
.exp-node { position: absolute; }

.exp-info-featured-banner {
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #78350f, #92400e);
  border: 1px solid #facc15;
  border-radius: 6px;
  color: #facc15;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  padding: 7px 10px;
  letter-spacing: 0.4px;
  line-height: 1.6;
  text-shadow: 0 0 8px #fbbf24;
}

/* ── Featured Season Pass — Results Screen ────────────────────────────────── */

.fp-results-section {
  width: 100%;
  background: rgba(146,64,14,0.15);
  border: 1px solid #facc15;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
}

.fp-results-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fp-results-icon {
  font-size: 14px;
}

.fp-results-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #facc15;
  letter-spacing: 0.5px;
  flex: 1;
}

.fp-results-xp-delta {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #fbbf24;
}

.fp-results-tier-up {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #86efac;
  padding: 2px 0;
}

.fp-results-cosmetic-claim {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #fde68a;
  padding: 3px 0;
}

.fp-results-progress-row {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 4px;
}

.fp-results-tier {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #94a3b8;
}

.fp-results-bar-wrap {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.fp-results-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Featured badge in expedition results header */
.exp-results-featured-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #facc15;
  background: rgba(146,64,14,0.4);
  border: 1px solid #facc15;
  border-radius: 4px;
  padding: 4px 10px;
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px #fbbf24;
}

/* ── Featured Season Pass — Season Pass Panel ─────────────────────────────── */

#season-pass-featured-body {
  width: 100%;
  margin-top: 10px;
}

.fp-panel-section {
  width: 100%;
  background: rgba(146,64,14,0.12);
  border: 1px solid #facc15;
  border-radius: 10px;
  padding: 14px 16px;
}

.fp-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fp-panel-biome-icon {
  font-size: 18px;
}

.fp-panel-title {
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #facc15;
  letter-spacing: 0.5px;
  flex: 1;
}

.fp-panel-ended-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #94a3b8;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 3px 7px;
}

.fp-panel-progress {
  margin-bottom: 12px;
}

.fp-panel-progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.fp-panel-xp-label,
.fp-panel-xp-val {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #cbd5e1;
}

.fp-panel-bar-wrap {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.fp-panel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.fp-panel-xp-next {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #64748b;
}

.fp-panel-cosmetics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fp-tier-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15,23,42,0.6);
  border: 1px solid #1e3a5f;
}

.fp-tier-row.fp-tier-claimed {
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
}

.fp-tier-row.fp-tier-locked {
  opacity: 0.55;
  border-color: #374151;
}

.fp-tier-row.fp-tier-reachable {
  border-color: #facc15;
  background: rgba(250,204,21,0.06);
}

.fp-tier-status {
  font-size: 18px;
  flex-shrink: 0;
  padding-top: 2px;
}

.fp-tier-info {
  flex: 1;
  min-width: 0;
}

.fp-tier-number-badge {
  display: inline-block;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #facc15;
  background: rgba(146,64,14,0.4);
  border: 1px solid #facc15;
  border-radius: 4px;
  padding: 2px 6px;
  margin-bottom: 4px;
}

.fp-tier-name {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #e2e8f0;
  margin-bottom: 3px;
}

.fp-tier-desc {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 3px;
}

.fp-tier-xp-needed {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #64748b;
}

.fp-tier-xp-needed.fp-tier-ready {
  color: #86efac;
}

.fp-tier-state {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.fp-claimed-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #22c55e;
}

.fp-expired-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ef4444;
}

.fp-pending-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #fbbf24;
}

.fp-locked-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #475569;
}

.fp-panel-note {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #64748b;
  line-height: 1.6;
  margin-top: 10px;
  text-align: center;
}

.fp-panel-no-biome {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  color: #64748b;
  text-align: center;
  padding: 10px 0;
}

/* ── Progressive Mode Unlock ─────────────────────────────────────────────── */

/* Lock overlay on mode cards */
.mode-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.mode-lock-icon {
  font-size: 1.8em;
  opacity: 0.9;
  filter: grayscale(0.3);
}
.mode-lock-text {
  font-family: "Press Start 2P", cursive;
  font-size: 0.5em;
  color: #aaa;
  letter-spacing: 1px;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
/* Locked mode card overrides */
.mode-card.mode-card-locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(120, 120, 120, 0.25) !important;
  box-shadow: none !important;
  filter: grayscale(0.6);
}
.mode-card.mode-card-locked:hover {
  transform: none;
  border-color: rgba(120, 120, 120, 0.25) !important;
  box-shadow: none !important;
}
/* Locked button (e.g. Expeditions) */
.mode-btn-locked {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
/* Shake animation on locked click */
@keyframes mode-lock-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}
.mode-lock-shake {
  animation: mode-lock-shake 0.4s ease-in-out;
}
/* Mode unlock toast variant */
.lu-toast-mode-unlock .lu-toast-icon {
  font-size: 1.8em;
}
.lu-toast-mode-unlock .lu-toast-title {
  color: #00ff88;
  text-shadow: 0 0 8px #00ff88;
}

/* ── NEW badge on freshly unlocked mode cards ─────────────────────────────── */
.mode-new-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #00ff88;
  color: #001a0d;
  font-size: 0.65em;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.3;
  z-index: 3;
  pointer-events: none;
  text-transform: uppercase;
  animation: mode-new-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}
@keyframes mode-new-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
  50%      { box-shadow: 0 0 16px rgba(0, 255, 136, 0.85); }
}
@keyframes mode-new-opacity-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── Prestige system ──────────────────────────────────────────────────────── */

/* Prestige button in stats panel */
.stats-prestige-section {
  margin-top: 16px;
  text-align: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 215, 0, 0.3);
}
.prestige-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  border: 2px solid #ffd700;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}
.prestige-btn:hover {
  background: linear-gradient(135deg, #ffed4a, #ffa500);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
  transform: scale(1.05);
}
.prestige-reward-preview {
  font-size: 9px;
  color: #aaa;
  margin-top: 8px;
  line-height: 1.4;
}

/* Prestige confirmation dialog */
#prestige-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
#prestige-confirm-panel {
  background: #1a1a2e;
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 24px 32px;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}
#prestige-confirm-title {
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: #ffd700;
  margin-bottom: 16px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
#prestige-confirm-body {
  font-size: 13px;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
}
#prestige-confirm-body p {
  margin: 8px 0;
}
.prestige-confirm-reward {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  padding: 10px;
  margin: 12px 0;
  color: #ffd700;
  font-size: 12px;
}
.prestige-confirm-warning {
  color: #ff6b6b;
  font-size: 11px;
  font-weight: bold;
}
.prestige-confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.prestige-confirm-yes {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  padding: 8px 20px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  border: 2px solid #ffd700;
  border-radius: 5px;
  cursor: pointer;
}
.prestige-confirm-yes:hover {
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}
.prestige-confirm-no {
  font-family: "Press Start 2P", cursive;
  font-size: 11px;
  padding: 8px 20px;
  background: transparent;
  color: #888;
  border: 1px solid #555;
  border-radius: 5px;
  cursor: pointer;
}
.prestige-confirm-no:hover {
  color: #fff;
  border-color: #aaa;
}

/* Leaderboard prestige indicators */
.lb-prestige-stars {
  font-size: 10px;
  vertical-align: middle;
}
.lb-prestige-crown {
  font-size: 12px;
  vertical-align: middle;
}

/* ── Metrics Dashboard ──────────────────────────────────────────────────── */
#metrics-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 310;
  pointer-events: all;
}
#metrics-panel {
  background: #111;
  border: 2px solid #0f0;
  border-radius: 6px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 380px;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}
#metrics-title {
  font-family: "Press Start 2P", cursive;
  font-size: 1.2em;
  color: #0f0;
  text-align: center;
  margin-bottom: 4px;
}
.metrics-section {
  margin-bottom: 8px;
}
.metrics-section-title {
  font-family: "Press Start 2P", cursive;
  font-size: 0.65em;
  color: #0a0;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metrics-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a1a;
  border-radius: 4px;
  padding: 10px 8px;
}
.metrics-val {
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  color: #0f0;
}
.metrics-label {
  font-size: 0.65em;
  color: #888;
  margin-top: 4px;
  text-align: center;
}
.metrics-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.metrics-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  background: #1a1a1a;
  border-radius: 2px;
  font-size: 0.8em;
  color: #ccc;
}
.metrics-row.metrics-header {
  color: #0a0;
  font-weight: bold;
  background: #0a0a0a;
  font-size: 0.7em;
}
.metrics-row span {
  flex: 1;
  text-align: center;
}
.metrics-row span:first-child {
  text-align: left;
}
.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metrics-list-item {
  padding: 5px 8px;
  background: #1a1a1a;
  border-radius: 2px;
  font-size: 0.8em;
  color: #ccc;
}
.metrics-empty {
  color: #555;
  font-size: 0.75em;
  padding: 8px;
  text-align: center;
}
#metrics-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
#metrics-close-btn, #metrics-clear-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.75em;
  padding: 10px 24px;
  border: 1px solid #0f0;
  background: transparent;
  color: #0f0;
  cursor: pointer;
  border-radius: 4px;
}
#metrics-close-btn:hover { background: #0f02; }
#metrics-clear-btn {
  border-color: #a00;
  color: #a00;
}
#metrics-clear-btn:hover { background: #a001; }
.settings-link-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 0.7em;
  padding: 8px 16px;
  border: 1px solid #0a0;
  background: transparent;
  color: #0a0;
  cursor: pointer;
  border-radius: 4px;
  width: 100%;
}
.settings-link-btn:hover { background: #0a01; }

/* ── Settings tab navigation ── */
#settings-tabs {
  display: flex;
  gap: 0;
  width: 100%;
  border-bottom: 2px solid #333;
  margin-bottom: 4px;
}
.settings-tab {
  font-family: "Press Start 2P", cursive;
  font-size: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #555;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.settings-tab:hover { color: #0f0; }
.settings-tab-active {
  color: #0f0;
  border-bottom-color: #0f0;
}

/* ── Controls tab panes ── */
#settings-pane-general,
#settings-pane-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ── Keybind table rows ── */
#keybind-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.keybind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.keybind-action-label {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ccc;
  flex: 1;
}
.keybind-key-badge {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #0f0;
  background: #1a1a1a;
  border: 1px solid #0f0;
  border-radius: 3px;
  padding: 4px 8px;
  min-width: 52px;
  text-align: center;
  white-space: nowrap;
}
.keybind-key-btn {
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.keybind-key-btn:hover {
  background: #0f01;
  color: #fff;
}
.keybind-key-btn-listening {
  background: #330;
  color: #ff0;
  border-color: #ff0;
  animation: kb-pulse 0.6s ease-in-out infinite alternate;
}
@keyframes kb-pulse {
  from { box-shadow: 0 0 0 0 rgba(255,255,0,0.3); }
  to   { box-shadow: 0 0 0 4px rgba(255,255,0,0); }
}
.keybind-conflict-msg {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  min-height: 14px;
  text-align: center;
  width: 100%;
}

/* ── Preset buttons ── */
#keybind-presets {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}
.kb-preset-btn {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid #555;
  color: #aaa;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.kb-preset-btn:hover {
  border-color: #0f0;
  color: #0f0;
}

/* ── Display-only rows in controls tab ── */
.keybind-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  opacity: 0.55;
}

/* Expedition card — earthy/explorer accent */
.mode-card-expedition {
  border-color: rgba(139, 195, 74, 0.5);
  box-shadow: 0 0 14px rgba(139, 195, 74, 0.1);
}
.mode-card-expedition:not(.mode-card-locked):hover {
  border-color: #8bc34a;
  box-shadow: 0 0 22px rgba(139, 195, 74, 0.35);
}
.mode-card-expedition .mode-card-name {
  color: #8bc34a;
  text-shadow: 0 0 6px #8bc34a;
}








.key-hint {
  color: #555;
  font-size: 0.8em;
}





/* ── First-launch minimal menu ──────────────────────────────────── */
.first-launch-settings {
  display: none !important;
}
#instructions.first-launch .controls-grid,
#instructions.first-launch #menu-missions-panel,
#instructions.first-launch #menu-more-toggle,
#instructions.first-launch #menu-secondary,
#instructions.first-launch #start-resume-btn,
#instructions.first-launch #hs-start-panel {
  display: none !important;
}

#instructions.first-launch .first-launch-settings {
  display: inline-block !important;
  margin-top: 10px;
  background: none;
  border: none;
  color: #aaa;
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 1px;
}

#instructions.first-launch .first-launch-settings:hover {
  color: #0f0;
}










/* ── Community Goals HUD Ticker ─────────────────────────────────────────── */
#cg-ticker {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  pointer-events: none;
  max-width: 220px;
}
.cg-ticker-inner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 200, 60, 0.3);
  border-radius: 5px;
  padding: 6px 8px;
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #ddd;
}
.cg-ticker-label {
  color: #ffcc3c;
  font-size: 7px;
  letter-spacing: 0.3px;
}
.cg-ticker-progress {
  color: #bbb;
  font-size: 6px;
}
.cg-tier-badge {
  font-size: 6px;
  font-weight: bold;
}
.cg-ticker-pct {
  color: #aaa;
  font-size: 6px;
}
.cg-ticker-players {
  color: #888;
  font-size: 6px;
}
.cg-ticker-bar-wrap {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: visible;
}
.cg-ticker-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffcc3c, #ff8c00);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.cg-ticker-bar-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 9px;
  border-radius: 1px;
  pointer-events: none;
}
.cg-marker-bronze { left: 40%; background: #cd7f32; }
.cg-marker-silver { left: 70%; background: #c0c0c0; }

/* ── Community Goals Guild Panel ─────────────────────────────────────────── */
.cg-panel {
  padding: 8px 0;
  font-size: 11px;
  color: #ccc;
}
.cg-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cg-panel-icon {
  font-size: 26px;
  line-height: 1;
}
.cg-panel-title-wrap {
  flex: 1;
}
.cg-panel-title {
  font-family: "Press Start 2P", cursive;
  font-size: 10px;
  color: #ffcc3c;
}
.cg-panel-week {
  font-size: 9px;
  color: #888;
  margin-top: 3px;
}
.cg-panel-players {
  font-size: 11px;
  color: #aaa;
}
.cg-panel-progress-wrap {
  margin-bottom: 12px;
}
.cg-panel-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #bbb;
  margin-bottom: 4px;
}
.cg-panel-bar-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: visible;
}
.cg-panel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffcc3c, #ff8c00);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.cg-panel-bar-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
}
.cg-panel-tier-reached {
  margin-top: 6px;
  font-family: "Press Start 2P", cursive;
  font-size: 9px;
  color: #ffd700;
  text-align: center;
  animation: cg-tier-glow 1.5s ease-in-out infinite alternate;
}
@keyframes cg-tier-glow {
  from { text-shadow: 0 0 4px rgba(255,215,0,0.4); }
  to   { text-shadow: 0 0 12px rgba(255,215,0,0.9); }
}
.cg-panel-section-title {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
  color: #666;
  letter-spacing: 1px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 4px;
}
.cg-tier-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cg-tier-row {
  display: grid;
  grid-template-columns: 60px 50px 1fr 60px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  font-size: 9px;
  opacity: 0.7;
}
.cg-tier-row.cg-tier-reached {
  opacity: 1;
  background: rgba(255,200,60,0.07);
  border: 1px solid rgba(255,200,60,0.2);
}
.cg-tier-name {
  font-family: "Press Start 2P", cursive;
  font-size: 7px;
}
.cg-tier-target { color: #aaa; font-size: 9px; }
.cg-tier-reward { color: #88aaff; font-size: 8px; }
.cg-tier-status { color: #aaa; font-size: 8px; text-align: right; }
.cg-tier-row.cg-tier-reached .cg-tier-status { color: #4caf50; }

.cg-lb-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cg-lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  font-size: 10px;
}
.cg-lb-rank {
  min-width: 28px;
  font-size: 12px;
}
.cg-lb-name { flex: 1; color: #ddd; }
.cg-lb-score { color: #ffcc3c; font-family: "Press Start 2P", cursive; font-size: 8px; }
.cg-lb-banner-badge {
  font-size: 7px;
  color: #4caf50;
  margin-left: 4px;
  font-family: inherit;
}
.cg-lb-empty, .cg-panel-error {
  padding: 12px;
  color: #666;
  font-size: 10px;
  text-align: center;
}
