/* Global Reset */
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body {
    background-color: #111;
    color: #ccc;
    font-family: 'Roboto Mono', monospace;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
#game-header {
    height: 60px;
    background: #000;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}
.logo { font-size: 24px; font-weight: bold; color: #fff; }
.highlight { color: #ffcc00; }
.user-info { color: #666; font-size: 14px; display: flex; align-items: center; gap: 10px; }

/* Lobby Screen */
#lobby-screen {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #111 70%);
}
.lobby-content {
    width: 600px;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.lobby-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.room-list { min-height: 200px; border: 1px dashed #333; display: flex; align-items: center; justify-content: center; margin-bottom: 30px; color: #444; }

.offline-mode-section { text-align: center; border-top: 1px solid #222; padding-top: 20px; }
.difficulty-select { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }

/* Buttons */
.btn-primary { background: #ffcc00; color: #000; border: none; padding: 10px 20px; font-weight: bold; cursor: pointer; border-radius: 4px; transition: 0.2s; }
.btn-primary:hover { background: #e6b800; transform: scale(1.05); }
.btn-secondary { background: transparent; color: #ffcc00; border: 1px solid #ffcc00; padding: 10px 20px; cursor: pointer; border-radius: 4px; }
.btn-secondary:hover { background: rgba(255, 204, 0, 0.1); }
.btn-level { background: #222; color: #888; border: 1px solid #333; padding: 8px 16px; cursor: pointer; transition: 0.2s; }
.btn-level:hover { color: #fff; border-color: #ffcc00; }
.btn-level.expert { border-color: #ff4444; color: #ff6666; }
.btn-level.expert:hover { background: #ff4444; color: #000; }
.btn-level.master { border-color: #be00ff; color: #e066ff; }
.btn-level.master:hover { background: #be00ff; color: #fff; box-shadow: 0 0 10px #be00ff; }

/* Game Screen */
#game-screen {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.game-layout {
    display: flex;
    align-items: center;
    gap: 40px;
}
.player-panel {
    width: 150px;
    text-align: center;
    opacity: 0.5;
    transition: 0.3s;
}
.player-panel.active { opacity: 1; transform: scale(1.1); }
.player-panel .avatar { font-size: 40px; margin-bottom: 10px; color: #444; }
.player-panel.active .avatar { color: #ffcc00; text-shadow: 0 0 10px #ffcc00; }
.player-panel .symbol { font-size: 30px; font-weight: bold; margin: 10px 0; }
.symbol.x { color: #00f6ff; }
.symbol.o { color: #ff4444; }

.timer { font-size: 20px; color: #fff; background: #222; padding: 5px; border-radius: 4px; }

.board-container {
    padding: 2px;
    background: #222;
    border-radius: 4px;
    position: relative;
}
canvas#caro-board {
    background: #111;
    cursor: crosshair;
    display: block;
}
#game-status {
    text-align: center;
    margin-top: 10px;
    color: #ffcc00;
    font-weight: bold;
}
#game-controls { text-align: center; margin-top: 10px; }
.btn-small { background: #333; color: #ccc; border: none; padding: 5px 10px; cursor: pointer; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-content {
    background: #151515;
    width: 400px;
    padding: 20px;
    border: 1px solid #333;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    border-radius: 8px;
}
.modal-header { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 20px; }
.close-btn { cursor: pointer; font-size: 20px; color: #666; }
.close-btn:hover { color: #fff; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: #888; font-size: 12px; }
.form-group input, .form-group select {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-family: inherit;
}
.form-group input:focus { border-color: #ffcc00; outline: none; }
.checkbox-group label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-group input { width: auto; }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
