:root {
    --bg-color: #1a1a2e;
    --text-color: #ffffff;
    --accent-color: #e94560;
    --secondary-color: #16213e;
    --input-bg: #0f3460;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

header {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center; 
    padding: 20px 0;
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-color);
    text-align: center;
}

.home-btn, 
.lang-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
}

.home-btn {
    left: 20px;
}

.lang-btn {
    right: 20px;
}

.home-btn:hover,
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

@media (max-width: 600px) {
    header {
        padding-top: 60px;
        padding-bottom: 15px;
        height: auto;
    }

    header h1 {
        font-size: 1.5rem;
        max-width: 90%;
        margin: 0 auto;
        line-height: 1.2;
        position: static;
        transform: none;
    }

    .home-btn, .lang-btn {
        position: absolute;
        top: 12px;
        transform: none;
        
        display: flex;
        align-items: center;
        justify-content: center;
        
        height: 36px;
        font-size: 0.85rem;
        padding: 0 15px;
    }

    .home-btn {
        left: 15px;
        width: 36px;
        padding: 0;
    }

    .lang-btn {
        right: 15px;
    }

    .home-btn:hover, 
    .lang-btn:hover {
        transform: scale(1.05);
    }

    .home-btn:active, 
    .lang-btn:active {
        transform: scale(0.95);
    }
}

.main-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.controls {
    flex: 1;
    min-width: 300px;
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--input-bg);
    color: white;
    font-size: 16px;
    outline: none;
}

#addBtn {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

#addBtn:hover {
    transform: scale(1.05);
}

ul {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

li {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

li:hover {
    background: rgba(233, 69, 96, 0.2);
}

li::after {
    content: '✖';
    color: #ff6b6b;
    font-size: 12px;
}

.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

canvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99); 
}

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid white;
    z-index: 10;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5));
}

#spinBtn {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-color);
    transition: 0.3s;
}

#spinBtn:hover {
    background: #ff5e78;
    box-shadow: 0 0 25px #ff5e78;
    transform: scale(1.05);
}

#spinBtn:disabled {
    background: #555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--secondary-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--accent-color);
    max-width: 90%;
    width: 400px;
    transform: scale(1);
    transition: transform 0.3s;
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

.modal-content h2 {
    margin-bottom: 15px;
    color: #ccc;
}

#winnerResult {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 30px;
}

#closeModal {
    background: white;
    color: black;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column-reverse;
        align-items: center;
    }
    
    .controls {
        width: 100%;
    }

    canvas {
        max-width: 300px;
    }
}