/* THE GAME - Intentionally chaotic styling */
/* Every section has a different vibe. This is by design. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #1a1a2e;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px);
  color: #c0c0c0;
  font-family: 'Courier New', monospace;
  overflow-x: hidden;
}

/* TITLE - pink on aqua, bold Times New Roman */
#game-title {
  font-family: 'Times New Roman', Times, serif;
  font-size: 22px;
  font-weight: bold;
  font-style: normal;
  color: #ff69b4;
  background: #00ffff;
  padding: 4px 12px;
  flex-shrink: 0;
}

/* MODAL STYLES */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #2a2a3a;
  border: 3px double #555;
  padding: 20px;
  max-width: 500px;
}

/* Game Branding */
.game-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.game-logo {
  width: 280px;
  height: auto;
  margin-bottom: 15px;
}

.game-logo.spinning {
  animation: spin 10s linear infinite;
  transition: animation-duration 0.5s ease;
  cursor: pointer;
}

.game-logo.spinning:hover {
  animation: spin 0.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.splash-text {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #8af;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(136, 170, 255, 0.5);
}

.save-slots-panel h3 {
  font-family: 'Courier New', monospace;
  color: #0f0;
  margin: 0 0 15px 0;
  font-size: 14px;
}

.slots-container {
  display: flex;
  gap: 10px;
}

.save-slot {
  background: #1a1a2a;
  border: 1px solid #444;
  padding: 10px;
  flex: 1;
  text-align: center;
}

.slot-header {
  font-family: Impact, sans-serif;
  font-size: 16px;
  color: #ff0;
  margin-bottom: 8px;
}

.slot-info {
  font-size: 10px;
  color: #888;
  min-height: 40px;
  margin-bottom: 8px;
}

.slot-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-buttons button {
  font-size: 10px;
  padding: 4px;
  background: #333;
  border: 1px solid #555;
  color: #aaa;
  cursor: pointer;
}

.slot-buttons button:hover {
  background: #444;
  color: #fff;
}

.danger-btn {
  background: #400 !important;
  border-color: #800 !important;
}

.danger-btn:hover {
  background: #600 !important;
}

.modal-actions {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-actions button {
  padding: 8px 12px;
  background: #444;
  border: 1px solid #666;
  color: #ddd;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}

.new-game-btn {
  background: #030 !important;
  border-color: #0a0 !important;
  color: #0f0 !important;
}

/* ENDING MODAL */
.ending-panel {
  text-align: center;
  max-width: 400px;
}

.ending-panel h2 {
  font-family: 'Georgia', serif;
  font-size: 28px;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
}

.ending-stats {
  text-align: left;
  font-size: 12px;
  margin: 20px 0;
  padding: 10px;
  background: #111;
  border: 1px dashed #444;
}

/* TOP BAR - mixed styles */
#top-bar {
  display: flex;
  align-items: stretch;
  padding: 0;
  background: linear-gradient(180deg, #3a3a4a 0%, #2a2a3a 100%);
  border-bottom: 2px groove #555;
  min-height: 36px;
  gap: 8px;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

#menu-btn {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  padding: 4px 8px;
  background: #c0c0c0;
  border: 2px outset #ddd;
  cursor: pointer;
  color: #000;
}

#menu-btn:active {
  border-style: inset;
}

.phase-indicator {
  font-family: 'Verdana', sans-serif;
  font-size: 11px;
  background: #000;
  padding: 3px 8px;
  border: 1px inset #333;
  color: #0ff;
}

.ticker {
  font-family: 'Lucida Console', monospace;
  font-size: 10px;
  color: #0f0;
  flex: 1;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  flex-shrink: 0;
}

.playtime {
  font-family: 'OCR A Extended', monospace;
  font-size: 11px;
  color: #aaa;
}

#alert-meter {
  width: 60px;
  height: 14px;
}

.alert-label {
  font-family: 'Impact', sans-serif;
  font-size: 10px;
  color: #f00;
}

/* GAME CONTAINER - 3 column layout */
#game-container {
  display: flex;
  gap: 8px;
  padding: 8px;
  height: calc(100vh - 72px);
  overflow: hidden;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 #222;
}

.left-col { flex: 0 0 280px; }
.middle-col { flex: 1; min-width: 260px; }
.right-col { flex: 0 0 240px; }

/* PANEL BASE */
.panel {
  padding: 8px;
  background: #252535;
  border: 1px solid #444;
  position: relative;
}

.panel[data-phase] {
  display: none;
}

.panel[data-phase].unlocked {
  display: block;
}

/* POWER PANEL - DOS style */
.power-panel {
  background: #000;
  border: 2px solid #0a0;
  font-family: 'Courier New', monospace;
  color: #0f0;
}

.dos-title {
  font-size: 11px;
  border-bottom: 1px dashed #0a0;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.power-display {
  text-align: center;
  margin: 10px 0;
}

.led-display {
  font-family: 'Digital-7', 'Courier New', monospace;
  font-size: 32px;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  letter-spacing: 2px;
}

.power-unit {
  font-size: 14px;
  margin-left: 4px;
}

.generators-list {
  max-height: 80px;
  overflow-y: auto;
  font-size: 10px;
  margin: 8px 0;
  padding: 4px;
  background: #001100;
  border: 1px solid #0a0;
}

.generator-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-bottom: 1px dotted #030;
}

.generator-item:last-child {
  border-bottom: none;
}

.generator-item button {
  font-size: 8px;
  padding: 1px 4px;
  background: #030;
  border: 1px solid #0a0;
  color: #0f0;
  cursor: pointer;
}

.power-controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.power-controls button {
  font-size: 10px;
  padding: 4px 8px;
  background: #020;
  border: 1px solid #0a0;
  color: #0f0;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}

.power-controls button:hover {
  background: #040;
}

.power-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ugly-toggle {
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ugly-toggle input {
  accent-color: #0f0;
}

.efficiency-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.efficiency-bar label {
  color: #0a0;
}

#power-efficiency {
  flex: 1;
  height: 10px;
  appearance: none;
  background: #001100;
  border: 1px solid #0a0;
}

#power-efficiency::-webkit-progress-bar {
  background: #001100;
}

#power-efficiency::-webkit-progress-value {
  background: #0f0;
}

#power-efficiency::-moz-progress-bar {
  background: #0f0;
}

/* MINING PANEL - ASCII box style */
.mining-panel {
  background: #1a1a1a;
  border: none;
  font-family: 'Consolas', monospace;
  color: #ff0;
}

.ascii-header {
  margin: 0;
  font-size: 12px;
  color: #aa0;
  text-align: center;
}

.depth-display {
  text-align: center;
  font-size: 12px;
  margin: 8px 0;
}

.depth-display input {
  width: 60px;
  background: #000;
  border: 1px inset #440;
  color: #ff0;
  font-family: 'Consolas', monospace;
  text-align: right;
  font-size: 12px;
}

.ore-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 11px;
}

.analog-gauge {
  flex: 1;
  height: 20px;
  background: linear-gradient(90deg, #110 0%, #330 50%, #550 100%);
  border: 2px inset #554;
  position: relative;
  border-radius: 2px;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #880 0%, #ff0 100%);
  width: 0%;
  transition: width 0.3s;
}

.gauge-needle {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 28px;
  background: #f00;
  left: 0%;
  transition: left 0.3s;
}

.drills-list {
  max-height: 60px;
  overflow-y: auto;
  font-size: 9px;
  background: #111;
  border: 1px solid #440;
  padding: 4px;
  margin: 6px 0;
}

.drill-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.mining-controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.mining-controls button {
  font-size: 9px;
  padding: 4px 6px;
  background: #332;
  border: 1px solid #554;
  color: #ff0;
  cursor: pointer;
}

.mining-controls button:hover {
  background: #443;
}

.mining-controls input[type="range"] {
  width: 60px;
  accent-color: #ff0;
}

#drill-speed-val {
  font-size: 10px;
  min-width: 16px;
}

/* PERSONNEL PANEL - Windows 95 table */
.personnel-panel {
  background: #c0c0c0;
  border: 2px outset #ddd;
  color: #000;
  font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, sans-serif;
}

.personnel-panel fieldset {
  border: 2px groove #aaa;
  margin: 0;
  padding: 6px;
}

.personnel-panel legend {
  font-size: 11px;
  font-weight: bold;
  color: #000080;
}

#workers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  background: #fff;
}

