@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Share+Tech+Mono&family=Barlow+Condensed:wght@300;400;600;700&display=swap');

:root {
  --bg: #0a0a08;
  --surface: #111110;
  --surface2: #1a1a17;
  --border: #2a2a22;
  --orange: #d4731a;
  --orange-bright: #f5891e;
  --orange-dim: #7a3e0a;
  --gold: #c8a84b;
  --gold-dim: #6b5520;
  --green-on: #b8ff00;
  --green-glow: #7acc00;
  --green-off: #2a3a10;
  --green-off-ring: #1a2808;
  --text: #c8c4b0;
  --text-dim: #6a6858;
  --red: #cc2200;
  --morse-yellow: #f0c040;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.07) 2px,
      rgba(0, 0, 0, 0.07) 4px);
  pointer-events: none;
  z-index: 9999;
}

/* Noise texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
}

/* HEADER */
header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #141410 0%, var(--bg) 100%);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 4px;
  color: var(--orange-bright);
  text-shadow: 0 0 20px rgba(245, 137, 30, 0.4);
  line-height: 1;
}

.logo span {
  color: var(--text-dim);
  font-size: 13px;
  display: block;
  letter-spacing: 8px;
  margin-top: 2px;
}

.biohazard {
  width: 36px;
  height: 36px;
  opacity: 0.7;
  filter: drop-shadow(0 0 8px var(--orange));
}

nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

.coffee-btn {
  margin-left: auto;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 8px 16px;
  border: 1px solid var(--orange);
  background: transparent;
  color: var(--orange-bright);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.coffee-btn:hover {
  background: var(--orange);
  color: var(--bg);
}

.tab-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--orange-bright);
  border-color: var(--orange-dim);
}

.tab-btn.active {
  background: var(--orange-dim);
  border-color: var(--orange);
  color: var(--orange-bright);
  text-shadow: 0 0 10px rgba(245, 137, 30, 0.5);
}

/* CONTENT */
.page {
  display: none;
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.page.active {
  display: block;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  letter-spacing: 5px;
  color: var(--orange-bright);
  border-bottom: 1px solid var(--orange-dim);
  padding-bottom: 10px;
  margin-bottom: 28px;
  text-shadow: 0 0 30px rgba(245, 137, 30, 0.3);
}

.sub-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 16px;
  margin-top: 32px;
}

/* ======= OVERVIEW PAGE ======= */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.guide-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange-dim);
}

.guide-card:hover {
  border-color: var(--orange-dim);
}

.guide-card:hover::before {
  background: var(--orange);
}

.card-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--orange-bright);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-dim);
}

.go-btn {
  display: inline-block;
  margin-top: 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border: 1px solid var(--orange-dim);
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.go-btn:hover {
  background: var(--orange-dim);
  color: var(--orange-bright);
}

/* ======= CIPHER PAGE ======= */
.cipher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.cipher-block {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
}

.cipher-block-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.alphabet-lock-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}

.alphabet-lock-inputs input {
  width: 60px;
  height: 50px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--orange-bright);
  font-family: 'Share Tech Mono', monospace;
  font-size: 20px;
  text-align: center;
  outline: none;
}

.alphabet-lock-inputs input:focus {
  border-color: var(--gold);
}

.alphabet-lock-display {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.lock-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--surface2);
  border: 2px solid var(--border);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: var(--gold);
  letter-spacing: 2px;
}

.number-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  font-size: 14px;
  text-align: center;
}

.number-row .num {
  color: var(--orange);
  font-family: 'Bebas Neue';
  font-size: 20px;
}

.number-row .sym {
  color: var(--morse-yellow);
  letter-spacing: 0px;
  font-size: 16px;
}

.sym-set {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.sym-label {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.morse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font-size: 14px;
}

.morse-entry {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.morse-letter {
  color: var(--orange-bright);
  font-weight: bold;
  min-width: 18px;
  font-size: 16px;
}

.morse-code {
  color: var(--morse-yellow);
  letter-spacing: 1px;
}

.bin-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  font-size: 14px;
}

.bin-entry {
  display: flex;
  gap: 6px;
}

.bin-num {
  color: var(--orange-bright);
  min-width: 20px;
  font-size: 15px;
}

.bin-val {
  color: var(--morse-yellow);
}

.alpha-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  font-size: 14px;
}

.alpha-entry {
  display: flex;
  gap: 5px;
}

