@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap');

/*
  Spawnpoint industrial theme.
  Factory-game inspired: bevelled steel panels, inset slots, amber signal
  colours, hazard striping, and the rusty gear mascot from Horror Defense.
  Loaded after style.css and host.css so it overrides them without
  touching the original component rules.
*/

:root {
  --bg: #1c1b1a;
  --surface: #313031;
  --surface2: #3a3938;
  --border: #0e0d0d;
  --text: #f1e9dc;
  --muted: #b4aa9b;
  --accent: #ffa632;
  --green: #74b84a;
  --heading: #ffe3b3;
  --slot: #232221;
  --steel-hi: #57544f;
  --steel-lo: #121110;
  --rust: #b5562a;
  --olive: #6f8436;
  --hazard: #f0b21b;
  --confirm: #5fae3c;
  --confirm-hi: #8fd862;
  --bevel: inset 2px 2px 0 var(--steel-hi), inset -2px -2px 0 var(--steel-lo), 0 0 0 1px #090808, 0 4px 10px #0007;
  --inset: inset 2px 2px 0 #0b0a0a, inset -1px -1px 0 #4a4744;
  font-family: 'Titillium Web', 'DM Sans', system-ui, sans-serif;
}

body {
  background:
    radial-gradient(ellipse at 15% -10%, #ffa63212, transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 31px, #ffffff05 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, #ffffff05 31px 32px),
    var(--bg);
  color: var(--text);
}

h1, h2, h3, .brand, .stat-value, .game-card-content strong, .detail-metrics strong {
  font-family: 'Titillium Web', 'Space Grotesk', sans-serif;
}
h1, h2, h3 { color: var(--heading); font-weight: 700; letter-spacing: 0; }
h1 { text-transform: uppercase; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
p { color: var(--muted); }
.heading-dot, .brand-period { color: var(--accent); }

/* Eyebrows read like stencilled machine labels */
.eyebrow, .nav-label, .modal-eyebrow, .subtle-caption, .host-game .game-protocol {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 2.5px;
}

/* ---------- Brand & gear mascot ---------- */
.brand { color: var(--heading); font-weight: 700; letter-spacing: 0; text-transform: uppercase; font-size: 1.35rem; }
.brand-logo { width: 38px; height: 38px; }
.brand-gear { width: 38px; height: 38px; display: block; filter: drop-shadow(0 2px 2px #000a); transition: transform .6s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .brand-gear { transform: rotate(60deg); }
.footer-gear { width: 16px; height: 16px; vertical-align: -3px; }

.empty-gear { width: 76px; height: 76px; filter: drop-shadow(0 4px 6px #000a); animation: gear-idle 4s ease-in-out infinite; }
@keyframes gear-idle { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-3px); } }

/* ---------- Sidebar: steel cabinet ---------- */
.sidebar, .host-sidebar {
  background: linear-gradient(180deg, #2c2b2a, #242322);
  border-right: 0;
  box-shadow: inset -2px 0 0 var(--steel-lo), inset -3px 0 0 #403e3b, 4px 0 18px #0006;
}
.workspace {
  background: var(--slot);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--inset);
}
.workspace-avatar, .avatar {
  background: linear-gradient(180deg, #8d8a85, #5f5c58);
  color: #1b1a19;
  border: 0;
  border-radius: 2px;
  font-weight: 700;
  box-shadow: inset 1px 1px 0 #c0bdb7, inset -1px -1px 0 #33312e;
}
.nav-item, .host-nav-link { color: #cbc2b4; border-radius: 2px; }
.nav-item:hover, .host-nav-link:hover { background: #3b3937; color: var(--heading); }
.nav-item.active {
  background: linear-gradient(90deg, #ffa63233, #ffa63208);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #ffa63240;
}
.nav-item.active:before { background: var(--accent); width: 4px; border-radius: 0; box-shadow: 0 0 10px var(--accent); }
.nav-count { background: var(--slot); color: var(--accent); border-radius: 2px; box-shadow: var(--inset); font-weight: 700; }

.little-card {
  background: var(--surface);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--bevel);
  overflow: hidden;
}
.little-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 8px, #1b1a19 8px 16px);
}
.little-card > .icon { color: var(--accent); }
.little-card button { color: var(--accent); border-top-color: #4a4744; }
.profile { border-top: 2px solid var(--steel-lo); box-shadow: inset 0 1px 0 #403e3b; }

/* ---------- Top bar ---------- */
.topbar {
  border-bottom: 0;
  background: linear-gradient(180deg, #2b2a29, #252423);
  box-shadow: inset 0 -2px 0 var(--steel-lo), inset 0 -3px 0 #403e3b;
}
.topbar-label, .search-trigger { color: #c9bfb0; }
.demo-tag { background: #ffa6321a; color: var(--accent); border: 1px solid #ffa63266; border-radius: 2px; font-weight: 700; }
.host-connection { color: #c9bfb0; }
.host-connection.live i, .profile-dot { background: var(--confirm-hi); box-shadow: 0 0 6px var(--confirm-hi); }
.icon-btn:hover { background: #3b3937; color: var(--accent); }
.breadcrumb { color: #8f877b; }
.breadcrumb span { color: var(--heading); }

/* ---------- Panels: bevelled steel plates with corner rivets ---------- */
.panel, .host-check, .host-game, .stat-card, .node-card, .notice, .host-info, .host-download-card, .host-settings {
  background:
    radial-gradient(circle at 9px 9px, #6a6560 0 2px, #0c0b0b 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, #6a6560 0 2px, #0c0b0b 2.5px, transparent 3.5px),
    radial-gradient(circle at 9px calc(100% - 9px), #6a6560 0 2px, #0c0b0b 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #6a6560 0 2px, #0c0b0b 2.5px, transparent 3.5px),
    linear-gradient(180deg, #353433, #2d2c2b);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--bevel);
}
.section-top, .host-subheading { color: var(--heading); }
.count-badge { background: var(--slot); color: var(--accent); border: 0; border-radius: 2px; box-shadow: var(--inset); font-weight: 700; }

/* Welcome panel: hazard-striped header and the mascot on the left */
.host-welcome {
  grid-template-columns: auto minmax(0, 1.65fr) minmax(230px, 1fr);
  align-items: center;
  position: relative;
  padding-top: 38px;
  overflow: hidden;
}
.host-welcome::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 10px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 14px, #1b1a19 14px 28px);
  box-shadow: 0 2px 0 #000;
}
.welcome-gear {
  width: 132px; height: 132px;
  filter: drop-shadow(0 6px 8px #000b);
  animation: gear-idle 5s ease-in-out infinite;
}
.host-welcome h2 { font-size: 1.65rem; line-height: 1.25; text-transform: uppercase; }
.host-flow { border-left: 0; padding: 16px 18px; background: var(--slot); box-shadow: var(--inset); border-radius: 2px; }
.flow-item > .icon { color: var(--accent); }
.flow-item strong { color: var(--heading); font-weight: 600; }
.flow-connector { border-left: 2px dashed #ffa63266; }

.host-check > .icon { color: var(--confirm-hi); }
.host-check strong { color: var(--heading); font-weight: 600; }
.host-check .dim { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: .78rem;
  transition: filter .12s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.secondary {
  background: linear-gradient(180deg, #a19e99, #7d7a75);
  color: #161514;
  border: 0;
  box-shadow: inset 2px 2px 0 #d4d1cb, inset -2px -2px 0 #45423e, 0 0 0 1px #0b0a0a, 0 3px 0 #0008;
}
.btn.secondary:hover:not(:disabled) { background: linear-gradient(180deg, #ffbe5c, #f0951f); border: 0; color: #1b1205; box-shadow: inset 2px 2px 0 #ffe0a8, inset -2px -2px 0 #9a5a0d, 0 0 0 1px #0b0a0a, 0 0 14px #ffa63255; }
.btn.primary {
  background: linear-gradient(180deg, #78c94c, #4f9a2e);
  color: #0d1a07;
  border: 0;
  box-shadow: inset 2px 2px 0 #b7f08f, inset -2px -2px 0 #2c5a18, 0 0 0 1px #0b0a0a, 0 3px 0 #0008;
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #8fdc62, #5fae3c); border: 0; box-shadow: inset 2px 2px 0 #c9f8a8, inset -2px -2px 0 #2c5a18, 0 0 0 1px #0b0a0a, 0 0 16px #74b84a66; }
.btn.danger {
  background: linear-gradient(180deg, #d0533c, #9c3222);
  color: #fff1ec;
  border: 0;
  box-shadow: inset 2px 2px 0 #f08a74, inset -2px -2px 0 #5a1c12, 0 0 0 1px #0b0a0a, 0 3px 0 #0008;
}
.btn.danger:hover:not(:disabled) { filter: brightness(1.12); background: linear-gradient(180deg, #d0533c, #9c3222); }
.text-btn { color: var(--accent); font-weight: 700; }
.icon-btn { border-radius: 2px; }

/* ---------- Inputs: recessed slots ---------- */
input, select, textarea {
  background-color: var(--slot);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--inset);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { box-shadow: var(--inset), 0 0 0 2px var(--accent); }
.table-search { background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset); }
.table-search input { box-shadow: none; }
.segmented, .filter-tabs { background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset); padding: 3px; }
.segmented button, .filter-tabs button { border-radius: 1px; color: #b4aa9b; }
.segmented button.selected, .filter-tabs button.selected { background: linear-gradient(180deg, #ffbe5c, #f0951f); color: #1b1205; border-color: transparent; font-weight: 700; }

/* ---------- Game cards & icons: inventory slots ---------- */
.game-icon, .backup-icon, .event-icon, .region-flag {
  background: var(--slot);
  border: 0;
  border-radius: 2px;
  box-shadow: var(--inset);
}
.host-game h3 { color: var(--heading); font-size: 1.1rem; }
.host-game:before { opacity: .12; }
.host-game .game-protocol {
  background: var(--slot); padding: 3px 6px; border-radius: 2px; box-shadow: var(--inset); top: 17px;
}
.host-game:hover { box-shadow: var(--bevel), 0 0 0 2px var(--accent); }
.game-card { border: 0; border-radius: 2px; box-shadow: var(--bevel); }
.game-card:hover { box-shadow: var(--bevel), 0 0 0 2px var(--accent); }
.game-plus { border-radius: 2px; }

/* ---------- Status lamps ---------- */
.status {
  background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset);
  color: var(--confirm-hi); font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.status i { width: 7px; height: 7px; background: var(--confirm-hi); box-shadow: 0 0 6px var(--confirm-hi); }
.status.offline { background: var(--slot); color: #a39a8d; }
.status.offline i { background: #6d6760; box-shadow: none; }
.host-status-good { color: var(--confirm-hi) !important; }
.host-status-bad { color: #ff7a5c !important; }
.host-status-waiting { color: var(--accent) !important; }

/* ---------- Stats, progress bars ---------- */
.stat-label { color: var(--heading); }
.stat-value { color: var(--text); }
.memory-track, .row-track { background: var(--slot); box-shadow: var(--inset); border-radius: 1px; height: 8px; }
.memory-track i, .row-track i {
  border-radius: 0;
  background: repeating-linear-gradient(-45deg, #ffbe5c 0 6px, #f0951f 6px 12px);
}
.mini-blocks i { background: #403e3b; border-radius: 0; }
.mini-blocks i.lit, .player-dots > i.filled { background: var(--accent); }

/* ---------- Tables ---------- */
thead { background: #262524; border-color: var(--steel-lo); }
th { color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
td { border-bottom-color: #232221; }
tbody tr:hover { background: #ffa63212; }
.table-footer, .activity-bottom { background: #2a2928; border-top: 2px solid var(--steel-lo); color: #9c9387; }

/* ---------- Empty states ---------- */
.host-empty h3, .empty-state h3 { color: var(--heading); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Notices ---------- */
.notice > .icon, .host-info > .icon { color: var(--accent); }
.host-info.warning, .notice.warning { box-shadow: var(--bevel), inset 4px 0 0 var(--hazard); }
.setup-note { background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset); color: #c9bfb0; }
.endpoint, .host-detail-address, .host-code {
  background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset); color: var(--accent);
}

/* ---------- Modals: machine GUI windows ---------- */
.modal-backdrop { background: #0c0b0bcc; }
.modal {
  background: linear-gradient(180deg, #353433, #2d2c2b);
  border: 0;
  border-radius: 2px;
  box-shadow: inset 2px 2px 0 var(--steel-hi), inset -2px -2px 0 var(--steel-lo), 0 0 0 1px #000, 0 30px 80px #000c;
  padding-top: 44px;
}
.modal::before {
  content: ''; position: absolute; inset: 2px 2px auto 2px; height: 22px;
  background:
    repeating-linear-gradient(90deg, transparent 0 3px, #ffffff08 3px 4px),
    linear-gradient(180deg, #44423f, #383634);
  box-shadow: inset 0 -2px 0 var(--steel-lo);
}
.modal-close { top: 3px; right: 6px; width: 22px; height: 20px; padding: 2px; }
.choose-game, .selected-game, .detail-metrics > div {
  background: var(--slot); border: 0; border-radius: 2px; box-shadow: var(--inset);
}
.choose-game:hover { background: #2b2a29; }
.choose-game.chosen { background: #ffa6321c; box-shadow: var(--inset), 0 0 0 2px var(--accent); }
.choose-game.chosen .radio { background: var(--accent); border-color: var(--accent); }
.wizard-steps .current { color: var(--accent); }
.wizard-steps > i { background: #4a4744; }
.detail-tabs { border-bottom: 2px solid var(--steel-lo); }
.detail-tabs button.selected { color: var(--accent); border-bottom-color: var(--accent); }
.modal-footer { border-top: 2px solid var(--steel-lo); }

/* ---------- Console ---------- */
.console, .host-log { background: #0f0e0d; border: 0; border-radius: 2px; box-shadow: var(--inset); }
.console-top { background: #262524; border-bottom: 2px solid #000; color: #a39a8d; }
.console-top i.connected { background: var(--confirm-hi); }
.log-line { color: #d8cfc2; }
.log-line.success { color: var(--confirm-hi); }
.console form > span { color: var(--accent); }

/* ---------- Toasts & footer ---------- */
#toasts > * { border-radius: 2px !important; }
footer { border-top: 0; box-shadow: inset 0 2px 0 var(--steel-lo), inset 0 3px 0 #403e3b; background: #232221; color: #8f877b; }

@media (max-width: 1200px) {
  .host-welcome { grid-template-columns: auto minmax(0, 1fr); }
  .host-welcome .host-flow { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 700px) {
  .host-welcome { grid-template-columns: 1fr; justify-items: start; }
  .welcome-gear { width: 88px; height: 88px; }
  .host-welcome .host-flow { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-gear, .empty-gear { animation: none; }
  .brand-gear { transition: none; }
}
