:root {
  color-scheme: light;
  --ink: #1c2630;
  --muted: #60717c;
  --paper: #f7f3ea;
  --panel: #ffffff;
  --line: #d9d2c3;
  --teal: #006d77;
  --teal-dark: #084c52;
  --coral: #e85d4f;
  --gold: #f0b429;
  --green: #2d8a56;
  --red: #b13c36;
  --shadow: 0 24px 70px rgba(31, 38, 44, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(240, 180, 41, 0.24), transparent 32rem),
    linear-gradient(135deg, #d7eced 0%, var(--paper) 48%, #f8dfd4 100%);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  align-items: center;
}

.quiz-panel,
.side-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.quiz-panel {
  border-radius: 8px;
  padding: clamp(18px, 3vw, 34px);
}

.side-panel {
  border-radius: 8px;
  padding: 24px;
}

.topbar,
.score-strip,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.category,
.status-label {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
}

.icon-button span {
  font-size: 1.4rem;
  font-weight: 900;
}

.score-strip {
  margin-top: 26px;
  color: var(--muted);
  font-weight: 750;
}

.progress-track {
  height: 10px;
  margin: 12px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e2d6;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral));
  transition: width 260ms ease;
}

.question-card {
  min-height: 570px;
}

.media-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 109, 119, 0.18), rgba(232, 93, 79, 0.16)),
    #f3efe6;
}

.media-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.media-placeholder {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.media-placeholder strong {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
}

.media-placeholder span {
  max-width: 36rem;
  color: var(--muted);
  font-weight: 650;
}

h2 {
  min-height: 78px;
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.12;
}

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

.answer {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-weight: 750;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.answer.drop-ready,
.answer:focus-within {
  border-color: var(--teal);
  transform: translateY(-1px);
  outline: none;
}

.answer-text {
  display: block;
}

.answer.correct {
  border-color: var(--green);
  background: #e8f5ec;
}

.answer.wrong {
  border-color: var(--red);
  background: #fae8e6;
}

.speed-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.speed-player-button {
  min-height: 72px;
  padding: 16px;
  border: 1px solid rgba(0, 109, 119, 0.28);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #eef8f7;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.speed-player-button:hover:not(:disabled),
.speed-player-button:focus-visible {
  border-color: var(--teal);
  transform: translateY(-1px);
  outline: none;
}

.speed-player-button:disabled {
  cursor: default;
}

.speed-player-button.speed-winner {
  border-color: var(--green);
  background: #e8f5ec;
}

.player-dock,
.drop-roster,
.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-dock {
  min-height: 52px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.player-chip {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 109, 119, 0.28);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #eef8f7;
  font-weight: 850;
  cursor: grab;
  user-select: none;
}

.player-chip:active {
  cursor: grabbing;
}

.player-chip.assigned {
  background: #fff7dd;
  border-color: rgba(240, 180, 41, 0.55);
}

.drop-roster {
  min-height: 38px;
  align-content: start;
}

.drop-roster:empty::before {
  content: "Slip spillere her";
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.scoreboard {
  margin-top: 14px;
}

.score-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.feedback {
  min-height: 56px;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.actions {
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  min-width: 150px;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--coral);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.status-block {
  margin-bottom: 24px;
}

.gauge {
  width: 100%;
  height: 170px;
  margin: 12px 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 109, 119, 0.08), rgba(240, 180, 41, 0.12)),
    #fff;
}

.gauge-fill {
  width: 100%;
  height: 0;
  margin-top: 170px;
  background: linear-gradient(180deg, var(--gold), var(--teal));
  transition: height 300ms ease, margin-top 300ms ease;
}

.playlist {
  color: var(--muted);
  line-height: 1.55;
}

.finished .question-card {
  min-height: 460px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px 0;
  }

  .side-panel {
    order: -1;
  }

  .gauge {
    height: 92px;
  }

  .gauge-fill {
    margin-top: 92px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar,
  .score-strip,
  .actions {
    align-items: stretch;
  }

  .topbar {
    align-items: start;
  }

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

  .speed-controls {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    flex: 1;
    min-width: 0;
  }

  .question-card {
    min-height: 620px;
  }
}
