@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Chai Theme Palette from chai.dhyeyvachhani.com */
    --background: hsl(35, 40%, 96%);
    /* Warm Beige */
    --foreground: hsl(25, 30%, 15%);
    /* Dark Brownish Grey */
    --card: hsl(0, 0%, 100%);
    /* White */
    --primary: hsl(15, 75%, 58%);
    /* Terracotta/Coral */
    --primary-fg: hsl(0, 0%, 100%);
    --secondary: hsl(35, 45%, 88%);
    /* Light Sand */
    --secondary-fg: hsl(25, 30%, 20%);
    --accent: hsl(140, 40%, 55%);
    /* Sage Green */
    --border: hsl(35, 20%, 85%);
    --input: hsl(35, 20%, 85%);
    --radius: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    /* Clean, modern font like the reference */
}

body {
    background-color: var(--background);
    /* Subtle grain or pattern could be nice, but solid warm beige matches reference */
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Floating Shapes - Subtle and Warm */
.shape {
    position: absolute;
    z-index: -1;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    top: -5%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: var(--secondary);
    border-radius: 50%;
    filter: blur(50px);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(60px);
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

.container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 95%;
    max-width: 480px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    text-align: center;
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.subtitle {
    font-weight: 400;
    color: hsl(25, 15%, 45%);
    /* Muted foreground */
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
}

input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--input);
    border-radius: calc(var(--radius) - 4px);
    font-size: 1rem;
    color: var(--foreground);
    outline: none;
    background: var(--background);
    transition: all 0.2s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px hsla(15, 75%, 58%, 0.1);
    background: var(--card);
}

.btn-add {
    width: 50px;
    height: 50px;
    /* Square-ish but rounded */
    border-radius: calc(var(--radius) - 4px);
    border: none;
    background: var(--primary);
    color: var(--primary-fg);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-add:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.name-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 2rem;
}

.name-item {
    background: var(--secondary);
    color: var(--secondary-fg);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: popIn 0.2s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.delete-btn {
    background: transparent;
    color: var(--secondary-fg);
    opacity: 0.5;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.delete-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Wheel Styles */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
    /* No heavy border, just subtle shadow */
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid var(--foreground);
    /* Dark pointer */
    z-index: 2;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.btn-decide {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-fg);
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.btn-decide:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px hsla(15, 75%, 58%, 0.25);
}

.btn-decide:disabled {
    background: var(--input);
    color: var(--secondary-fg);
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Overlay */
.result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: var(--radius);
    z-index: 10;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.winner-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.winner-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
}

.btn-reset {
    background: transparent;
    color: var(--foreground);
    padding: 10px 30px;
    border: 1px solid var(--border);
    border-radius: 9999px;
    /* Pill shape */
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.btn-reset:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}