/* divider.css — the Divider app screen: a dark terminal workspace framed by
   the same light chassis chrome as the desktop, with green/orange/red
   reserved for status signals rather than used as general decoration. */

.screen--app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--screen-bg);
}

/* ---------- topbar ---------- */

.app-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--chassis-100), var(--chassis-300));
  border-bottom: 1px solid var(--chassis-500);
  flex-wrap: wrap;
  flex: none;
}
.app-topbar__title { font-weight: 800; letter-spacing: 0.08em; font-size: 13px; margin-right: auto; }
.app-topbar__season { display: flex; gap: 6px; align-items: center; }
.app-topbar__season select {
  border: 1px solid var(--chassis-500); border-radius: 3px; padding: 6px 8px; background: #fff; font-size: 12px; max-width: 160px;
}
.app-tabs { display: flex; gap: 4px; }
.tab-btn {
  background: var(--chassis-200); border: 1px solid var(--chassis-500); padding: 6px 12px;
  font-size: 11px; letter-spacing: 0.06em; border-radius: 3px; color: var(--ink-muted); font-weight: 600;
}
.tab-btn--active { background: var(--orange-500); color: #2a1400; border-color: var(--orange-700); }
.app-topbar__actions { display: flex; gap: 6px; flex-wrap: wrap; }

.app-body { flex: 1; display: flex; overflow: hidden; }

.tab-panel { display: none; }
.tab-panel--active { display: block; }
#tab-board.tab-panel--active { display: flex; width: 100%; overflow: hidden; }
#tab-setup.tab-panel--active { width: 100%; padding: 20px; overflow-y: auto; background: var(--chassis-100); color: var(--ink); }

/* ---------- panel chrome shared by bench + overview ---------- */

.panel-title { font-size: 11px; letter-spacing: 0.1em; color: var(--phosphor-500); margin-bottom: 10px; }
.panel-subtitle { font-size: 10px; letter-spacing: 0.08em; color: var(--ink-on-dark); opacity: 0.75; margin: 14px 0 8px; }

.bench, .overview {
  flex: none;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.bench { width: 230px; background: var(--screen-bg-raised); border-right: 1px solid var(--screen-line); }
.overview { width: 280px; background: var(--screen-bg-raised); border-left: 1px solid var(--screen-line); }

.bench__hint { font-size: 11px; color: var(--ink-on-dark); opacity: 0.65; margin-bottom: 10px; }
.bench__list { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; }

.overview-stats { margin-bottom: 6px; }

/* ---------- bench cards + session bar (also reused in overview) ---------- */

.bench-card {
  background: var(--chassis-700);
  border: 1px solid var(--chassis-600);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.bench-card:hover { border-color: var(--orange-500); }
.bench-card--selected {
  border-color: var(--orange-500);
  background: var(--chassis-600);
  box-shadow: 0 0 0 1px var(--orange-500), 0 0 10px rgba(232, 128, 47, 0.35);
}
.bench-card__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 6px; }
.bench-card__name { font-size: 13px; font-weight: 600; color: var(--ink-on-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-card__multi { font-size: 10px; color: var(--orange-300); flex: none; }
.bench-card__sessions-label { font-size: 10px; color: var(--ink-on-dark); opacity: 0.6; margin-top: 4px; }

.session-bar { display: flex; align-items: center; gap: 6px; }
.session-bar__track { position: relative; flex: 1; height: 7px; border-radius: 4px; background: var(--chassis-800); overflow: hidden; }
.session-bar__zone-min { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(224, 74, 61, 0.22); }
.session-bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width 200ms ease; background: var(--chassis-500); }
.session-bar__ideal-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-on-dark); opacity: 0.55; }
.session-bar__badge { font-size: 9px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; flex: none; }
.session-bar__badge--alarm { background: var(--red-700); color: #fff; animation: alarm-pulse 1.2s infinite; }
.session-bar__badge--warn { background: var(--amber-700); color: #fff; }

.session-bar--below-min .session-bar__fill,
.session-bar--approaching-ideal .session-bar__fill { background: var(--amber-500); }
.session-bar--ideal .session-bar__fill,
.session-bar--above-ideal .session-bar__fill { background: var(--phosphor-500); }
.session-bar--over-max .session-bar__fill { background: var(--red-500); animation: alarm-pulse 1.2s infinite; }

@keyframes alarm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---------- board ---------- */

.board {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  display: flex;
  gap: 14px;
  padding: 16px;
  align-items: flex-start;
  background: var(--screen-bg);
}

.empty-board { margin: auto; text-align: center; color: var(--ink-on-dark); opacity: 0.8; font-size: 13px; }
.empty-board__actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

.campaign-col {
  flex: 0 0 240px;
  background: var(--chassis-700);
  border: 1px solid var(--chassis-600);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.campaign-col.cap--below-min { border-style: dashed; border-color: var(--amber-500); }
.campaign-col.cap--viable { border-color: var(--phosphor-700); box-shadow: 0 0 0 1px rgba(62, 209, 126, 0.15); }
.campaign-col.cap--over-max { border-color: var(--red-500); animation: col-alarm 1.6s infinite; }
@keyframes col-alarm {
  0%, 100% { box-shadow: 0 0 0 1px rgba(224, 74, 61, 0.35); }
  50% { box-shadow: 0 0 0 2px rgba(224, 74, 61, 0.75); }
}

.campaign-col__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.campaign-col__titlewrap { min-width: 0; }
.campaign-col__title { font-size: 13px; font-weight: 700; color: var(--ink-on-dark); }
.campaign-col__gm { font-size: 10px; color: var(--ink-on-dark); opacity: 0.6; margin-top: 2px; }
.campaign-col__meta-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-on-dark); opacity: 0.75; }

.led { display: flex; align-items: center; gap: 5px; flex: none; }
.led__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chassis-500); }
.led__label { font-size: 9px; letter-spacing: 0.05em; white-space: nowrap; color: var(--ink-on-dark); opacity: 0.7; }
.led--below-min .led__dot { background: var(--amber-500); animation: pulse-dot 2s infinite; }
.led--below-min .led__label { color: var(--amber-300); }
.led--viable .led__dot { background: var(--phosphor-500); box-shadow: 0 0 5px var(--phosphor-500); }
.led--viable .led__label { color: var(--phosphor-300); }
.led--over-max .led__dot { background: var(--red-500); box-shadow: 0 0 6px var(--red-500); animation: pulse-dot 0.8s infinite; }
.led--over-max .led__label { color: var(--red-300); }

