:root {
  --glass-top: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.74) 0%,
    rgba(218, 240, 255, 0.58) 48%,
    rgba(162, 212, 246, 0.62) 50%,
    rgba(198, 233, 253, 0.72) 100%
  );
  --glass-border-outer: rgba(24, 78, 126, 0.72);
  --glass-border-inner: rgba(255, 255, 255, 0.86);
  --window-shadow:
    0 12px 34px rgba(8, 42, 74, 0.42),
    0 2px 8px rgba(8, 42, 74, 0.24);

  --body-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(238, 246, 253, 0.92) 100%);
  --border-strong: #8aa7c4;
  --border-soft: #c7d9ea;

  --text: #13283d;
  --text-secondary: #395570;
  --text-muted: #5d7892;

  --font: "Segoe UI", Frutiger, "Frutiger Linotype", Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --overlay-scale: 1;
  --preview-fit: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.is-hidden {
  display: none !important;
}

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  padding: 24px;
  pointer-events: none;
  user-select: none;
}

.stage[data-position="top-left"] {
  align-items: flex-start;
  justify-content: flex-start;
}

.stage[data-position="top-left"] .poll-card {
  transform-origin: top left;
}

.stage[data-position="top-right"] {
  align-items: flex-start;
  justify-content: flex-end;
}

.stage[data-position="top-right"] .poll-card {
  transform-origin: top right;
}

.stage[data-position="bottom-left"] {
  align-items: flex-end;
  justify-content: flex-start;
}

.stage[data-position="bottom-left"] .poll-card {
  transform-origin: bottom left;
}

.stage[data-position="bottom-right"] {
  align-items: flex-end;
  justify-content: flex-end;
}

.stage[data-position="bottom-right"] .poll-card {
  transform-origin: bottom right;
}

.stage[data-position="center"] {
  align-items: center;
  justify-content: center;
}

.stage[data-position="center"] .poll-card {
  transform-origin: center center;
}

.poll-card {
  width: 390px;
  max-width: calc(100vw - 48px);
  padding: 7px;
  border-radius: 7px;
  background: var(--glass-top);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid var(--glass-border-outer);
  box-shadow:
    inset 0 1px 0 var(--glass-border-inner),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    var(--window-shadow);

  opacity: 0;
  --vis-scale: 0.94;
  --vis-y: 8px;
  transform: translateY(var(--vis-y)) scale(calc(var(--overlay-scale) * var(--vis-scale) * var(--preview-fit)));
  transition:
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.poll-card.is-visible {
  opacity: 1;
  --vis-scale: 1;
  --vis-y: 0px;
}

.poll-card.is-idle-preview.is-visible {
  opacity: 0.88;
}

.aero-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 5px 7px 6px;
}

.poll-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #0b2540;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.title-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid #1a66a3;
  background: linear-gradient(180deg, #74c4f7 0%, #3ba0e4 49%, #1a7ec9 50%, #2a97e4 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 48, 86, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 1px 2px rgba(10, 44, 78, 0.2);
}

.status-pill.is-rolling {
  border-color: #a86414;
  background: linear-gradient(180deg, #ffe89c 0%, #f7be4a 49%, #df951b 50%, #f3b53b 100%);
  color: #422100;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 6px rgba(242, 174, 46, 0.55);
}

.status-pill.is-winner {
  border-color: #167234;
  background: linear-gradient(180deg, #6de28e 0%, #31ba5a 49%, #1a9740 50%, #33c15d 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 62, 28, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 1px 2px rgba(12, 66, 30, 0.24);
}

.status-pill.is-idle {
  border-color: #7d9ab6;
  background: linear-gradient(180deg, #f8fbfe 0%, #e4eff9 49%, #d1e2f2 50%, #e4eff9 100%);
  color: #2b4a68;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.countdown-text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0b2540;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(36, 94, 145, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.countdown-track {
  height: 5px;
  margin: 0 0 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(18, 58, 96, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 2px rgba(10, 38, 68, 0.28);
}

.countdown-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #98e5ff 0%, #3cb5f5 49%, #168be0 50%, #33aaf3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform-origin: left center;
  will-change: transform;
}

.aero-body {
  background: var(--body-bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 10px 9px;
}

.option-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 8px 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 247, 253, 0.92) 100%);
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition:
    opacity 220ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.option-row.is-dimmed {
  opacity: 0.54;
}

.option-row.is-roulette {
  border-color: #c48418;
  background: linear-gradient(180deg, #fffdf4 0%, #fff4cf 49%, #fee7a4 50%, #fff3c6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(228, 162, 34, 0.45),
    0 0 10px rgba(235, 170, 36, 0.35);
  transform: scale(1.012);
}

.option-row.is-winner {
  border-color: #259144;
  background: linear-gradient(180deg, #f3fff6 0%, #dffae7 49%, #ccf4d8 50%, #e4fceb 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(45, 178, 84, 0.35),
    0 0 12px rgba(42, 188, 86, 0.32);
}

.option-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.keycap {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  border: 1px solid #7395b8;
  background: linear-gradient(180deg, #ffffff 0%, #e8f3fc 48%, #cfe4f7 50%, #e5f2fc 100%);
  color: #103559;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 2px rgba(15, 52, 88, 0.16);
}

.option-row.is-roulette .keycap {
  border-color: #c47d12;
  background: linear-gradient(180deg, #fff6cc 0%, #fbd66c 48%, #e9a71c 50%, #fad062 100%);
  color: #422100;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 6px rgba(242, 176, 38, 0.6);
}

.option-row.is-winner .keycap {
  border-color: #167234;
  background: linear-gradient(180deg, #74e694 0%, #35be5e 48%, #1c9a43 50%, #37c662 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 62, 28, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 1px 2px rgba(12, 66, 30, 0.25);
}

.option-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-row.is-winner .option-label {
  color: #0e4420;
}

.option-stats {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

.option-row.is-winner .option-stats {
  color: #125829;
}

.bar-track {
  position: relative;
  height: 11px;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(180deg, #d7e4f0 0%, #ebf2f8 100%);
  border: 1px solid #a9bfd4;
  box-shadow: inset 0 1px 2px rgba(16, 48, 82, 0.18);
}

.bar-fill {
  height: 100%;
  width: 0%;
  min-width: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #86d3fb 0%, #3ca6ea 48%, #1980cd 50%, #33a1e8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.option-row.is-roulette .bar-fill {
  background: linear-gradient(180deg, #ffe794 0%, #f5be46 48%, #d99116 50%, #f0b437 100%);
}

.option-row.is-winner .bar-fill {
  background: linear-gradient(180deg, #74ea95 0%, #36c260 48%, #1c9c44 50%, #38ca64 100%);
}

.idle-empty {
  padding: 18px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid #d5e3f0;
  background: linear-gradient(180deg, #f3f8fd 0%, #e4eff9 100%);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.footer-hint {
  font-weight: 600;
  color: #1b4b78;
}

.footer-total {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
