/* ============ THE HUB — neo-arcade street-courier HUD ============ */
@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #0c0d10;
  --bg-2: #121419;
  --panel: #15181f;
  --panel-2: #1b1f28;
  --line: #262b36;
  --ink: #eef1f5;
  --muted: #8b93a3;
  --green: #27e0a0;
  --green-dim: #1c9c70;
  --amber: #ffb020;
  --red: #ff5d5d;
  --radius: 16px;
  --tap: 46px;
  --maxw: 720px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  background-image: radial-gradient(
      1200px 600px at 80% -10%,
      rgba(39, 224, 160, 0.08),
      transparent 60%
    ),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 176, 32, 0.06), transparent 55%),
    repeating-linear-gradient(
      -36deg,
      transparent 0 38px,
      rgba(255, 255, 255, 0.012) 38px 39px
    );
}

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.45;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100%;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------- typography ---------- */
h1,
h2,
h3 {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.eyebrow {
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--green);
}
.muted {
  color: var(--muted);
}
a {
  color: inherit;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 14px;
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand b {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
}
.brand .brandmark {
  display: inline-flex;
  align-items: center;
}
.brand .brandmark img {
  height: 30px;
  width: auto;
  max-width: 120px;
  display: block;
  object-fit: contain;
}
.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(39, 224, 160, 0.18), 0 0 14px var(--green);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(39, 224, 160, 0), 0 0 14px var(--green);
  }
}
.who {
  text-align: right;
  line-height: 1.15;
}
.who .nm {
  font-weight: 800;
  font-size: 14px;
}
.who .uid {
  font-size: 11px;
  color: var(--muted);
}
.who .uid b {
  color: var(--amber);
  font-family: "Unbounded", sans-serif;
  letter-spacing: 0.04em;
}

/* ---------- cards / panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:active {
  transform: scale(0.99);
}
.card .banner {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0a0b0e
    repeating-linear-gradient(45deg, #14171d 0 14px, #11141a 14px 28px);
  display: block;
}
.card .body {
  padding: 14px;
}
.card h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
.card .desc {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.meta .ic {
  color: var(--green);
}

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.upcoming {
  color: var(--amber);
  border-color: rgba(255, 176, 32, 0.4);
  background: rgba(255, 176, 32, 0.08);
}
.pill.ongoing {
  color: var(--green);
  border-color: rgba(39, 224, 160, 0.45);
  background: rgba(39, 224, 160, 0.1);
}
.pill.ended {
  color: var(--muted);
}
.pill.pending {
  color: var(--amber);
}
.pill.accepted {
  color: var(--green);
}
.pill.rejected {
  color: var(--red);
}
.tagpop {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(12, 13, 16, 0.78);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
}

/* ---------- buttons ---------- */
button,
.btn {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 14px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, filter 0.12s;
}
button:active,
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: linear-gradient(180deg, var(--green), var(--green-dim));
  border-color: transparent;
  color: #04130d;
  box-shadow: 0 8px 24px -10px rgba(39, 224, 160, 0.7);
}
.btn-amber {
  background: linear-gradient(180deg, var(--amber), #c9831a);
  border-color: transparent;
  color: #1c1304;
}
.btn-danger {
  color: var(--red);
  border-color: rgba(255, 93, 93, 0.4);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  min-height: 38px;
  font-size: 13px;
  padding: 0 12px;
}
button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- forms ---------- */
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}
input,
textarea,
select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
  min-height: var(--tap);
}
textarea {
  min-height: 96px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 224, 160, 0.15);
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.switch input {
  width: 46px;
  height: 26px;
  appearance: none;
  background: var(--line);
  border-radius: 999px;
  position: relative;
  min-height: 0;
  transition: background 0.2s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s;
}
.switch input:checked {
  background: var(--green);
}
.switch input:checked::after {
  transform: translateX(20px);
}
.switch label {
  margin: 0;
  text-transform: none;
  color: var(--ink);
  font-size: 14px;
}

/* ---------- layout helpers ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 26px 0 14px;
}
.section-head h2 {
  font-size: 21px;
}
.stack {
  display: grid;
  gap: 14px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.spread {
  justify-content: space-between;
}
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- chat ---------- */
.chat {
  display: flex;
  flex-direction: column;
  height: 60vh;
  min-height: 360px;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}
.msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  align-self: flex-start;
  animation: rise 0.25s ease both;
}
.msg.me {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(39, 224, 160, 0.16), rgba(39, 224, 160, 0.06));
  border-color: rgba(39, 224, 160, 0.35);
}
.msg .who2 {
  font-size: 11px;
  color: var(--amber);
  font-weight: 700;
  margin-bottom: 2px;
}
.msg .tx {
  font-size: 14px;
  word-break: break-word;
}
.msg .tm {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  text-align: right;
}
.composer {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}
.composer input {
  flex: 1;
}
.wsdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.wsdot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px;
  margin: 16px 0;
}
.tabs button {
  flex: 1;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.tabs button.active {
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- bottom nav ---------- */
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: calc(100% - 28px);
  max-width: calc(var(--maxw) - 28px);
  z-index: 60;
  display: flex;
  background: rgba(20, 23, 30, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 16px 40px -16px #000;
}
.nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 4px;
  border-radius: 12px;
}
.nav a .gi {
  display: block;
  font-size: 19px;
  margin-bottom: 3px;
}
.nav a.active {
  color: var(--green);
  background: rgba(39, 224, 160, 0.1);
}

/* ---------- misc ---------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}
.empty .big {
  font-family: "Unbounded";
  font-size: 40px;
  opacity: 0.5;
}
.thumb {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 5, 7, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: var(--maxw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(26px + env(safe-area-inset-bottom));
  animation: up 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes up {
  from {
    transform: translateY(100%);
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 12px;
  z-index: 500;
  font-size: 13px;
  font-weight: 600;
  animation: rise 0.25s ease;
  max-width: 90%;
}
.toast.err {
  border-color: rgba(255, 93, 93, 0.5);
  color: #ffd0d0;
}
.center {
  display: grid;
  place-items: center;
  min-height: 70vh;
  text-align: center;
}
.spin {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: sp 0.8s linear infinite;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
hr.sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

/* ---------- hub buttons (dashboard) ---------- */
.hubrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 4px;
}
.hubbtn {
  position: relative;
  min-height: 58px;
  justify-content: flex-start;
  gap: 10px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 13px;
  padding: 0 14px;
}
.hubbtn .hicon {
  color: var(--green);
  font-size: 18px;
}
.hubbtn .badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--amber);
  color: #1c1304;
  font-family: "Unbounded";
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}
.hubbtn b {
  color: var(--green);
  font-family: "Unbounded";
}

/* ---------- banner placeholder / gradient ---------- */
.banner.ph {
  position: relative;
  display: grid;
  place-items: center;
}
.banner .bimg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner .binit {
  font-family: "Unbounded";
  font-weight: 800;
  font-size: 46px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

/* ---------- persistent global-chat floating button ----------
   Hidden for now (it overlapped the chat send button). The GC controller
   still creates it and keeps it in sync, so re-enabling is a one-line change:
   set `display: grid;` below. Positioned bottom-center to avoid the composer. */
.gcfab {
  display: none;
  place-items: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 70;
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(39, 224, 160, 0.4);
  background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(39, 224, 160, 0.06);
}
.gcfab .gci {
  font-size: 22px;
  color: var(--green);
}
.gcfab .wsdot {
  position: absolute;
  top: 9px;
  right: 9px;
}
.gcfab .badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--amber);
  color: #1c1304;
  font-family: "Unbounded";
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}
@media (min-width: 760px) {
  body.admin-view .gcfab {
    bottom: 24px;
  }
}

/* ---------- room info box ---------- */
.roombox {
  margin: 8px 0 4px;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.roombox .room-val {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.roombox.on {
  border: none;
  color: #10210a;
  background: linear-gradient(135deg, #b6ff5a, var(--green));
  box-shadow: 0 14px 34px -14px rgba(39, 224, 160, 0.7);
}
.roombox.on .room-val {
  color: #0a1f12;
}
.roombox.on .pill {
  background: rgba(0, 0, 0, 0.18);
  border-color: rgba(0, 0, 0, 0.2);
  color: #0a1f12;
}
.roombox.off {
  border-style: dashed;
}
.roombox.off .room-val {
  color: var(--ink);
  opacity: 0.85;
}
.roombox.locked {
  border-style: dashed;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.roomnote {
  margin: 8px 2px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--red);
}

/* ---------- capacity progress bar ---------- */
.capbar {
  margin-top: 12px;
}
.capbar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  margin-bottom: 6px;
}
.capbar-head b {
  font-family: "Unbounded";
  color: var(--green);
  font-size: 13px;
}
.capbar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.capbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.capbar.full .capbar-head b {
  color: var(--amber);
}
.capbar.full .capbar-fill {
  background: linear-gradient(90deg, #c9831a, var(--amber));
}
.capbar.unlimited .capbar-fill {
  background: repeating-linear-gradient(
    45deg,
    rgba(39, 224, 160, 0.5) 0 8px,
    rgba(39, 224, 160, 0.22) 8px 16px
  );
}

/* ---------- line boxes (rules / outfit terms) ---------- */
.linebox {
  margin: 8px 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
}
.lrow {
  display: flex;
  gap: 9px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.45;
}
.lrow + .lrow {
  border-top: 1px solid var(--line);
}
.lrow .ln {
  font-family: "Unbounded";
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  min-width: 16px;
  padding-top: 2px;
}
details.foldbox {
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  overflow: hidden;
}
details.foldbox > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-family: "Unbounded";
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.foldbox > summary::-webkit-details-marker {
  display: none;
}
details.foldbox > summary::after {
  content: "▾";
  color: var(--green);
  transition: transform 0.2s;
}
details.foldbox[open] > summary::after {
  transform: rotate(180deg);
}
details.foldbox[open] > summary {
  border-bottom: 1px solid var(--line);
}
details.foldbox .linebox {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ---------- image popup ---------- */
.imgmodal {
  align-items: center;
}
.imgmodal .sheet {
  border-radius: 18px;
  max-width: 560px;
  width: calc(100% - 28px);
}
.imgwrap {
  display: grid;
  place-items: center;
  min-height: 200px;
}
.fullimg {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

/* ---------- admin: desktop-friendly (not mobile-first) ---------- */
.ugrid {
  display: grid;
  gap: 12px;
}
body.admin-view #app {
  max-width: 1080px;
}
@media (min-width: 760px) {
  body.admin-view .ugrid {
    grid-template-columns: repeat(2, 1fr);
  }
  body.admin-view .modal {
    align-items: center;
  }
  body.admin-view .sheet {
    border-radius: 20px;
    max-width: 560px;
  }
}
.kbd {
  font-family: "Unbounded";
  color: var(--amber);
}
