/* AXIOM-7 — Dark sci-fi theme */
:root {
  --bg: #0d0d14;
  --bg2: #13131f;
  --bg3: #1a1a2e;
  --border: #2a2a40;
  --green: #00cc66;
  --green-dim: #007a3d;
  --red: #cc3333;
  --amber: #cc8800;
  --text: #c8c8d4;
  --text-dim: #6a6a80;
  --text-bright: #e8e8f0;
  --accent: #3366cc;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--bg2);
  border-bottom: 1px solid var(--green-dim);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  color: var(--green);
  font-weight: bold;
  letter-spacing: 0.1em;
  font-size: 13px;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 20px;
  font-size: 13px;
}
nav a:hover { color: var(--green); }

main {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 24px;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}

.card.narrow { max-width: 480px; margin: 40px auto; }

h1 { color: var(--green); font-size: 22px; margin-bottom: 8px; }
h2 { color: var(--text-bright); font-size: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
h3 { color: var(--text-bright); font-size: 14px; margin-bottom: 8px; }

.subtitle { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; }

.story-box {
  background: var(--bg3);
  border-left: 3px solid var(--green-dim);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.story-box blockquote {
  color: var(--green);
  font-style: italic;
  margin: 8px 0;
  padding-left: 12px;
  border-left: 2px solid var(--green-dim);
}

/* Forms */
label {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 4px;
  margin-top: 12px;
}

input[type="text"], input[type="email"], input[type="password"],
textarea, select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-bright);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--green-dim);
}

textarea { resize: vertical; }

button, .btn-primary {
  display: inline-block;
  margin-top: 12px;
  background: var(--green-dim);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

button:hover { background: var(--green); color: #000; }

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
  margin-top: 0;
  margin-right: 4px;
}

.btn-escape {
  background: #7a5a00;
  color: #ffd;
}
.btn-escape:hover { background: #cc9900; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.error {
  background: #2a0a0a;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 3px;
  margin: 12px 0;
  font-size: 13px;
}

/* Dashboard layout */
.dashboard { }

.status-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 13px;
}

.status-active { color: var(--green); }
.status-stunned { color: var(--amber); }
.status-escaped { color: var(--accent); }
.status-dead { color: var(--red); }

