@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&family=Saira+Condensed:wght@500;600;700;800&family=Saira+Stencil+One&display=swap");
:root {
  --bg: #15130f;
  --bg-2: #1b1814;
  --panel: #221f1a;
  --panel-2: #2b2721;
  --line: #3d372e;
  --text: #ece4d6;
  --muted: #a79e8f;
  --accent: #e8661a;
  --accent-ink: #1a0d03;
  --ok: #8fae5a;
  --warn: #f5b942;
  --err: #d9583a;
  --chat: #7cc4ff;
  --cmd: #ffb35c;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* ---------- LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: 230px 1fr;
  grid-template-rows: 58px 1fr;
  grid-template-areas: "side top" "side main";
  height: 100vh;
}
.sidebar {
  grid-area: side;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  letter-spacing: .2px;
}
.brand img { width: 30px; height: 30px; border-radius: 6px; }
.brand small { display: block; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.nav-group { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 6px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #c3cad6;
  text-decoration: none;
  font-weight: 500;
}
.nav-link i { width: 18px; text-align: center; color: var(--muted); }
.nav-link:hover { background: var(--panel-2); color: #fff; }
.nav-link.active { background: rgba(232,102,26,.12); color: var(--accent); }
.nav-link.active i { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: var(--err); }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); }
.user .who { line-height: 1.15; }
.user .who b { display: block; font-size: 13px; }
.user .who span { font-size: 11px; color: var(--muted); }
.badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 2px 7px; border-radius: 4px; background: rgba(232,102,26,.15); color: var(--accent); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: #c3cad6; cursor: pointer; text-decoration: none; font-size: 13px;
}
.icon-btn:hover { border-color: #33405a; color: #fff; }
.icon-btn.on { background: rgba(232,102,26,.12); border-color: rgba(232,102,26,.4); color: var(--accent); }
.btn-primary {
  height: 36px; padding: 0 16px; border: 0; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: var(--err); color: #fff; }

.main { grid-area: main; overflow: auto; padding: 20px; min-height: 0; }

/* ---------- CARDS ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card .k { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.card .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.section-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 22px 0 10px; }

/* ---------- CONSOLE ---------- */
.console-page { display: grid; grid-template-columns: 1fr 320px; gap: 14px; height: 100%; min-height: 0; }
.console-wrap { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 13px; }
.tabs button.active { background: var(--panel-2); color: #fff; }
.tabs .count { font-size: 11px; color: var(--muted); margin-left: 4px; }
.search { height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-2); outline: none; min-width: 160px; flex: 1; max-width: 280px; }
.search:focus { border-color: #3a4a68; }

.log {
  flex: 1; overflow-y: auto; min-height: 0;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  padding: 10px 12px; background: #120f0c;
}
.log .l { white-space: pre-wrap; word-break: break-word; padding: 0 4px; border-radius: 3px; }
.log .l:hover { background: rgba(255,255,255,.03); }
.log .ts { color: #4b5873; margin-right: 8px; user-select: none; }
.log .Warning { color: var(--warn); }
.log .Error { color: var(--err); }
.log .Chat { color: var(--chat); }
.log .Chat .u { color: #fff; font-weight: 600; }
.log .Chat .team { color: #6ee7b7; }
.log .Command { color: var(--cmd); }
.log .Command .by { color: var(--muted); }
.log .System { color: #a78bfa; font-style: italic; }
.log .reply { color: #d7dde8; }
.log .empty { color: var(--muted); padding: 20px; text-align: center; font-family: inherit; }

.new-lines {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 6px 14px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); display: none;
}

.input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.input-row select { height: 38px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--line); padding: 0 8px; }
.cmd {
  flex: 1; height: 38px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line);
  background: #120f0c; font-family: var(--mono); outline: none;
}
.cmd:focus { border-color: var(--accent); }
.quick { display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; background: var(--panel); }
.quick button { border: 1px dashed #4a4336; background: transparent; color: var(--muted); border-radius: 6px; padding: 4px 9px; cursor: pointer; font-family: var(--mono); font-size: 12px; }
.quick button:hover { color: #fff; border-color: var(--accent); }

.side-panel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.side-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.side-head b { flex: 1; }
.players { overflow-y: auto; flex: 1; min-height: 0; }
.player { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.player:hover { background: var(--panel-2); }
.player .n { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.player .n span { color: var(--muted); font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }
.player .s { font-family: var(--mono); color: var(--muted); font-size: 11.5px; }
.player .acts { display: none; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.player.open .acts { display: flex; }
.player .acts button { font-size: 12px; height: 28px; padding: 0 9px; }

/* ---------- MODAL ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.show { display: flex; }
.modal { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.modal h3 { margin: 0 0 6px; }
.modal p { color: var(--muted); margin: 0 0 12px; }
.modal input { width: 100%; height: 38px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg-2); padding: 0 10px; outline: none; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.toast { position: fixed; right: 18px; bottom: 18px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; z-index: 60; display: none; max-width: 360px; }

/* ---------- LOGIN ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(800px 400px at 50% -10%, rgba(232,102,26,.10), transparent), var(--bg); }
.login { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.login .head { text-align: center; margin-bottom: 20px; }
.login .head img { width: 56px; height: 56px; border-radius: 10px; }
.login h2 { margin: 10px 0 4px; }
.login .head p { color: var(--muted); margin: 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--bg-2); }
.step .num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--panel-2); font-weight: 700; color: var(--muted); flex: none; }
.step.done .num { background: rgba(34,197,94,.15); color: var(--ok); }
.step .txt { flex: 1; min-width: 0; }
.step .txt b { display: block; }
.step .txt span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.step a.go { text-decoration: none; height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 7px; font-weight: 600; color: #fff; flex: none; }
.go.steam { background: #1b2838; border: 1px solid #2a475e; }
.go.discord { background: #5865f2; }
.err { background: rgba(240,82,82,.1); border: 1px solid rgba(240,82,82,.35); color: #ffb4b4; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.login .foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login .foot a { color: var(--muted); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
  .console-page { grid-template-columns: 1fr; grid-template-rows: 1fr 260px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 58px 1fr; grid-template-areas: "side" "top" "main"; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { border-bottom: 0; height: 50px; }
  .nav-group { flex-direction: row; padding: 6px; }
  .nav-label, .sidebar-foot { display: none; }
  .user .who { display: none; }
  .main { padding: 12px; }
}

/* ---------- IronWilds metalo tema (2026-10-14) ---------- */
body { font-size: 15px; }
h1, h2, h3, h4, .brand, .nav a, .btn, .tabs button, .badge {
  font-family: "Saira Condensed", "Roboto Condensed", Arial, sans-serif;
}
h1, h2, h3 { font-weight: 700; letter-spacing: .01em; }
.brand span, .brand b { font-family: "Saira Stencil One", "Saira Condensed", Impact, sans-serif; font-weight: 400; letter-spacing: .03em; }
.card, .console-wrap, .side-panel, .modal, .login {
  border-radius: 2px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.btn, .tabs, .tabs button, .search, .input-row select, .modal input, .step, .toast, .badge { border-radius: 2px; }
.sidebar { background: linear-gradient(180deg, #1f1c17, #181511); }
