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

/* CSS Variables for Theming */
:root {
  /* Default Dark Theme */
  --bg-color: #000000;
  --text-color: #a0a0a0;
  --accent-color: #00ff00;
  --border-color: #606060;
  --error-color: #ff0000;
  --success-color: #00ff00;
  --info-color: #00ffff;
  --warning-color: #ffff00;
  --gold-color: #ffd700;
  --input-bg: rgba(0, 0, 0, 0.3);
  --panel-bg: rgba(0, 0, 0, 1);
  --panel-border: #303030;

  /* Font Size Variable */
  --base-font-size: 16px;
}

/* Dark Matrix Theme */
body[data-theme="dark-matrix"] {
  --bg-color: #0d1b0d;
  --text-color: #33ff33;
  --accent-color: #00ff00;
  --border-color: #1a4d1a;
  --success-color: #00ff00;
  --info-color: #00ff00;
  --panel-bg: rgba(0, 50, 0, 1);
  --panel-border: #1a4d1a;
}

/* Dark Amber Theme */
body[data-theme="dark-amber"] {
  --bg-color: #1a1200;
  --text-color: #ffb000;
  --accent-color: #ffcc00;
  --border-color: #664400;
  --success-color: #ffcc00;
  --info-color: #ffcc00;
  --error-color: #ff6600;
  --panel-bg: rgba(50, 30, 0, 1);
  --panel-border: #664400;
}

/* Dark Purple Theme */
body[data-theme="dark-purple"] {
  --bg-color: #1a0a2e;
  --text-color: #c7a3ff;
  --accent-color: #9d4edd;
  --border-color: #5a189a;
  --success-color: #9d4edd;
  --info-color: #c77dff;
  --panel-bg: rgba(90, 24, 154, 1);
  --panel-border: #5a189a;
}

/* Light Gray Theme */
body[data-theme="light-default"] {
  --bg-color: #f5f5f5;
  --text-color: #333333;
  --accent-color: #007700;
  --border-color: #cccccc;
  --error-color: #cc0000;
  --success-color: #007700;
  --info-color: #0077cc;
  --warning-color: #cc7700;
  --gold-color: #cc9900;
  --input-bg: rgba(255, 255, 255, 0.8);
  --panel-bg: rgba(255, 255, 255, 1);
  --panel-border: #cccccc;
}

/* Light Blue Theme */
body[data-theme="light-blue"] {
  --bg-color: #e6f2ff;
  --text-color: #1a3a52;
  --accent-color: #0066cc;
  --border-color: #99ccff;
  --error-color: #cc0000;
  --success-color: #006633;
  --info-color: #0066cc;
  --warning-color: #cc6600;
  --gold-color: #cc9900;
  --input-bg: rgba(255, 255, 255, 0.8);
  --panel-bg: rgba(255, 255, 255, 1);
  --panel-border: #99ccff;
}

/* Light Cream Theme */
body[data-theme="light-cream"] {
  --bg-color: #faf8f3;
  --text-color: #3d3833;
  --accent-color: #8b7355;
  --border-color: #d4c5b0;
  --error-color: #b33030;
  --success-color: #4a7c59;
  --info-color: #5b7c99;
  --warning-color: #b87333;
  --gold-color: #cc9900;
  --input-bg: rgba(255, 255, 255, 0.8);
  --panel-bg: rgba(255, 250, 245, 1);
  --panel-border: #d4c5b0;
}

/* Colorblind Friendly Theme - avoids red/green, uses blue/orange/yellow */
body[data-theme="colorblind"] {
  --bg-color: #1a1a2e;
  --text-color: #e0e0e0;
  --accent-color: #00a8ff;
  --border-color: #4a5568;
  --error-color: #ff6b35;
  --success-color: #00a8ff;
  --info-color: #ffd93d;
  --warning-color: #ff6b35;
  --gold-color: #ffd93d;
  --input-bg: rgba(30, 30, 50, 0.5);
  --panel-bg: rgba(40, 40, 60, 1);
  --panel-border: #4a5568;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Courier New", monospace;
  font-size: var(--base-font-size);
  height: 100vh;
  overflow: hidden;
}

#terminal-container {
  width: 100%;
  max-width: 1920px;
  height: 100vh;
  padding: 20px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#ascii-header {
  color: var(--accent-color);
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 30px;
  padding: 15px 10px;
  opacity: 0.9;
  white-space: pre;
  font-family: "Courier New", Courier, monospace;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 8px var(--accent-color);
  overflow: hidden;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

#login-screen {
  justify-content: center;
  align-items: center;
}

.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.prompt-text {
  color: #a0a0a0;
}

