:root {
  --bg: #0d1117;
  --card: #151b23;
  --card-2: #1c2430;
  --text: #f3f6fb;
  --muted: #aeb8c7;
  --line: rgba(255, 255, 255, .09);
  --accent: #f4c542;
  --accent-dark: #c99500;
  --danger: #ff5c5c;
  --success: #62d394;
  --warning: #f4c542;
  --blue: #8db8ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, .30);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 197, 66, .13), transparent 34%),
    radial-gradient(circle at bottom right, rgba(244, 197, 66, .06), transparent 30%),
    var(--bg);
  padding: clamp(12px, 2.5vw, 28px);
}

[hidden] {
  display: none !important;
}

.card,
.clock-card,
.stat-card {
  background: rgba(21, 27, 35, .94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.card {
  padding: clamp(18px, 2.2vw, 26px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .82rem;
}

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

h1 {
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: .98;
  margin-bottom: 12px;
}

h2 {
  margin-bottom: 6px;
}

.subtitle,
.section-title p,
#counter,
.rules-list,
label,
.modal-card p {
  color: var(--muted);
}

.subtitle {
  line-height: 1.45;
}

/* PIN */

.pin-screen {
  min-height: calc(100vh - 24px);
  display: grid;
  place-items: center;
}

.pin-card {
  width: min(460px, 100%);
  padding: clamp(22px, 4vw, 34px);
}

.pin-logo {
  display: block;
  width: clamp(90px, 22vw, 132px);
  margin: 0 auto 24px;
}

.pin-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

/* Header */

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
  min-width: 0;
}

.header-logo {
  width: clamp(88px, 12vw, 150px);
  max-height: 76px;
  object-fit: contain;
  flex-shrink: 0;
}

.clock-card {
  padding: 20px;
  display: grid;
  place-content: center;
  text-align: center;
}

.clock-card span {
  color: var(--muted);
  font-size: .9rem;
}

.clock-card strong {
  font-size: 2rem;
  margin-top: 4px;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 24px;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Formulare */

label {
  display: grid;
  gap: 8px;
  font-size: .92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  color: var(--text);
  outline: none;
  font-size: 1rem;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(244, 197, 66, .12);
}

.actions,
.toolbar,
.search-wrap,
menu {
  display: flex;
  gap: 12px;
  align-items: center;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.primary {
  background: var(--accent);
  color: #171717;
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.message {
  min-height: 22px;
  margin-top: 14px;
  font-weight: 800;
}

.message.ok {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

/* Regeln */

.rules-list {
  padding-left: 20px;
  line-height: 1.55;
  margin-bottom: 0;
}

/* Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 2rem;
}

/* Liste */

.toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.search-wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap input {
  min-width: 260px;
}

.search-wrap select {
  width: 190px;
}

.guest-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.guest-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-left: 5px solid var(--warning);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.guest-card.done {
  opacity: .62;
  border-left-color: var(--success);
}

.guest-card.supervisor {
  border-left-color: var(--blue);
}

.guest-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.guest-name {
  font-size: 1.2rem;
  font-weight: 900;
}

.guest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.active {
  background: rgba(244, 197, 66, .13);
  color: var(--warning);
}

.badge.done {
  background: rgba(98, 211, 148, .13);
  color: var(--success);
}

.badge.supervisor {
  background: rgba(111, 168, 255, .13);
  color: var(--blue);
}

.badge.danger {
  background: rgba(255, 92, 92, .13);
  color: var(--danger);
}

.guest-note {
  color: var(--muted);
  margin-bottom: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty {
  color: var(--muted);
  padding: 20px 0;
}

/* Dialog */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .65);
}

.modal-card {
  width: min(440px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

menu {
  justify-content: flex-end;
  padding: 0;
  margin: 18px 0 0;
}

/* Tablet */

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

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Handy */

@media (max-width: 760px) {
  body {
    padding: 12px;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .header-brand {
    align-items: center;
  }

  .header-logo {
    width: 82px;
    max-height: 62px;
  }

  .app-header h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .clock-card {
    padding: 16px;
  }

  .layout {
    gap: 14px;
    margin-bottom: 14px;
  }

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

  .actions,
  .toolbar,
  .search-wrap,
  .row-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .search-wrap input,
  .search-wrap select {
    width: 100%;
    min-width: 0;
  }

  button {
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }

  .guest-cards {
    grid-template-columns: 1fr;
  }

  .guest-top {
    flex-direction: column;
  }

  .pin-card {
    width: 100%;
  }

  .pin-logo {
    width: 96px;
  }

  .pin-card h1 {
    font-size: 2.35rem;
  }
}

/* Kleine Handys */

@media (max-width: 430px) {
  body {
    padding: 10px;
  }

  .card,
  .clock-card,
  .stat-card,
  .modal-card {
    border-radius: 18px;
  }

  .header-brand {
    align-items: flex-start;
    gap: 12px;
  }

  .header-logo {
    width: 74px;
  }

  .eyebrow {
    letter-spacing: .12em;
    font-size: .75rem;
  }

  .app-header h1 {
    font-size: 2.1rem;
  }

  .subtitle {
    font-size: .95rem;
  }

  input,
  select,
  button {
    font-size: .98rem;
  }

  menu {
    flex-direction: column;
  }
}