/* Full-screen TV display for Members Draw */

.md-display-body {
    background: radial-gradient(1200px 800px at 20% 20%, rgba(255,255,255,0.08), rgba(0,0,0,0)),
                radial-gradient(900px 700px at 80% 30%, rgba(255,215,0,0.10), rgba(0,0,0,0)),
                radial-gradient(800px 600px at 70% 90%, rgba(0,255,170,0.08), rgba(0,0,0,0)),
                hsla(223.78,51.39%,18.24%,1);
    color: #f7fafc;
    overflow: hidden;
}

.md-display {
    height: 100vh;
    padding: clamp(14px, 2.5vh, 40px) clamp(20px, 4vw, 60px);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 22px);
    overflow: hidden;
}

.md-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.md-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.md-logo {
    width: clamp(100px, 12vw, 180px);
    max-height: 11vh;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.35));
}

.md-kicker {
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.md-title {
    font-size: clamp(26px, 4.4vmin, 52px);
    font-weight: 800;
    line-height: 1.0;
    margin-top: 6px;
}

.md-status {
    font-size: clamp(14px, 2.1vmin, 22px);
    font-weight: 600;
    opacity: 0.9;
    padding: clamp(8px, 1.4vh, 14px) clamp(12px, 1.4vw, 18px);
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
}

.md-stage {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(20px, 3vw, 48px);
    align-items: center;
}

.md-wheel-wrap {
    position: relative;
    display: grid;
    place-items: center;
    height: min(78vh, 920px);
    width: fit-content;
    margin: 0 clamp(8px, 2.5vw, 40px);
}

.md-pointer {
    position: absolute;
    top: 50%;
    right: -35px;
    width: 0;
    height: 0;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    /* Points left (toward wheel center) */
    border-right: 44px solid #f6e05e;
    filter: drop-shadow(0 14px 26px rgba(0,0,0,0.45));
    z-index: 3;
    /* Centre the triangle tip exactly on the wheel's 3 o'clock point (where the
       winning name lands), independent of wheel size. */
    transform: translateY(-50%);
}

.md-wheel {
    width: min(74vh, 880px);
    height: min(74vh, 880px);
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    /* Dark inner rim — a white inset ring here also bloomed on the TV and lifted
       the navy wedges near the edge. */
    box-shadow:
        0 35px 80px rgba(0,0,0,0.55),
        inset 0 0 0 3px rgba(0,0,0,0.35);
    position: relative;
    /* Allow the pointer triangle to overlap the rim cleanly */
    overflow: visible;
}

/* Remove glossy highlight overlay (flat segments) */
.md-wheel::after {
    content: none;
}

.md-wheel-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: none;      /* conic-gradient wedges are set inline in JS */
    /* translateZ(0) + backface-visibility force the wheel onto its own GPU layer,
       so the spin is a composited texture rotation (smooth on the weak TV) rather
       than a per-frame repaint of the conic-gradient + names. will-change alone
       wasn't enough on that browser. */
    transform: rotate(0deg) translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    position: relative;
}

/* Thin dark spoke dividers over the conic-gradient wedges (below the names).
   Only shown once the wheel is actually drawn (the .md-has-wedges class is added
   in JS) — otherwise the dividers would appear as lines on the empty idle wheel.
   --n is the segment count, set in JS alongside the class. */
.md-wheel-face.md-has-wedges::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 1;
    background: repeating-conic-gradient(from 0deg,
        #0a0a0c 0 0.8deg,
        transparent 0.8deg calc(360deg / var(--n, 12)));
}

.md-seg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    width: 50%;
    pointer-events: none;
    z-index: 2;   /* names sit above the wedges + dividers */
}

