:root {
    --pink: #E31C64;
    --pink-dark: #B8104E;
    --navy: #16204A;
    --navy-2: #1F2C5C;
    --purple: #6C3FA6;
    --purple-light: #8B5FC2;
    --cream: #FBF3E8;
    --gold: #D9A94E;
    --gold-light: #F0D89B;
    --ink: #221B2E;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background: var(--cream);
    background-image:
        radial-gradient(circle at 8% 92%, rgba(227, 28, 100, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 95% 6%, rgba(108, 63, 166, 0.16) 0%, transparent 42%);
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    padding-bottom: 40px;
}

/* ---------- HEADER ---------- */
.topbar {
    position: relative;
    background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 55%, var(--purple) 130%);
    padding: 26px 20px 32px;
    overflow: hidden;
}

.topbar::before,
.topbar::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
}

.topbar::before {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(227, 28, 100, 0.55), transparent 70%);
    top: -90px;
    left: -60px;
}

.topbar::after {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(217, 169, 78, 0.35), transparent 70%);
    bottom: -140px;
    right: -60px;
}

.eyebrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pink);
    color: #fff;
    font-family: 'Anton', sans-serif;
    letter-spacing: 0.04em;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 100px;
    text-transform: uppercase;
}

.headline {
    position: relative;
    font-family: 'Anton', sans-serif;
    color: #fff;
    font-size: clamp(28px, 5vw, 44px);
    line-height: 1.05;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.headline span {
    color: var(--gold-light);
}

.subhead {
    position: relative;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    max-width: 560px;
    margin: 0;
}

/* ---------- MAIN LAYOUT ---------- */
.stage {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 0;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width:820px) {
    .stage {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
        padding: 24px 24px 0;
    }
    .wheel-wrap {
        max-width: 300px;
    }
}

.panel {
    background: #fff;
    border: 1px solid rgba(22, 32, 74, 0.08);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 30px -18px rgba(22, 32, 74, 0.35);
}

.panel h2 {
    font-family: 'Anton', sans-serif;
    font-size: 19px;
    text-transform: uppercase;
    color: var(--navy);
    margin: 0 0 4px;
    letter-spacing: 0.02em;
}

.panel .hint {
    font-size: 12.5px;
    color: #7A7488;
    margin: 0 0 16px;
}

.name-form {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.name-form input {
    flex: 1;
    border: 1.5px solid #E7DFF3;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease;
    min-width: 0;
}

.name-form input:focus {
    border-color: var(--purple);
}

.btn {
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-add {
    background: var(--navy);
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.btn-add:hover {
    filter: brightness(1.15);
}

.name-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.name-list::-webkit-scrollbar {
    width: 6px;
}

.name-list::-webkit-scrollbar-thumb {
    background: #E7DFF3;
    border-radius: 10px;
}

.name-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--cream);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 500;
}

.name-chip .swatch {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    margin-right: 8px;
}

.name-chip .label {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.name-chip .label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.name-chip button {
    background: none;
    border: none;
    color: #B0A8C2;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
}

.name-chip button:hover {
    color: var(--pink);
}

.empty-state {
    text-align: center;
    padding: 24px 10px;
    color: #A79FBB;
    font-size: 13px;
    border: 1.5px dashed #E7DFF3;
    border-radius: 12px;
    margin-bottom: 16px;
}

.panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-secondary {
    flex: 1;
    min-width: 120px;
    background: #fff;
    color: var(--navy);
    border: 1.5px solid #E7DFF3;
    padding: 9px 10px;
    font-size: 12.5px;
}

.btn-secondary:hover {
    background: #F5F0FB;
}

.counter {
    font-family: 'Anton', sans-serif;
    color: var(--purple);
}

/* ---------- WHEEL AREA ---------- */
.wheel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 20px 30px;
    position: relative;
}

.wheel-wrap {
    position: relative;
    width: 86%;
    max-width: 420px;
    aspect-ratio: 1/1;
    margin-bottom: 38px;
}

.wheel-glow {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--pink), var(--gold), var(--purple), var(--pink));
    filter: blur(2px);
    opacity: 0.9;
    z-index: 0;
}

#wheelCanvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    filter: drop-shadow(0 18px 30px rgba(22, 32, 74, 0.25));
}

.pointer {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 46px;
    height: 56px;
    filter: drop-shadow(0 6px 8px rgba(22, 32, 74, 0.35));
}

.hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, #b8853a 100%);
    border: 4px solid #fff;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.hub svg {
    width: 28px;
    height: 28px;
}

.spin-btn {
    font-family: 'Anton', sans-serif;
    font-size: 19px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(120deg, var(--pink), var(--pink-dark));
    padding: 16px 46px;
    border-radius: 100px;
    box-shadow: 0 12px 24px -8px rgba(227, 28, 100, 0.6);
}

.spin-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.spin-btn:disabled {
    background: #D8D2E4;
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
}

.spin-note {
    margin-top: 10px;
    font-size: 12.5px;
    color: #8A8399;
    text-align: center;
}

/* ---------- WINNER MODAL ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 15, 35, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}

.overlay.show {
    display: flex;
}

.ticket {
    position: relative;
    background: linear-gradient(160deg, var(--navy) 0%, var(--purple) 140%);
    border-radius: 0;
    padding: 36px 34px 50px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold);
    animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes pop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ticket .kicker {
    font-family: 'Anton', sans-serif;
    color: var(--gold-light);
    letter-spacing: 0.08em;
    font-size: 13px;
    text-transform: uppercase;
}

.ticket .winner-name {
    font-family: 'Anton', sans-serif;
    color: #fff;
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.1;
    margin: 10px 0 14px;
    word-break: break-word;
}

.ticket .sub {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13.5px;
    margin-bottom: 22px;
}

.ticket-close {
    background: var(--gold);
    color: var(--navy);
    padding: 11px 30px;
    border-radius: 100px;
    font-size: 14px;
}

.ticket-close:hover {
    filter: brightness(1.08);
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- CREDITS & BRANDING ---------- */
.credits-footer {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 20px 10px;
    border-top: 1.5px dashed rgba(22, 32, 74, 0.1);
}

.credits-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #7A7488;
    font-weight: 700;
}

.credits-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.credits-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    border: 1.5px solid #E7DFF3;
    box-shadow: 0 4px 12px rgba(22, 32, 74, 0.04);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.credits-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 32, 74, 0.08);
    border-color: var(--purple);
    color: var(--purple);
}

.credits-item svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2px;
}

.ticket-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.ticket-footer-label {
    display: block;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 10px;
    font-weight: 600;
}

.ticket-footer-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.t-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ticket-dev-credit {
    position: absolute;
    bottom: 12px;
    left: 16px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
    letter-spacing: 0.05em;
}