.alpha-letter {
  color: var(--orange-bright);
  min-width: 14px;
}

.alpha-num {
  color: var(--morse-yellow);
}

.roman-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  text-align: center;
  margin-bottom: 4px;
}

.roman-row .rn {
  color: var(--morse-yellow);
  font-size: 12px;
}

.roman-row .rnum {
  color: var(--orange);
  font-size: 11px;
}

.numpad-diagram {
  display: inline-grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(3, 50px);
  gap: 4px;
  margin: 12px 0;
}

.numpad-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--orange-bright);
  font-family: 'Bebas Neue';
  position: relative;
}

.numpad-cell .arrow-text {
  position: absolute;
  font-size: 10px;
  color: var(--text-dim);
  bottom: 1px;
  right: 2px;
  font-family: 'Share Tech Mono';
}

.dir-box {
  display: inline-grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 3px;
  margin: 8px 0;
}

.dir-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--morse-yellow);
}

.dir-cell.center {
  background: var(--orange-dim);
  color: white;
  font-size: 12px;
}

/* lock types */
.lock-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 700px) {
  .lock-info-grid {
    grid-template-columns: 1fr;
  }
}

.lock-card {
  background: var(--surface);
  border: 1px solid var(--orange-dim);
  padding: 16px;
  text-align: center;
}

.lock-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.lock-name {
  font-family: 'Bebas Neue';
  letter-spacing: 2px;
  color: var(--orange);
  font-size: 16px;
  margin-bottom: 6px;
}

.lock-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ======= LIGHT PUZZLE PAGE ======= */
.light-page-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .light-page-layout {
    grid-template-columns: 1fr;
  }
}

.solver-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.solver-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 3px;
  color: var(--green-on);
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(184, 255, 0, 0.3);
}

.solver-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.6;
}

.grid-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.grid-control-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.grid-size-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--orange-bright);
  font-family: 'Share Tech Mono';
  font-size: 14px;
  padding: 6px 10px;
  width: 55px;
  text-align: center;
  outline: none;
}

.grid-size-input:focus {
  border-color: var(--orange);
}

.puzzle-grid-container {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
}

.puzzle-plate {
  position: relative;
  background: #8a8a7a;
  border: 3px solid #5a5a4a;
  border-radius: 4px;
  padding: 16px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.3), 0 0 30px rgba(184, 255, 0, 0.05);
  background-image: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 70%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
}

.screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #aaa, #444);
  border: 1px solid #333;
}

.screw.tl {
  top: 6px;
  left: 6px;
}

.screw.tr {
  top: 6px;
  right: 6px;
}

.screw.bl {
  bottom: 6px;
  left: 6px;
}

.screw.br {
  bottom: 6px;
  right: 6px;
}

.puzzle-grid {
  display: grid;
  gap: 10px;
}

.light-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  transition: all 0.12s;
  background: radial-gradient(circle at 40% 35%, #3a5018 0%, #2a3c10 45%, #1a2808 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), inset 0 -2px 4px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.light-btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  background: transparent;
  pointer-events: none;
}

.light-btn::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  background: rgba(50, 70, 20, 0.3);
  pointer-events: none;
}

