:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #14171c;
  --panel2: #1b2027;
  --line: #303741;
  --green: #22c55e;
  --green2: #16a34a;
  --text: #eefbf2;
  --muted: #95ad9d;
  --red: #ef4444;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #20252c 0, var(--bg) 48%);
  color: var(--text);
  font:
    14px Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  max-width: 1500px;
  margin: auto;
  padding: 22px;
}

.center {
  max-width: 560px;
  margin: 8vh auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--green);
  display: block;
  flex-shrink: 0;
  place-items: center;
  color: #031108;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 28px #22c55e55;
}

h1,
h2,
h3 {
  margin: 0.2em 0;
}

.muted {
  color: var(--muted);
}

.card {
  background: #14171cee;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 16px 45px #0005;
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.spread {
  justify-content: space-between;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(380px, 1.25fr) minmax(350px, 1fr);
  gap: 14px;
}

.full {
  grid-column: 1/-1;
}

input,
select {
  background: #101318;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}

input:focus,
select:focus {
  border-color: var(--green);
}

button {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 10px;
  font-weight: 700;
}

button:hover {
  border-color: #3b6b4b;
}

button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #031108;
}

button.danger {
  background: #3b1316;
  border-color: #782329;
}

.small {
  padding: 6px 9px;
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.pill {
  border-radius: 99px;
  padding: 6px 10px;
  background: #20262d;
  color: #cdd5df;
}

.pill.red {
  background: #3b1618;
  color: #fecaca;
}

.room {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.buzzer {
  width: 100%;
  min-height: 170px;
  border-radius: 20px;
  font-size: 34px;
  background: linear-gradient(145deg, #b45309, #f59e0b);
  color: #160b02;
  border: 0;
  box-shadow: 0 14px 50px #f59e0b25;
}

.buzzer:disabled {
  background: #252a31;
  color: #8b949e;
  box-shadow: none;
  cursor: not-allowed;
}

.scoreboard {
  display: grid;
  gap: 8px;
}

.teamline,
.buzzline,
.playerline,
.historyline {
  display: grid;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #101318;
  border-radius: 11px;
  padding: 9px;
}

.teamline {
  grid-template-columns: 10px 1fr auto auto;
}

.buzzline {
  grid-template-columns: 32px 1fr 100px 70px;
}

.playerline {
  grid-template-columns: 1fr 120px auto;
}

.historyline {
  grid-template-columns: 130px 1fr auto;
}

.dot {
  width: 10px;
  height: 36px;
  border-radius: 8px;
}

.score {
  font-size: 22px;
  font-weight: 900;
}

.dim {
  opacity: 0.45;
}

.value.active {
  background: var(--green);
  color: #031108;
}

.positive {
  color: #55e88a;
}

.negative {
  color: #ff7474;
}

.separator {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: #000a;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal>.card {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow: auto;
}

#toast {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 50;
}

.toast {
  background: #301418;
  border: 1px solid #7d2932;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.technical {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 900px) {

  .dashboard,
  .grid2 {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 12px;
  }

  .playerline {
    grid-template-columns: 1fr;
  }

  .buzzer {
    min-height: 45vh;
  }

  .full {
    grid-column: auto;
  }
}


html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.header-controls {
  flex-wrap: nowrap;
}

.ping-pill {
  display: inline-flex;
  gap: 6px;
  min-width: 112px;
}

.stable-label {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  white-space: nowrap;
}

.stable-label__sizer,
.stable-label__text {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.stable-label__sizer {
  visibility: hidden;
  pointer-events: none;
}

#timingDetails {
  box-sizing: border-box;
  flex: 0 0 152px;
  width: 152px;
  min-width: 152px;
  max-width: 152px;
}

#mute {
  box-sizing: border-box;
  flex: 0 0 90px;
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

#lock {
  box-sizing: border-box;
  flex: 0 0 100px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.buzzer-column {
  display: grid;
  align-self: start;
  min-width: 0;
  gap: 14px;
}

.buzzer-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.buzzer-card__header,
.buzzer-results-card__header {
  min-height: 32px;
}

.buzzer-card__host-controls {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
}

.buzzer-results-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.buzzer-results-card__list {
  display: grid;
  min-width: 0;
  max-height: 320px;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.scoreboard-card {
  min-width: 0;
  align-self: start;
}

.buzzer__label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.buzzer__hint {
  display: block;
  min-height: 16px;
  margin-top: 8px;
  line-height: 16px;
}

.deleteTeam {
  min-width: 58px;
}

.dashboard-primary {
  display: grid;
  grid-template-columns: minmax(380px, 1.25fr) minmax(350px, 1fr);
  gap: 14px;
  align-items: start;
}

.score-timer-column {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-self: start;
}

.host-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.timer-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.timer-card__header {
  min-height: 32px;
}

.timer-face {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, #18221c, #101813);
  box-shadow: inset 0 0 38px #22c55e10;
}

.timer-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(52px, 7vw, 88px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  text-align: center;
}

.timer-card[data-status="finished"] {
  border-color: var(--red);
  box-shadow: 0 0 30px #ef444433;
}

.timer-card[data-status="running"] #timerStatus {
  background: #12351f;
  color: #86efac;
}

.timer-card[data-status="paused"] #timerStatus {
  background: #422d0a;
  color: #fde68a;
}

.timer-card[data-status="finished"] #timerStatus {
  background: #3b1618;
  color: #fecaca;
}

.timer-duration-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.timer-duration-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.timer-controls {
  display: grid;
  gap: 10px;
}

.timer-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-checkbox input {
  min-width: auto;
}

.timer-buttons button {
  flex: 1 1 120px;
}

.timer-buttons button:disabled,
.timer-controls input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.timer-client-note {
  text-align: center;
}

@media (max-width: 900px) {

  .dashboard-primary,
  .host-settings {
    grid-template-columns: 1fr;
  }

  .host-settings {
    margin-top: 14px;
  }

  .timer-face {
    min-height: 150px;
  }
}

.timer-face {
  background: linear-gradient(145deg, #252a31, #181c22);
  border-color: #3a424d;
  box-shadow: inset 0 0 38px #0003;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.timer-card[data-status="running"] .timer-face {
  background: linear-gradient(145deg, #173a25, #10291b);
  border-color: #2f7d4a;
  box-shadow: inset 0 0 42px #22c55e18;
}

.timer-card[data-status="paused"] .timer-face {
  background: linear-gradient(145deg, #4a350f, #2d220d);
  border-color: #a66d0a;
  box-shadow: inset 0 0 42px #f59e0b18;
}

.timer-card[data-status="finished"] {
  border-color: var(--line);
  box-shadow: 0 16px 45px #0005;
}

.timer-card[data-status="finished"] .timer-face {
  background: linear-gradient(145deg, #4a171b, #2d1013);
  border-color: #9f3038;
  box-shadow: inset 0 0 42px #ef444420;
}

.dashboard-primary,
.host-settings {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.dashboard-primary>*,
.host-settings>* {
  min-width: 0;
}

@media (max-width: 900px) {

  .dashboard-primary,
  .host-settings {
    grid-template-columns: minmax(0, 1fr);
  }
}