:root {
  --bg: #08111f;
  --panel: rgba(13, 23, 39, 0.9);
  --border: rgba(106, 139, 184, 0.24);
  --text: #edf2f7;
  --muted: #94a3b8;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.10), transparent 35%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.10), transparent 30%),
    linear-gradient(180deg, #020617, #0b1220);
  background-color: #020617;
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
  overflow-x: hidden;
}

.cast-layout {
  min-height: 100vh;
  padding: 16px 12px 78px;
}

.question-header {
  border-bottom: 1px solid var(--border);
  padding: 8px 8px 18px;
  margin-bottom: 14px;
}

.cast-title {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.06;
  margin: 0;
  letter-spacing: -0.02em;
}

.center { text-align: center; }
.muted { color: var(--muted); }

.cast-option {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(13, 23, 39, 0.92);
  border: 1px solid var(--border);
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.cast-option.correct {
  border-color: rgba(34, 197, 94, 0.82);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.cast-option.hide-bars .result-bar-wrap,
.cast-option.hide-bars .cast-votes,
.cast-option.hide-bars .cast-percent {
  opacity: 0;
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.result-label {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-percent {
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  flex: 0 0 auto;
  transition: opacity .25s ease;
}

.cast-votes {
  margin-top: 6px;
  font-size: 14px;
  transition: opacity .25s ease;
}

.result-bar-wrap {
  margin-top: 10px;
  background: rgba(2, 6, 23, 0.88);
  border-radius: 999px;
  height: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: opacity .25s ease;
}

.result-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  will-change: width;
}

.vote-tank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
  gap: 28px;
  margin-top: 18px;
}

.vote-tank-card {
  background: rgba(13, 23, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px 18px 20px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  min-height: 620px;
  box-shadow: var(--shadow);
}

.vote-tank-visual {
  width: 100%;
  min-height: 460px;
  display: grid;
  place-items: center;
  position: relative;
}

.vote-tank-shell {
  width: 260px;
  height: 400px;
  border-radius: 30px;
  border: 3px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.72));
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  box-shadow: inset 0 0 30px rgba(255,255,255,.03);
}

.vote-tank-fill {
  width: 100%;
  height: 0%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 14%),
    linear-gradient(180deg, rgba(56,189,248,.92), rgba(34,197,94,.92));
  position: relative;
  will-change: height, transform;
}

.vote-tank-fill::before,
.vote-tank-fill::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -8%;
  width: 116%;
  height: 28px;
  border-radius: 45%;
  background: rgba(255,255,255,.12);
  opacity: .9;
  animation: liquidWaveA 2.6s linear infinite;
}

.vote-tank-fill::after {
  top: -6px;
  opacity: .48;
  animation: liquidWaveB 2.1s linear infinite;
}

.vote-tank-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 112px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 8px 24px rgba(0,0,0,.38);
}

.vote-tank-label {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vote-tank-percent {
  font-size: clamp(38px, 4vw, 54px);
  font-weight: 900;
  line-height: 1;
}

.vote-tank-votes {
  font-size: 18px;
}

.tank-hide-fill .vote-tank-fill,
.tank-hide-fill .vote-tank-percent,
.tank-hide-fill .vote-tank-votes {
  opacity: 0;
}

.cast-debug {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

.cast-debug details {
  margin: 0 0 0;
  background: rgba(2, 6, 23, 0.94);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 28px rgba(0,0,0,.22);
}

.cast-debug summary {
  cursor: pointer;
  padding: 10px 14px;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

.cast-debug summary::-webkit-details-marker {
  display: none;
}

.cast-debug-content {
  padding: 0 14px 12px;
  border-top: 1px solid var(--border);
}

.cast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  font-size: 12px;
}

@keyframes liquidWaveA {
  0% { transform: translateX(-2%) scaleX(1.02); }
  50% { transform: translateX(2%) scaleX(.98); }
  100% { transform: translateX(-2%) scaleX(1.02); }
}

@keyframes liquidWaveB {
  0% { transform: translateX(3%) scaleX(.98); }
  50% { transform: translateX(-3%) scaleX(1.02); }
  100% { transform: translateX(3%) scaleX(.98); }
}

@media (max-width: 1200px) {
  .vote-tank-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
  }
  .vote-tank-card { min-height: 560px; }
  .vote-tank-visual { min-height: 400px; }
  .vote-tank-shell { width: 220px; height: 340px; }
  .vote-tank-icon { font-size: 94px; }
}

@media (max-width: 900px) {
  .cast-layout { padding: 14px 10px 78px; }
  .vote-tank-grid { grid-template-columns: 1fr; }
  .vote-tank-card { min-height: auto; }
  .vote-tank-visual { min-height: 360px; }
}