#workers-table th {
  background: #000080;
  color: #fff;
  padding: 2px 4px;
  text-align: left;
  font-weight: normal;
}

#workers-table td {
  border: 1px solid #808080;
  padding: 2px 4px;
}

#workers-table tr:nth-child(even) {
  background: #e0e0e0;
}

.personnel-controls {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.personnel-controls button {
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 10px;
  padding: 3px 8px;
  background: #c0c0c0;
  border: 2px outset #ddd;
  cursor: pointer;
}

.personnel-controls button:active {
  border-style: inset;
}

.personnel-controls select {
  font-size: 10px;
  padding: 2px;
}

.worker-stam {
  width: 40px;
  height: 8px;
  background: #800;
  display: inline-block;
  vertical-align: middle;
}

.worker-stam-fill {
  height: 100%;
  background: #0a0;
}

/* CREDITS PANEL - LCD calculator */
.credits-panel {
  background: #2a3a2a;
  border: 3px ridge #556;
  text-align: center;
  padding: 12px;
}

.lcd-display {
  background: #9ab;
  padding: 8px 12px;
  border: 2px inset #667;
  display: inline-block;
}

.lcd-label {
  display: block;
  font-size: 8px;
  color: #234;
  font-family: 'Arial Narrow', sans-serif;
  text-transform: uppercase;
}

.lcd-value {
  font-family: 'Digital-7', 'Courier New', monospace;
  font-size: 28px;
  color: #123;
  letter-spacing: 1px;
}

.credit-rate {
  margin-top: 6px;
  font-size: 10px;
  color: #8a8;
}

/* RESEARCH PANEL - Mixed styles */
.research-panel {
  background: #2a2a4a;
  border: 1px solid #448;
  font-family: 'Trebuchet MS', sans-serif;
  color: #aaf;
}

.research-panel details {
  margin: 0;
}

.research-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  padding: 4px;
  background: #336;
  margin: -8px -8px 8px -8px;
}

.research-current {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  margin-bottom: 6px;
}

#research-marquee {
  flex: 1;
  background: #112;
  color: #0ff;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  height: 18px;
}

#research-progress {
  width: 100%;
  height: 12px;
  appearance: none;
  background: #112;
  border: 1px solid #448;
}

#research-progress::-webkit-progress-bar {
  background: #112;
}

#research-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #00f, #0ff);
}

#research-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #00f, #0ff);
}

#research-percent {
  font-size: 10px;
  margin-left: 6px;
}

.tech-tree {
  border: 1px dashed #448;
  margin: 8px 0;
  padding: 6px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 10px;
}

.tech-tree legend {
  font-size: 9px;
  color: #88a;
}

.tech-option {
  display: block;
  padding: 3px 0;
  cursor: pointer;
}

.tech-option:hover {
  background: #334;
}

.tech-option input {
  margin-right: 6px;
  accent-color: #0ff;
}

.tech-option.completed {
  color: #4a4;
  text-decoration: line-through;
}

.research-points {
  text-align: right;
  font-size: 11px;
  color: #88f;
  margin-top: 4px;
}

/* ANOMALY PANEL - Radar style */
.anomaly-panel {
  background: #0a0a0a;
  border: 2px solid #333;
  text-align: center;
}

.anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 10px;
}

.blink-warning {
  color: #f00;
  font-weight: bold;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

#radar-canvas {
  background: radial-gradient(circle, #001a00 0%, #000 100%);
  border: 2px solid #0a0;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
}

#anomaly-log {
  width: 100%;
  background: #000;
  color: #0a0;
  border: 1px solid #030;
  font-family: 'Courier New', monospace;
  font-size: 8px;
  resize: none;
  margin-top: 6px;
}

.anomaly-energy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: #a0a;
}

.pulse-orb {
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #f0f 0%, #606 50%, #303 100%);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* CONTAINMENT PANEL - Industrial */
.containment-panel {
  background: #2a2020;
  border: 2px solid #a44;
  font-family: 'Arial Black', sans-serif;
}

.industrial-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #fa0;
  padding: 4px;
  background: repeating-linear-gradient(45deg, #330 0px, #330 10px, #220 10px, #220 20px);
  margin: -8px -8px 8px -8px;
}

.integrity-display {
  color: #f44;
}

.containment-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.containment-grid .cell {
  width: 33.33%;
  height: 50px;
  background: #1a1a1a;
  border: 2px solid #444;
  text-align: center;
  font-size: 10px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.containment-grid .cell:hover {
  border-color: #888;
}

.containment-grid .cell.occupied {
  background: #2a1a2a;
  color: #f0f;
  border-color: #a0a;
}

.containment-grid .cell.critical {
  animation: critical-flash 0.3s infinite;
}

@keyframes critical-flash {
  50% { background: #400; border-color: #f00; }
}

.containment-grid .cell.selected {
  box-shadow: 0 0 8px #ff0 inset;
}

.containment-controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.containment-controls button {
  font-size: 9px;
  padding: 4px 8px;
  border: 2px outset #666;
  cursor: pointer;
  font-family: 'Arial', sans-serif;
}

.capture-btn {
  background: #363;
  color: #0f0;
}

.purge-btn {
  background: #633;
  color: #f66;
}

.lockdown-btn {
  background: #663;
  color: #ff0;
}

.specimen-info {
  margin-top: 8px;
  padding: 6px;
  background: #111;
  border: 1px dashed #444;
  font-size: 9px;
  color: #888;
  min-height: 40px;
}

/* DEPTH PANEL - Vertical well */
.depth-panel {
  background: #1a1a10;
  border: 1px solid #554;
}

.depth-header {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #aa8;
  text-align: center;
  border-bottom: 1px solid #443;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.depth-well {
  position: relative;
  height: 180px;
  background: linear-gradient(180deg, #332 0%, #221 50%, #110 100%);
  border: 2px inset #443;
  margin: 0 20px;
}

.depth-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #654 0%, #432 100%);
  height: 0%;
  transition: height 0.5s;
}

.depth-markers {
  position: absolute;
  right: -65px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 7px;
  color: #665;
}

.depth-markers span {
  white-space: nowrap;
}

.strange-readings {
  margin-top: 8px;
  font-size: 9px;
  color: #a8a;
  font-style: italic;
  min-height: 20px;
}

/* DEFENSE PANEL - CRT military style */
.defense-panel {
  background: #0a0a0a;
  border: 2px solid #0a0;
  position: relative;
}

.defense-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.2) 2px,
    rgba(0,0,0,0.2) 4px
  );
  pointer-events: none;
}

.crt-effect {
  text-align: center;
  padding: 6px;
  background: #001100;
  margin: -8px -8px 8px -8px;
}

.flash-text {
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 0 5px #0f0;
}

.turrets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 8px 0;
}

.turret-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 8px;
  color: #0a0;
  padding: 6px;
  background: #001100;
  border: 1px solid #030;
  cursor: pointer;
}

.turret-toggle input {
  accent-color: #0f0;
  margin-bottom: 4px;
}

.turret-toggle:has(input:checked) {
  background: #003300;
  border-color: #0f0;
  box-shadow: 0 0 8px #0f0;
}

.ammo-display {
  font-size: 10px;
  color: #ff0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.ammo-display button {
  font-size: 8px;
  padding: 2px 6px;
  background: #330;
  border: 1px solid #550;
  color: #ff0;
  cursor: pointer;
}

.breach-alerts {
  min-height: 40px;
  background: #100;
  border: 1px solid #300;
  padding: 4px;
  font-size: 9px;
  margin: 6px 0;
}

.breach-alert {
  color: #f00;
  padding: 2px 0;
  animation: blink 0.3s infinite;
}

.siren-btn {
  width: 100%;
  padding: 8px;
  background: #600;
  border: 2px outset #800;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Impact', sans-serif;
  font-size: 12px;
}

.siren-btn:hover {
  background: #800;
}

.siren-btn:active {
  border-style: inset;
}

.siren-btn.active {
  animation: siren-flash 0.2s infinite;
}