.light-btn.on {
  background: radial-gradient(circle at 38% 32%, #f0ff60 0%, #b8ff00 30%, #7acc00 65%, #3d7a00 100%);
  box-shadow: inset 0 2px 4px rgba(255, 255, 200, 0.3), inset 0 -2px 4px rgba(0, 80, 0, 0.4), 0 0 12px rgba(184, 255, 0, 0.7), 0 0 30px rgba(184, 255, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.light-btn.on::after {
  background: rgba(255, 255, 200, 0.4);
  width: 26px;
  height: 26px;
}

.light-btn:hover {
  transform: scale(1.06);
}

.light-btn:active {
  transform: scale(0.96);
}

.solution-panel {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  min-height: 80px;
}

.solution-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--green-on);
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(184, 255, 0, 0.3);
}

.solution-grid {
  display: grid;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 10px;
}

.solution-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sol-cell {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

.sol-cell.press {
  background: radial-gradient(circle, #b8ff00, #5a9900);
  color: #000;
  box-shadow: 0 0 8px rgba(184, 255, 0, 0.5);
}

.sol-cell.skip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.solution-note {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.no-solution {
  color: var(--red);
  font-size: 12px;
}

.action-row {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.action-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 18px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  min-width: 100px;
}

.btn-solve {
  border-color: var(--green-glow);
  background: rgba(122, 204, 0, 0.1);
  color: var(--green-on);
}

.btn-solve:hover {
  background: rgba(122, 204, 0, 0.25);
}

.btn-clear {
  border-color: var(--border);
  background: transparent;
  color: var(--text-dim);
}

.btn-clear:hover {
  border-color: var(--orange-dim);
  color: var(--orange);
}

.btn-reset {
  border-color: var(--red);
  background: transparent;
  color: var(--red);
  opacity: 0.7;
}

.btn-reset:hover {
  opacity: 1;
  background: rgba(204, 34, 0, 0.1);
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
}

.info-card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
}

.info-card p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 8px;
}

.adj-example {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 6px;
  margin: 12px auto;
  width: fit-content;
}

.adj-cell {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: 'Share Tech Mono';
  border: 2px solid transparent;
}

.adj-cell.center-btn {
  background: radial-gradient(circle at 38% 32%, #f0ff60, #b8ff00, #7acc00, #3d7a00);
  box-shadow: 0 0 12px rgba(184, 255, 0, 0.6);
  color: #000;
  font-weight: bold;
}

.adj-cell.affected {
  background: radial-gradient(circle at 40% 35%, #3a5018, #2a3c10, #1a2808);
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: 0 0 6px rgba(213, 115, 26, 0.4);
}

.adj-cell.unaffected {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text-dim);
}

.adj-legend {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
  line-height: 1.5;
}

.tips-list {
  list-style: none;
}

.tips-list li {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.tips-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--orange);
}

.press-count {
  font-family: 'Bebas Neue';
  font-size: 22px;
  color: var(--green-on);
  text-shadow: 0 0 10px rgba(184, 255, 0, 0.5);
}

.status-badge {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 3px 10px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.badge-unsolved {
  background: rgba(204, 34, 0, 0.2);
  border: 1px solid var(--red);
  color: var(--red);
}

.badge-solved {
  background: rgba(122, 204, 0, 0.2);
  border: 1px solid var(--green-glow);
  color: var(--green-on);
}

.badge-empty {
  background: rgba(100, 100, 80, 0.2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.highlight {
  color: var(--orange-bright);
}

.highlight-gold {
  color: var(--gold);
}

.highlight-green {
  color: var(--green-on);
}

@media (max-width: 600px) {
  header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .page {
    padding: 16px;
  }

  .light-btn {
    width: 40px;
    height: 40px;
  }

  .word-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ======= MAP PAGE ======= */
.map-viewport {
  width: 960px;
  height: 576px;
  background: #050504;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

@media (max-width: 1000px) {
  .map-viewport {
    width: 100%;
    max-width: 960px;
    height: auto;
    aspect-ratio: 960 / 576;
  }
}

.map-viewport:active {
  cursor: grabbing;
}

.map-container {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-image {
  display: block;
  max-width: none;
  filter: brightness(0.9) contrast(1.1);
  transition: filter 0.3s;
}

.map-viewport:hover .map-image {
  filter: brightness(1);
}

.map-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.2s;
}

.map-ctrl-btn:hover {
  background: var(--orange-dim);
  color: var(--orange-bright);
  border-color: var(--orange);
}

.map-zoom-indicator {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
  min-width: 36px;
}

.map-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-options-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
}

.map-options-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--orange-bright);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-opt-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}

.map-opt-btn:hover {
  border-color: var(--orange-dim);
  color: var(--orange);
}

.map-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-opt-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-opt-group label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.map-opt-group select,
.map-opt-group input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
}

.map-opt-group select:focus,
.map-opt-group input:focus {
  border-color: var(--orange-dim);
}

.map-legend {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.map-legend-color {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
}

.map-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 960px;
  height: 576px;
  pointer-events: none;
}

.map-cell {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(80, 80, 60, 0.15);
  box-sizing: border-box;
}

.map-cell:hover {
  outline: 2px solid var(--orange-bright);
  outline-offset: -2px;
  z-index: 5;
  background: rgba(245, 137, 30, 0.15) !important;
}

.map-cell.has-building {
  border-color: rgba(200, 168, 75, 0.3);
}

.map-cell.has-building:hover {
  border-color: rgba(245, 137, 30, 0.6);
}

.map-cell.faded {
  opacity: 0.2;
}

.map-cell.outpost {
  background: rgba(0, 255, 0, 0.25);
}

.map-cell.pvpZone {
  background: rgba(255, 0, 0, 0.25);
}

.map-cell.purplezone {
  background: rgba(154, 18, 179, 0.25);
}

.map-cell.npc {
  background: rgba(255, 255, 255, 0.2);
}

.map-cell.permanent {
  background: rgba(255, 115, 0, 0.15);
}

.map-cell.raid {
  background: rgba(255, 0, 0, 0.1);
}

.map-cell.highlight {
  outline: 2px solid var(--orange-bright);
  outline-offset: -2px;
}

.map-building-tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--orange-dim);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  z-index: 100;
  display: none;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.map-tooltip-level {
  font-family: 'Bebas Neue';
  font-size: 16px;
  color: var(--green-on);
  margin-bottom: 4px;
}

.map-tooltip-district {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.map-tooltip-buildings {
  color: var(--text);
  line-height: 1.5;
}

.map-tooltip-buildings strong {
  color: var(--orange-bright);
}

/* Word list page additions */
.word-scramble-section {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  margin-top: 24px;
}

.word-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding: 8px;
  border-left: 2px solid var(--orange-dim);
  background: var(--surface2);
}

.word-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 800px) {
  .word-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

.word-col-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.word-list {
  list-style: none;
}

.word-list li {
  font-size: 11px;
  color: var(--text);
  padding: 2px 0;
  letter-spacing: 1px;
}

.word-list li:hover {
  color: var(--orange-bright);
  cursor: default;
}

/* Mission Markers */
.mission-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--orange-bright);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 0 6px var(--orange);
}

