body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-image: url('assets/background5.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent !important;
    z-index: 3;
}
#video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transform: scaleX(-1);
    opacity: 1.0;
}
#hand-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
#status {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: rgba(0, 5, 78, 0.7);
    padding: 10px;
    z-index: 10;
    font-size: 16px;
}
#controls {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
}

/* Voice Controls Styling */
#voice-controls {
    position: absolute;
    top: 60px;
    left: 5px;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#voice-controls .voice-label {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    font-size: 14px;
    margin-right: 5px;
}

#voice-select {
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    min-width: 160px;
    transition: background-color 0.2s;
}

#voice-select:hover {
    background-color: white;
}

#voice-toggle {
    padding: 6px 10px;
    background-color: #2d2d2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    min-width: 36px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#voice-toggle:hover {
    background-color: #2d2d2d;
    transform: scale(1.05);
}

#voice-toggle.disabled {
    background-color: #f44336;
}

#voice-toggle.disabled:hover {
    background-color: #d32f2f;
}

button {
    padding: 8px 16px;
    margin-right: 10px;
    background-color: #292929;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #d700d0;
}

#zoomInBtn, #zoomOutBtn {
    font-weight: bold;
    font-size: 16px;
    padding: 8px 12px;
    min-width: 40px;
}

#debug {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px;
    z-index: 10;
    font-size: 12px;
    text-align: center;
    min-width: 300px;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    z-index: 100;
}

/* Multiplayer styling */
.ui-panel {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    z-index: 100;
}

#multiplayer-status {
    top: 10px;
    right: 10px;
    text-align: right;
}

#game-controls {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

#resignBtn {
    background-color: #f44336;
}

#resignBtn:hover {
    background-color: #d32f2f;
}

/* Start screen styles */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.start-menu {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    width: 400px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.start-menu h1 {
    margin-top: 0;
    color: #333;
    font-size: 28px;
}

.start-menu p {
    color: #666;
    margin-bottom: 30px;
}

.online-users {
    background-color: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.game-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #4a72b0;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.game-btn:hover {
    background-color: #345d9d;
}

.game-btn:last-child {
    margin-bottom: 0;
}

.waiting-message {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-radius: 5px;
    color: #856404;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #856404;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Chess Clock Styles */
.chess-clock {
    position: absolute;
    background-color: white;
    color: black;
    padding: 15px 20px;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    z-index: 15;
    border: 5px solid transparent;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.chess-clock.active {
    border-color: #ffff00;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.6);
}

#human-clock {
    bottom: 30px;
    right: 30px;
}

#robot-clock {
    top: 30px;
    right: 30px;
}

.chess-clock .clock-label {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 5px;
    color: #666;
}

.chess-clock .time-display {
    font-size: 32px;
    font-weight: bold;
    color: black;
}

.chess-clock.time-warning {
    background-color: #ffeeee;
    border-color: #ff4444;
}

.chess-clock.time-critical {
    background-color: #ffcccc;
    border-color: #ff0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Hide cursor and hand canvas during cinematics */
body.cinematic-playing #hand-canvas,
body.cinematic-playing .cursor-sphere {
    display: none !important;
    visibility: hidden !important;
}