.terminal-input {
  background-color: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-color);
  font-family: "Courier New", monospace;
  font-size: var(--base-font-size);
  padding: 10px;
  border-radius: 4px;
  outline: none;
  caret-color: var(--text-color);
  transition: border-color 0.2s ease;
}

.terminal-input:focus {
  border-color: var(--accent-color);
}

.terminal-input::placeholder {
  color: #606060;
  opacity: 0.5;
}

.info-text {
  color: #606060;
  font-size: 12px;
  text-align: center;
  opacity: 0.7;
}

#game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Critical: allows flex item to shrink below content size */
  overflow: hidden; /* Prevent expansion beyond allocated space */
}

#terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #606060;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  margin-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #606060 #0c0c0c;
  min-height: 0; /* Allow shrinking below content size */
}

#terminal-output::-webkit-scrollbar {
  width: 8px;
}

#terminal-output::-webkit-scrollbar-track {
  background: #0c0c0c;
}

#terminal-output::-webkit-scrollbar-thumb {
  background-color: #606060;
  border-radius: 4px;
}

.terminal-line {
  margin-bottom: 5px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-line.command {
  color: #ffffff;
}

.terminal-line.success {
  color: #a0a0a0;
}

.terminal-line.error {
  color: #ff0000;
}

.terminal-line.info {
  color: #00ffff;
}

.terminal-line.broadcast {
  color: #ffff00;
  font-style: italic;
}

.terminal-line.system {
  color: #ff00ff;
}

.terminal-line.maintenance {
  color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.15);
  padding: 8px;
  margin: 4px 0;
  border-left: 4px solid #ff6b6b;
  font-weight: bold;
}

.gold-amount {
  color: #ffd700;
  font-weight: bold;
}

#terminal-input-line {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid #606060;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  flex-shrink: 0; /* Keep input line always visible */
}

.prompt-symbol {
  color: #a0a0a0;
  margin-right: 10px;
  font-weight: bold;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #a0a0a0;
  font-family: "Courier New", monospace;
  font-size: 14px;
  outline: none;
}

#status-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin-top: 10px;
  border: 1px solid #606060;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  font-size: calc(var(--base-font-size) * 0.75); /* 12px at 16px base */
  flex-shrink: 0; /* Keep status bar always visible */
  align-items: center; /* Vertically center all items */
}

#status-bar span {
  color: #a0a0a0;
}

#connection-status {
  color: #ff0000;
}

#connection-status.connected {
  color: #a0a0a0;
}

.version-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  color: #606060;
  font-family: "Courier New", monospace;
  z-index: 1000;
  pointer-events: none;
}

.new-messages-indicator {
  position: absolute;
  bottom: 50px;
  right: 20px;
  background-color: rgba(0, 200, 0, 0.9);
  color: #000;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 200, 0, 0.4);
  animation: pulse 1.5s ease-in-out infinite;
  display: none;
}

.new-messages-indicator:hover {
  background-color: rgba(0, 255, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 255, 0, 0.6);
}

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

/* Blinking cursor effect */
@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.terminal-input:focus {
  animation: none;
}

/* Terminal subtle effect - removed glow */

/* Tutorial Screen */
#tutorial-screen {
  display: block;
  padding: 40px 20px;
  overflow-y: auto;
  background-color: #000000;
}

#tutorial-screen.active {
  display: block;
}

.tutorial-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  border: 2px solid #606060;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.8);
}

.tutorial-container h2 {
  color: #00ff00;
  text-align: center;
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.tutorial-content {
  color: #a0a0a0;
  line-height: 1.8;
}

.tutorial-content > p {
  text-align: center;
  margin-bottom: 20px;
  color: #808080;
}

.tutorial-content > p:first-child {
  font-size: 16px;
  color: #909090;
}

.tutorial-section {
  margin: 25px 0;
  padding: 15px;
  border-left: 3px solid #404040;
  background-color: rgba(0, 0, 0, 0.3);
}

.tutorial-section h3 {
  color: #00cc00;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: bold;
}

.tutorial-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.tutorial-content ol.tutorial-steps {
  margin: 10px 0;
  padding-left: 25px;
  color: #909090;
}

.tutorial-content ol.tutorial-steps li {
  margin: 8px 0;
  padding-left: 5px;
}

.tutorial-content li {
  margin: 6px 0;
  color: #909090;
}

.tutorial-content .highlight {
  color: #00ff00;
  font-weight: bold;
}

.tutorial-content code {
  background-color: rgba(0, 255, 0, 0.1);
  border: 1px solid #404040;
  padding: 2px 6px;
  border-radius: 3px;
  color: #00ff00;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.tutorial-content .game-loop {
  text-align: center;
  font-size: 16px;
  color: #00cc00;
  font-weight: bold;
  margin: 15px 0;
  padding: 10px;
  background-color: rgba(0, 255, 0, 0.05);
  border-radius: 4px;
}

.tutorial-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #404040;
  color: #00ff00;
  font-size: 16px;
  animation: pulse 2s infinite;
}

