:root {
    --paper: #f7eddc;
    --paper-soft: rgba(255, 251, 245, 0.86);
    --ink: #1d2637;
    --ink-soft: rgba(29, 38, 55, 0.72);
    --teal: #0b6b6f;
    --teal-soft: #cce8e6;
    --orange: #ef6c3d;
    --amber: #f6c55f;
    --berry: #b94b57;
    --sky: #88b9d8;
    --line: rgba(29, 38, 55, 0.1);
    --line-strong: rgba(29, 38, 55, 0.16);
    --shadow: 0 30px 80px rgba(21, 36, 50, 0.16);
    --shadow-soft: 0 18px 34px rgba(21, 36, 50, 0.1);
    --radius-lg: 34px;
    --radius-md: 24px;
    --radius-sm: 18px;
    --font-sans: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(246, 197, 95, 0.48), transparent 28%),
        radial-gradient(circle at 83% 6%, rgba(11, 107, 111, 0.18), transparent 22%),
        radial-gradient(circle at 72% 70%, rgba(185, 75, 87, 0.14), transparent 26%),
        radial-gradient(circle at 32% 50%, rgba(255, 255, 255, 0.55), transparent 34%),
        linear-gradient(150deg, #f8efdf 0%, #edf6f3 48%, #fff7ea 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(29, 38, 55, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29, 38, 55, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 90%);
}

img,
canvas {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

.page-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 44px;
}

.card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    background: linear-gradient(165deg, rgba(255, 253, 249, 0.94), rgba(255, 248, 239, 0.78));
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.card::after {
    content: '';
    position: absolute;
    inset: auto -14% -44% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 68%);
    pointer-events: none;
}

.hero-panel,
.playground {
    display: grid;
    gap: 22px;
}

.hero-panel {
    grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.78fr);
    align-items: stretch;
}

.hero-copy,
.entry-panel,
.wheel-panel,
.cloud-panel,
.metric-stack {
    padding: 28px;
}

.hero-copy {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at right top, rgba(246, 197, 95, 0.24), transparent 34%),
        linear-gradient(155deg, rgba(255, 253, 248, 0.96), rgba(255, 247, 235, 0.84));
}

.eyebrow,
.form-label,
.metric-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(29, 38, 55, 0.68);
}

.eyebrow::before {
    content: '';
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--orange), var(--amber));
}

h1,
.section-title,
.winner-name,
.metric-value,
.metric-name,
.error-code {
    font-family: var(--font-display);
}

