:root {
  color-scheme: light;
  --bg: #111418;
  --panel: #1a2027;
  --ink: #eef3f7;
  --muted: #b3c0cb;
  --line: #32404d;
  --accent: #7dd3c7;
  --accent-2: #f28b82;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: clamp(18px, 3vw, 40px);
}

.presenter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: calc(100vh - clamp(36px, 6vw, 80px));
}

.presenter-copy h1,
.vote h1,
.admin h1 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

.presenter-copy h1 {
  max-width: 980px;
  font-size: clamp(44px, 8vw, 112px);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 800;
  text-transform: uppercase;
}

.results {
  display: grid;
  gap: 20px;
  max-width: 960px;
  margin-top: clamp(34px, 5vw, 70px);
}

.result {
  display: grid;
  gap: 10px;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: clamp(22px, 3vw, 44px);
  font-weight: 800;
}

.result-top strong {
  min-width: 2ch;
  text-align: right;
}

.bar {
  height: clamp(18px, 2.8vw, 34px);
  overflow: hidden;
  border-radius: 999px;
  background: #2a3239;
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

#barB {
  background: var(--accent-2);
}

.total {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
}

.qr-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.qr-panel img {
  width: min(100%, 340px);
  aspect-ratio: 1;
  image-rendering: pixelated;
  background: #fff;
  border-radius: 8px;
}

.qr-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.qr-panel a {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-weight: 800;
}

.debug {
  width: 100%;
  margin: 4px 0 0;
  padding: 12px 14px;
  overflow: auto;
  border-radius: 8px;
  background: #11161b;
  color: #c6d0d8;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.vote,
.admin {
  width: min(100%, 760px);
  margin: 0 auto;
  padding-top: min(14vh, 96px);
}

.vote h1 {
  font-size: clamp(34px, 9vw, 64px);
}

.vote-header {
  display: grid;
  gap: 10px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.vote-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.confirm-vote {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #0e1317;
  font-weight: 900;
  cursor: pointer;
}

.confirm-vote:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.thanks {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thanks h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}

.thanks p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.thanks button {
  min-height: 48px;
  width: fit-content;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #11161b;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.choice-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
}

.choice-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #ffffff;
}

.choice-label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.choice-key {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #24353a;
  color: var(--accent);
  font-weight: 900;
}

.choice-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(20px, 4vw, 30px);
}

.choice-card[aria-pressed="true"] {
  border-color: var(--accent);
}

.choice-card:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status {
  min-height: 28px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.vote-results {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.vote-results h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.admin h1 {
  font-size: clamp(32px, 6vw, 54px);
}

.admin p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.admin button {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-2);
  color: #111418;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 860px) {
  .presenter {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .presenter-copy h1 {
    font-size: clamp(38px, 12vw, 68px);
  }

  .qr-panel {
    width: min(100%, 380px);
    justify-self: center;
  }

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