:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --primary-color: #ffffff;
    --tower-color: #333;
    --base-color: #555;
    --disc-colors: #e0e0e0, #bdbdbd, #9e9e9e, #757575, #616161, #424242, #303030, #212121;
    --rainbow-colors: #FF5252, #FF4081, #E040FB, #7C4DFF, #536DFE, #448AFF, #40C4FF, #18FFFF;
    --monochrome-colors: #e0e0e0, #d0d0d0, #c0c0c0, #b0b0b0, #a0a0a0, #909090, #808080, #707070;
    --disc-padding: 2px;
    --disc-radius: 5px;
    --disc-height: 25px;
    --disc-spacing: 5px; 
    --warning-color: #FF5252;
    --danger-color: #FF1744;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.container {
    max-width: 800px;
    width: 100%;
    padding: 20px;
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

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

h1 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 300;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

button {
    background-color: var(--primary-color);
    color: #121212;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

.settings-btn {
    background: none;
    color: var(--primary-color);
    font-size: 20px;
    padding: 4px 8px;
}

.disc-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

select {
    background-color: #333;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 6px;
    border-radius: 4px;
}

.game-board {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    height: 300px;
    position: relative;
    flex-grow: 1;
}

.tower {
    position: relative;
    width: 180px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
}

.rod {
    position: absolute;
    bottom: 10px;
    width: 8px;
    height: 220px;
    background-color: var(--tower-color);
    border-radius: 4px;
    z-index: 1;
}

.base {
    width: 150px;
    height: 10px;
    background-color: var(--base-color);
    border-radius: 3px;
    z-index: 2;
}

.tower-key {
    position: absolute;
    bottom: -20px;
    color: var(--primary-color);
    opacity: 0.4;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    width: 30px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}

.tower:hover .tower-key {
    opacity: 0.7;
    transform: translateY(-5px);
}

.disc {
    position: absolute;
    height: var(--disc-height);
    border-radius: var(--disc-radius);
    transition: transform 0.3s ease, bottom 0.3s ease;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(0, 0, 0, 0.8);
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 150px; 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Block style discs */
.block-style .disc {
    border-radius: 0;
    box-shadow: none;
    border: var(--disc-padding) solid rgba(0, 0, 0, 0.3);
}

/* Rounded style discs */
.rounded-style .disc {
    border-radius: 15px;
}

.message {
    text-align: center;
    margin-top: 20px;
    min-height: 24px;
    color: var(--primary-color);
    font-weight: bold;
}

.tower.selected .rod {
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Footer Styles */
.footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px 0;
    font-size: 14px;
    color: #777;
    border-top: 1px solid #333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #252525;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

h3 {
    margin: 15px 0;
    color: var(--primary-color);
    font-size: 18px;
}

.setting {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Keyboard Controls */
.keyboard-controls {
    margin-top: 20px;
    background-color: rgba(40, 40, 40, 0.3);
    border-radius: 8px;
    padding: 10px;
    position: fixed;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
}

.keyboard-controls.visible {
    opacity: 0.6;
}

.keyboard-controls:hover {
    opacity: 1;
}

.key-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: #121212;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Keyboard Settings */
.keyboard-settings {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

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

.key-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.key-btn.listening {
    background-color: #ff5252;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
    }
}

/* Light theme */
body.light-theme {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --tower-color: #999;
    --base-color: #777;
}

body.light-theme button {
    color: #f5f5f5;
}

body.light-theme select {
    background-color: #ddd;
    color: #333;
    border: 1px solid #bbb;
}

body.light-theme .modal-content {
    background-color: #e0e0e0;
}

body.light-theme .keyboard-controls {
    background-color: rgba(220, 220, 220, 0.5);
}

body.light-theme .footer {
    color: #555;
    border-top-color: #ccc;
}

/* User info panel */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-color);
    font-weight: bold;
}

.user-name {
    font-weight: bold;
    color: var(--primary-color);
}

.login-link, .leaderboard-link {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin: 0 5px;
}

.login-link:hover, .leaderboard-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.logout-btn {
    background: none;
    color: var(--primary-color);
    opacity: 0.7;
    padding: 2px 8px;
    font-weight: normal;
    font-size: 0.9em;
}

.logout-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Score modal styles */
.score-summary {
    margin-bottom: 15px;
}

.score-details {
    margin-bottom: 20px;
    list-style: none;
}

.score-details li {
    margin: 8px 0;
}

.score-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.secondary-btn {
    background-color: #555;
    color: var(--text-color);
}

/* Warning modal */
.warning-modal {
    border-left: 4px solid var(--warning-color);
}

.warning-message {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--warning-color);
}

.warning-detail {
    margin-bottom: 20px;
}

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

.warning-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ban-confirm-btn {
    background-color: #555;
    color: var(--text-color);
}

/* Banned account modal */
.banned-modal {
    border-left: 4px solid var(--danger-color);
    text-align: center;
}

.banned-icon {
    font-size: 50px;
    margin: 10px 0 20px;
    color: var(--danger-color);
}

.banned-message {
    font-weight: bold;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.banned-detail {
    margin-bottom: 25px;
    line-height: 1.5;
}

.banned-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.banned-btn {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
    display: inline-block;
}

.banned-btn:hover {
    opacity: 0.9;
}

@media (max-width: 768px) {
    .game-board {
        height: 250px;
    }
    
    .tower {
        width: 120px;
        height: 200px;
    }
    
    .rod {
        height: 170px;
    }
    
    .base {
        width: 110px;
    }
    
    .disc {
        height: 20px;
        font-size: 12px;
        max-width: 110px;
    }
    
    :root {
        --disc-height: 20px;
        --disc-spacing: 4px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px 10px;
    }
    
    .game-board {
        height: 220px;
    }
    
    .tower {
        width: 95px;
        height: 170px;
    }
    
    .rod {
        height: 140px;
        width: 6px;
    }
    
    .base {
        width: 90px;
        height: 8px;
    }
    
    .disc {
        height: 18px;
        font-size: 10px;
        max-width: 90px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    .key-info {
        flex-direction: column;
        align-items: center;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .footer {
        font-size: 12px;
    }
    
    :root {
        --disc-height: 18px;
        --disc-spacing: 3px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }
    
    .container {
        padding: 10px 5px;
    }
    
    .game-board {
        height: 200px;
        padding: 10px 0;
    }
    
    .tower {
        width: 85px;
        height: 150px;
    }
    
    .rod {
        height: 120px;
        width: 5px;
    }
    
    .base {
        width: 75px;
    }
    
    .disc {
        height: 16px;
        font-size: 9px;
        max-width: 75px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .tower-key {
        font-size: 12px;
    }
    
    :root {
        --disc-height: 16px;
        --disc-spacing: 2px;
    }
}

@media (max-width: 400px) {
    .game-board {
        height: 180px;
    }
    
    .tower {
        width: 75px;
        height: 140px;
    }
    
    .rod {
        height: 110px;
        width: 4px;
    }
    
    .base {
        width: 65px;
        height: 7px;
    }
    
    .disc {
        height: 14px;
        font-size: 8px;
        max-width: 65px;
    }
    
    :root {
        --disc-height: 14px;
        --disc-spacing: 2px;
    }
}

@media (max-width: 350px) {
    .game-board {
        height: 160px;
    }
    
    .tower {
        width: 65px;
        height: 120px;
    }
    
    .rod {
        height: 90px;
        width: 4px;
    }
    
    .base {
        width: 55px;
        height: 6px;
    }
    
    .disc {
        height: 12px;
        font-size: 7px;
        max-width: 55px;
    }
    
    :root {
        --disc-height: 12px;
        --disc-spacing: 1px;
    }
}

/* React-specific adjustments */
.modal-open {
    display: block;
}