.mission-marker:hover {
  transform: scale(1.3);
  background: var(--gold);
}

.mission-marker.selected {
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 0 4px var(--bg);
  transform: scale(1.4);
}

/* Mission Panel - Integrated into page */
.mission-panel {
  display: flex;
  margin-top: 16px;
  height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-direction: column;
}

.mission-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.mission-panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--orange-bright);
}

.mission-panel-toggle-icon {
  color: var(--text-dim);
  font-size: 14px;
  transition: transform 0.2s;
}

.mission-panel-filters {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}

.mission-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mission-filter-group label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.mission-filter-group input,
.mission-filter-group select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
}

.mission-filter-group input:focus,
.mission-filter-group select:focus {
  border-color: var(--orange-dim);
  outline: none;
}

.mission-filter-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange-bright);
}

.mission-filter-group input[type="number"] {
  width: 60px;
}

.mission-filter-group input[type="text"] {
  width: 140px;
}

.mission-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}

.mission-list-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.mission-list-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.mission-list-item:hover {
  border-color: var(--orange-dim);
}

.mission-list-item.selected {
  border-color: var(--orange-bright);
  background: rgba(245, 137, 30, 0.1);
}

.mission-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mission-type-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.type-kill { background: var(--red); color: #fff; }
.type-find { background: #4a90d9; color: #fff; }
.type-fetch { background: var(--green-on); color: var(--bg); }
.type-escort { background: var(--gold); color: var(--bg); }
.type-challenge { background: #9b59b6; color: #fff; }
.type-generic { background: var(--text-dim); color: var(--bg); }

.mission-name {
  font-size: 13px;
  color: var(--orange-bright);
}

.mission-item-giver {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.mission-item-details {
  display: flex;
  gap: 8px;
  font-size: 10px;
}

.mission-level {
  color: var(--gold);
}

.mission-district {
  color: var(--text-dim);
}

.mission-badge {
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 9px;
}

.mission-badge.permanent {
  background: var(--green-on);
  color: var(--bg);
}

.mission-badge.daily {
  background: #9b59b6;
  color: #fff;
}

/* Scrap Page */
.scrap-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 20px;
}

.scrap-category-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--orange-bright);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.scrap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.scrap-table th,
.scrap-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.scrap-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
}

.scrap-table td:first-child {
  color: var(--text);
}

.scrap-table td:not(:first-child) {
  text-align: right;
  font-family: 'Share Tech Mono', monospace;
}

.rarity-normal { color: #888 !important; }
.rarity-superior { color: #4a90d9 !important; background: rgba(74, 144, 217, 0.1) !important; }
.rarity-rare { color: #c8a84b !important; background: rgba(200, 168, 75, 0.1) !important; }
.rarity-elite { color: #9b59b6 !important; background: rgba(155, 89, 182, 0.1) !important; }

/* DPS Calculator */
.dps-layout {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.dps-panel {
  flex: 1;
  min-width: 300px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 16px;
}

.dps-panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--orange-bright);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.dps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dps-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dps-input-group label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.dps-input-group input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--orange-bright);
  padding: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  text-align: right;
}

.dps-input-group input:focus {
  border-color: var(--orange-dim);
  outline: none;
}

.dps-results-panel {
  width: 280px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 16px;
}

.dps-result-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dps-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.dps-result-label {
  font-size: 12px;
  color: var(--text-dim);
}

.dps-result-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 16px;
  color: var(--orange-bright);
}

.dps-stats-summary {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dps-stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.dps-stat-item span:first-child {
  color: var(--text-dim);
}

.dps-highlight {
  color: var(--green-on) !important;
  font-weight: bold;
}

/* Sliding Puzzle */
.sliding-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.sliding-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sliding-puzzle-select {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sliding-grid-size-btns {
  display: flex;
  gap: 4px;
}

.grid-size-btn {
  padding: 6px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.grid-size-btn:hover {
  border-color: var(--orange-bright);
  color: var(--orange-bright);
}

.grid-size-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--bg);
}

.sliding-puzzle-select label {
  font-size: 12px;
  color: var(--text-dim);
}

.sliding-puzzle-select select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--orange-bright);
  padding: 8px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
}

.sliding-image-preview {
  width: 133px;
  height: 133px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sliding-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sliding-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 133px);
  grid-template-rows: repeat(3, 133px);
  gap: 4px;
  background: var(--surface2);
  border: 2px solid var(--border);
  padding: 4px;
}