.tutorial-footer strong {
  color: #00ff00;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Game container with stats panel */
#game-container {
  display: flex;
  flex: 1;
  gap: 10px;
  min-height: 0;
}

#terminal-area {
  flex: 2 1 0;
  min-width: 400px;
  display: flex;
  flex-direction: column;
}

#terminal-area #terminal-output {
  flex: 1;
}

/* Activity Feed Panel */
#activity-feed {
  display: flex;
  flex-direction: row;
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid #303030;
  border-radius: 4px;
  overflow: visible;
  transition: all 0.3s ease;
  position: relative;
  font-size: var(--base-font-size);
  flex-shrink: 0;
}

#activity-feed.activity-feed-collapsed {
  width: 30px;
  flex: 0 0 30px;
}

#activity-feed:not(.activity-feed-collapsed) {
  flex: 1 1 0;
  min-width: 280px;
  max-width: 400px;
}

.activity-feed-toggle {
  width: 30px;
  background-color: transparent;
  border: none;
  border-right: 1px solid #303030;
  color: #00ff00;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  gap: 10px;
}

#activity-feed:hover .activity-feed-toggle,
.activity-feed-toggle:focus {
  opacity: 1;
  background-color: rgba(0, 50, 0, 0.3);
}

.activity-feed-toggle:hover {
  background-color: rgba(0, 100, 0, 0.5);
}

.activity-feed-toggle .toggle-icon {
  display: block;
}

#activity-feed:not(.activity-feed-collapsed)
  .activity-feed-toggle
  .toggle-icon::before {
  content: "◀";
}

#activity-feed.activity-feed-collapsed
  .activity-feed-toggle
  .toggle-icon::before {
  content: "▶";
}

#activity-feed.activity-feed-collapsed .activity-feed-toggle::after {
  content: "A\AC\AT\AI\AV\AI\AT\AY";
  writing-mode: vertical-rl;
  font-size: 9px;
  letter-spacing: 2px;
  color: #505050;
  margin-top: 20px;
}

.activity-feed-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#activity-feed.activity-feed-collapsed .activity-feed-content {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.activity-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #303030;
  background-color: rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 100;
}

.activity-feed-header h3 {
  color: #a0a0a0;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.activity-feed-filter {
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid #404040;
  color: #e0e0e0;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.activity-feed-filter:hover {
  border-color: #606060;
  background-color: rgba(0, 0, 0, 0.9);
}

.activity-feed-filter:active {
  background-color: rgba(0, 50, 0, 0.3);
  border-color: #00ff00;
}

.activity-feed-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #606060 #0c0c0c;
}

.activity-feed-messages::-webkit-scrollbar {
  width: 6px;
}

.activity-feed-messages::-webkit-scrollbar-track {
  background: #0c0c0c;
}

.activity-feed-messages::-webkit-scrollbar-thumb {
  background-color: #606060;
  border-radius: 3px;
}

.activity-message {
  margin-bottom: 8px;
  font-size: calc(var(--base-font-size) * 0.75); /* 12px at 16px base */
  line-height: 1.4;
  color: #808080;
  display: flex;
  gap: 8px;
}

.activity-message .timestamp {
  color: #505050;
  flex-shrink: 0;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  width: 40px;
  text-align: right;
}

.activity-message .message-content {
  flex: 1;
  word-wrap: break-word;
}

.activity-message.level-up {
  color: #00ff00;
  font-weight: bold;
  background-color: rgba(0, 100, 0, 0.2);
  border-left: 3px solid #00ff00;
  padding: 4px 6px;
  border-radius: 3px;
  margin: 2px 0;
}

.activity-message.merchant {
  color: #ff00ff;
}

.activity-message.notification {
  color: #87ceeb;
  font-weight: bold;
  background-color: rgba(30, 60, 100, 0.3);
  border-left: 3px solid #87ceeb;
  padding: 4px 6px;
  border-radius: 3px;
  margin: 2px 0;
}

.activity-message.maintenance {
  color: #ff6b6b;
  font-weight: bold;
  background-color: rgba(255, 107, 107, 0.2);
  border-left: 3px solid #ff6b6b;
  padding: 4px 6px;
  border-radius: 3px;
  margin: 2px 0;
}

