/* WHEEL OF NAMES – 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;
    --red: #ef4444;
    --green: #22c55e;
    --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;
    overflow: hidden;
    position: fixed;
    inset: 0
}

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

/* Layout: wheel left, names right */
.app-layout {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    height: 100dvh;
    padding: 1rem;
}

.wheel-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
    flex-shrink: 0
}

.names-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 260px;
    flex-shrink: 0
}

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

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--accent-1);
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(200, 162, 74, .7));
    line-height: 1;
}

#wheel-canvas {
    width: 420px;
    height: 420px;
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(200, 162, 74, .25), 0 0 0 5px var(--glass-border)
}

.winner-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: 2rem;
    font-weight: 900;
    min-height: 2.5rem;
    color: var(--text-primary);
    text-align: center;
}

.winner-emoji {
    color: var(--accent-1);
    filter: drop-shadow(0 0 12px rgba(200, 162, 74, .45));
}

.winner-name {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wheel-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center
}

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

.names-heading {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: .6rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.names-list-scroll {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: .6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 162, 74, .3) transparent;
}

.names-list-scroll::-webkit-scrollbar {
    width: 4px
}

.names-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(200, 162, 74, .3);
    border-radius: 4px
}

/* Name items */
.name-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background .15s;
}

.name-item:hover {
    background: rgba(255, 255, 255, .05)
}

.name-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0
}

.name-text {
    flex: 1;
    text-align: left;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary)
}

.name-remove {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: .7rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.name-remove:hover {
    background: rgba(239, 68, 68, .15);
    color: var(--red)
}

/* Add row */
.add-row {
    display: flex;
    gap: .4rem;
    margin-bottom: .5rem
}

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

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

.btn-add {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Name actions */
.names-actions {
    display: flex;
    gap: .4rem;
    justify-content: center
}

.btn-small {
    padding: .3rem .7rem;
    font-size: .7rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.btn-small:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--text-primary)
}

.btn-small-danger:hover {
    background: rgba(239, 68, 68, .15);
    color: var(--red)
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .85rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    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: .4;
    cursor: not-allowed;
    transform: none
}

.btn-danger {
    padding: .55rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    background: var(--red);
    box-shadow: 0 4px 14px rgba(239, 68, 68, .3);
    transition: transform .2s;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.4rem;
    font-size: .82rem;
    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;
    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)
}

/* Responsive: stack on mobile */
@media(max-width:700px) {
    .app-layout {
        flex-direction: column;
        gap: .8rem;
        padding: .5rem;
        justify-content: flex-start;
        overflow-y: auto
    }

    #wheel-canvas {
        width: 280px !important;
        height: 280px !important
    }

    .names-side {
        width: 96%;
        max-width: 400px
    }

    .names-list-scroll {
        max-height: 160px
    }

    .winner-display {
        font-size: 1.5rem
    }

    .wheel-pointer {
        font-size: 1.6rem;
        top: -8px
    }
}

@media(max-width:400px) {
    #wheel-canvas {
        width: 240px !important;
        height: 240px !important
    }

    .names-list-scroll {
        max-height: 120px
    }
}

@keyframes float {

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

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