:root {
    --primary-gold: #ffd700;
    --secondary-gold: #d4af37;
    --primary-red: #c41e3a;
    --dark-bg: #1a1a1a;
    --darker-bg: #0f0f0f;
    --text-light: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    overflow: hidden;
    /* Prevent scrollbars due to particles/danmaku */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

.container {
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.gold-text {
    font-family: 'Playfair Display', serif;
    color: var(--primary-gold);
    font-size: 3rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    letter-spacing: 2px;
}

.decoration-line {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    margin-top: 10px;
}

.lang-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: var(--primary-gold);
    color: var(--darker-bg);
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.lottery-display {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 40px;
    border-radius: 50%;
    width: 400px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    position: relative;
}

.current-prize-label {
    font-size: 1.5rem;
    color: var(--primary-red);
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.rolling-name {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--text-light);
    height: 80px;
    line-height: 80px;
    overflow: hidden;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.prize-selector {
    display: flex;
    gap: 15px;
}

.prize-btn {
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    border-radius: 5px;
}

.prize-btn:hover,
.prize-btn.active {
    background: var(--primary-gold);
    color: var(--darker-bg);
    box-shadow: 0 0 15px var(--primary-gold);
}

.action-buttons {
    display: flex;
    gap: 30px;
}

.action-btn {
    padding: 15px 50px;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn.start {
    background: linear-gradient(45deg, var(--primary-gold), var(--secondary-gold));
    color: var(--darker-bg);
}

.action-btn.stop {
    background: linear-gradient(45deg, var(--primary-red), #a01830);
    color: white;
}

.action-btn.import {
    background: linear-gradient(45deg, #4a90e2, #0056b3);
    color: white;
    font-size: 1rem;
    /* Slightly smaller font for secondary action */
    padding: 15px 30px;
}

.action-btn.bg-set {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    color: white;
    font-size: 1rem;
    padding: 15px 30px;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.action-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.winners-panel {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.winners-panel h2 {
    color: var(--primary-gold);
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 10px;
}

.winners-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}

.winner-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.5s ease-out;
}

.winner-item .prize-tag {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-red);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--primary-gold);
    text-align: center;
    min-width: 400px;
    box-shadow: 0 0 50px var(--primary-gold);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover {
    color: white;
}

.modal-winners {
    margin-top: 20px;
    font-size: 2rem;
    color: var(--primary-gold);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Danmaku */
#danmaku-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px black;
    animation: moveLeft 10s linear forwards;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes moveLeft {
    from {
        left: 100%;
    }

    to {
        left: -20%;
    }
}

/* Scrollbar */
.winners-list::-webkit-scrollbar {
    width: 5px;
}

.winners-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.winners-list::-webkit-scrollbar-thumb {
    background: var(--secondary-gold);
    border-radius: 5px;
}

.draw-count-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    color: var(--primary-gold);
    font-weight: bold;
}

.draw-count-input {
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--text-light);
    padding: 8px;
    width: 60px;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
}