.activity-message .player-highlight {
  color: #ffd700;
  font-weight: bold;
}

.no-activity {
  color: #505050;
  font-style: italic;
  text-align: center;
  padding: 20px;
  font-size: 12px;
}

/* Hide activity feed on small screens */
@media (max-width: 1100px) {
  #activity-feed {
    display: none;
  }
}

/* Stats Panel */
#stats-panel {
  flex: 1 1 0;
  min-width: 280px;
  max-width: 400px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid #303030;
  border-radius: 4px;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: var(--base-font-size);
}

.stats-section {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid #202020;
  border-radius: 4px;
  padding: 10px;
}

.stats-section h3 {
  color: #a0a0a0;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #303030;
  padding-bottom: 5px;
}

/* Player Stats */
.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #808080;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
}

.stat-label {
  color: #606060;
}

/* Skills */
.skill-item {
  margin-bottom: 12px;
}

.skill-name {
  display: block;
  color: #808080;
  font-size: calc(var(--base-font-size) * 0.75); /* 12px at 16px base */
  margin-bottom: 3px;
}

.skill-bar {
  position: relative;
  width: 100%;
  height: 16px;
  background-color: #1a1a1a;
  border: 1px solid #303030;
  border-radius: 3px;
  overflow: hidden;
}

.skill-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  /* Default gray - overridden by JavaScript with skill-specific colors */
  background-color: #505050;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.skill-xp-text {
  position: absolute;
  width: 100%;
  text-align: center;
  color: #e0e0e0;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  font-weight: bold;
  line-height: 14px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 1;
}

.skill-level {
  display: block;
  color: #a0a0a0;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  margin-top: 2px;
  text-align: right;
}

/* Effects */
/* Weather display */
.weather-section {
  background-color: rgba(0, 255, 0, 0.1);
  border: 1px solid #00ff00;
  border-radius: 4px;
}

.weather-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  font-size: 16px;
}

#weather-emoji {
  font-size: 24px;
}

#weather-name {
  color: #00ff00;
  font-weight: bold;
}

#effects-list {
  color: #808080;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
}

.effect-item {
  margin-bottom: 5px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
  border-left: 3px solid #606060;
  cursor: help;
  position: relative;
  transition: background-color 0.2s ease;
}

.effect-item:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.effect-item .effect-name {
  display: block;
  font-weight: bold;
  margin-bottom: 3px;
}

.effect-item .effect-duration {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  color: #909090;
  font-family: "Courier New", monospace;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 10;
}

.effect-item .effect-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 8px;
  background-color: #1a1a1a;
  border: 1px solid #00ff00;
  border-radius: 4px;
  padding: 8px 12px;
  z-index: 1000;
  font-size: calc(var(--base-font-size) * 0.75); /* 12px at 16px base */
  line-height: 1.4;
  color: #a0a0a0;
  white-space: normal;
  box-shadow: 0 -2px 8px rgba(0, 255, 0, 0.2);
}

.effect-item:hover .effect-tooltip {
  display: block;
  z-index: 1001;
}

.effect-positive {
  border-left-color: #40a040;
}

.effect-positive .effect-name {
  color: #60c060;
}

.effect-negative {
  border-left-color: #a04040;
}

.effect-negative .effect-name {
  color: #c06060;
}

.effect-neutral {
  border-left-color: #4080a0;
}

.effect-neutral .effect-name {
  color: #60a0c0;
}

.no-effects {
  color: #505050;
  font-style: italic;
  text-align: center;
  padding: 10px;
}

/* Responsive design */
@media (max-width: 1400px) {
  #terminal-area {
    flex: 1.5 1 0;
  }
}

@media (max-width: 1200px) {
  #activity-feed:not(.activity-feed-collapsed),
  #stats-panel {
    min-width: 240px;
    max-width: 320px;
  }

  #terminal-area {
    flex: 1 1 0;
    min-width: 350px;
  }
}

@media (max-width: 768px) {
  #terminal-container {
    padding: 10px;
  }

  #ascii-header {
    font-size: 10px;
    line-height: 1.2;
    padding: 5px;
  }

  .terminal-input {
    font-size: 14px;
  }

  /* Hide stats panel on mobile */
  #stats-panel {
    display: none;
  }

  #terminal-area {
    width: 100%;
  }
}

/* ========== AUTH SCREEN STYLES ========== */
#auth-screen {
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

#auth-screen.active {
  display: flex;
}

