:root {
  --bg: #0e1116;
  --card: #151922;
  --accent: #ff9f1c;
  --accent-2: #5ef2c1;
  --text: #f4f5fb;
  --muted: #aeb5c9;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --border: #232938;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(94, 242, 193, 0.08), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(255, 159, 28, 0.09), transparent 35%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(120deg, rgba(94, 242, 193, 0.08), rgba(255, 159, 28, 0.08));
}

.title-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.emoji {
  font-size: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

h1 {
  margin: 0;
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 600;
  font-size: 32px;
}

.lede {
  margin: 6px 0 0;
  color: #d8deef;
  max-width: 620px;
}

.layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 2fr 1fr;
  grid-template-areas:
    "current scoreboard"
    "current topics";
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

#section-topics {
  grid-area: topics;
}

#section-current {
  grid-area: current;
}

#section-scoreboard {
  grid-area: scoreboard;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card header h2 {
  margin: 0 0 4px;
  font-family: 'Fredoka', sans-serif;
}

.card header p {
  margin: 0;
  color: var(--muted);
}

.topic-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.topic-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0c0f14;
  color: var(--text);
  font-size: 15px;
}

button {
  background: linear-gradient(135deg, #ff9f1c, #ff6f61);
  color: #0c0f14;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 159, 28, 0.35);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.queue h3 {
  margin: 16px 0 6px;
  font-size: 16px;
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-list li {
  background: rgba(255, 159, 28, 0.1);
  border: 1px solid rgba(255, 159, 28, 0.3);
  color: #ffd7a4;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status {
  background: rgba(94, 242, 193, 0.1);
  border: 1px solid rgba(94, 242, 193, 0.4);
  color: var(--accent-2);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.current-item {
  margin: 12px 0 10px;
  font-size: 18px;
  padding: 12px;
  background: #0c0f14;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.countdown {
  font-size: 12rem;
  font-weight: 800;
  text-align: center;
  margin: 0;
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.countdown.active {
  opacity: 1;
}

.meter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}

.dial {
  --dial-radius: min(40vw, 45vh);
  --dial-base: 40px;
  position: relative;
  width: calc(var(--dial-radius) * 2);
  height: calc(var(--dial-radius) + var(--dial-base));
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dial::before {
  content: '';
  position: absolute;
  width: calc(var(--dial-radius) * 2);
  height: calc(var(--dial-radius) * 2);
  left: 50%;
  bottom: calc(var(--dial-base) - var(--dial-radius));
  transform: translateX(-50%);
  border-radius: 50%;
  background: conic-gradient(from 270deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  clip-path: inset(0 0 50% 0);
}

.ticks {
  position: absolute;
  inset: 0;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ticks span {
  position: absolute;
  left: 50%;
  bottom: var(--dial-base);
  transform-origin: 50% calc(var(--dial-radius) + var(--dial-base));
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--dial-radius) + 24px)) rotate(calc(var(--angle) * -1)) translateX(-50%);
}

.ticks span:nth-child(1) {
  --angle: -90deg;
}

.ticks span:nth-child(2) {
  --angle: -45deg;
}

.ticks span:nth-child(3) {
  --angle: 0deg;
}

.ticks span:nth-child(4) {
  --angle: 45deg;
}

.ticks span:nth-child(5) {
  --angle: 90deg;
}

.needle {
  width: 2px;
  height: var(--dial-radius);
  background: #ffecd1;
  position: absolute;
  bottom: var(--dial-base);
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: bottom center;
  transition: transform 120ms ease-out;
  box-shadow: 0 0 12px rgba(255, 159, 28, 0.7);
}

.dial-center {
  width: 96px;
  height: 96px;
  background: #0e1116;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4);
  font-size: 32px;
  font-weight: 800;
  color: #ffecd1;
  position: absolute;
  bottom: calc(var(--dial-base) - 48px);
  left: 50%;
  transform: translateX(-50%);
}

.verdict {
  font-size: 24px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 12px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

tbody tr {
  border-top: 1px solid var(--border);
}

td,
th {
  padding: 10px 6px;
  text-align: left;
}

tbody tr:hover {
  background: rgba(255, 159, 28, 0.05);
}

td strong {
  color: #ffecd1;
}

.notice {
  position: fixed;
  bottom: 12px;
  right: 12px;
  background: #0c0f14;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  box-shadow: var(--shadow);
  max-width: 320px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "current"
      "scoreboard"
      "topics";
  }

  .dial {
    --dial-radius: 40vw;
  }
}

@media (max-width: 740px) {
  .meter {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dial {
    --dial-radius: 160px;
    --dial-base: 20px;
  }

  .dial-center {
    width: 90px;
    height: 90px;
    font-size: 28px;
  }
}