:root {
  color-scheme: dark;
  font:
    15px/1.55 'Segoe UI',
    system-ui,
    sans-serif;
  background: #080d12;
  color: #e9f0f4;
  --muted: #92a5b4;
  --accent: #bbf87a;
  --edge: #26343e;
  --panel: #121d25;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button {
  min-height: 42px;
  border: 1px solid #3a4d58;
  border-radius: 6px;
  padding: 9px 17px;
  background: #22323e;
  color: #e9f0f4;
  font-weight: 650;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  background: #2c414e;
  border-color: #739382;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.45;
}
.app-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  min-height: 100dvh;
  max-width: 1600px;
  margin: auto;
}
.sidebar {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 18px 18px;
  background: linear-gradient(170deg, #15212a, #0d161e 75%);
  border-right: 1px solid var(--edge);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 32px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 47px;
  height: 49px;
  border: 1px solid #b6f47b;
  border-radius: 12px 4px;
  background: linear-gradient(135deg, #d6ff96, #7cc45d);
  color: #142415;
  font:
    900 29px 'Trebuchet MS',
    sans-serif;
  box-shadow: 0 0 26px #b7f87a17;
}
.brand h1 {
  font:
    850 27px/1 'Trebuchet MS',
    sans-serif;
  letter-spacing: 0.16em;
  margin: 0;
}
.brand p,
.menu-caption,
.eyebrow,
.workspace-footer,
.connection-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}
.brand p {
  color: var(--muted);
  margin: 7px 0 0;
}
.menu-caption {
  color: #8296a2;
  padding-left: 14px;
  margin: 0 0 12px;
}
#navigation {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.navigation-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 61px;
  padding: 10px 12px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #b3c2cc;
  position: relative;
}
.navigation-button:hover:not(:disabled) {
  border-color: var(--edge);
  background: #1c2c37;
}
.navigation-button[aria-selected='true'] {
  background: linear-gradient(90deg, #b8f47c1c, #b8f47c05);
  color: var(--accent);
  border-color: #95cf6d40;
}
.navigation-button[aria-selected='true']::before {
  position: absolute;
  left: -19px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  content: '';
  background: var(--accent);
  box-shadow: 0 0 12px #bcf87a80;
}
.navigation-symbol {
  width: 22px;
  font-size: 23px;
  text-align: center;
  font-weight: 400;
}
.navigation-copy {
  flex: 1;
}
.navigation-label {
  display: block;
  font-size: 13px;
}
.navigation-hint {
  display: block;
  margin-top: 2px;
  color: #8196a3;
  font-size: 10px;
  font-weight: 450;
}
.navigation-marker {
  font:
    11px/1.2 ui-monospace,
    monospace;
  opacity: 0.6;
}
.navigation-button[data-dirty='true'] .navigation-marker {
  color: #f3cb7d;
  opacity: 1;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 26px;
}
.sidebar-actions {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
}
.sidebar-actions button {
  background: transparent;
  border-color: transparent;
  text-align: left;
  min-height: 37px;
  color: #91a5b1;
  font-size: 12px;
}
.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--edge);
  padding: 18px 8px 0;
  min-width: 0;
}
.player-avatar {
  display: grid;
  place-items: center;
  background: #284237;
  color: var(--accent);
  border: 1px solid #54725a;
  border-radius: 7px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-weight: 750;
}
.player-card div {
  min-width: 0;
}
.player-card p {
  margin: 0;
}
#identity {
  font-weight: 650;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-detail {
  font:
    9px/1.7 ui-monospace,
    monospace;
  color: #8197a4;
  overflow-wrap: anywhere;
}
.workspace {
  padding: 38px clamp(20px, 4vw, 58px) 20px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 100% 0, #b3ef7b07, transparent 40%),
    linear-gradient(#101a2220 1px, transparent 1px),
    linear-gradient(90deg, #101a2220 1px, transparent 1px), #0c131a;
  background-size:
    auto,
    38px 38px,
    38px 38px,
    auto;
}
.workspace-header {
  padding-bottom: 27px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 27px;
}
.eyebrow {
  color: #8dba75;
  margin: 0 0 13px;
}
.page-heading {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: space-between;
}
.page-heading h2 {
  font:
    750 clamp(24px, 3vw, 34px)/1.2 'Trebuchet MS',
    'Segoe UI',
    sans-serif;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
#page-description {
  color: var(--muted);
  margin: 0;
  max-width: 610px;
  font-size: 13px;
}
.connection-label {
  color: #8b9fab;
  white-space: nowrap;
  margin-top: 5px;
  padding: 5px 9px;
  border: 1px solid #33434e;
  border-radius: 4px;
  font-size: 9px;
}
.connection-label[data-state='connected'] {
  color: var(--accent);
  border-color: #6d964849;
  background: #b8f47c08;
}
.connection-label[data-state='expired'] {
  color: #ffc28c;
  border-color: #986d4849;
}
.notice {
  border: 1px solid #8a6d354d;
  border-left: 3px solid #dfb35d;
  border-radius: 5px;
  padding: 12px 16px;
  background: #3a301b4d;
  color: #f5d796;
  margin: 0 0 22px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.notice[data-kind='loading'] {
  color: #c9dcc8;
  background: #22322360;
  border-color: #6c8a5340;
  border-left-color: var(--accent);
}
.settings-content {
  flex: 1;
  min-width: 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.menu-card {
  background: linear-gradient(145deg, #17242e, #111c24);
  border: 1px solid #2b3c47;
  border-radius: 8px;
  padding: clamp(17px, 2vw, 25px);
  position: relative;
  min-width: 0;
}
.menu-card::before {
  content: '';
  position: absolute;
  left: 18px;
  top: -1px;
  width: 35px;
  height: 2px;
  background: #72915c;
}
.menu-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.menu-card p {
  color: #9bafbc;
  font-size: 13px;
  margin: 8px 0 18px;
}
.card-kicker {
  color: #7f9eac !important;
  font-size: 9px !important;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-top: 0 !important;
}
.card-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #293a45;
  padding-top: 17px;
  margin-top: 22px;
}
.control-label {
  font-size: 10px;
  color: #8196a5;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.state-button,
.button-primary {
  background: #b7ee7b;
  color: #172315;
  border-color: #c8fa95;
  box-shadow: 0 3px 14px #9bdd6510;
}
.state-button:hover:not(:disabled),
.button-primary:hover:not(:disabled) {
  background: #cff99d;
  border-color: #e2ffc4;
}
.state-button[data-state='off'] {
  background: #25343e;
  border-color: #465965;
  color: #c5d2da;
  box-shadow: none;
}
.button-danger {
  background: #3d252b;
  border-color: #76434e;
  color: #ffc0c6;
}
.button-danger:hover:not(:disabled) {
  background: #573039;
  border-color: #aa6374;
}
.button-secondary {
  background: #1c2b35;
  border-color: #3b4f5b;
  color: #c4d2db;
}
.button-small {
  font-size: 11px;
  min-height: 33px;
  padding: 5px 11px;
}
.wide-card {
  margin-bottom: 18px;
}
.state-readout {
  font:
    700 28px/1.3 'Trebuchet MS',
    sans-serif;
  letter-spacing: -0.02em;
  margin: 12px 0;
  color: #d6e8d3;
}
.state-readout[data-enabled='true'] {
  color: var(--accent);
}
.status-row {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
  color: #a7bac5;
}
.status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #8f9d9a;
}
.status-row[data-pending='true'] .status-dot {
  background: #f3cf7d;
  box-shadow: 0 0 10px #f3cf7d30;
}
.role-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  font-weight: 600;
  font-size: 12px;
}
.role-count {
  color: var(--accent);
  font:
    10px ui-monospace,
    monospace;
}
.role-select {
  width: 100%;
  min-height: 190px;
  padding: 6px;
  border: 1px solid #3c505b;
  border-radius: 5px;
  background: #0c171e;
  color: #c9d9e2;
}
.role-select option {
  padding: 8px 9px;
  border-radius: 3px;
  margin: 2px 0;
}
.role-select option:checked {
  background: #39553d linear-gradient(#39553d, #39553d);
  color: #e0ffc2;
}
.role-select option:disabled {
  color: #ab8585;
}
.field-help {
  display: block;
  color: #7d93a1;
  font-size: 11px;
  margin-top: 9px;
}
.draft-bar {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  background: #142129;
  border: 1px solid #334b53;
  border-radius: 6px;
  padding: 16px 19px;
}
.draft-bar p {
  margin: 0;
  color: #9fb5be;
  font-size: 12px;
}
.draft-bar[data-dirty='true'] {
  border-color: #9a7e424d;
  background: #302b1c4d;
}
.draft-bar[data-dirty='true'] p {
  color: #efd393;
}
.draft-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.empty-panel {
  text-align: center;
  padding: 44px clamp(15px, 3vw, 45px);
  border: 1px solid #2c3f49;
  border-radius: 9px;
  background: linear-gradient(130deg, #17252d, #101a23);
}
.empty-symbol {
  display: block;
  font-size: 37px;
  color: #a4d877;
  margin-bottom: 15px;
}
.empty-panel h3 {
  font-size: 22px;
  margin: 0 0 12px;
}
.empty-panel p {
  color: #93aab7;
  max-width: 550px;
  margin: 0 auto 18px;
  font-size: 13px;
}
.empty-panel .panel-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.loading-symbol {
  animation: pulse 1.2s ease-in-out infinite;
}
.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #1f303a;
  margin-top: 32px;
  padding-top: 18px;
  color: #667f8f;
  font-size: 9px;
}
dialog {
  max-width: 420px;
  padding: 28px;
  border: 1px solid #53614b;
  border-radius: 10px;
  background: #142029;
  color: #e5eef2;
  box-shadow: 0 25px 100px #0009;
}
dialog::backdrop {
  background: #03080bc9;
  backdrop-filter: blur(4px);
}
dialog h2 {
  margin: 0 0 12px;
  font:
    700 25px 'Trebuchet MS',
    sans-serif;
}
dialog > p:not(.eyebrow) {
  color: #9cb2bf;
  font-size: 13px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .connection-label {
    display: none;
  }
  .workspace {
    padding-top: 28px;
  }
}
@media (max-width: 640px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }
  .brand {
    padding: 0 0 18px;
  }
  .brand-mark {
    width: 37px;
    height: 39px;
    font-size: 23px;
  }
  .brand h1 {
    font-size: 23px;
  }
  .menu-caption {
    display: none;
  }
  #navigation {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
  }
  .navigation-button {
    flex: 1 1 calc(50% - 7px);
    width: auto;
    min-height: 47px;
    padding: 8px;
    gap: 8px;
    border-color: #263943;
  }
  .navigation-label {
    font-size: 11px;
  }
  .navigation-hint,
  .navigation-marker {
    display: none;
  }
  .navigation-symbol {
    font-size: 18px;
    width: 20px;
  }
  .navigation-button[aria-selected='true']::before {
    display: none;
  }
  .sidebar-bottom {
    padding-top: 10px;
    display: flex;
    flex-direction: column-reverse;
  }
  .player-card {
    border-top: 0;
    padding: 10px 0 0;
  }
  .sidebar-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin: 8px 0 0;
  }
  .sidebar-actions button {
    text-align: center;
    padding: 5px 9px;
    min-height: 32px;
  }
  .workspace {
    padding: 24px 18px 18px;
  }
  .workspace-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
  }
  .draft-bar {
    align-items: flex-start;
    flex-direction: column;
  }
  .draft-actions {
    width: 100%;
  }
  .draft-actions button {
    flex: 1;
  }
  .workspace-footer {
    font-size: 8px;
  }
  .role-select {
    min-height: 165px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