.md-seg-text {
    display: inline-block;
    position: absolute;
    right: 4px;
    top: 0;
    transform-origin: 100% 50%;
    text-align: right;
    /* transform is set dynamically */
    max-width: 92%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    font-weight: 800;
    font-size: clamp(13px, 1.8vmin, 20px);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Charcoal + yellow wedges. Names are white on the charcoal wedges and dark on
   the yellow ones — both high-contrast. Charcoal has no blue channel to lift, so
   unlike the old navy it doesn't wash to pale blue on the TV. A light halo behind
   the white names keeps them legible right at a wedge's edge. */
.md-seg-text.on-dark {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.md-seg-text.on-light {
    color: #15233f;
    text-shadow: 0 1px 2px rgba(255,255,255,0.45);
}

/* Winner highlight only appears once the wheel has stopped (.md-stopped is added
   in JS on transition end) — otherwise the gold name would give the winner away
   mid-spin. Until then the winner's name looks like any other. */
.md-wheel-face.md-stopped .md-seg-text.md-winner-seg {
    font-weight: 900;
}

.md-wheel-face.md-stopped .md-seg-text.md-winner-seg.on-dark {
    color: #f6e05e;
    text-shadow: 0 0 12px rgba(246, 224, 94, 0.85), 0 1px 3px rgba(0,0,0,0.9);
}

.md-wheel-face.md-stopped .md-seg-text.md-winner-seg.on-light {
    text-shadow: 0 0 12px rgba(246, 201, 69, 0.95), 0 1px 2px rgba(255,255,255,0.6);
}

/* For very dense wheels, shrink labels a little (still scales with the screen) */
.md-wheel-face[data-dense="1"] .md-seg-text {
    font-size: clamp(11px, 1.5vmin, 17px);
    padding: 0;
    border-radius: 0;
    background: transparent;
}

/* Winner cards container — one card per draw, stacked. */
.md-reveals {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(12px, 2vh, 22px);
    min-height: 0;
    max-height: 100%;
}

.md-draw-name {
    font-size: clamp(13px, 1.9vmin, 20px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 2px;
}

/* Two or more cards: shrink so they fit stacked. */
.md-reveals[data-count="2"] .md-amount,
.md-reveals[data-count="3"] .md-amount,
.md-reveals[data-count="4"] .md-amount { font-size: clamp(22px, 3.6vmin, 40px); }
.md-reveals[data-count="2"] .md-winner,
.md-reveals[data-count="3"] .md-winner,
.md-reveals[data-count="4"] .md-winner { font-size: clamp(18px, 3vmin, 34px); }
.md-reveals[data-count="2"] .md-reveal,
.md-reveals[data-count="3"] .md-reveal,
.md-reveals[data-count="4"] .md-reveal { gap: clamp(4px, 0.9vh, 10px); padding: clamp(12px, 1.8vh, 20px) clamp(14px, 1.6vw, 24px); }
.md-reveals[data-count="3"] .md-sub,
.md-reveals[data-count="4"] .md-sub { display: none; }

.md-reveal {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 16px);
    padding: clamp(16px, 2.4vh, 28px) clamp(18px, 2vw, 30px);
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(12px);
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
}

.md-amount {
    font-size: clamp(34px, 6vmin, 60px);
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #f6e05e;
    text-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.md-winner {
    font-size: clamp(26px, 4.8vmin, 52px);
    font-weight: 900;
    line-height: 1.06;
}

.md-outcome {
    display: none;
    font-size: clamp(20px, 3.2vmin, 34px);
    font-weight: 900;
    line-height: 1.15;
    padding: clamp(12px, 1.6vh, 18px) 20px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    text-align: center;
}

.md-outcome.is-visible {
    display: block;
}

.md-outcome.md-outcome-present {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(74, 222, 128, 0.45);
    color: #dcfce7;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.md-outcome.md-outcome-absent {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(252, 165, 165, 0.4);
    color: #fee2e2;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.md-outcome.md-outcome-neutral {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
}

.md-sub {
    font-size: clamp(14px, 2.1vmin, 22px);
    opacity: 0.9;
    font-weight: 600;
}

.md-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    opacity: 0.95;
    font-weight: 700;
    font-size: clamp(20px, 3vmin, 34px);
}

/* Animations */
.md-pop {
    animation: mdPop 900ms cubic-bezier(.2,.9,.2,1) both;
}

@keyframes mdPop {
    0% { transform: translateY(18px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.md-spin-glow {
    animation: mdGlow 1200ms ease-in-out infinite alternate;
}

@keyframes mdGlow {
    from { box-shadow: 0 35px 80px rgba(0,0,0,0.55), inset 0 0 0 14px rgba(255,255,255,0.10), inset 0 0 0 2px rgba(255,255,255,0.14); }
    to { box-shadow: 0 45px 95px rgba(0,0,0,0.65), inset 0 0 0 14px rgba(255,255,255,0.13), inset 0 0 0 2px rgba(255,255,255,0.18); }
}

@media (max-width: 1100px) {
    .md-stage {
        grid-template-columns: 1fr;
    }
    .md-title { font-size: 44px; }
    .md-amount { font-size: 54px; }
    .md-winner { font-size: 44px; }
}