h1 {
    max-width: 9ch;
    margin: 14px 0 18px;
    font-size: clamp(3rem, 7vw, 5.7rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.lead,
.section-copy,
.form-note,
.winner-meta,
.cloud-empty {
    color: var(--ink-soft);
    line-height: 1.7;
}

.lead {
    max-width: 52ch;
    font-size: 1.08rem;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-highlight {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(29, 38, 55, 0.08);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
    color: rgba(29, 38, 55, 0.9);
}

.button-row,
.name-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button-row {
    align-items: center;
}

.chip,
.cloud-chip,
.cloud-empty {
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(29, 38, 55, 0.08);
    box-shadow: 0 10px 24px rgba(29, 38, 55, 0.06);
}

.metric-stack {
    display: grid;
    gap: 14px;
    align-content: start;
    background:
        radial-gradient(circle at top right, rgba(246, 197, 95, 0.22), transparent 34%),
        linear-gradient(150deg, rgba(8, 89, 92, 0.98), rgba(29, 52, 79, 0.96));
    color: #fff;
}

.metric-card {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.metric-stack .metric-label {
    color: rgba(255, 255, 255, 0.78);
}

.metric-value {
    display: block;
    margin-top: 8px;
    font-size: clamp(2.6rem, 7vw, 4.1rem);
    line-height: 1;
}

.metric-name {
    display: block;
    margin-top: 10px;
    font-size: clamp(1.4rem, 4vw, 2.1rem);
    line-height: 1.1;
}

.playground {
    margin-top: 26px;
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
    grid-template-areas: 'wheel entry';
    align-items: start;
}

.buzz-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 22px;
    margin-top: 18px;
}

.countdown-panel,
.share-panel {
    padding: 24px 26px;
    min-height: 100%;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.countdown-cell {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 18px 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(29, 38, 55, 0.08);
}

.countdown-value {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    line-height: 1;
}

.countdown-label,
.countdown-status,
.share-feedback,
.share-url {
    color: var(--ink-soft);
}

.countdown-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.countdown-status,
.share-feedback {
    margin: 18px 0 0;
    line-height: 1.7;
}

.share-actions,
.winner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.share-ghost {
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    border: 1px solid rgba(29, 38, 55, 0.1);
    box-shadow: 0 12px 24px rgba(29, 38, 55, 0.08);
}

.share-url {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(29, 38, 55, 0.08);
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.countdown-panel .section-title,
.share-panel .section-title {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-head {
    display: grid;
    gap: 8px;
}

.section-title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.section-copy {
    margin: 16px 0 0;
    max-width: 62ch;
}

.status-banner {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    line-height: 1.5;
    border: 1px solid transparent;
}

.status-banner.is-success {
    background: rgba(158, 215, 216, 0.28);
    border-color: rgba(11, 107, 111, 0.18);
}

.status-banner.is-error {
    background: rgba(239, 108, 61, 0.12);
    border-color: rgba(239, 108, 61, 0.22);
}

.status-banner.is-hidden {
    display: none;
}

.name-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    scroll-margin-top: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
    scroll-margin-top: 110px;
}

.entry-panel {
    scroll-margin-top: 20px;
}

.input-shell {
    position: relative;
}

.input-shell::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--amber));
    transform: translateY(-50%);
    pointer-events: none;
}

.name-form input {
    width: 100%;
    min-height: 58px;
    padding: 18px 54px 18px 18px;
    border: 1px solid rgba(29, 38, 55, 0.12);
    border-radius: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.name-form input:focus {
    outline: none;
    border-color: rgba(11, 107, 111, 0.5);
    box-shadow: 0 0 0 5px rgba(11, 107, 111, 0.12);
    transform: translateY(-1px);
}

.input-shell.is-invalid input {
    border-color: rgba(185, 75, 87, 0.72);
    box-shadow: 0 0 0 5px rgba(185, 75, 87, 0.12);
}

.input-shell.is-invalid::after {
    background: linear-gradient(135deg, rgba(185, 75, 87, 1), rgba(239, 108, 61, 0.92));
}

.field-error,
.form-feedback {
    margin: 0;
    min-height: 1.4em;
    font-size: 0.9rem;
    line-height: 1.5;
}

.field-error {
    color: var(--berry);
    font-weight: 700;
}

.field-error:empty,
.form-feedback:empty {
    min-height: 0;
}

.form-feedback {
    color: var(--ink-soft);
    font-weight: 700;
}

.name-form input:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.icon-button:disabled,
.spin-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.btn-primary,
.spin-button,
.btn-secondary,
.home-link {
    appearance: none;
    border: 0;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary,
.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 16px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--orange), #ff9f1c);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 18px 30px rgba(239, 108, 61, 0.26);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 15px 20px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(11, 107, 111, 0.96), rgba(62, 92, 118, 0.96));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 16px 30px rgba(11, 107, 111, 0.22);
}

.btn-primary:hover,
.btn-secondary:hover,
.spin-button:hover,
.home-link:hover {
    transform: translateY(-2px);
}

.form-note {
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
}

.anti-bot-copy {
    display: block;
    margin: -2px 0 0;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.tip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.tip-card {
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 247, 235, 0.7));
    border: 1px solid rgba(29, 38, 55, 0.08);
    box-shadow: var(--shadow-soft);
}

.tip-card p {
    margin: 10px 0 0;
    line-height: 1.6;
}

.tip-number {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(11, 107, 111, 0.9), rgba(33, 88, 132, 0.92));
    color: #fff;
    font-weight: 800;
}

.name-list-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.list-title {
    margin: 0;
    font-size: 1.05rem;
}

.list-count {
    font-weight: 700;
    color: rgba(29, 38, 55, 0.62);
}

.name-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.name-pill,
.empty-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(29, 38, 55, 0.08);
}

.empty-state {
    justify-content: flex-start;
    line-height: 1.7;
    color: var(--ink-soft);
}

.name-pill strong,
.winner-name {
    font-size: 1.08rem;
}

.name-pill span {
    display: block;
    margin-top: 2px;
    color: rgba(29, 38, 55, 0.58);
    font-size: 0.88rem;
}

.name-pill .name-pill-meta {
    margin-top: 6px;
    color: rgba(11, 107, 111, 0.88);
    font-weight: 700;
}

