/* SPIN THE BOTTLE – Redesigned */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html,
body {
    overscroll-behavior: none;
    touch-action: manipulation
}

:root {
    --bg-dark: #1c2a1c;
    --glass-bg: rgba(200, 162, 74, .06);
    --glass-border: rgba(200, 162, 74, .12);
    --accent-1: #c8a24a;
    --accent-2: #e6c877;
    --accent-3: #7a4324;
    --text-primary: #e9dfc4;
    --text-secondary: rgba(233, 223, 196, .6);
    --font: 'Outfit', system-ui, sans-serif
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: fixed;
    inset: 0
}

#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s, visibility .4s
}

.screen.active {
    opacity: 1;
    visibility: visible
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.2rem;
    text-align: center;
    max-width: 440px;
    width: 92%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
    position: relative;
    overflow: hidden
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle, rgba(200, 162, 74, .12) 0%, transparent 60%);
    pointer-events: none
}

.logo-area {
    margin-bottom: 1.2rem
}

.logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: .3rem;
    filter: drop-shadow(0 0 18px rgba(200, 162, 74, .5));
    animation: float 3s ease-in-out infinite
}

h1 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -.5px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15
}

.tagline {
    color: var(--text-secondary);
    font-size: .85rem;
    margin-top: .2rem;
    font-weight: 300;
    letter-spacing: .5px
}

.players-input-area {
    margin-bottom: 1.2rem
}

.players-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin-bottom: .6rem;
    min-height: 1.5rem
}

.player-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(200, 162, 74, .15);
    border: 1px solid rgba(200, 162, 74, .3);
    border-radius: 100px;
    cursor: pointer;
    transition: opacity .2s
}

.player-tag:hover {
    opacity: .7
}

.player-tag .remove {
    font-size: .65rem;
    opacity: .6
}

.add-row {
    display: flex;
    gap: .5rem
}

.theme-input {
    flex: 1;
    padding: .6rem .8rem;
    font-family: var(--font);
    font-size: .85rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    outline: none;
    transition: border-color .2s
}

.theme-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(200, 162, 74, .15)
}

.btn-add-player {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 2.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
    box-shadow: 0 4px 20px rgba(230, 200, 119, .35);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, .15) 100%);
    pointer-events: none
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.03)
}

.btn-primary:active {
    transform: scale(.97)
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.8rem;
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-primary);
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    cursor: pointer;
    transition: background .2s, transform .2s
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .14);
    transform: translateY(-1px)
}

.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
    box-shadow: 0 4px 12px rgba(122, 67, 36, .3);
    transition: transform .2s
}

.btn-accent:hover {
    transform: translateY(-1px)
}

.pulse {
    position: relative
}

.pulse::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 100px;
    border: 2px solid var(--accent-1);
    animation: pulse-ring 2s cubic-bezier(.4, 0, .6, 1) infinite
}

.btn-arrow {
    display: inline-block;
    transition: transform .2s
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px)
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 2px
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border)
}

.game-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    position: relative;
    z-index: 1
}

/* Wheel / Circle */
.wheel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center
}

#bottle-canvas {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(200, 162, 74, .15), 0 0 0 4px var(--glass-border)
}

/* Bottle overlay */
.bottle-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bottle-svg {
    width: 54px;
    height: 190px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, .7)) drop-shadow(0 0 40px rgba(200, 162, 74, .4));
    transition: transform 3.5s cubic-bezier(.15, .85, .25, 1);
    transform-origin: center center;
}

/* Prompt */
.prompt-display {
    font-size: 1.5rem;
    font-weight: 800;
    min-height: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 360px;
    line-height: 1.3;
}

.btn-spin-game {
    padding: .85rem 3rem;
    font-size: 1.1rem
}

/* ---- Game Controls Layout ---- */
.game-controls {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.game-controls-secondary {
    display: flex;
    align-items: center;
    gap: .8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: .2rem;
}

/* ---- Shuffle Button ---- */
.btn-shuffle {
    padding: .6rem 1.4rem;
    font-size: .85rem;
    font-weight: 600;
    transition: transform .2s, background .2s, box-shadow .3s;
}

.btn-shuffle:hover {
    background: rgba(255, 255, 255, .14);
    transform: translateY(-1px);
}

.shuffle-flash {
    box-shadow: 0 0 20px rgba(200, 162, 74, .5) !important;
    background: rgba(200, 162, 74, .2) !important;
}

/* ---- Zebra Toggle ---- */
.zebra-toggle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    margin: .8rem 0;
}

.zebra-toggle-ingame {
    margin: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.toggle-label-sm {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.toggle-icon {
    font-size: 1.2rem;
}

.toggle-icon-sm {
    font-size: 1rem;
}

.toggle-hint {
    font-size: .7rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch-sm {
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: background .3s, border-color .3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform .3s, background .3s;
}

.toggle-switch-sm .toggle-slider::before {
    width: 14px;
    height: 14px;
    left: 2px;
}

.toggle-switch input:checked + .toggle-slider {
    background: rgba(200, 162, 74, .3);
    border-color: var(--accent-1);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(20px);
    background: var(--accent-1);
}

.toggle-switch-sm input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(16px);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

@keyframes pulse-ring {
    0% {
        opacity: 1;
        transform: scale(1)
    }

    80%,
    100% {
        opacity: 0;
        transform: scale(1.15)
    }
}

@media(max-width:600px) {
    .glass-card {
        padding: 1.8rem 1.3rem;
        max-width: 96vw;
        width: 96%
    }

    #bottle-canvas {
        width: 300px !important;
        height: 300px !important
    }

    .bottle-svg {
        width: 44px;
        height: 155px
    }

    .prompt-display {
        font-size: 1.2rem
    }

    h1 {
        font-size: 1.8rem
    }
}

@media(max-width:360px) {
    #bottle-canvas {
        width: 250px !important;
        height: 250px !important
    }

    .bottle-svg {
        width: 38px;
        height: 130px
    }

    h1 {
        font-size: 1.5rem
    }
}
