:root {
    --bg: #0b1028;
    --panel: rgba(20, 25, 58, 0.86);
    --cyan: #95d8ff;
    --pink: #c68cff;
    --violet: #8b9cff;
    --gold: #f5d88a;
    --text: #f5f7ff;
    --muted: #c4c9e8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 12%, rgba(149, 216, 255, 0.16), transparent 25rem),
        radial-gradient(circle at 82% 16%, rgba(198, 140, 255, 0.12), transparent 24rem),
        linear-gradient(135deg, #081024 0%, #11163a 48%, #19133d 100%);
    overflow-x: hidden;
}

button, input { font: inherit; }

#stars, #confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#stars { z-index: 0; }
#confetti { z-index: 8; }

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 34px;
}

.brand-panel {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 22px;
    align-items: center;
    min-height: 178px;
}

.logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(149, 216, 255, 0.36));
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--cyan);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: clamp(2.3rem, 6vw, 5.7rem);
    line-height: 0.95;
    text-shadow: 0 0 18px rgba(149, 216, 255, 0.32);
}

.subtitle {
    max-width: 680px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.game-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: center;
}

.wheel-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 570px;
}

.wheel-stage::before {
    content: "";
    position: absolute;
    width: min(72vw, 520px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(149, 216, 255, .12), transparent 68%);
    transform: translateY(18px);
}

#wheel {
    position: relative;
    width: min(90vw, 620px);
    aspect-ratio: 1;
    height: auto;
    border-radius: 50%;
    filter: drop-shadow(0 0 22px rgba(149, 216, 255, 0.22));
}

.pointer {
    position: absolute;
    top: calc(50% - min(45vw, 310px) - 2px);
    z-index: 2;
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 52px solid var(--gold);
    filter: drop-shadow(0 0 10px rgba(245, 216, 138, 0.7));
}

.spin-button {
    position: absolute;
    width: 142px;
    height: 142px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.78);
    color: #fff;
    cursor: pointer;
    background: radial-gradient(circle, #b88dff 0%, #6376d8 55%, #232a66 100%);
    box-shadow: 0 0 18px rgba(149, 216, 255, 0.36), inset 0 0 20px rgba(255,255,255,.22);
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: 0;
    transition: transform .2s ease, opacity .2s ease;
}

.spin-button:hover:not(:disabled) { transform: scale(1.06); }
.spin-button:disabled { cursor: not-allowed; opacity: .55; }

.control-panel {
    padding: 22px;
    border: 1px solid rgba(149, 216, 255, 0.24);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(19, 25, 60, 0.9), rgba(12, 16, 39, 0.92));
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(14px);
}

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

.panel-header h2 {
    margin: 0;
    font-size: 1.45rem;
}

.icon-button, .close-button {
    border: 1px solid rgba(125, 249, 255, 0.55);
    color: #fff;
    background: rgba(125, 249, 255, 0.09);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(149, 216, 255, 0.16);
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
}

form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

label {
    display: grid;
    gap: 7px;
    color: #dce3ff;
    font-weight: 700;
}

label span {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
}

input {
    width: 100%;
    border: 1px solid rgba(125, 249, 255, 0.3);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--text);
    background: rgba(9, 14, 35, 0.72);
    outline: none;
}

input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(149, 216, 255, 0.12);
}

.status-message {
    min-height: 44px;
    margin: 4px 0 0;
    color: var(--gold);
    font-weight: 800;
}

.prize-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.prize-list span {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 7px 10px;
    color: #eef3ff;
    background: rgba(255, 255, 255, 0.06);
    font-size: .86rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 3, 18, 0.76);
}

.modal[hidden] { display: none; }

.modal-card {
    position: relative;
    width: min(520px, 100%);
    border: 1px solid rgba(125, 249, 255, 0.35);
    border-radius: 8px;
    padding: 34px 26px;
    text-align: center;
    background: linear-gradient(145deg, rgba(28, 33, 76, 0.98), rgba(10, 13, 35, 0.98));
    box-shadow: 0 18px 70px rgba(0, 0, 0, 0.42);
}

.modal.mystery .modal-card {
    border-color: rgba(255, 216, 107, 0.85);
    background: linear-gradient(145deg, #5f3600, #180b39 48%, #07041b);
    box-shadow: 0 0 48px rgba(245, 216, 138, 0.42);
}

.modal-kicker {
    margin: 0 0 8px;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 900;
}

.modal.mystery .modal-kicker { color: var(--gold); }

.modal-card h2 {
    margin: 0;
    font-size: clamp(2rem, 9vw, 4rem);
    text-shadow: 0 0 18px currentColor;
}

.modal-card p:last-child {
    margin-bottom: 0;
    color: #dce3ff;
}

.close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
}

@media (max-width: 920px) {
    .brand-panel {
        grid-template-columns: 100px 1fr;
        min-height: 128px;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

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

    .wheel-stage {
        min-height: auto;
    }

    .control-panel {
        order: -1;
    }
}

@media (max-width: 560px) {
    .app-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 16px;
    }

    .brand-panel {
        grid-template-columns: 84px 1fr;
        gap: 12px;
    }

    .logo {
        width: 84px;
        height: 84px;
    }

    .subtitle {
        font-size: .95rem;
    }

    .control-panel {
        padding: 16px;
    }

    .spin-button {
        width: 106px;
        height: 106px;
        font-size: 1.25rem;
    }

    .pointer {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 38px;
        top: calc(50% - 45vw - 2px);
    }
}