.campaign-col__s0 { font-size: 10px; padding: 4px 6px; border-radius: 3px; background: var(--chassis-800); }
.s0--none { color: var(--ink-on-dark); opacity: 0.5; }
.s0--invalid { color: var(--red-300); }
.s0--viable { color: var(--phosphor-300); }

.campaign-col__seats { display: flex; flex-direction: column; gap: 6px; min-height: 40px; border-radius: 4px; padding: 2px; }
.campaign-col__seats.drop-hover { background: rgba(232, 128, 47, 0.14); outline: 1px dashed var(--orange-500); }

.seat-empty {
  border: 1px dashed var(--chassis-500);
  border-radius: 4px;
  padding: 8px;
  font-size: 10px;
  text-align: center;
  color: var(--ink-on-dark);
  opacity: 0.4;
  letter-spacing: 0.05em;
}

/* ---------- chips (assigned player instances) ---------- */

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: grab;
  border: 1px solid transparent;
  font-size: 12px;
}
.chip:active { cursor: grabbing; }
.chip__pips { font-size: 8px; letter-spacing: 1px; opacity: 0.85; flex: none; }
.chip__name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip__rank { font-size: 10px; opacity: 0.75; flex: none; }
.chip__remove { background: none; border: none; color: inherit; opacity: 0.55; font-size: 13px; line-height: 1; padding: 0 2px; flex: none; }
.chip__remove:hover { opacity: 1; }

