/* quayside — harbours.longervision.com
   Night-bridge instrument panel: ink sea, brass, port/starboard lamps. */

:root {
  --ink:        #0a1620;
  --panel:      #101f2c;
  --panel-2:    #0d1a26;
  --line:       #1d3242;
  --fog:        #d5dee3;
  --fog-dim:    #8aa0ae;
  --brass:      #c8a45c;
  --port:       #e0455a;   /* red  — held by another helm */
  --starboard:  #3fbf7f;   /* green — channel free        */
  --font-ui:    'Chakra Petch', system-ui, sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, monospace;
}

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

html { color-scheme: dark; }

body {
  background:
    radial-gradient(1200px 600px at 70% -10%, #12293a 0%, transparent 60%),
    var(--ink);
  color: var(--fog);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }

.brand-mark {
  width: 34px; height: 34px;
  stroke: var(--brass);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}
.brand-mark circle { fill: var(--brass); stroke: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  color: var(--fog);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--fog-dim);
  letter-spacing: 0.06em;
}

/* ---------- lease lamp (signature) ---------- */
.lease {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.lamp {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--starboard);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--starboard) 60%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}
.lamp.port {
  background: var(--port);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--port) 60%, transparent);
}
.lamp.helm {
  background: var(--brass);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--brass) 60%, transparent);
}

.lease-text { display: flex; flex-direction: column; line-height: 1.2; }
.lease-state {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.lease-detail {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--fog-dim);
}

.btn-release {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--brass);
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.btn-release:hover { filter: brightness(1.1); }
.btn-release:focus-visible { outline: 2px solid var(--fog); outline-offset: 2px; }

/* ---------- layout ---------- */
.deck {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- player ---------- */
.player-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.player-frame video { width: 100%; height: 100%; display: block; }

.player-tag {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  background: rgba(10, 22, 32, 0.78);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.onair-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--port);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .onair-dot { animation: none; }
}

.bridge-note {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--fog-dim);
  max-width: 60ch;
  line-height: 1.55;
}

/* ---------- channel rail ---------- */
.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.rail-head h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
}
.mono { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fog-dim); }

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: var(--brass); background: var(--panel-2); }
.card:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.card img {
  width: 110px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  background: #000;
}

.card-body { min-width: 0; }
.card-name {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-id {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--fog-dim);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card.active {
  border-color: var(--brass);
  background: linear-gradient(90deg, color-mix(in srgb, var(--brass) 10%, var(--panel)), var(--panel));
}
.card.active .card-id::before {
  content: "ON AIR · ";
  color: var(--port);
  font-weight: 500;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--port);
  color: var(--fog);
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  max-width: min(92vw, 480px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 50;
}
.toast.ok { border-color: var(--starboard); }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--fog-dim);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .deck { grid-template-columns: 1fr; }
  .cards { max-height: none; overflow: visible; }
  .topbar { flex-wrap: wrap; }
  .lease { margin-left: auto; }
}