.name-pill .name-order {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-top: 0;
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(246, 197, 95, 0.95), rgba(239, 108, 61, 0.88));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1;
}

.name-pill.is-fresh {
    animation: entry-flash 2.1s ease;
}

.wheel-panel {
    grid-area: wheel;
    isolation: isolate;
    padding: 32px;
    background:
        radial-gradient(circle at 50% 14%, rgba(246, 197, 95, 0.24), transparent 32%),
        radial-gradient(circle at 82% 22%, rgba(11, 107, 111, 0.12), transparent 28%),
        linear-gradient(175deg, rgba(255, 252, 247, 0.96), rgba(255, 247, 236, 0.82));
}

.entry-panel {
    grid-area: entry;
    align-self: start;
    background:
        linear-gradient(180deg, rgba(255, 252, 248, 0.94), rgba(255, 248, 238, 0.82));
}

.admin-card {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(158, 215, 216, 0.14));
    border: 1px solid rgba(29, 38, 55, 0.08);
}

.admin-card.is-live {
    background: linear-gradient(150deg, rgba(255, 249, 237, 0.96), rgba(246, 197, 95, 0.22));
    border-color: rgba(246, 197, 95, 0.36);
}

.admin-title {
    margin: 6px 0 0;
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.1;
}

.admin-text {
    margin: 10px 0 0;
    color: var(--ink-soft);
    line-height: 1.7;
}

.admin-form {
    display: grid;
    gap: 12px;
}

.admin-controls,
.wheel-toolbar,
.monitor-grid {
    display: grid;
    gap: 12px;
}

.admin-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-inline,
.admin-status-row {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(29, 38, 55, 0.08);
    font-weight: 800;
}

.admin-warning {
    margin-top: 0;
}

.schedule-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(29, 38, 55, 0.08);
}

.schedule-row,
.schedule-actions {
    display: grid;
    gap: 12px;
    align-items: center;
}

.schedule-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.schedule-actions {
    grid-template-columns: minmax(0, 1fr) auto;
}

.danger-button {
    background: linear-gradient(145deg, rgba(185, 75, 87, 0.96), rgba(128, 34, 50, 0.96));
    box-shadow: 0 16px 30px rgba(185, 75, 87, 0.24);
}

.name-pill-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-form {
    margin: 0;
}

.icon-button {
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: rgba(185, 75, 87, 0.12);
    color: var(--berry);
    font-weight: 800;
    cursor: pointer;
}

.wheel-toolbar {
    margin-top: 22px;
    grid-template-columns: repeat(3, minmax(0, max-content));
    align-items: center;
    justify-content: center;
}

.toolbar-button {
    min-height: 48px;
    padding-inline: 18px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(29, 38, 55, 0.1);
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.status-chip.is-open {
    background: rgba(158, 215, 216, 0.28);
}

.status-chip.is-locked {
    background: rgba(239, 108, 61, 0.18);
}

.wheel-panel.is-celebrating {
    animation: pulse-shell 0.8s ease;
}

.wheel-shell {
    position: relative;
    width: min(100%, 640px);
    margin: 26px auto 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    --wheel-shift-x: 0px;
    --wheel-shift-y: 0px;
    --halo-x: 0px;
    --halo-y: 0px;
}

.wheel-halo {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 235, 186, 0.9), transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(11, 107, 111, 0.32), transparent 44%);
    filter: blur(34px);
    transform: translate(var(--halo-x), var(--halo-y));
    transition: transform 0.18s ease-out;
}

.pointer {
    position: absolute;
    top: -6px;
    z-index: 4;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 36px solid var(--ink);
    filter: drop-shadow(0 12px 18px rgba(29, 38, 55, 0.18));
}

#rouletteWheel,
#liveRouletteWheel {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 22px 28px rgba(29, 38, 55, 0.18));
    transform: translate(var(--wheel-shift-x), var(--wheel-shift-y));
    transition: transform 0.18s ease-out;
}

