/* ==========================================================================
   SelectAWheel — Stream Overlay Styles (v3 — viewport-safe layout)
   1920 × 1080 fixed layout. Winner banner always fits.
   ========================================================================== */

html,
body {
  width: 1920px;
  height: 1080px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0f172a;
  font-family: "Inter", sans-serif;
  color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
}

/* Hide off-screen inputs the wheel engine expects */
.stream-hidden {
  position: absolute;
  left: -99999px;
  top: -99999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   Main layout: wheel (left) + sidebar (right). Fixed 1080px height.
   ------------------------------------------------------------------------- */
.stream-stage {
  width: 1920px;
  height: 1080px;
  display: grid;
  grid-template-columns: 1fr 620px;
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(147, 197, 253, 0.1) 0%,
      transparent 55%
    ),
    radial-gradient(
      circle at 85% 85%,
      rgba(196, 181, 253, 0.1) 0%,
      transparent 55%
    ),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  transition: background 1.2s ease;
  position: relative;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   LEFT COLUMN — column layout with fixed math that always fits 1080px
   ------------------------------------------------------------------------- */
.stream-wheel-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 1080px;
  padding: 20px 20px 20px 60px;
  gap: 14px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

/* --- Theme bar: fixed 58px --- */
.stream-theme-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition:
    border-color 0.6s ease,
    background 0.6s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.stream-theme-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.stream-theme-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* --- Wheel wrap: 620x620, leaves room for banner + pointer --- */
.stream-wheel-wrap {
  position: relative;
  width: 620px;
  height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 30px; /* room for pointer above */
}

#wheelCanvas {
  width: 620px !important;
  height: 620px !important;
  border-radius: 50%;
  box-shadow:
    0 0 0 12px #ffffff,
    0 0 0 16px rgba(148, 163, 184, 0.22),
    0 24px 60px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.6s ease;
}

.stream-pointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-top: 50px solid #ffffff;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
  z-index: 10;
}

/* -------------------------------------------------------------------------
   WINNER BANNER — large, prominent, always visible within 1080px
   ------------------------------------------------------------------------- */
.stream-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 780px;
  height: 160px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.stream-result.winner {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.3) 0%,
    rgba(16, 185, 129, 0.14) 100%
  );
  border-color: #10b981;
  box-shadow:
    0 0 40px rgba(16, 185, 129, 0.5),
    0 0 80px rgba(16, 185, 129, 0.25);
  animation: winnerPulse 1.4s ease-in-out infinite alternate;
}

@keyframes winnerPulse {
  from {
    box-shadow:
      0 0 40px rgba(16, 185, 129, 0.5),
      0 0 80px rgba(16, 185, 129, 0.25);
  }
  to {
    box-shadow:
      0 0 60px rgba(16, 185, 129, 0.75),
      0 0 120px rgba(16, 185, 129, 0.4);
  }
}

.stream-result-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.3s ease;
  line-height: 1;
}

.stream-result.winner .stream-result-label {
  color: #6ee7b7;
}

.stream-result-value {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.1;
  word-break: break-word;
  text-align: center;
  max-width: 720px;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.stream-result.winner .stream-result-value {
  color: #ffffff;
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

/* -------------------------------------------------------------------------
   RIGHT COLUMN — branding + recent winners
   ------------------------------------------------------------------------- */
.stream-side-col {
  display: flex;
  flex-direction: column;
  padding: 40px 60px 30px 20px;
  gap: 18px;
  height: 1080px;
  box-sizing: border-box;
  overflow: hidden;
}

.stream-brand {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.stream-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #3b82f6);
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
  transition: background 0.6s ease;
}

.stream-brand-name {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stream-brand-tag {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* Recent winners panel — flexes to fill remaining height */
.stream-panel {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.stream-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.stream-winner-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.stream-winner-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  animation: slideIn 0.4s ease;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.stream-winner-list li.fresh {
  background: rgba(16, 185, 129, 0.18);
  border-left: 3px solid #10b981;
}

.stream-winner-list li .idx {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  min-width: 30px;
}

.stream-winner-list li .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-winner-list li .theme {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stream-panel-small {
  flex: 0 0 auto;
  gap: 10px;
  padding: 16px 22px;
}

.stream-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.stream-panel-label {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.stream-panel-value {
  font-weight: 700;
  color: #ffffff;
}

.stream-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.stream-footer-url {
  font-size: 1rem;
  font-weight: 700;
  color: var(--stream-accent, #f59e0b);
  transition: color 0.8s ease;
}

.stream-footer-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

/* -------------------------------------------------------------------------
   Palette-driven accent
   ------------------------------------------------------------------------- */
:root {
  --stream-accent: #2563eb;
}

.stream-logo {
  background: linear-gradient(135deg, var(--stream-accent), #ffffff);
}

/* -------------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .stream-winner-list li {
    animation: none;
  }
  .stream-result.winner {
    animation: none;
  }
  .stream-stage,
  .stream-logo,
  .stream-result {
    transition: none;
  }
}