.sliding-cell {
  width: 133px;
  height: 133px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.sliding-cell.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
}

.sliding-cell.drag-over {
  border-color: var(--orange-bright);
  background: rgba(245, 137, 30, 0.1);
}

.sliding-piece {
  width: 133px;
  height: 133px;
  background-size: 133px 133px;
  cursor: grab;
  border: 1px solid var(--border);
  position: relative;
}

.sliding-piece:active {
  cursor: grabbing;
}

.sliding-piece.dragging {
  opacity: 0.5;
}

.piece-number {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px black;
  pointer-events: none;
}

.sliding-controls {
  display: flex;
  gap: 12px;
}

.sliding-solution {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  min-width: 280px;
  min-height: 200px;
  max-width: 350px;
  max-height: 400px;
  overflow-y: auto;
}

.sliding-right {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
}

.sliding-pieces-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sliding-pieces-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--orange-bright);
}

.sliding-pieces-tray {
  display: grid;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 12px;
  min-width: 282px;
}

.sliding-tray-piece {
  width: 133px;
  height: 133px;
  background-size: 133px 133px;
  cursor: grab;
  border: 1px solid var(--border);
}

.sliding-tray-piece:active {
  cursor: grabbing;
}

/* Info Page */
.info-container {
  max-width: 800px;
}

.info-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.info-btn {
  padding: 10px 24px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.info-btn:hover {
  border-color: var(--orange-bright);
  color: var(--orange-bright);
}

.info-btn.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--bg);
}

.info-section {
  display: none;
}

.info-section.active {
  display: block;
}

.info-subsection {
  margin-bottom: 8px;
}

.info-toggle-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.info-toggle-btn:hover {
  border-color: var(--orange-bright);
}

.info-toggle-btn.active {
  background: var(--surface);
  border-color: var(--orange);
  color: var(--orange-bright);
}

.info-content {
  display: none;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

.info-content.active {
  display: block;
}

.exp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: var(--text-dim);
}

.exp-table th,
.exp-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: center;
}

.exp-table th {
  background: var(--surface2);
  color: var(--orange-bright);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px;
}

.exp-table td {
  background: var(--surface);
}

.skill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  color: var(--text);
  overflow-x: auto;
  display: block;
}

.skill-table th,
.skill-table td {
  padding: 6px 8px;
  border: 1px solid var(--border);
  text-align: left;
}

.skill-table th {
  background: var(--surface2);
  color: var(--orange-bright);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px;
  font-size: 11px;
}

.skill-table td {
  background: var(--surface);
  vertical-align: top;
}