.spin-button {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 3;
    width: 136px;
    height: 136px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(160deg, #fff8eb, #ffd37f 80%);
    box-shadow:
        0 18px 36px rgba(29, 38, 55, 0.18),
        inset 0 10px 20px rgba(255, 255, 255, 0.45);
    color: var(--ink);
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.spin-button:hover {
    transform: translate(-50%, -50%) translateY(-2px);
}

.spin-button.is-hidden {
    display: none;
}

.winner-panel {
    margin-top: 28px;
    padding: 24px 26px;
    border-radius: 30px;
    background:
        linear-gradient(165deg, rgba(255, 249, 237, 0.98), rgba(255, 236, 183, 0.78)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent);
    border: 1px solid rgba(246, 197, 95, 0.42);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.winner-panel.announce {
    animation: winner-pop 0.5s ease;
}

.winner-actions {
    align-items: center;
}

.share-result-button {
    min-width: 240px;
}

.winner-share-feedback {
    margin: 0;
}

.winner-name {
    display: block;
    margin-top: 12px;
    font-size: clamp(2.4rem, 5.3vw, 3.6rem);
    line-height: 0.98;
}

.winner-meta {
    max-width: 48ch;
    margin: 12px auto 0;
}

.monitor-grid {
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitor-card {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(29, 38, 55, 0.08);
    box-shadow: var(--shadow-soft);
}

.monitor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.monitor-round {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

body.live-body {
    background:
        radial-gradient(circle at 18% 22%, rgba(246, 197, 95, 0.28), transparent 30%),
        radial-gradient(circle at 82% 14%, rgba(11, 107, 111, 0.24), transparent 25%),
        linear-gradient(150deg, #f4ecd9 0%, #edf6f5 48%, #fff8ea 100%);
}

.live-page-shell {
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0;
}

.live-stage {
    padding: 28px;
    min-height: calc(100vh - 36px);
    display: grid;
    gap: 22px;
}

.live-stage-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.live-title {
    max-width: none;
    margin: 12px 0 0;
    font-size: clamp(2.8rem, 5vw, 4.8rem);
}

.live-chip-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
    gap: 24px;
    align-items: center;
}

.live-wheel-panel {
    display: grid;
    align-items: center;
}

.live-wheel-shell {
    width: min(100%, 780px);
    margin: 0 auto;
}

.live-sidebar {
    display: grid;
    gap: 18px;
}

.live-winner-panel {
    margin-top: 0;
    min-height: 240px;
    display: grid;
    align-content: start;
}

.live-winner-panel .winner-name {
    font-size: clamp(2.6rem, 4.7vw, 4.4rem);
}

.live-tally-card {
    min-height: 260px;
}

.stack-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.stack-row,
.stack-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(29, 38, 55, 0.08);
}

.stack-row strong {
    display: block;
}

.stack-row span,
.stack-empty {
    color: var(--ink-soft);
}

.winners-card {
    margin-top: 18px;
}

.winner-row {
    background: linear-gradient(145deg, rgba(255, 248, 231, 0.96), rgba(246, 197, 95, 0.18));
}

.cloud-panel {
    margin-top: 24px;
    background:
        radial-gradient(circle at right top, rgba(246, 197, 95, 0.18), transparent 30%),
        linear-gradient(165deg, rgba(255, 252, 248, 0.94), rgba(255, 248, 238, 0.78));
}

.name-cloud {
    margin-top: 18px;
}

.cloud-chip:nth-child(3n + 1) {
    background: rgba(255, 255, 255, 0.82);
}

.cloud-chip:nth-child(3n + 2) {
    background: rgba(158, 215, 216, 0.26);
}

.cloud-chip:nth-child(3n + 3) {
    background: rgba(246, 197, 95, 0.28);
}

.error-page {
    display: grid;
    place-items: center;
}

.error-shell {
    width: min(680px, 100%);
    text-align: center;
    padding: 48px 28px;
}

.error-shell .lead {
    margin-left: auto;
    margin-right: auto;
}

.error-code {
    margin: 18px 0 0;
    font-size: clamp(4rem, 11vw, 7rem);
    line-height: 1;
}

.home-link {
    margin-top: 24px;
}

.site-credit {
    width: min(1220px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 0 0 26px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.6;
}

.site-credit a {
    color: var(--teal);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(11, 107, 111, 0.28);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-credit a:hover {
    color: var(--ink);
    border-color: rgba(29, 38, 55, 0.36);
}

.live-body .site-credit {
    width: min(1440px, calc(100% - 28px));
    padding-bottom: 18px;
}

.fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.confetti-piece {
    position: absolute;
    top: -24px;
    width: 12px;
    height: 18px;
    border-radius: 4px;
    opacity: 0.95;
    animation: confetti-fall 1.8s linear forwards;
}

.sound-off {
    opacity: 0.72;
}

.reveal {
    animation: rise-in 0.75s ease both;
}

.reveal-delay-1 {
    animation-delay: 0.08s;
}

.reveal-delay-2 {
    animation-delay: 0.16s;
}

.reveal-delay-3 {
    animation-delay: 0.24s;
}

.reveal-delay-4 {
    animation-delay: 0.32s;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-shell {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes winner-pop {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 rgba(246, 197, 95, 0);
    }

    50% {
        transform: scale(1.015);
        box-shadow: 0 18px 34px rgba(246, 197, 95, 0.24);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(246, 197, 95, 0);
    }
}

@keyframes confetti-fall {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(var(--drift-x), 110vh, 0) rotate(720deg);
        opacity: 0;
    }
}

@keyframes entry-flash {
    0% {
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.76);
        box-shadow: 0 0 0 rgba(11, 107, 111, 0);
    }

    25% {
        transform: translateY(-2px);
        background: rgba(204, 232, 230, 0.74);
        box-shadow: 0 18px 28px rgba(11, 107, 111, 0.14);
    }

    100% {
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.76);
        box-shadow: 0 0 0 rgba(11, 107, 111, 0);
    }
}

@media (max-width: 980px) {
    .hero-panel,
    .buzz-grid,
    .playground {
        grid-template-columns: 1fr;
    }

    .playground {
        grid-template-areas:
            'wheel'
            'entry';
    }

    .metric-stack {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-controls,
    .wheel-toolbar,
    .monitor-grid {
        grid-template-columns: 1fr 1fr;
    }

    h1 {
        max-width: 12ch;
    }

    .live-layout {
        grid-template-columns: 1fr;
    }

    .live-stage-head {
        align-items: start;
        flex-direction: column;
    }

    .live-chip-row {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 24px, 1220px);
        padding: 18px 0 28px;
    }

    .site-credit {
        width: min(100% - 24px, 1220px);
        padding-bottom: 22px;
    }

    .hero-copy,
    .entry-panel,
    .wheel-panel,
    .cloud-panel,
    .metric-stack {
        padding: 22px;
    }

    .metric-stack {
        grid-template-columns: 1fr;
    }

    .name-form {
        gap: 18px;
    }

    .tip-grid {
        grid-template-columns: 1fr;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .name-list-head {
        align-items: start;
        flex-direction: column;
    }

    .spin-button {
        width: 118px;
        height: 118px;
        font-size: 0.85rem;
    }

    .winner-panel {
        padding: 22px;
    }

    .admin-inline,
    .admin-status-row,
    .schedule-row,
    .schedule-actions {
        grid-template-columns: 1fr;
    }

    .admin-controls,
    .wheel-toolbar,
    .monitor-grid {
        grid-template-columns: 1fr;
    }

    .share-actions,
    .winner-actions {
        flex-direction: column;
    }

    .button-row {
        align-items: stretch;
        flex-direction: column;
    }

    .button-row .btn-primary {
        width: 100%;
    }

    .button-row .form-note {
        min-height: 0;
    }

    .form-group {
        gap: 10px;
    }

    .name-form {
        gap: 20px;
    }

    .name-form input {
        padding: 19px 54px 19px 18px;
    }

    .field-error,
    .form-feedback {
        font-size: 0.95rem;
    }

    .live-page-shell {
        width: min(100% - 20px, 1440px);
        padding: 12px 0;
    }

    .live-stage {
        padding: 22px;
        min-height: auto;
    }

    .live-winner-panel {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    body::before {
        opacity: 0.55;
    }

    .card {
        border-radius: 26px;
    }

    .live-body .site-credit {
        width: min(100% - 20px, 1440px);
    }

    h1 {
        max-width: none;
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .section-title {
        font-size: clamp(1.45rem, 7.2vw, 2.05rem);
    }

    .hero-highlights {
        flex-direction: column;
    }

    .pointer {
        border-left-width: 16px;
        border-right-width: 16px;
        border-top-width: 28px;
    }

    .spin-button {
        width: 104px;
        height: 104px;
        letter-spacing: 0.12em;
    }

    .wheel-shell {
        width: min(100%, 520px);
    }

    .btn-primary,
    .btn-secondary,
    .home-link {
        width: 100%;
    }

    .countdown-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