.tier-1 { background: var(--phosphor-700); color: var(--phosphor-100); border-color: var(--phosphor-500); }
.tier-2 { background: var(--phosphor-900); color: var(--phosphor-300); border-color: var(--phosphor-700); }
.tier-3 { background: var(--chassis-600); color: var(--ink-on-dark); border-color: var(--chassis-500); }
.tier-4 { background: var(--amber-700); color: var(--amber-300); border-color: var(--amber-500); }
.tier-5 { background: var(--orange-900); color: var(--orange-300); border-color: var(--orange-700); }
.tier-unranked { background: var(--chassis-800); color: var(--red-300); border: 1px dashed var(--red-700); }

.chip--overflow { outline: 2px solid var(--red-500); animation: alarm-pulse 1.2s infinite; }

/* ---------- overview ---------- */

.health-banner { padding: 8px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; margin-bottom: 12px; }
.health-banner--ok { background: rgba(62, 209, 126, 0.15); color: var(--phosphor-300); }
.health-banner--warn { background: rgba(207, 154, 61, 0.2); color: var(--amber-300); }
.health-banner--invalid { background: rgba(224, 74, 61, 0.2); color: var(--red-300); }

.stat-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.stat-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-on-dark); gap: 8px; }
.stat-row__label { opacity: 0.75; }
.stat-row__value { font-weight: 700; flex: none; }

.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-list-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-on-dark); }
.session-list-row__name { width: 62px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-list-row__num { width: 36px; flex: none; text-align: right; opacity: 0.7; }

/* ---------- setup tab ---------- */

.setup-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 1100px; margin: 0 auto; }
.setup-col { display: flex; flex-direction: column; }
.setup-col__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.setup-col__header .ghost-btn { width: auto; margin: 0; }

.editor-list { display: flex; flex-direction: column; }

.editor-card {
  background: #fff;
  border: 1px solid var(--chassis-400);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.editor-card__main { flex: 1; min-width: 0; }
.editor-card__title { font-weight: 700; font-size: 13px; }
.editor-card__meta { font-size: 11px; color: var(--ink-muted); margin: 2px 0 6px; }
.editor-card__dates { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--ink-muted); }
.date-pill { background: var(--chassis-200); padding: 2px 6px; border-radius: 3px; }
.date-pill--gm-out { color: var(--red-700); text-decoration: line-through; }
.editor-card__actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

@media (max-width: 760px) {
  .setup-columns { grid-template-columns: 1fr; }
}

/* ---------- suggestions ---------- */

.suggestion-list { display: flex; flex-direction: column; gap: 12px; }
.suggestion-card { border: 1px solid var(--chassis-400); border-radius: 6px; padding: 12px; }
.suggestion-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.suggestion-card__label { font-weight: 700; font-size: 13px; }
.suggestion-card__desc { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.suggestion-card__stats { font-size: 11px; color: var(--ink-muted); margin-bottom: 8px; }

.health-pill { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; flex: none; }
.health-pill--valid { background: rgba(62, 209, 126, 0.18); color: var(--phosphor-700); }
.health-pill--needs-work { background: rgba(207, 154, 61, 0.25); color: var(--amber-700); }
.health-pill--invalid { background: rgba(224, 74, 61, 0.18); color: var(--red-700); }

/* ---------- saved divisions ---------- */

.division-list { display: flex; flex-direction: column; gap: 10px; }
.division-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--chassis-400); border-radius: 6px; padding: 10px 12px; flex-wrap: wrap; }
.division-row__main { flex: 1; min-width: 200px; }
.division-row__name { font-weight: 700; font-size: 13px; }
.division-row__meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.division-row__note { font-size: 11px; color: var(--ink-muted); margin-top: 4px; font-style: italic; }
.division-row__actions { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }

/* ---------- import / export ---------- */

.io-panel { display: flex; flex-direction: column; gap: 18px; }
.io-section { border-top: 1px dashed var(--chassis-400); padding-top: 12px; }
.io-section:first-child { border-top: none; padding-top: 0; }
.io-row { margin: 6px 0; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .bench { width: 190px; }
  .overview { width: 230px; }
}
@media (max-width: 720px) {
  #tab-board.tab-panel--active { flex-direction: column; overflow-y: auto; }
  .bench, .overview { width: 100%; max-height: 240px; border: none; border-bottom: 1px solid var(--screen-line); }
  .board { overflow-x: auto; }
  .app-topbar__title { order: -1; width: 100%; margin-right: 0; }
}
