/* Dragon's Exodus website — Copyright (c) 2026 Dragon's Exodus. MIT License; see LICENSE. */
:root {
  --de-green: #70883c;
  --de-green-lt: #809536;
  --bg: #0a0f0a;
  --bg-2: #121a12;
  --bg-3: #18221a;
  --line: #2a3a28;
  --fg: #cccccc;
  --fg-dim: #8a9a86;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
}

body { display: flex; flex-direction: column; }

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(#18221a, #0d130d);
  border-bottom: 2px solid var(--de-green);
}
.brand {
  color: var(--de-green-lt);
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  font-size: 18px;
}
.topbar-r { display: flex; align-items: center; gap: 8px; }
.topbar-r button {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
.topbar-r button:hover { border-color: var(--de-green); }

.conn {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: capitalize;
}
.conn.open { background: #1f3a1f; color: #9fe09f; }
.conn.connecting { background: #3a371f; color: #e0d89f; }
.conn.closed { background: #3a1f1f; color: #e09f9f; }

.tabbar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 4px 8px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--de-green);
  overflow-x: auto;
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.tab.active { color: var(--de-green-lt); background: var(--bg); border-color: var(--de-green); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #e09f9f; }
.tab-dot.open { background: #9fe09f; }
.tab-dot.connecting { background: #e0d89f; }
.tab-dot.closed { background: #e09f9f; }
.tab-title { outline: none; }
.tab-title[contenteditable="true"] { background: var(--bg-2); padding: 0 3px; border-radius: 3px; }
.tab-x { background: none; border: none; color: var(--fg-dim); cursor: pointer; font-size: 12px; padding: 0 2px; line-height: 1; }
.tab-x:hover { color: #e09f9f; }

.sessions { flex: 1 1 auto; min-height: 0; }

.app {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 8px;
  padding: 8px;
}

.screen { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.term {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px;
}
.inputbar { flex: 0 0 auto; margin-top: 8px; }
.cmd {
  width: 100%;
  font-family: Menlo, Consolas, monospace;
  font-size: 15px;
  padding: 10px;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.cmd:focus { outline: none; border-color: var(--de-green); }

.side {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.minimap {
  width: 100%;
  height: 220px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.dpad button {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
}
.dpad button:hover { border-color: var(--de-green); }
.dpad button:active { background: var(--de-green); color: #08120a; }
.dpad-wide { grid-column: 1 / -1; }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
}
.panel h3 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--de-green-lt);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.bar {
  position: relative;
  height: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  margin: 4px 0;
  overflow: hidden;
}
.bar-fill { height: 100%; width: 0; transition: width .2s ease; }
.bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-shadow: 0 1px 2px #000;
}

.statgrid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 2px 12px; }
.stat { display: flex; justify-content: space-between; font-size: 13px; }
.stat-k { color: var(--fg-dim); }

.combat { font-size: 13px; color: var(--fg-dim); }
.combat.fighting { color: #ff8c66; }
.combat-target { margin-top: 4px; }

.cd-list { font-size: 13px; }
.cd { display: flex; justify-content: space-between; padding: 1px 0; }
.cd-time { color: var(--de-green-lt); }

.room-h { font-size: 11px; color: var(--fg-dim); margin-top: 6px; }
.room-list { font-size: 13px; }
.room-ent { padding: 1px 0; }

@media (max-width: 820px) {
  .app { display: flex; flex-direction: column; }
  .screen { height: 52vh; flex: 0 0 auto; }
  .side { flex: 1 1 auto; }
}

/* user action buttons (in the d-pad grid) */
.abtn { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abtn.unset { color: var(--fg-dim); font-style: italic; }

/* options modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(560px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--de-green); border-radius: 6px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; color: var(--de-green-lt); }
.modal-x { background: none; border: none; color: var(--fg); font-size: 16px; cursor: pointer; }
.modal-tabs { display: flex; gap: 4px; padding: 8px 14px 0; }
.modal-tab {
  background: var(--bg-3); color: var(--fg-dim);
  border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.modal-tab.active { color: var(--de-green-lt); background: var(--bg-2); border-color: var(--de-green); }
.modal-body { overflow-y: auto; padding: 12px 14px; border-top: 1px solid var(--line); }
.modal-pane { display: flex; flex-direction: column; gap: 8px; }

.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-label { flex: 1 1 auto; font-size: 13px; }
.opt-num { width: 70px; }
.opt-sep { width: 36px; text-align: center; }
.opt-text { flex: 1 1 auto; min-width: 0; }
.modal input[type=text], .modal input[type=number], .modal textarea {
  background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 4px; padding: 5px 7px; font-size: 13px; font-family: inherit;
}
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--de-green); }
.opt-ta { width: 100%; font-family: Menlo, Consolas, monospace; resize: vertical; }
.opt-sub { margin-top: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--de-green-lt); }
.opt-hint { margin: 0 0 4px; font-size: 12px; color: var(--fg-dim); }
.opt-card {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); border-radius: 4px; padding: 8px; background: var(--bg-3);
}
.opt-del { background: #3a1f1f; color: #e09f9f; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.opt-add { align-self: flex-start; background: var(--bg-3); color: var(--de-green-lt); border: 1px solid var(--de-green); border-radius: 4px; padding: 6px 12px; cursor: pointer; font-size: 13px; }

/* history viewer */
.modal-wide { width: min(900px, 96vw); height: 80vh; }
.hist-bar { display: flex; gap: 6px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.hist-sel { flex: 1 1 auto; min-width: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font-size: 13px; }
.hist-search { width: 160px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font-size: 13px; }
.hist-search:focus { outline: none; border-color: var(--de-green); }
.hist-btn { background: var(--bg-3); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 9px; cursor: pointer; font-size: 13px; }
.hist-btn:hover { border-color: var(--de-green); }
.hist-btn:disabled { opacity: .4; cursor: default; }
.hist-body { flex: 1 1 auto; min-height: 0; padding: 6px; background: var(--bg); }
