* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gray-light: #17171a;
    --gray: #121215;
    --gray-dark: #0A0A0C;
    --gray-accent: hsla(0, 0%, 82%, 0.1);
    --primary-color: #5865f2;
    --text-color: #fff;
    --danger-color: #ed4245;
    --success-color: #57f287;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-dark);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Card Styles */
.start-card, .menu-card, .number-game-container, .spin-container {
    background: var(--gray-light);
    border: 1px solid var(--gray-accent);
    border-radius: 5px;
    padding: 40px;
    text-align: center;
}

.spin-container {
    text-align: left;
}

.start-card h1, .menu-card h1, .spin-container h1, .number-game-container h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

/* Input Styles */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--gray-accent);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.word-input-popup {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-accent);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 20px;
}

.word-input-popup:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #4752c4;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    margin-top: 20px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c03537;
}

.btn-spin {
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    padding: 15px 30px;
    margin-top: 30px;
}

.btn-spin:hover {
    background: #4752c4;
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Menu Buttons */
.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.menu-btn {
    background: var(--gray);
    border: 1px solid var(--gray-accent);
    border-radius: 5px;
    padding: 40px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: var(--gray-light);
}

/* Spin Wheel */
.spin-wheel-container {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    float: right;
    margin-right: 26%;
    width: 520px;
}

.wheel-wrapper {
    position: relative;
    display: block;
    margin: 0 auto;
    width: 520px;
}

#spinWheel {
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--primary-color);
    z-index: 10;
}

/* Participants Section */
.participants-section {
    margin-top: 600px;
    clear: both;
    background: var(--gray-light);
    border: 1px solid var(--gray-accent);
    border-radius: 5px;
    padding: 20px;
}

.participants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.participants-header h2 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.participants-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
}

#numberParticipantsList {
    max-height: 260px;
}

.participant-item {
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid var(--gray-accent);
}

.participant-name {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: var(--gray-light);
    border: 1px solid var(--gray-accent);
    border-radius: 5px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.popup-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.winner-name {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: bold;
    margin: 20px 0;
}

.winner-number {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin: 15px 0;
}

.winner-number strong {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.popup-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.popup-buttons .btn {
    flex: 1;
}

/* Messages */
.error-message {
    color: var(--danger-color);
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

.status-message {
    color: var(--success-color);
    margin-top: 10px;
    display: none;
}

.status-message.show {
    display: block;
}

/* Number Game Styles */
.number-game-setup {
    margin: 30px 0;
}

.number-game-setup label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.number-range-select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 1px solid var(--gray-accent);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 1rem;
    margin: 10px 0 20px;
    cursor: pointer;
}

.number-range-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.number-game-play {
    margin-top: 30px;
}

.hidden-number-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden-number {
    width: 200px;
    height: 200px;
    background: var(--gray);
    border: 2px solid var(--gray-accent);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.hidden-number:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hidden-number.revealed {
    background: rgba(255, 255, 255, 0.15);
}

.giveaway-word-display {
    background: var(--gray);
    border: 1px solid var(--gray-accent);
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.giveaway-word-display p {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.giveaway-word-display strong {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Scrollbar */
.participants-list::-webkit-scrollbar {
    width: 6px;
}

.participants-list::-webkit-scrollbar-track {
    background: var(--gray-dark);
}

.participants-list::-webkit-scrollbar-thumb {
    background: var(--gray-accent);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .start-card, .menu-card, .spin-container, .number-game-container {
        padding: 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .menu-buttons {
        grid-template-columns: 1fr;
    }

    #spinWheel {
        width: 350px;
        height: 350px;
    }

    .participants-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
