:root {
    --primary: #00f3ff;
    --primary-dim: #00f3ff40;
    --secondary: #ff0055;
    --secondary-dim: #ff005540;
    --bg-dark: #0a0b10;
    --bg-panel: #11141d;
    --text-main: #ffffff;
    --text-dim: #8892b0;
    --border-color: #2a2f3d;
    --font-display: 'Orbitron', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Background Effects */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    z-index: -2;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px) translateZ(-200px); }
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
    background-size: 100% 4px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.3;
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.cyber-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--primary-dim);
    padding-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.company-logo {
    height: 60px; /* Adjust based on logo aspect ratio */
    margin-bottom: 15px;
}

.cyber-header h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-dim);
    letter-spacing: 4px;
}

.subtitle {
    color: var(--secondary);
    font-family: var(--font-display);
    letter-spacing: 2px;
    margin-top: 5px;
}

.main-interface {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 20px;
    flex: 1;
    min-height: 0; /* Fix flex overflow */
}

/* Panel Styles */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.panel::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 20px; height: 20px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
}
.panel::after {
    content: '';
    position: absolute;
    bottom: -1px; right: -1px;
    width: 20px; height: 20px;
    border-bottom: 2px solid var(--primary);
    border-right: 2px solid var(--primary);
}

.panel-header h2 {
    font-family: var(--font-display);
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Controls */
.cyber-select, .cyber-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--primary-dim);
    color: var(--text-main);
    padding: 10px 15px; /* Increased padding */
    font-family: var(--font-display);
    margin-bottom: 15px;
    outline: none;
    transition: all 0.3s;
}

.cyber-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300f3ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px; /* Space for arrow */
    cursor: pointer;
}

.cyber-select:focus, .cyber-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-dim);
}

.cyber-btn {
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.2s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.cyber-btn.primary {
    background: var(--primary);
    color: #000;
}
.cyber-btn.primary:hover {
    background: #ccfcff;
    box-shadow: 0 0 15px var(--primary);
}

.cyber-btn.warning {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}
.cyber-btn.warning:hover {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 0 15px var(--secondary);
}

.cyber-btn.secondary {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
}
.cyber-btn.secondary:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.cy-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333 !important;
    color: #888 !important;
    box-shadow: none !important;
}

/* Stats */
.current-stats {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-box {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}
.stat-box .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 5px;
}
.stat-box .value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
}

/* Stage */
.stage-panel {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a202c 0%, #11141d 70%);
}

.drawing-display {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decoration-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px dashed var(--primary-dim);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.rolling-text {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    text-shadow: 0 0 20px var(--primary);
    z-index: 2;
}

.winner-popup {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    background: rgba(10, 11, 16, 0.95);
    border: 2px solid var(--secondary);
    padding: 40px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 0 50px var(--secondary-dim);
    backdrop-filter: blur(10px);
}
.hidden { display: none !important; }

.winner-label {
    color: var(--secondary);
    font-family: var(--font-display);
    letter-spacing: 4px;
    margin-bottom: 20px;
    animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }

.prize-image {
    max-width: 300px;
    max-height: 200px;
    margin: 10px auto;
    display: block;
}

.prize-name-display {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    margin: 10px 0;
    text-shadow: 0 0 10px var(--primary-dim);
}

.winner-name {
    font-size: 5rem;
    font-family: var(--font-display);
    color: #fff;
    text-shadow: 0 0 30px var(--secondary);
}

/* Winners List */
.winners-list-container {
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    padding: 10px;
    border-left: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.history-prize {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
}
.history-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    width: 600px;
    max-width: 90%;
    background: var(--bg-panel);
    border: 1px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    display: flex;
    flex-direction: column;
}
.modal-header {
    background: var(--primary-dim);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-family: var(--font-display); color: var(--primary); }
.close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 20px; }
.setting-group { margin-bottom: 20px; }
.setting-group label { display: block; margin-bottom: 5px; font-family: var(--font-display); color: var(--text-dim); font-size: 0.9rem; }
.modal-footer { padding: 20px; border-top: 1px solid var(--border-color); text-align: right; }

/* Responsive */
@media (max-width: 1024px) {
    .main-interface { grid-template-columns: 250px 1fr; }
    .winners-panel { position: fixed; right: -350px; top: 0; height: 100%; width: 300px; z-index: 100; transition: right 0.3s; }
    .winners-panel.active { right: 0; }
}

@media (max-width: 768px) {
    .main-interface { display: flex; flex-direction: column; }
    .drawing-display { min-height: 400px; }
    .rolling-text { font-size: 2.5rem; }
    .cyber-header h1 { font-size: 2rem; }
}