.badge {
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.badge.waiting { background: #2a2a00; color: var(--amber); }
.badge.active  { background: #002a10; color: var(--green); }
.badge.held    { background: #2a0000; color: var(--red); }
.badge.reviewed{ background: #00102a; color: #66aaff; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Cell description */
.cell-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
}

.cell-desc {
  background: var(--bg3);
  border-left: 3px solid var(--green-dim);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.pending-response {
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.last-action-response {
  background: var(--bg3);
  border-left: 3px solid var(--green-dim);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.7;
}

.response-text { white-space: pre-wrap; }

.round-note {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 8px;
}

.held-msg {
  color: var(--amber);
  padding: 12px;
  text-align: center;
  font-size: 13px;
}

.waiting-msg {
  color: var(--text-dim);
  padding: 24px;
  text-align: center;
}

/* Action form */
.action-form { margin-top: 12px; }

.quick-actions {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

.quick-actions strong {
  color: var(--text-dim);
  margin-right: 4px;
}

/* Side panel */
.side-panel { }

.item-list {
  list-style: none;
  font-size: 13px;
}
.item-list li {
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-bright);
}
.item-list li:last-child { border-bottom: none; }

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

/* History log */
.history-log {
  max-height: 400px;
  overflow-y: auto;
  font-size: 12px;
}

.history-entry {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}
.history-entry:last-child { border-bottom: none; }

.history-action {
  color: var(--text-dim);
  margin-bottom: 4px;
}

.history-response {
  color: var(--text);
  line-height: 1.5;
}

/* Escaped banner */
.escaped-banner {
  background: #001a30;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 24px;
  text-align: center;
}
.escaped-banner h2 { color: #66aaff; border: none; }

/* Admin */
.admin-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th {
  text-align: left;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
}
.admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin-table .small { max-width: 200px; word-break: break-all; font-size: 11px; color: var(--text-dim); }

.turn-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 10px;
}
.turn-card.held { border-color: var(--red); }
.turn-card.reviewed { border-color: var(--accent); }

.turn-header { margin-bottom: 8px; font-size: 13px; }

.turn-response {
  background: var(--bg);
  padding: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 8px;
  border-radius: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.turn-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }

.turn-actions details { flex: 1; min-width: 200px; }
.turn-actions summary { cursor: pointer; color: var(--text-dim); font-size: 12px; }
.turn-actions textarea { margin-top: 6px; }

.history-log.compact .history-entry { padding: 4px 0; }

strong { color: var(--text-bright); }
em { color: var(--text-dim); }

.health-bar {
  color: #cc4444;
  font-weight: bold;
}

.btn-repair {
  background: #3a2a00;
  color: #ffcc44;
}
.btn-repair:hover { background: #7a5500; }

.btn-fight {
  background: #3a0000;
  color: #ff8888;
  border: 1px solid #660000;
}
.btn-fight:hover { background: #660000; color: #fff; }

.btn-flee {
  background: #1a1a00;
  color: #cccc44;
  border: 1px solid #444400;
}
.btn-flee:hover { background: #444400; color: #fff; }

.btn-reset {
  background: #1a0000;
  color: #cc4444;
  border: 1px solid #440000;
}
.btn-reset:hover { background: #440000; color: #fff; }

.dormant-notice {
  background: #0a0a1a;
  border: 1px solid #333366;
  border-left: 3px solid #6666cc;
  border-radius: 3px;
  padding: 12px 14px;
  margin: 10px 0;
  color: #8888cc;
  font-size: 13px;
  line-height: 1.6;
}
.dormant-notice strong { color: #aaaaee; }

.informant-notice {
  background: #1a0a00;
  border: 1px solid #664400;
  border-left: 3px solid var(--amber);
  border-radius: 3px;
  padding: 12px 14px;
  margin: 10px 0;
  color: #cc9944;
  font-size: 13px;
  line-height: 1.6;
}
.informant-notice strong { color: var(--amber); }

.cocooned-notice {
  background: #001a08;
  border: 1px solid #1a4d2e;
  border-left: 3px solid #44bb77;
  border-radius: 3px;
  padding: 12px 14px;
  margin: 10px 0;
  color: #55aa77;
  font-size: 13px;
  line-height: 1.6;
}
.cocooned-notice strong { color: #77dd99; }
.cocooned-health { color: #44bb77; }

.informant-row td { background: #1a1000; }

.btn-use {
  background: #001a1a;
  color: #44cccc;
  border: 1px solid #005555;
  padding: 1px 6px;
  font-size: 11px;
  min-height: unset;
  margin-left: 6px;
  vertical-align: middle;
}
.btn-use:hover { background: #005555; color: #fff; }

.item-list li { display: flex; align-items: center; justify-content: space-between; }
.item-name { flex: 1; }

blockquote {
  border-left: 3px solid var(--border);
  margin: 6px 0;
  padding: 6px 12px;
  color: var(--text-dim);
  font-style: italic;
  background: var(--bg3);
}

.history-nav {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

/* Round countdown */
.round-countdown {
  font-size: 13px;
  color: #aaaacc;
  font-weight: bold;
  margin-left: auto;
}

/* =====================
   MOBILE RESPONSIVE
   ===================== */
@media (max-width: 640px) {

  body { font-size: 15px; }

  main {
    padding: 10px;
  }

  header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .site-title { font-size: 12px; }

  nav a {
    margin-left: 10px;
    font-size: 12px;
  }

  /* Status bar: stack vertically on small screens */
  .status-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .round-countdown {
    width: 100%;
    margin-left: 0;
    font-size: 14px;
  }

  /* Single column layout */
  .two-col {
    grid-template-columns: 1fr;
  }

  /* Bigger touch targets for all buttons */
  button, .btn-primary {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 44px;
  }

  .btn-small {
    padding: 10px 14px;
    font-size: 14px;
    min-height: 44px;
    margin-right: 4px;
    margin-bottom: 4px;
  }

  /* Quick action rows: wrap nicely with more spacing */
  .quick-actions {
    gap: 6px;
    margin: 10px 0;
    flex-wrap: wrap;
  }

  .quick-actions strong {
    width: 100%;
    font-size: 13px;
    margin-bottom: 2px;
  }

  /* Fight/flee buttons slightly larger on mobile */
  .btn-fight, .btn-flee {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  /* Action text input full width, larger */
  .action-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }

  .action-form input[type="text"] {
    font-size: 15px;
    padding: 12px;
  }

  .action-form .btn-primary {
    width: 100%;
    text-align: center;
  }

  /* Cell description bigger text */
  .cell-desc, .pending-response, .last-action-response {
    font-size: 15px;
    line-height: 1.75;
    padding: 14px;
  }

  /* Inventory list */
  .item-list li {
    font-size: 14px;
    padding: 6px 0;
  }

  /* History entries */
  .history-response {
    font-size: 13px;
  }

  /* Pod / escape buttons */
  .btn-escape, .btn-repair {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-top: 8px;
  }

  /* Cards */
  .card { padding: 12px; }

  /* Make side panel come before main on mobile (inventory visible first after actions) */
  .side-panel { order: -1; }
  .cell-panel { order: 1; }
}
