/*
  YellowOrGreen — style.css
  Core layout and visual design. Animations live in animations.css,
  breakpoint overrides live in responsive.css.
*/

:root {
  /* The ball's single hue (~72°), expressed as tonal steps for UI accents.
     Never introduce a second hue for "yellow" vs "green" UI — both sides
     of the debate share this ramp, exactly like the ball itself. */
  --ball-hue-light: #E9F1BE;
  --ball-hue-mid:   #CFE24E;
  --ball-hue-base:  #BFDF20;
  --ball-hue-deep:  #8FB61C;
  --ball-hue-dark:  #697915;

  /* "Yellow" and "Green" as separate brand accents for the two vote
     options — distinct from the ball's ambiguous hue, and from each
     other, so the poll UI never relies on color alone (icons + text
     labels back these up per WCAG 1.4.1). */
  --accent-yellow: #F4C430;
  --accent-yellow-dark: #B8901A;
  --accent-green: #2FA36B;
  --accent-green-dark: #1E7A4E;

  --ink: #0c2027;
  --ink-soft: #3a4a4d;
  --paper: #f4f7ef;

  --court-shadow: #06181a;

  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.6);

  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 10px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--court-shadow);
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  background: #fff;
  color: var(--ink);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* ---------------------------------------------------------------------
   Court background layer
--------------------------------------------------------------------- */

.court-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.court-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.court-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(6, 24, 26, 0.55) 0%,
      rgba(6, 24, 26, 0.25) 30%,
      rgba(6, 24, 26, 0.35) 65%,
      rgba(6, 24, 26, 0.65) 100%);
}

/* ---------------------------------------------------------------------
   Page frame
--------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: clamp(28px, 4vw, 38px);
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.btn-share:hover,
.btn-share:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  color: var(--paper);
}

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: 0.5rem clamp(1rem, 5vw, 2.5rem) 2rem;
  text-align: center;
}

.hero-copy {
  max-width: 46rem;
}

.headline {
  color: var(--paper);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.75rem, 4.6vw, 3.1rem);
  margin: 0 0 0.35rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.subhead {
  color: var(--paper);
  opacity: 0.92;
  font-size: clamp(1rem, 2.1vw, 1.35rem);
  margin: 0;
  font-weight: 500;
}

/* ---------------------------------------------------------------------
   Ball
--------------------------------------------------------------------- */

.ball-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ball-img {
  width: clamp(150px, 22vw, 260px);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.4));
}

/* ---------------------------------------------------------------------
   Poll card — glassmorphism
--------------------------------------------------------------------- */

.poll-card {
  width: min(560px, 92vw);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(4, 20, 22, 0.45);
  padding: clamp(1.25rem, 3.5vw, 2rem);
}

.poll-heading {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

.poll-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.poll-option {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
}

.option-yellow { border: 1px solid rgba(244, 196, 48, 0.35); }
.option-green  { border: 1px solid rgba(47, 163, 107, 0.35); }

.option-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.option-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ink);
}

.option-yellow .option-label i { color: var(--accent-yellow-dark); font-size: 0.7rem; }
.option-green .option-label i { color: var(--accent-green-dark); font-size: 0.7rem; }

.option-percent {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.option-percent[data-loading] {
  opacity: 0.4;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 32, 39, 0.12);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  width: 0%;
}

.bar-yellow { background: linear-gradient(90deg, var(--accent-yellow-dark), var(--accent-yellow)); }
.bar-green  { background: linear-gradient(90deg, var(--accent-green-dark), var(--accent-green)); }

.vote-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.15rem;
}

.btn-vote-yellow { background: linear-gradient(180deg, var(--accent-yellow), var(--accent-yellow-dark)); color: #3a2c04; }
.btn-vote-green  { background: linear-gradient(180deg, var(--accent-green), var(--accent-green-dark)); }

.vote-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.vote-btn:not(:disabled):hover,
.vote-btn:not(:disabled):focus-visible {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.vote-btn:not(:disabled):active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.poll-option.voted .vote-btn {
  display: none;
}

.vote-confirmation {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  background: rgba(12, 32, 39, 0.08);
  color: var(--ink);
  margin-top: 0.15rem;
}

.poll-option.voted .vote-confirmation {
  display: inline-flex;
}

.poll-total {
  text-align: center;
  margin: 1.1rem 0 0;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

#total-votes {
  color: var(--ink);
  font-weight: 800;
}

.poll-status {
  min-height: 1.2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */

.site-footer {
  text-align: center;
  padding: 0.75rem 1rem 1.1rem;
  font-size: 0.8rem;
  color: rgba(244, 247, 239, 0.75);
}

.site-footer a {
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Focus states (keyboard accessibility)
--------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-radius: 6px;
}

.vote-btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