@keyframes siren-flash {
  50% { background: #f00; }
}

.breaches-survived {
  font-size: 10px;
  color: #0a0;
  text-align: center;
  margin-top: 8px;
}

/* ESCAPE PANEL - Urgent */
.escape-panel {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 2px solid #888;
}

.escape-header {
  text-align: center;
  font-family: 'Georgia', serif;
  font-size: 11px;
  color: #fa0;
  padding: 6px;
  background: #333;
  margin: -8px -8px 8px -8px;
}

.escape-header blink {
  animation: blink 1s infinite;
}

.escape-checklist {
  font-size: 10px;
}

.escape-checklist label {
  display: block;
  padding: 4px 0;
  border-bottom: 1px dotted #333;
}

.escape-checklist label:has(input:checked) {
  color: #0f0;
  text-decoration: line-through;
}

.escape-checklist input {
  margin-right: 8px;
  accent-color: #0f0;
}

.launch-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 16px;
  font-family: 'Impact', sans-serif;
  background: linear-gradient(180deg, #666 0%, #333 100%);
  border: 3px outset #888;
  color: #888;
  cursor: not-allowed;
}

.launch-btn:enabled {
  background: linear-gradient(180deg, #0a0 0%, #060 100%);
  border-color: #0f0;
  color: #fff;
  cursor: pointer;
  animation: launch-ready 0.5s infinite;
}

@keyframes launch-ready {
  50% { box-shadow: 0 0 20px #0f0; }
}

/* TRANSCENDENCE PANEL - Glitchy */
.transcend-panel {
  background: #0a0010;
  border: 1px solid #a0f;
}

.transcend-header {
  text-align: center;
  padding: 8px;
  margin: -8px -8px 8px -8px;
  background: linear-gradient(90deg, #200020 0%, #400040 50%, #200020 100%);
}

.glitch-text {
  font-family: 'Courier New', monospace;
  color: #f0f;
  font-size: 12px;
  text-shadow: 2px 0 #0ff, -2px 0 #f00;
  animation: glitch 0.3s infinite;
}

@keyframes glitch {
  0% { text-shadow: 2px 0 #0ff, -2px 0 #f00; }
  25% { text-shadow: -2px 0 #0ff, 2px 0 #f00; }
  50% { text-shadow: 2px 2px #0ff, -2px -2px #f00; }
  75% { text-shadow: -2px 2px #0ff, 2px -2px #f00; }
}

.transcend-progress {
  height: 20px;
  background: #100010;
  border: 1px solid #606;
  margin: 8px 0;
}

.transcend-fill {
  height: 100%;
  background: linear-gradient(90deg, #606 0%, #f0f 50%, #606 100%);
  width: 0%;
  transition: width 0.3s;
}

.transcend-req {
  font-size: 9px;
  color: #808;
  text-align: center;
}

#merge-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #200020;
  border: 2px solid #a0a;
  color: #f0f;
  font-family: 'Courier New', monospace;
  cursor: not-allowed;
}

#merge-btn:enabled {
  cursor: pointer;
  animation: merge-ready 0.5s infinite;
}

@keyframes merge-ready {
  50% { background: #400040; box-shadow: 0 0 20px #f0f; }
}

/* BOTTOM BAR */
#bottom-bar {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: #2a2a3a;
  border-top: 2px groove #444;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
}

.status-lights {
  display: flex;
  gap: 4px;
}

.light {
  font-size: 8px;
  padding: 2px 6px;
  background: #222;
  border: 1px solid #333;
  color: #444;
  border-radius: 2px;
}

.light.green {
  background: #030;
  border-color: #0a0;
  color: #0f0;
  box-shadow: 0 0 4px #0f0;
}

.light.yellow {
  background: #330;
  border-color: #aa0;
  color: #ff0;
  box-shadow: 0 0 4px #ff0;
}

.light.red {
  background: #300;
  border-color: #a00;
  color: #f00;
  box-shadow: 0 0 4px #f00;
  animation: blink 0.5s infinite;
}

.message-area {
  flex: 1;
  font-size: 10px;
  color: #aaa;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.auto-save-indicator {
  font-size: 9px;
  color: #666;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border: 1px solid #333;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Worker row actions */
.worker-fire-btn {
  font-size: 7px;
  padding: 1px 3px;
  background: #c00;
  color: #fff;
  border: 1px solid #800;
  cursor: pointer;
}

.worker-role-select {
  font-size: 8px;
  width: 70px;
}

/* LEARNING PANEL TAB - 1.5x size */
.learning-tab {
  position: fixed;
  bottom: 40px;
  right: 0;
  width: 135px;
  background: #1a3a1a;
  border: 2px solid #2a5a2a;
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 100;
  transition: transform 0.2s, box-shadow 0.2s;
}

.learning-tab:hover {
  transform: translateX(-4px);
  background: #1f4a1f;
}

.learning-tab.glowing {
  animation: learning-glow 1.5s ease-in-out infinite;
}

@keyframes learning-glow {
  0%, 100% {
    box-shadow: 0 0 4px #4a4, 0 0 8px #2a2, inset 0 0 10px rgba(100, 200, 100, 0.2);
  }
  50% {
    box-shadow: 0 0 10px #6f6, 0 0 20px #4a4, 0 0 30px #2a2, inset 0 0 15px rgba(100, 200, 100, 0.4);
  }
}

.learning-icon {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.learning-label {
  font-family: 'Times New Roman', Times, serif;
  font-size: 21px;
  font-weight: bold;
  color: #c00;
  text-shadow: 1px 1px 0 #400, 1px 1px 2px rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

/* LEARNING PANEL SIDEBAR - dark green theme */
.learning-panel {
  position: fixed;
  top: 10%;
  right: -380px;
  width: 380px;
  height: 80vh;
  background: linear-gradient(180deg, #0a1f0a 0%, #051005 50%, #0a1a0a 100%);
  border: 3px solid #2a5a2a;
  border-right: none;
  border-radius: 12px 0 0 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease-in-out;
  box-shadow: -8px 0 25px rgba(0,0,0,0.9), inset 0 0 30px rgba(0, 50, 0, 0.3);
}

.learning-panel.open {
  right: 0;
}

/* Blackletter heading that overflows - Gothic pirate style */
.learning-blackletter {
  position: absolute;
  top: -35px;
  left: -20px;
  font-family: 'Blackletter', 'Old English Text MT', 'UnifrakturMaguntia', 'Luminari', 'MedievalSharp', 'Pirata One', cursive, fantasy;
  font-size: 28px;
  color: #8b1a1a;
  text-shadow:
    1px 1px 0 #2a0a0a,
    2px 2px 0 #1a0505,
    3px 3px 4px rgba(0,0,0,0.9),
    0 0 8px rgba(139, 26, 26, 0.5),
    0 0 20px rgba(80, 10, 10, 0.3);
  white-space: nowrap;
  z-index: 201;
  pointer-events: none;
  letter-spacing: 1px;
  font-weight: normal;
}

.learning-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  padding-top: 20px;
  background: linear-gradient(180deg, #1a3a1a 0%, #0d1f0d 100%);
  border-bottom: 2px solid #3a5a3a;
  border-radius: 9px 0 0 0;
}

.font-size-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-size-caption {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: 11px;
  color: #ffffff;
  margin-right: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.font-size-btn {
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, #8ad4ff 0%, #4ab8f0 30%, #2a98d0 70%, #1a78b0 100%);
  border: 1px solid #5ac8ff;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 -1px 2px rgba(0,0,0,0.2) inset,
    0 2px 4px rgba(0,0,0,0.3),
    0 0 8px rgba(100,200,255,0.3);
  text-shadow: 0 -1px 1px rgba(0,0,0,0.3);
}

.font-size-btn:hover {
  background: linear-gradient(180deg, #a0e0ff 0%, #60c8ff 30%, #40a8e0 70%, #2088c0 100%);
  border-color: #80d8ff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 -1px 2px rgba(0,0,0,0.2) inset,
    0 2px 6px rgba(0,0,0,0.3),
    0 0 12px rgba(120,210,255,0.5);
}

.font-size-btn:active {
  background: linear-gradient(180deg, #2a88c0 0%, #3a98d0 30%, #4aa8e0 70%, #6ac0f0 100%);
  box-shadow:
    0 -1px 0 rgba(255,255,255,0.2) inset,
    0 1px 2px rgba(0,0,0,0.3) inset,
    0 1px 2px rgba(0,0,0,0.2);
}

.learning-header h2 {
  display: none;
}

.learning-close {
  width: 28px;
  height: 28px;
  background: #1a0a0a;
  border: 2px solid #3a2a2a;
  color: #a44;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learning-close:hover {
  background: #2a1a1a;
  border-color: #5a3a3a;
  color: #f66;
}

.learning-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Georgia', serif;
  font-size: 11px;
  line-height: 1.5;
  color: #a0c0a0;
  background: linear-gradient(180deg, rgba(10, 30, 10, 0.5) 0%, rgba(5, 15, 5, 0.8) 100%);
}

.manual-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #2a4a2a;
}

.manual-section:last-child {
  border-bottom: none;
}

.manual-section h3 {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #b080d0;
  margin: 0 0 8px 0;
  padding: 4px 8px;
  background: #1a0a1a;
  border-left: 3px solid #8050a0;
  text-shadow: 0 0 6px rgba(160, 100, 200, 0.3);
}

.manual-section h4 {
  font-family: 'Arial', sans-serif;
  font-size: 10px;
  color: #c090e0;
  margin: 8px 0 6px 0;
  text-transform: uppercase;
  text-shadow: 0 0 4px rgba(180, 120, 220, 0.3);
}

.manual-section p {
  margin: 6px 0;
}

.manual-section ul,
.manual-section ol {
  margin: 6px 0;
  padding-left: 18px;
}

.manual-section li {
  margin: 3px 0;
}

.manual-section b {
  color: #c0e0c0;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 9px;
}

.manual-table th {
  background: #1a2a1a;
  color: #6a9a6a;
  padding: 4px 6px;
  text-align: left;
  border: 1px solid #2a4a2a;
  font-family: 'Courier New', monospace;
}

.manual-table td {
  padding: 4px 6px;
  border: 1px solid #2a4a2a;
  background: #0a150a;
}

.manual-table tr:nth-child(even) td {
  background: #0d1a0d;
}

.manual-tip {
  background: #0a1a1a;
  border-left: 2px solid #4a8aaa;
  padding: 6px 10px;
  margin: 8px 0;
  font-style: italic;
  color: #8ab8c8;
  font-size: 10px;
}

.manual-warning {
  background: #1a0a0a;
  border-left: 2px solid #aa4a4a;
  padding: 6px 10px;
  margin: 8px 0;
  font-weight: bold;
  color: #c88a8a;
  font-size: 10px;
}

/* Learning panel scrollbar */
.learning-content::-webkit-scrollbar {
  width: 8px;
}

.learning-content::-webkit-scrollbar-track {
  background: #050a05;
}

.learning-content::-webkit-scrollbar-thumb {
  background: #1a3a1a;
  border: 1px solid #2a5a2a;
}

.learning-content::-webkit-scrollbar-thumb:hover {
  background: #2a4a2a;
}

/* ============ DEBUG RANDOMIZER BUTTON SYSTEM ============ */

/* Debug Key - movable element */
.debug-key {
  position: fixed;
  width: 48px;
  height: 48px;
  cursor: pointer;
  z-index: 500;
  user-select: none;
  /* Default position - JS will override */
  right: 20px;
  top: 50px;
}

.debug-key:hover {
  filter: drop-shadow(0 0 8px #ffd700);
}

.debug-key.following {
  cursor: none;
  pointer-events: none;
}

.debug-key.hidden {
  display: none;
}

.key-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  pointer-events: none;
}

/* Move Key checkbox label */
.move-key-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  border: 2px solid #ffd700;
  padding: 4px 8px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11px;
  color: #ffd700;
  white-space: nowrap;
  cursor: pointer;
  z-index: 501;
  pointer-events: auto;
}

.move-key-label input[type="checkbox"] {
  margin-right: 4px;
  cursor: pointer;
}

/* Key Move Modal - black and yellow danger theme */
.key-move-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10001;
  justify-content: center;
  align-items: center;
}

.key-move-modal.active {
  display: flex;
}

.key-move-modal-content {
  background: #111;
  border: 4px solid #ffd700;
  padding: 30px 40px;
  text-align: center;
  box-shadow:
    0 0 40px #ffd700,
    0 0 80px rgba(255, 215, 0, 0.3),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.key-move-danger {
  font-family: 'Times New Roman', Times, serif;
  font-size: 28px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700, 0 0 20px #ff8c00;
  margin-bottom: 15px;
  animation: danger-pulse 1s ease-in-out infinite;
}

@keyframes danger-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.key-move-modal-content p {
  font-family: 'Times New Roman', Times, serif;
  font-size: 18px;
  color: #ccc;
  margin-bottom: 25px;
}

.key-move-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.key-move-buttons button {
  font-family: 'Times New Roman', Times, serif;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 30px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s;
}

.key-move-buttons button:first-child {
  background: #ffd700;
  border-color: #ffaa00;
  color: #000;
}

.key-move-buttons button:first-child:hover {
  background: #ffea00;
  box-shadow: 0 0 15px #ffd700;
}

.key-move-buttons button:last-child {
  background: #333;
  border-color: #555;
  color: #aaa;
}

.key-move-buttons button:last-child:hover {
  background: #444;
  color: #fff;
}

/* Debug Randomizer Button Container - bottom left */
.drb-container {
  position: fixed;
  bottom: 50px;
  left: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  z-index: 50;
}

/* The Debug Randomizer Button itself */
.debug-randomizer-btn {
  position: relative;
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 12px 20px;
  background: linear-gradient(180deg, #e87a1a 0%, #cc5500 50%, #993d00 100%);
  border: 3px solid #ff8c00;
  border-radius: 8px;
  color: #fff;
  text-shadow: 1px 1px 2px #000, 0 0 5px #000;
  cursor: pointer;
  box-shadow:
    0 4px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.debug-randomizer-btn:hover:not(.locked):not(:disabled) {
  background: linear-gradient(180deg, #ff9933 0%, #e87a1a 50%, #cc5500 100%);
  transform: translateY(-2px);
  box-shadow:
    0 6px 12px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.2);
}

.debug-randomizer-btn:active:not(.locked):not(:disabled) {
  transform: translateY(0);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Locked state */
.debug-randomizer-btn.locked {
  background: linear-gradient(180deg, #666 0%, #444 50%, #333 100%);
  border-color: #555;
  color: #888;
  cursor: not-allowed;
}

.debug-randomizer-btn.locked .lock-overlay {
  display: block;
}

.debug-randomizer-btn.permanently-locked {
  opacity: 0.5;
}

/* Lock icon overlay */
.lock-overlay {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
  pointer-events: none;
}

/* Drop zone highlight when dragging key over */
.debug-randomizer-btn.drop-target {
  border-color: #ffd700;
  background: linear-gradient(180deg, #ffaa00 0%, #cc7700 50%, #aa5500 100%) !important;
  box-shadow:
    0 0 30px #ffd700,
    0 0 60px #ff8c00,
    0 4px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.5);
  animation: drop-pulse 0.3s ease-in-out infinite;
  transform: scale(1.05);
}

@keyframes drop-pulse {
  0%, 100% { box-shadow: 0 0 25px #ffd700, 0 0 50px #ff8c00, 0 4px 8px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 40px #ffd700, 0 0 80px #ff8c00, 0 4px 8px rgba(0,0,0,0.4); }
}

/* Warning text next to button */
.drb-warning {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #ff4444;
  font-style: italic;
  text-shadow: 0 0 5px #ff0000;
  animation: warning-pulse 1s ease-in-out infinite;
}

@keyframes warning-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Debug Confirmation Popup */
.debug-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.debug-popup.active {
  display: flex;
}

.debug-popup-content {
  background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
  border: 4px double #cc5500;
  border-radius: 12px;
  padding: 30px 40px;
  max-width: 450px;
  text-align: center;
  box-shadow:
    0 0 30px rgba(255, 100, 0, 0.5),
    inset 0 0 20px rgba(0,0,0,0.5);
}

.debug-popup-content p {
  font-family: 'Georgia', serif;
  font-size: 16px;
  color: #ffcc88;
  margin: 0 0 25px 0;
  line-height: 1.6;
  text-shadow: 0 1px 2px #000;
}

.debug-popup-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.debug-popup-buttons button {
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.debug-popup-buttons button:first-child {
  background: linear-gradient(180deg, #cc3300 0%, #991100 100%);
  border: 2px solid #ff4400;
  color: #fff;
}

.debug-popup-buttons button:first-child:hover {
  background: linear-gradient(180deg, #ff4400 0%, #cc3300 100%);
}

.debug-popup-buttons button:last-child {
  background: linear-gradient(180deg, #444 0%, #222 100%);
  border: 2px solid #666;
  color: #aaa;
}

.debug-popup-buttons button:last-child:hover {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  color: #fff;
}

/* Cheat Mode Bouncing Floater - cursive transparent text */
.cheat-mode-floater {
  position: fixed;
  z-index: 9997;
  font-family: 'Brush Script MT', 'Segoe Script', 'Bradley Hand', 'Lucida Handwriting', cursive;
  font-size: 42px;
  font-style: italic;
  color: rgba(255, 100, 100, 0.35);
  text-shadow:
    0 0 10px rgba(255, 50, 50, 0.3),
    0 0 20px rgba(255, 0, 0, 0.2),
    2px 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 2px;
  animation: cheat-text-wiggle 2s ease-in-out infinite;
}

@keyframes cheat-text-wiggle {
  0%, 100% {
    transform: rotate(-2deg) scale(1);
    opacity: 0.35;
  }
  25% {
    transform: rotate(1deg) scale(1.02);
    opacity: 0.4;
  }
  50% {
    transform: rotate(-1deg) scale(0.98);
    opacity: 0.3;
  }
  75% {
    transform: rotate(2deg) scale(1.01);
    opacity: 0.38;
  }
}

/* ============ KONATA PANEL ============ */

/* Konata Tab - in top bar, left of TIME */
.konata-tab {
  background: repeating-linear-gradient(
    45deg,
    #4a90d9,
    #4a90d9 8px,
    #ffffff 8px,
    #ffffff 16px
  );
  padding: 4px 12px;
  cursor: pointer;
  border: 2px solid #2060a0;
  border-radius: 4px;
  margin-right: 10px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.konata-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(74, 144, 217, 0.5);
}

.konata-tab-text {
  font-family: 'Comic Sans MS', 'Chalkboard', cursive;
  font-size: 12px;
  font-weight: bold;
  color: #1a4a80;
  text-shadow: 1px 1px 0 #fff;
}

/* Konata Panel - drops from top */
.konata-panel {
  position: fixed;
  top: -500px;
  right: 60px;
  width: 320px;
  background: repeating-linear-gradient(
    45deg,
    #4a90d9,
    #4a90d9 10px,
    #ffffff 10px,
    #ffffff 20px
  );
  border: 4px solid #2060a0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow:
    0 8px 25px rgba(0,0,0,0.5),
    inset 0 0 20px rgba(255,255,255,0.3);
  z-index: 800;
  transition: top 0.4s ease-out;
  overflow: hidden;
  pointer-events: none;
}

.konata-panel.open {
  top: 36px;
  pointer-events: auto;
}

.konata-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, #2060a0 0%, #1a4a80 100%);
  border-bottom: 2px solid #4a90d9;
}

.konata-title {
  font-family: 'Comic Sans MS', 'Chalkboard', cursive;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 0 #1a4a80;
}

.konata-buttons {
  display: flex;
  gap: 8px;
}

.konata-btn {
  background: linear-gradient(180deg, #fff 0%, #ddd 100%);
  border: 2px solid #4a90d9;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.konata-btn:hover {
  background: linear-gradient(180deg, #4a90d9 0%, #2060a0 100%);
  transform: scale(1.1);
}

.konata-image-container {
  padding: 15px;
  background: rgba(255,255,255,0.9);
  margin: 10px;
  border-radius: 8px;
  border: 3px solid #4a90d9;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.konata-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* ============ SPECIAL EFFECTS ============ */

/* Screen shake effect */
@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5px, -3px); }
  20% { transform: translate(5px, 3px); }
  30% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  50% { transform: translate(-3px, 3px); }
  60% { transform: translate(3px, -3px); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -1px); }
  90% { transform: translate(-1px, 1px); }
}

body.screen-shake {
  animation: screen-shake 0.5s ease-out;
}

/* Glitch effect */
@keyframes glitch-anim {
  0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
  20% { clip-path: inset(92% 0 1% 0); transform: translate(2px, -2px); }
  40% { clip-path: inset(43% 0 1% 0); transform: translate(-1px, 1px); }
  60% { clip-path: inset(25% 0 58% 0); transform: translate(1px, -1px); }
  80% { clip-path: inset(54% 0 7% 0); transform: translate(-2px, 2px); }
  100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -2px); }
}

.glitch-effect {
  position: relative;
}

.glitch-effect::before,
.glitch-effect::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
}

.glitch-effect::before {
  color: #ff0000;
  animation: glitch-anim 0.3s infinite linear alternate-reverse;
  z-index: -1;
}

.glitch-effect::after {
  color: #00ffff;
  animation: glitch-anim 0.3s infinite linear alternate;
  animation-delay: 0.15s;
  z-index: -1;
}

/* Flash effect overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  background: white;
  pointer-events: none;
  opacity: 0;
  z-index: 99999;
}

.flash-overlay.active {
  animation: flash-anim 0.3s ease-out;
}

@keyframes flash-anim {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* Red alert flash */
.flash-overlay.red {
  background: #ff0000;
}

.flash-overlay.red.active {
  animation: flash-red-anim 0.5s ease-out;
}

@keyframes flash-red-anim {
  0% { opacity: 0.5; }
  50% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* Particle container */
.particle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes particle-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes particle-explode {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* CRT flicker effect for breach */
@keyframes crt-flicker {
  0% { opacity: 1; }
  3% { opacity: 0.8; }
  6% { opacity: 1; }
  7% { opacity: 0.9; }
  8% { opacity: 1; }
  9% { opacity: 0.7; }
  10% { opacity: 1; }
  100% { opacity: 1; }
}

body.crt-flicker {
  animation: crt-flicker 0.15s ease-in-out;
}

/* ============ ACHIEVENEMNTS PANEL ============ */

/* Achievenemnts Tab */
.achievements-tab {
  background: linear-gradient(180deg, #ffd700 0%, #b8860b 100%);
  padding: 4px 12px;
  cursor: pointer;
  border: 2px solid #8b6914;
  border-radius: 4px;
  margin-right: 10px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.achievements-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.5);
}

.achievements-tab-text {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 11px;
  color: #3a2a00;
  text-shadow: 1px 1px 0 #ffd700;
}

/* Achievenemnts Panel */
.achievements-panel {
  position: fixed;
  top: -600px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-height: 70vh;
  background: linear-gradient(180deg, #2a2a1a 0%, #1a1a0a 100%);
  border: 4px solid #ffd700;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow:
    0 8px 25px rgba(0,0,0,0.7),
    0 0 30px rgba(255, 215, 0, 0.3),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
  z-index: 850;
  transition: top 0.4s ease-out;
  overflow: hidden;
  pointer-events: none;
}

.achievements-panel.open {
  top: 36px;
  pointer-events: auto;
}

.achievements-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(180deg, #ffd700 0%, #b8860b 100%);
  border-bottom: 3px solid #8b6914;
}

.achievements-title {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 20px;
  color: #2a1a00;
  text-shadow: 1px 1px 0 #ffea00;
  letter-spacing: 2px;
}

.achievements-count {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #3a2a00;
  background: rgba(0,0,0,0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.achievements-close {
  background: linear-gradient(180deg, #aa0000 0%, #660000 100%);
  border: 2px solid #ff0000;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
}

.achievements-close:hover {
  background: linear-gradient(180deg, #ff0000 0%, #aa0000 100%);
  transform: scale(1.1);
}

.achievements-list {
  padding: 15px;
  max-height: calc(70vh - 60px);
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  border: 2px solid #444;
  border-radius: 8px;
  transition: all 0.2s;
}

.achievement-item.unlocked {
  border-color: #ffd700;
  background: linear-gradient(180deg, rgba(255,215,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
}

.achievement-item.locked {
  opacity: 0.5;
  filter: grayscale(80%);
}

.achievement-icon {
  width: 40px;
  height: 40px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  border: 2px solid #666;
}

.achievement-item.unlocked .achievement-icon {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

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

.achievement-name {
  font-family: 'Arial Black', sans-serif;
  font-size: 12px;
  color: #ffd700;
  margin-bottom: 2px;
}

.achievement-item.locked .achievement-name {
  color: #888;
}

.achievement-desc {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #aaa;
}

/* Achievement unlock notification */
.achievement-notification {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(180deg, #2a2a1a 0%, #1a1a0a 100%);
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.5s ease-out;
  box-shadow:
    0 0 30px rgba(255, 215, 0, 0.5),
    0 8px 25px rgba(0,0,0,0.5);
}

.achievement-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.achievement-notification-icon {
  font-size: 36px;
}

.achievement-notification-text {
  display: flex;
  flex-direction: column;
}

.achievement-notification-label {
  font-family: 'Impact', sans-serif;
  font-size: 12px;
  color: #ffd700;
  letter-spacing: 2px;
}

.achievement-notification-name {
  font-family: 'Arial Black', sans-serif;
  font-size: 16px;
  color: #fff;
}

/* ============ ICON BUTTONS (Top Bar) ============ */
/* Chiseled square stone style */

.icon-btn {
  background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 100%);
  border: none;
  border-top: 2px solid #555;
  border-left: 2px solid #444;
  border-right: 2px solid #111;
  border-bottom: 2px solid #000;
  border-radius: 0;
  font-size: 18px;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-right: 1px;
  cursor: pointer;
  transition: all 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.1), inset -1px -1px 0 rgba(0,0,0,0.3);
}

.icon-btn:hover {
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  border-top-color: #666;
  border-left-color: #555;
}

.icon-btn:active {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border-top: 2px solid #111;
  border-left: 2px solid #111;
  border-right: 2px solid #444;
  border-bottom: 2px solid #555;
  box-shadow: inset -1px -1px 0 rgba(255,255,255,0.1), inset 1px 1px 0 rgba(0,0,0,0.3);
}

/* Bonus Layer button - hidden by default */
#bonus-layer-btn {
  display: none;
}

#bonus-layer-btn.visible {
  display: inline-flex;
}

/* ============ BONUS LAYER SYSTEM ============ */
/*
 * Architecture: Bonus layers are BEHIND everything.
 * When activated, the game content compacts upward into the top bar,
 * and the bottom bar slides up to sit just below the top bar.
 * This reveals the bonus layers underneath.
 *
 * Z-index stack (bottom to top):
 * -10: Future bonus layers (deeper)
 * -5: Psyche layer (first bonus layer)
 * 1: Game container (normal content)
 * 10: Bottom bar
 * 20: Top bar
 * Higher: Modals, panels, popups
 */

/* Wrapper for game content that will be compacted */
.game-content-wrapper {
  position: relative;
  z-index: 1;
}

/* The Psyche bonus layer - always present, revealed by compacting */
.bonus-layer {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -5;
  overflow: hidden;
}

/* Individual layer backgrounds */
.bonus-layer-psyche {
  position: absolute;
  inset: 0;
  background-image: url('assets/backgrounds/psyche.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

/* Darkening overlay for psyche layer */
.bonus-layer-psyche::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* Content container for each layer */
.bonus-layer-content {
  position: absolute;
  /* Start below the Surface Layer's bottom bar when compacted */
  top: 0;
  left: 0;
  right: 0;
  /* Leave room for future Psyche Layer bottom bar */
  bottom: 28px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  /* Extra top padding to push content below Surface Layer's bottom bar */
  padding: 38px 8px 8px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out 0.3s;
}

.bonus-layer.active .bonus-layer-content {
  opacity: 1;
  pointer-events: auto;
}

/* Future: Psyche Layer top bar placeholder (where Surface bottom bar sits) */
.bonus-layer-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  /* This area is covered by Surface Layer's bottom bar when compacted */
}

/* Future: Psyche Layer bottom bar (golden yellow) */
.bonus-layer-bottombar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(180deg, #c9a227 0%, #8b7317 100%);
  border-top: 2px groove #ffd700;
  display: none; /* Hidden until implemented */
}

/* Game container compacting animation */
#game-container {
  position: relative;
  z-index: 1;
  /* Give game container its own background to cover psyche layer */
  background: #1a1a2e;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease-out;
  overflow: hidden;
}

#game-container.compacting {
  height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Bottom bar animation - moves up when compacting */
#bottom-bar {
  z-index: 10;
  transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#bottom-bar.compacted {
  top: 36px;
  bottom: auto;
}

/* Top bar stays fixed at top */
#top-bar {
  position: relative;
  z-index: 20;
}

/* ============ PSYCHE LAYER MINIGAME - PYRAMID OF PROVIDENCE ============ */

.psyche-game-container {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 900px;
  height: 100%;
  max-height: calc(100vh - 150px);
}

/* Shared panel styling - Egyptian theme */
.psyche-pyramid-panel,
.psyche-control-panel {
  background: linear-gradient(180deg, #1a1510 0%, #0d0a08 100%);
  border: 2px solid #b8860b;
  box-shadow:
    0 0 20px rgba(184, 134, 11, 0.3),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  font-family: 'Courier New', monospace;
}

/* Hieroglyph decorations */
.hieroglyph {
  font-size: 14px;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700;
}

/* Left Panel: Pyramid Grid */
.psyche-pyramid-panel {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
}

.psyche-panel-header {
  background: linear-gradient(180deg, #2a2010 0%, #1a1508 100%);
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 2px;
  border-bottom: 1px solid #b8860b;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Pyramid Grid Container */
.pyramid-grid-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(184, 134, 11, 0.1) 0%, transparent 70%);
}

.pyramid-level {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 4px 0;
}

.pyramid-capstone {
  margin-bottom: 8px;
}

.pyramid-capstone .pyramid-node {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4a3a10 0%, #2a2008 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.pyramid-node {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2a2010 0%, #1a1508 100%);
  border: 2px solid #8b7355;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.pyramid-node:hover {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  transform: scale(1.1);
}

.pyramid-node.locked {
  opacity: 0.3;
  cursor: not-allowed;
}

.pyramid-node.locked:hover {
  transform: none;
  box-shadow: none;
}

.pyramid-node.has-symbol {
  background: linear-gradient(135deg, #3a2a10 0%, #2a1a08 100%);
  border-color: #daa520;
}

.pyramid-node.pattern-active {
  animation: pattern-glow 1s ease-in-out infinite;
}

@keyframes pattern-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.9), 0 0 40px rgba(255, 215, 0, 0.4); }
}

.node-symbol {
  font-size: 18px;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

.pyramid-capstone .node-symbol {
  font-size: 24px;
}

/* Sacred geometry SVG overlay */
.pyramid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
}

/* Pattern Status */
.pyramid-pattern-status {
  padding: 8px;
  text-align: center;
  font-size: 10px;
  color: #b8860b;
  border-top: 1px solid #3a2a10;
  background: rgba(0, 0, 0, 0.3);
}

/* Right Panel: Controls */
.psyche-control-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
}

/* Resources */
.psyche-resources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.psyche-resource {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(90deg, rgba(184, 134, 11, 0.1) 0%, transparent 100%);
  border-left: 3px solid #b8860b;
}

.resource-icon {
  font-size: 16px;
  color: #ffd700;
  width: 20px;
  text-align: center;
}

.resource-name {
  font-size: 9px;
  color: #8b7355;
  letter-spacing: 1px;
  flex: 1;
}

.resource-value {
  font-size: 14px;
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.alignment-resource {
  flex-wrap: wrap;
}

.alignment-bar {
  width: 100%;
  height: 6px;
  background: #1a1510;
  border: 1px solid #5a4a30;
  margin-top: 4px;
}

.alignment-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b0000 0%, #ffd700 50%, #228b22 100%);
  width: 50%;
  transition: width 0.3s;
}

/* Enlightenment */
.psyche-enlightenment {
  background: linear-gradient(180deg, #2a2010 0%, #1a1508 100%);
  border: 1px solid #b8860b;
  padding: 10px;
  text-align: center;
}

.enlightenment-header {
  font-size: 10px;
  color: #ffd700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.enlightenment-bar {
  height: 12px;
  background: #0d0a08;
  border: 1px solid #5a4a30;
  position: relative;
  overflow: hidden;
}

.enlightenment-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b8860b, #ffd700, #fff8dc);
  transition: width 0.5s;
  box-shadow: 0 0 10px #ffd700;
}

.enlightenment-value {
  font-size: 12px;
  color: #ffd700;
  margin-top: 4px;
  display: block;
}

/* Symbol Palette */
.psyche-symbols {
  border: 1px solid #5a4a30;
  background: rgba(0, 0, 0, 0.3);
}

.symbols-header,
.spells-header {
  font-size: 9px;
  color: #8b7355;
  padding: 6px 8px;
  border-bottom: 1px solid #3a2a10;
  letter-spacing: 1px;
  text-align: center;
}

.symbols-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
}

.symbol-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  background: linear-gradient(180deg, #2a2010 0%, #1a1508 100%);
  border: 1px solid #5a4a30;
  cursor: pointer;
  transition: all 0.2s;
}

.symbol-slot.locked {
  opacity: 0.4;
}

.symbol-slot.unlocked:hover {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.symbol-slot.selected {
  border-color: #ffd700;
  background: linear-gradient(180deg, #3a3010 0%, #2a2008 100%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.symbol-icon {
  font-size: 20px;
  color: #ffd700;
}

.symbol-slot.locked .symbol-icon {
  color: #5a4a30;
}

.symbol-name {
  font-size: 7px;
  color: #8b7355;
  margin-top: 2px;
}

.symbol-cost {
  font-size: 7px;
  color: #b8860b;
  margin-top: 1px;
}

/* Spells */
.psyche-spells {
  border: 1px solid #5a4a30;
  background: rgba(0, 0, 0, 0.3);
}

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

.spell-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: linear-gradient(180deg, #1a1020 0%, #0d0810 100%);
  border: 1px solid #4a3060;
  color: #9370db;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Courier New', monospace;
}

.spell-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.spell-btn.unlocked:hover {
  border-color: #9370db;
  box-shadow: 0 0 10px rgba(147, 112, 219, 0.5);
  background: linear-gradient(180deg, #2a1830 0%, #1a1020 100%);
}

.spell-btn:active:not(.locked) {
  transform: scale(0.95);
}

.spell-icon {
  font-size: 16px;
}

.spell-name {
  font-size: 8px;
  margin-top: 2px;
}

/* Stats */
.psyche-stats {
  margin-top: auto;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a2a10;
  font-size: 9px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  color: #8b7355;
  padding: 2px 0;
}

.stat-row span:last-child {
  color: #b8860b;
}

/* Psyche Message Display */
.psyche-message {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #2a2010 0%, #1a1508 100%);
  border: 2px solid #ffd700;
  padding: 10px 20px;
  color: #ffd700;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 100;
}

.psyche-message.visible {
  opacity: 1;
  visibility: visible;
}

/* Pyramid Node Symbol Display */
.pyramid-node .symbol-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 16px;
}

.pyramid-node .symbol-slot.filled {
  animation: symbolPulse 2s ease-in-out infinite;
}

@keyframes symbolPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.pyramid-node.locked {
  opacity: 0.3;
  cursor: not-allowed;
}

.pyramid-node.locked .symbol-slot {
  pointer-events: none;
}

/* Spell Cooldown */
.spell-btn.cooldown {
  opacity: 0.5;
  cursor: wait;
}

.spell-btn.cooldown::after {
  content: '⏳';
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
}

/* ============ SETTINGS PANEL ============ */

.settings-panel {
  position: fixed;
  top: -400px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  background: #3a3a3a;
  z-index: 9500;
  transition: top 0.4s ease-out;
  /* Construction border - orange and black stripes */
  border: 8px solid;
  border-image: repeating-linear-gradient(
    -45deg,
    #ff8c00,
    #ff8c00 10px,
    #111 10px,
    #111 20px
  ) 8;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,0,0,0.3);
}

.settings-panel.open {
  top: 36px;
}

.settings-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
  border-bottom: 2px solid #555;
}

/* 3D Cursive Settings Title */
.settings-title {
  font-family: 'Brush Script MT', 'Segoe Script', 'Bradley Hand', cursive;
  font-size: 36px;
  color: #fff;
  text-shadow:
    1px 1px 0 #ff8c00,
    2px 2px 0 #cc7000,
    3px 3px 0 #995300,
    4px 4px 0 #663800,
    5px 5px 10px rgba(0,0,0,0.5);
  letter-spacing: 2px;
}

.settings-tiger {
  height: 50px;
  width: auto;
  margin-left: 4px;
  vertical-align: middle;
}

.settings-close {
  background: #333;
  border: 2px solid #555;
  border-radius: 4px;
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-close:hover {
  background: #c00;
  border-color: #f00;
}

.settings-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Stylized Checkbox Options */
.settings-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 2px solid #444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.settings-option:hover {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-color: #ff8c00;
}

.settings-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-option.disabled:hover {
  border-color: #444;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

.settings-option input[type="checkbox"] {
  display: none;
}

/* Custom Checkbox */
.settings-checkbox {
  width: 24px;
  height: 24px;
  background: #111;
  border: 3px solid #555;
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}

.settings-option:hover .settings-checkbox {
  border-color: #888;
}

.settings-option.disabled .settings-checkbox {
  background: #222;
  border-color: #333;
}

/* Checkbox checked state */
.settings-option input[type="checkbox"]:checked + .settings-checkbox {
  background: linear-gradient(135deg, #ff8c00 0%, #cc7000 100%);
  border-color: #ffaa00;
}

.settings-option input[type="checkbox"]:checked + .settings-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.settings-label {
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #ddd;
  flex-grow: 1;
}

.settings-hint {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #888;
  font-style: italic;
}

/* ============ SECRET SETTINGS PANEL ============ */
/* Minimalist early computer styling - only shades of orange */

.secret-settings-panel {
  position: fixed;
  top: -200px;
  left: calc(50% - 420px);
  width: 180px;
  background: #1a0a00;
  border: 2px solid #804000;
  z-index: 9499;
  transition: top 0.4s ease-out;
  font-family: monospace;
}

.secret-settings-panel.open {
  top: 36px;
}

.secret-settings-header {
  background: #804000;
  color: #ff8c00;
  font-size: 9px;
  padding: 4px 6px;
  text-align: center;
  letter-spacing: 1px;
}

/* Disabled state for secret options */
.secret-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.secret-option.disabled input {
  cursor: not-allowed;
}

.secret-settings-content {
  padding: 8px;
}

.secret-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
}

.secret-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #0a0500;
  border: 1px solid #663300;
  cursor: pointer;
  flex-shrink: 0;
}

.secret-option input[type="checkbox"]:checked {
  background: #cc6600;
  border-color: #ff8c00;
}

.secret-option span {
  font-size: 10px;
  color: #cc6600;
}

.secret-option:hover span {
  color: #ff8c00;
}

.secret-link {
  display: block;
  font-size: 10px;
  color: #993300;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 0 2px 0;
  margin-top: 4px;
  border-top: 1px solid #331100;
}

.secret-link:hover {
  color: #ff4400;
}

/* ============ CHEAT MODE EFFECTS SYSTEM ============ */

/* Eye toggle button */
.cheat-effects-toggle {
  background: linear-gradient(180deg, #ff4444 0%, #aa0000 100%);
  padding: 4px 10px;
  cursor: pointer;
  border: 2px solid #ff0000;
  border-radius: 4px;
  margin-right: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  font-size: 14px;
}

.cheat-effects-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.cheat-effects-toggle.disabled {
  background: linear-gradient(180deg, #666 0%, #333 100%);
  border-color: #555;
  opacity: 0.7;
}

/* Containers */
.cheat-popups-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}

.cheat-floaters-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8999;
}

/* ============================================================
   CHEAT MODE POPUPS - Each one COMPLETELY different
   ============================================================ */

/* POPUP TYPE 1: Windows 95 BSOD style */
.cheat-popup.red {
  position: absolute;
  pointer-events: auto;
  background: #0000aa;
  color: #fff;
  font-family: 'Lucida Console', 'Courier New', monospace;
  font-size: 13px;
  padding: 0;
  border: none;
  min-width: 320px;
  box-shadow: 5px 5px 0 #000;
}
.cheat-popup.red .cheat-popup-header {
  background: #aaa;
  color: #0000aa;
  padding: 2px 4px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}
.cheat-popup.red .cheat-popup-icon { display: none; }
.cheat-popup.red .cheat-popup-title::before { content: '✕ '; }
.cheat-popup.red .cheat-popup-close {
  background: #c0c0c0;
  border: 2px outset #fff;
  color: #000;
  font-size: 10px;
  padding: 0 4px;
  cursor: pointer;
}
.cheat-popup.red .cheat-popup-content {
  padding: 20px;
  text-align: center;
  line-height: 1.6;
}

/* POPUP TYPE 2: Hazard tape industrial */
.cheat-popup.yellow {
  position: absolute;
  pointer-events: auto;
  background: repeating-linear-gradient(45deg, #000, #000 20px, #ffd700 20px, #ffd700 40px);
  padding: 4px;
  border: none;
}
.cheat-popup.yellow .cheat-popup-header {
  display: none;
}
.cheat-popup.yellow .cheat-popup-content {
  background: #1a1a1a;
  color: #ffd700;
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  padding: 15px 25px;
  text-align: center;
  letter-spacing: 2px;
}
.cheat-popup.yellow::after {
  content: '⚠';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  filter: drop-shadow(0 0 5px #ffd700);
}

/* POPUP TYPE 3: Matrix terminal */
.cheat-popup.glitch {
  position: absolute;
  pointer-events: auto;
  background: #0a0a0a;
  border: 1px solid #0f0;
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 0;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3), inset 0 0 50px rgba(0, 255, 0, 0.05);
  animation: glitch-jitter 0.1s infinite;
}
.cheat-popup.glitch .cheat-popup-header {
  background: #0f0;
  color: #000;
  padding: 2px 6px;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
}
.cheat-popup.glitch .cheat-popup-icon { display: none; }
.cheat-popup.glitch .cheat-popup-title::before { content: 'root@system:~# '; }
.cheat-popup.glitch .cheat-popup-close {
  background: none;
  border: none;
  color: #000;
  font-weight: bold;
  cursor: pointer;
}
.cheat-popup.glitch .cheat-popup-content {
  padding: 10px;
  text-shadow: 0 0 5px #0f0;
}
.cheat-popup.glitch .cheat-popup-content::before {
  content: '> ';
  opacity: 0.7;
}
@keyframes glitch-jitter {
  0%, 95% { transform: translate(0); }
  96% { transform: translate(-2px, 1px); }
  98% { transform: translate(1px, -1px); }
}

/* POPUP TYPE 4: Retro Mac System 7 */
.cheat-popup.retro {
  position: absolute;
  pointer-events: auto;
  background: #ddd;
  border: 2px solid #000;
  border-radius: 0;
  padding: 0;
  font-family: 'Chicago', 'Geneva', 'Helvetica', sans-serif;
  font-size: 12px;
  box-shadow: 2px 2px 0 #000, inset -1px -1px 0 #888, inset 1px 1px 0 #fff;
}
.cheat-popup.retro .cheat-popup-header {
  background: repeating-linear-gradient(90deg, #000 0px, #000 1px, #ddd 1px, #ddd 3px);
  padding: 3px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cheat-popup.retro .cheat-popup-icon {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid #000;
  font-size: 0;
}
.cheat-popup.retro .cheat-popup-title {
  background: #ddd;
  padding: 0 10px;
  font-weight: bold;
}
.cheat-popup.retro .cheat-popup-close {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid #000;
  font-size: 8px;
  line-height: 10px;
  text-align: center;
  cursor: pointer;
}
.cheat-popup.retro .cheat-popup-content {
  padding: 15px;
  color: #000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.cheat-popup.retro .cheat-popup-content::before {
  content: '⚠';
  font-size: 32px;
}

/* POPUP TYPE 5: Blood drip horror */
.cheat-popup.creepy {
  position: absolute;
  pointer-events: auto;
  background: linear-gradient(180deg, #1a0505 0%, #0a0202 100%);
  border: none;
  border-top: 3px solid #8b0000;
  padding: 0;
  font-family: 'Times New Roman', serif;
  min-width: 250px;
  box-shadow: 0 10px 30px rgba(139, 0, 0, 0.5);
}
.cheat-popup.creepy .cheat-popup-header {
  display: none;
}
.cheat-popup.creepy .cheat-popup-content {
  color: #8b0000;
  font-size: 20px;
  font-style: italic;
  padding: 25px;
  text-align: center;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #8b0000;
  animation: creepy-pulse 2s infinite;
}
.cheat-popup.creepy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  width: 8px;
  height: 40px;
  background: linear-gradient(180deg, #8b0000 0%, transparent 100%);
  border-radius: 0 0 50% 50%;
}
.cheat-popup.creepy::after {
  content: '';
  position: absolute;
  top: 0;
  right: 30%;
  width: 5px;
  height: 25px;
  background: linear-gradient(180deg, #8b0000 0%, transparent 100%);
  border-radius: 0 0 50% 50%;
}
@keyframes creepy-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* POPUP TYPE 6: Vaporwave neon */
.cheat-popup.neon {
  position: absolute;
  pointer-events: auto;
  background: linear-gradient(135deg, #1a0030 0%, #000020 50%, #100020 100%);
  border: 3px solid;
  border-image: linear-gradient(90deg, #ff00ff, #00ffff, #ff00ff) 1;
  padding: 0;
  font-family: 'Arial', sans-serif;
  transform: skewX(-2deg);
}
.cheat-popup.neon .cheat-popup-header {
  background: linear-gradient(90deg, rgba(255,0,255,0.3), rgba(0,255,255,0.3));
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ff00ff;
}
.cheat-popup.neon .cheat-popup-icon { display: none; }
.cheat-popup.neon .cheat-popup-title {
  color: #00ffff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}
.cheat-popup.neon .cheat-popup-close {
  background: none;
  border: 1px solid #ff00ff;
  color: #ff00ff;
  padding: 0 6px;
  cursor: pointer;
  text-shadow: 0 0 5px #ff00ff;
}
.cheat-popup.neon .cheat-popup-content {
  color: #ff00ff;
  font-size: 14px;
  font-weight: bold;
  padding: 15px;
  text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff;
}

/* Popup fade out animation */
.cheat-popup.fade-out {
  animation: popup-fadeout 0.3s ease-out forwards;
}
@keyframes popup-fadeout {
  to { opacity: 0; transform: scale(0.8); }
}


/* ============================================================
   CHEAT MODE FLOATERS - Each one COMPLETELY different
   ============================================================ */

/* FLOATER 1: Giant translucent Times New Roman */
.cheat-floater.corrupted {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Times New Roman', Times, serif;
  font-size: 72px;
  font-weight: bold;
  color: rgba(139, 0, 0, 0.15);
  text-shadow: 0 0 30px rgba(139, 0, 0, 0.3);
  letter-spacing: -3px;
}

/* FLOATER 2: Lime green monospace small */
.cheat-floater.warning {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #32cd32;
  opacity: 0.6;
  text-shadow: 0 0 5px #32cd32;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* FLOATER 3: Glitchy chromatic aberration */
.cheat-floater.glitch-text {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Arial Black', sans-serif;
  font-size: 28px;
  color: rgba(255, 255, 255, 0.4);
  text-shadow:
    -3px 0 rgba(255, 0, 0, 0.5),
    3px 0 rgba(0, 255, 255, 0.5);
  animation: chromatic-shake 0.15s infinite;
}
@keyframes chromatic-shake {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, -1px); }
}

/* FLOATER 4: Tiny whisper gray italic */
.cheat-floater.whisper {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Georgia', serif;
  font-size: 11px;
  font-style: italic;
  color: rgba(120, 120, 120, 0.4);
  letter-spacing: 4px;
}

/* FLOATER 5: HUGE bold impact */
.cheat-floater.bold {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Impact', 'Haettenschweiler', sans-serif;
  font-size: 96px;
  color: rgba(255, 0, 0, 0.08);
  text-transform: uppercase;
  letter-spacing: -5px;
  line-height: 0.8;
}

/* FLOATER 6: Handwritten scrawl */
.cheat-floater.scrawl {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-size: 36px;
  color: rgba(180, 50, 50, 0.35);
  transform: rotate(-8deg);
  font-weight: normal;
}

/* FLOATER 7: Yellow warning tape style */
.cheat-floater.tape {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Arial Black', sans-serif;
  font-size: 16px;
  color: #000;
  background: rgba(255, 215, 0, 0.7);
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transform: rotate(3deg);
}

/* FLOATER 8: Matrix falling code style */
.cheat-floater.matrix {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'MS Gothic', 'Courier New', monospace;
  font-size: 20px;
  color: rgba(0, 255, 65, 0.5);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.8);
  writing-mode: vertical-rl;
}

/* FLOATER 9: Outlined hollow text */
.cheat-floater.outline {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Verdana', sans-serif;
  font-size: 42px;
  font-weight: bold;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 100, 100, 0.4);
  text-transform: uppercase;
}

/* FLOATER 10: Pixelated retro */
.cheat-floater.pixel {
  position: absolute;
  pointer-events: none;
  user-select: none;
  font-family: 'Courier New', monospace;
  font-size: 24px;
  color: rgba(255, 0, 255, 0.5);
  text-shadow: 2px 2px 0 rgba(0, 255, 255, 0.3);
  image-rendering: pixelated;
  letter-spacing: 3px;
}
