:root {
  --bg: #070c12;
  --panel: #0d141d;
  --panel-2: #101923;
  --border: #233246;
  --border-soft: #1a2635;
  --text: #f6f8fb;
  --muted: #7790ad;
  --teal: #56f2c2;
  --teal-dim: #1aa982;
  --gold: #b99a53;
  --danger: #ff7b82;
  --blue: #6aa6ff;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -30%, rgba(58, 105, 151, .14), transparent 38%),
    linear-gradient(180deg, #081018 0%, #070c12 32%, #060a0f 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-x: auto;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .07;
  pointer-events: none;
}
.ambient-a { top: -220px; left: 12%; background: #4d9fff; }
.ambient-b { top: 20%; right: -220px; background: #42f1bf; }

.topbar {
  width: min(1760px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  position: sticky;
  left: 0;
  z-index: 4;
}
.eyebrow, .team-label, .modal-kicker {
  margin: 0 0 4px;
  color: #6f88a6;
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 800;
}
h1 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9bb0c8;
  font-size: 13px;
}
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 16px var(--teal); }
.live-dot b { color: #dbe8f6; }

.ghost-btn, .secondary-btn, .primary-btn, .admin-clear {
  border: 1px solid var(--border);
  color: #cfe1f6;
  background: rgba(13,20,29,.82);
  border-radius: 10px;
  padding: 9px 13px;
}
.ghost-btn:hover, .secondary-btn:hover { border-color: #3b5472; background: #111c28; }
.primary-btn { border-color: #268c72; color: #04100d; background: var(--teal); font-weight: 800; }
.primary-btn:hover { filter: brightness(1.04); }

.page-shell {
  width: min(1760px, calc(100% - 56px));
  min-width: 1180px;
  margin: 0 auto;
  padding-bottom: 52px;
}

.fixed-area {
  width: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 38px;
  position: relative;
}
.fixed-area .fixed-card:first-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: 310px;
}
.fixed-area::before {
  content: "";
  position: absolute;
  width: 1px;
  height: 26px;
  top: 86px;
  left: 50%;
  background: #253447;
}
.fixed-area::after {
  content: "";
  position: absolute;
  top: 111px;
  left: 25%;
  right: 25%;
  height: 1px;
  background: #253447;
}

.fixed-card, .role-card {
  position: relative;
  background: linear-gradient(180deg, rgba(15,22,31,.96), rgba(12,18,26,.96));
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
}
.fixed-card { min-height: 86px; }
.fixed-card.green { border-color: #347c68; }
.fixed-card h3, .role-card h3 { margin: 0 0 7px; font-size: 15px; letter-spacing: -.015em; }
.fixed-card .role, .role-card .role { color: var(--teal); font-size: 12px; font-weight: 800; margin: 0 0 6px; }
.fixed-card .detail, .role-card .detail { color: var(--muted); font-size: 11px; margin: 0; line-height: 1.45; }

.connector-main {
  width: 1px;
  height: 30px;
  background: #253447;
  margin: 0 auto;
}
.board-wrap { position: relative; }
.team-board {
  border-top: 1px solid #263649;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(205px, 1fr));
  gap: 20px;
  position: relative;
}
.team-column { min-width: 0; }
.team-head { min-height: 62px; padding: 0 2px 10px; }
.team-head h2 { margin: 0 0 2px; font-size: 13px; letter-spacing: -.01em; }
.team-desc { margin: 0; color: #8ca3bd; font-size: 10.5px; line-height: 1.35; }
.role-stack { position: relative; padding-left: 14px; }
.role-stack::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 10px;
  width: 1px;
  background: #1b2a3b;
}
.role-card {
  min-height: 84px;
  margin-bottom: 12px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  overflow: hidden;
}
.role-card::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 22px;
  width: 15px;
  height: 1px;
  background: #24354a;
}
.role-card.lead { border-color: #67572f; }
.role-card.available:hover {
  transform: translateY(-1px);
  border-color: #3f607d;
  background: linear-gradient(180deg, #111b27, #0d151e);
}
.role-card.available { cursor: pointer; }
.role-card.filled { border-color: #2a394d; }
.role-card.mine { box-shadow: 0 0 0 1px rgba(86,242,194,.32), 0 12px 30px rgba(21,112,87,.08); }
.role-card .name {
  margin: 0 0 7px;
  min-height: 18px;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.015em;
}
.role-card .name.empty { color: #58718e; font-weight: 700; }
.slot-status {
  position: absolute;
  top: 10px;
  right: 11px;
  font-size: 9px;
  letter-spacing: .08em;
  font-weight: 900;
  color: #5e7997;
  text-transform: uppercase;
}
.filled .slot-status { color: #557089; }
.mine .slot-status { color: var(--teal); }
.admin-clear {
  position: absolute;
  right: 11px;
  bottom: 11px;
  padding: 5px 8px;
  font-size: 10px;
  color: #ffd0d2;
  border-color: #5f3035;
  background: rgba(74,24,29,.34);
}
.admin-clear:hover { border-color: #a94e56; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #111a24;
  border: 1px solid #2b3b4e;
  box-shadow: var(--shadow);
  color: #dbe8f6;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  z-index: 20;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #783c43; color: #ffd5d8; }
.toast.success { border-color: #2e745f; color: #bdffe9; }

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}
.modal::backdrop { background: rgba(2,6,10,.76); backdrop-filter: blur(7px); }
.modal-card {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid #2a3d52;
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #101923, #0b121a);
  box-shadow: 0 30px 100px rgba(0,0,0,.6);
  position: relative;
}
.modal-card.small { width: min(420px, calc(100vw - 32px)); }
.modal-card h2 { margin: 2px 0 8px; font-size: 22px; }
.muted { color: #869cb5; font-size: 13px; line-height: 1.55; }
.field-label { display: block; margin: 18px 0 7px; color: #b7c8d9; font-size: 12px; font-weight: 800; }
input {
  width: 100%;
  border: 1px solid #2a3b4f;
  border-radius: 11px;
  background: #071018;
  color: #f5f8fb;
  padding: 12px 13px;
  outline: none;
}
input:focus { border-color: #3f9b80; box-shadow: 0 0 0 3px rgba(86,242,194,.08); }
.warning-note { color: #b7a984; background: rgba(117,93,45,.12); border: 1px solid #51462f; border-radius: 10px; padding: 10px 12px; font-size: 11px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.close-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #7288a0; font-size: 25px; }
.close-x:hover { color: white; }

.admin-mode .ghost-btn { border-color: #2c8c73; color: var(--teal); }

@media (max-width: 1250px) {
  .topbar, .page-shell { width: 1180px; }
}

body { background: linear-gradient(180deg, rgba(5,12,22,.65), rgba(5,12,22,.91)), url('https://images.unsplash.com/photo-1736077722346-31ba59414728?auto=format&fit=crop&w=2400&q=85') center/cover fixed; }
.topbar, .page-shell { width: min(1760px, calc(100% - 48px)); min-width: 0; }
.topbar { padding-top: 36px; }
.board-intro { display: flex; justify-content: space-between; gap: 16px; color: #b1c5dc; font-size: 13px; margin: 12px 0 32px; }
.board-intro p { margin: 0; }
.board-intro span { color: var(--teal); }
.fixed-card, .role-card { backdrop-filter: blur(16px); background: linear-gradient(145deg, rgba(19,32,47,.9), rgba(8,17,29,.86)); }
.role-card { padding-top: 30px; overflow-wrap: anywhere; }
.role-card:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
.admin-mode .role-card { padding-bottom: 48px; }
.admin-delete { position: absolute; bottom: 11px; left: 11px; border: 1px solid #663e4a; border-radius: 8px; padding: 5px 8px; color: #ffb9c2; background: #321d2a; font-size: 10px; }
.add-role { width: calc(100% - 14px); margin-left: 14px; border-style: dashed; }
footer { display: flex; justify-content: space-between; gap: 16px; margin: 0 24px 24px; font-size: 10px; color: #9badc2; letter-spacing: .08em; }
footer a { color: #9badc2; }
.toast { max-width: calc(100vw - 32px); width: max-content; }
@media (max-width: 1200px) {
  .team-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar, .page-shell { width: calc(100% - 32px); }
  .topbar { align-items: start; flex-direction: column; padding-top: 24px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .board-intro { flex-direction: column; gap: 8px; }
  .fixed-area { width: 100%; gap: 16px; }
  .fixed-area .fixed-card:first-child { width: min(310px, 100%); }
  .team-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .fixed-card, .role-card { padding-left: 12px; padding-right: 12px; }
  footer { flex-direction: column; }
}
@media (max-width: 480px) {
  .fixed-area, .team-board { grid-template-columns: 1fr; }
  .fixed-area .fixed-card:first-child { width: 100%; }
  .fixed-area::before, .fixed-area::after { display: none; }
  .team-head { min-height: auto; padding-bottom: 16px; }
}