.auth-container {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.auth-tab {
  flex: 1;
  padding: 12px 24px;
  background-color: #1a1a1a;
  color: #606060;
  border: 1px solid #303030;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  font-weight: bold;
  transition: all 0.2s ease;
}

.auth-tab:hover {
  background-color: #202020;
  color: #808080;
}

.auth-tab.active {
  background-color: #00ff00;
  color: #000000;
  border-color: #00ff00;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #00ff00;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  margin-bottom: 8px;
  font-family: "Courier New", Courier, monospace;
}

.auth-button {
  width: 100%;
  padding: 14px;
  background-color: #00ff00;
  color: #000000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: calc(var(--base-font-size) * 0.9375); /* 15px at 16px base */
  font-weight: bold;
  transition: background-color 0.2s ease;
  margin-top: 10px;
}

.auth-button:hover {
  background-color: #00cc00;
}

.auth-button:active {
  background-color: #009900;
}

.error-message {
  color: #ff0000;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  margin-top: 12px;
  min-height: 20px;
  font-family: "Courier New", Courier, monospace;
}

.logout-button {
  padding: 6px 12px;
  background-color: #303030;
  color: #00ff00;
  border: 1px solid #00ff00;
  border-radius: 3px;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: calc(var(--base-font-size) * 0.6875); /* 11px at 16px base */
  font-weight: bold;
  transition: all 0.2s ease;
  margin-left: 10px;
}

.logout-button:hover {
  background-color: #00ff00;
  color: #000000;
}

.logout-button:active {
  background-color: #00cc00;
}

/* Bug Report */
.bug-report {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1000;
  color: #606060;
  font-family: "Courier New", monospace;
}

.bug-report:hover {
  color: #00ff00;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: var(--panel-bg);
  margin: 5% auto;
  padding: 30px;
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 0 30px var(--accent-color);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  color: #a0a0a0;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--accent-color);
}

.modal-content h2 {
  color: var(--accent-color);
  margin-top: 0;
  margin-bottom: 20px;
  font-family: "Courier New", monospace;
}

.modal-content .form-group {
  margin-bottom: 20px;
}

.modal-content label {
  display: block;
  color: #a0a0a0;
  margin-bottom: 8px;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
}

.terminal-textarea {
  width: 100%;
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  resize: vertical;
  box-sizing: border-box;
}

.terminal-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.submit-button {
  flex: 1;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: var(--bg-color);
  border: none;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-button:hover {
  background-color: var(--success-color);
  box-shadow: 0 0 12px var(--accent-color);
}

.submit-button:disabled {
  background-color: #404040;
  color: #808080;
  cursor: not-allowed;
}

.cancel-button {
  padding: 12px 24px;
  background-color: transparent;
  color: #a0a0a0;
  border: 1px solid #606060;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  border-color: #a0a0a0;
  color: #ffffff;
}

.status-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  display: none;
}

.status-message.success {
  background-color: var(--panel-bg);
  border: 1px solid var(--success-color);
  color: var(--success-color);
  display: block;
}

.status-message.error {
  background-color: var(--panel-bg);
  border: 1px solid var(--error-color);
  color: var(--error-color);
  display: block;
}

/* Settings Button */
.settings-button {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  color: #606060;
  font-family: "Courier New", monospace;
  transition: all 0.3s ease;
}

.settings-button:hover {
  color: var(--accent-color);
  transform: rotate(45deg);
}

/* Settings Modal Styles */
.settings-section {
  margin-bottom: 30px;
}

.settings-section h3 {
  color: var(--accent-color);
  margin-bottom: 15px;
  font-size: calc(var(--base-font-size) * 1); /* Same as base */
  font-family: "Courier New", monospace;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.settings-section h4 {
  color: var(--text-color);
  margin: 15px 0 10px 0;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  font-family: "Courier New", monospace;
  opacity: 0.8;
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.theme-category {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-button {
  padding: 12px 20px;
  background-color: var(--panel-bg);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.875); /* 14px at 16px base */
  transition: all 0.3s ease;
  text-align: left;
}

.theme-button:hover {
  border-color: var(--accent-color);
  background-color: var(--input-bg);
  transform: translateX(5px);
}

.theme-button.active {
  border-color: var(--accent-color);
  background-color: var(--accent-color);
  color: var(--bg-color);
  font-weight: bold;
}

.font-size-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.font-size-button {
  padding: 12px 16px;
  background-color: var(--panel-bg);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: calc(var(--base-font-size) * 0.8125); /* 13px at 16px base */
  transition: all 0.3s ease;
}

.font-size-button:hover {
  border-color: var(--accent-color);
  background-color: var(--input-bg);
}

.font-size-button.active {
  border-color: var(--accent-color);
  background-color: var(--accent-color);
  color: var(--bg-color);
  font-weight: bold;
}

.footer {
  height: 50px;
  position: relative;
}
