:root {
    --primary: #6C5CE7;
    --secondary: #A29BFE;
    --accent: #FD79A8;
    --bg-dark: #0F0F23;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #F5F5F5;
    --text-secondary: #B0B0CC;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    padding: 8px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(45deg);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 1.25rem;
    font-weight: 600;
}

#board-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

#game-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

#overlay-message {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

button {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.secondary-btn {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.setting-item {
    margin-bottom: 25px;
    text-align: left;
}

.setting-item label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

select {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    outline: none;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 600px) {
    h1 { font-size: 1.8rem; }
    .stats-bar { gap: 15px; padding: 10px; }
    .stat-item .value { font-size: 1rem; }
    .glass-panel { padding: 25px; }
}
