:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-strong: #ffffff;
  --ink: #111111;
  --muted: #525252;
  --line: #d8dde5;
  --red: #c5222a;
  --red-dark: #8f171f;
  --gold: #af7500;
  --green: #087653;
  --charcoal: #111111;
  --stage-panel: #f6f8fb;
  --stage-line: #d8dde5;
  --stage-text: #111111;
  --stage-muted: #545b66;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
}

button,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.setup-view {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.setup-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.5rem;
  line-height: 1.05;
}

.time-form {
  display: grid;
  grid-template-columns: auto minmax(170px, 220px) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.time-form label {
  color: var(--muted);
  font-weight: 750;
  padding-left: 6px;
}

select,
textarea {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 8px;
}

select {
  min-height: 44px;
  padding: 0 36px 0 12px;
}

.primary-button,
.quiet-button,
.stage-button,
.next-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  min-height: 44px;
  padding: 0 22px;
  background: var(--red);
  color: white;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--red-dark);
}

.checkbox-control {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.checkbox-control input {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-height: 0;
}

.entry-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 460px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-title {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  margin: 0;
  font-size: 1.4rem;
}

.panel-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 100%;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 18px;
  font-size: 1.22rem;
  line-height: 1.55;
  outline-offset: -4px;
}

textarea::placeholder {
  color: #9a9188;
}

.setup-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  flex-wrap: wrap;
}

.setup-stats {
  font-weight: 850;
}

.quiet-button {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--line);
}

.setup-error {
  margin: 0;
  color: var(--red-dark);
  font-weight: 800;
}

.brand-credit {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.brand-credit a {
  color: var(--red-dark);
  text-decoration: none;
}

.brand-credit a:hover,
.brand-credit a:focus-visible {
  text-decoration: underline;
}

.stage-view {
  min-height: 100vh;
  background: #ffffff;
  color: var(--stage-text);
  display: grid;
  grid-template-rows: minmax(108px, auto) 1fr 78px;
}

.stage-queue {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  border-bottom: 1px solid var(--stage-line);
  background: #ffffff;
}

.queue-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.queue-card {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--stage-panel);
  border: 1px solid var(--stage-line);
  border-left: 6px solid var(--gold);
  border-radius: 8px;
}

.queue-card[data-group="Mitglieder"] {
  border-left-color: var(--red);
}

.queue-card[data-group="Andere Chapter"] {
  border-left-color: var(--gold);
}

.queue-card[data-group="Besucher"] {
  border-left-color: var(--green);
}

.queue-card.is-empty {
  opacity: 0.38;
  border-left-color: var(--stage-line);
}

.queue-label {
  color: var(--stage-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.queue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.45rem;
  font-weight: 900;
}

.queue-group {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--stage-muted);
  font-weight: 750;
}

.stage-controls {
  display: grid;
  grid-auto-flow: column;
  align-content: center;
  gap: 8px;
}

.stage-button {
  min-width: 94px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--charcoal);
  color: #ffffff;
  border: 1px solid var(--stage-line);
}

.stage-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  justify-items: center;
  align-items: center;
  gap: 22px;
  padding: 24px 48px 18px;
  cursor: pointer;
  outline: none;
  user-select: none;
}

.current-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.group-pill,
.position-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  background: var(--stage-panel);
  border: 1px solid var(--stage-line);
  color: var(--stage-muted);
  font-weight: 850;
}

.group-pill[data-group="Mitglieder"] {
  color: var(--red-dark);
  border-color: rgba(185, 37, 43, 0.8);
}

.group-pill[data-group="Andere Chapter"] {
  color: #7b5200;
  border-color: rgba(201, 151, 45, 0.8);
}

.group-pill[data-group="Besucher"] {
  color: #075f43;
  border-color: rgba(47, 125, 88, 0.8);
}

.presenter-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.current-name {
  max-width: 100%;
  margin: 0;
  text-align: center;
  font-size: 10rem;
  line-height: 0.94;
  font-weight: 950;
  white-space: nowrap;
}

.timer-display {
  min-width: 5ch;
  text-align: center;
  font-size: 6.4rem;
  line-height: 0.95;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.signal-display {
  min-height: 68px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 950;
}

.signal-display.is-thanks {
  color: var(--gold);
}

.signal-display.is-applause {
  color: var(--green);
}

.stage-footer {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--stage-line);
  background: #ffffff;
}

.stage-footer .brand-credit {
  max-width: 560px;
  margin-left: 0;
  text-align: center;
  color: var(--stage-muted);
}

.progress-shell {
  height: 18px;
  overflow: hidden;
  background: #eef1f5;
  border: 1px solid var(--stage-line);
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 180ms linear;
}

.next-button {
  min-height: 50px;
  min-width: 132px;
  padding: 0 24px;
  background: var(--charcoal);
  color: #ffffff;
}

@media (max-width: 980px) {
  .setup-header,
  .setup-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .time-form,
  .entry-grid,
  .stage-queue,
  .queue-list,
  .stage-footer {
    grid-template-columns: 1fr;
  }

  .brand-credit,
  .stage-footer .brand-credit {
    margin-left: 0;
    text-align: left;
  }

  .entry-panel {
    min-height: 260px;
  }

  .stage-view {
    grid-template-rows: auto 1fr auto;
  }

  .stage-controls {
    grid-auto-flow: column;
  }

  .stage-main {
    padding: 20px;
  }

  .current-name {
    font-size: 4.8rem;
  }

  .timer-display {
    font-size: 4.6rem;
  }
}

@media (max-width: 620px) {
  .setup-view {
    padding: 18px;
  }

  h1 {
    font-size: 2rem;
  }

  .time-form {
    padding: 12px;
  }

  .stage-controls {
    grid-auto-flow: row;
  }

  .queue-name {
    font-size: 1.12rem;
  }

  .current-name {
    font-size: 3.3rem;
  }

  .timer-display {
    font-size: 3.4rem;
  }
}
