:root {
    --wildtech-orange: #ff7b00;
    --wildtech-brown: #8b4513;
    --light-orange: #ffab4d;
    --dark-brown: #654321;
    --background: #1a1a1a;
    --text-light: #ffffff;
    --text-dark: #333333;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Severance Mode Theme */
body.severance-theme {
    --wildtech-orange: #00d4aa;
    --wildtech-brown: #1f2937;
    --light-orange: #10b981;
    --dark-brown: #0f172a;
    --background: #0d1117;
    --text-light: #00ff41;
    --text-dark: #1f2937;
    --success: #38bdf8;
    --warning: #2563eb;
    --danger: #1d4ed8;
    --shadow: rgba(0, 212, 170, 0.2);
}

/* Matrix Mode Theme */
body.matrix-theme {
    --wildtech-orange: #39ff14;
    --wildtech-brown: #001a00;
    --light-orange: #00cc33;
    --dark-brown: #000800;
    --background: #000000;
    --text-light: #00ff41;
    --text-dark: #001100;
    --success: #00ff41;
    --warning: #39ff14;
    --danger: #00cc33;
    --shadow: rgba(0, 255, 65, 0.3);
}

/* Severance Theme specific styles */
body.severance-theme {
    background: linear-gradient(135deg, #0d1117 0%, #1f2937 100%);
}

body.severance-theme #gameCanvas {
    background: #111827;
    border-color: #00d4aa;
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.3);
}

body.severance-theme .game-info {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

body.severance-theme button {
    background: var(--wildtech-brown);
    border: 1px solid var(--wildtech-orange);
    text-shadow: 0 0 8px currentColor;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}

body.severance-theme button:hover {
    box-shadow: 0 0 15px var(--wildtech-orange);
    transform: translateY(-2px);
}

body.severance-theme .lang-btn,
body.severance-theme .advanced-controls-btn,
body.severance-theme .theme-btn {
    border: 1px solid var(--wildtech-orange);
}

body.severance-theme footer {
    background: rgba(15, 23, 42, 0.8);
    border-top-color: var(--wildtech-orange);
}

body.severance-theme .modal-content {
    background: var(--background);
    border-color: var(--wildtech-orange);
    box-shadow: 0 0 30px rgba(0, 212, 170, 0.4);
}

body.severance-theme .start-screen,
body.severance-theme .game-over-screen {
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(0, 212, 170, 0.3);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.2);
}

body.severance-theme .legend {
    background: rgba(17, 24, 39, 0.6);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

body.severance-theme .legend-item {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(0, 212, 170, 0.1);
}

body.severance-theme .player-input {
    background: rgba(17, 24, 39, 0.5);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 212, 170, 0.2);
}

body.severance-theme .records {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

body.severance-theme .record-item {
    background: rgba(31, 41, 55, 0.4);
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
}

/* Matrix Theme specific styles */
body.matrix-theme {
    background: linear-gradient(135deg, #000000 0%, #001100 100%);
}

body.matrix-theme #gameCanvas {
    background: #000800;
    border-color: #39ff14;
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.4);
}

body.matrix-theme .game-info {
    background: rgba(0, 26, 0, 0.7);
    border: 1px solid rgba(0, 255, 65, 0.4);
}

body.matrix-theme button {
    background: var(--wildtech-brown);
    border: 1px solid var(--wildtech-orange);
    text-shadow: 0 0 10px currentColor;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}

body.matrix-theme button:hover {
    box-shadow: 0 0 20px var(--wildtech-orange);
    transform: translateY(-2px);
}

body.matrix-theme .lang-btn,
body.matrix-theme .advanced-controls-btn,
body.matrix-theme .theme-btn {
    border: 1px solid var(--wildtech-orange);
}

body.matrix-theme footer {
    background: rgba(0, 8, 0, 0.9);
    border-top-color: var(--wildtech-orange);
}

body.matrix-theme .modal-content {
    background: var(--background);
    border-color: var(--wildtech-orange);
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.5);
}

body.matrix-theme .start-screen,
body.matrix-theme .game-over-screen {
    background: rgba(0, 26, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.4);
    box-shadow: 0 4px 25px rgba(0, 255, 65, 0.3);
}

body.matrix-theme .legend {
    background: rgba(0, 17, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

body.matrix-theme .legend-item {
    background: rgba(0, 26, 0, 0.6);
    border: 1px solid rgba(0, 255, 65, 0.2);
}

body.matrix-theme .player-input {
    background: rgba(0, 17, 0, 0.6);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 65, 0.3);
}

body.matrix-theme .records {
    background: rgba(0, 17, 0, 0.7);
    border: 1px solid rgba(0, 255, 65, 0.3);
}

body.matrix-theme .record-item {
    background: rgba(0, 26, 0, 0.5);
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, var(--dark-brown) 100%);
    color: var(--text-light);
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
}

.game-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    flex-wrap: wrap;
    order: 2;
}

.game-info > div {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 3px;
}

#gameCanvas {
    border: 3px solid var(--wildtech-orange);
    border-radius: 10px;
    background: #222;
    box-shadow: 0 4px 15px var(--shadow);
    max-width: 100%;
    height: auto;
    order: 1;
    flex: 1;
    margin-bottom: 10px;
    max-height: 70vh;
    min-height: 300px;
}

.game-controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    order: 3;
}

.start-screen, .game-over-screen {
    text-align: center;
    padding: 30px;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow-y: auto;
    max-height: 100%;
}

.start-screen h2, .game-over-screen h2 {
    color: var(--wildtech-orange);
    font-size: 2rem;
    margin-bottom: 20px;
}

.legend {
    margin: 30px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.legend h3 {
    color: var(--wildtech-orange);
    margin-bottom: 15px;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.legend-color {
    width: 30px;
    height: 20px;
    margin-right: 15px;
    border-radius: 3px;
    border: 1px solid #fff;
}

.legend-color.light {
    background: var(--success);
}

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

.legend-color.meeting {
    background: var(--danger);
}

.legend-color.allhands {
    background: linear-gradient(45deg, var(--wildtech-brown), var(--wildtech-orange));
}

.player-input {
    margin: 30px 0;
}

.player-input label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.player-input input {
    padding: 12px;
    font-size: 1.2rem;
    border: 2px solid var(--wildtech-orange);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    text-align: center;
    text-transform: uppercase;
    margin-right: 10px;
    width: 100px;
}

.records {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.records h3 {
    color: var(--wildtech-orange);
    margin-bottom: 15px;
}

#recordsList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

button {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--wildtech-orange);
    color: white;
}

button:hover {
    background: var(--light-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.hidden {
    display: none !important;
}

footer {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--wildtech-orange);
    color: #ccc;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links {
    text-align: left;
}

.footer-links a {
    color: var(--wildtech-orange);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--light-orange);
}

.footer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.advanced-controls-btn,
.theme-btn {
    padding: 6px 12px;
    background: var(--wildtech-brown);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.advanced-controls-btn:hover,
.theme-btn:hover {
    background: var(--dark-brown);
    transform: translateY(-2px);
}

.theme-btn.active {
    background: var(--wildtech-orange);
    color: var(--background);
}

.theme-selector {
    display: flex;
    gap: 6px;
}

.language-selector {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 12px;
    background: var(--wildtech-orange);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--light-orange);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        height: 100vh;
        max-height: 100vh;
    }
    
    body {
        overflow: hidden;
    }
    
    .game-screen {
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-controls {
        justify-content: center;
    }
    
    .game-info {
        flex-direction: row;
        justify-content: space-around;
        text-align: center;
        margin-top: 10px;
        margin-bottom: 8px;
        padding: 8px;
    }
    
    .game-info > div {
        font-size: 0.9rem;
        margin: 2px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: calc(100vh - 200px);
        min-height: 250px;
    }
    
    .legend {
        max-width: 100%;
    }
    
    .player-input input {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: center;
        margin-top: 8px;
        gap: 10px;
    }
    
    footer {
        margin-top: 15px;
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .game-screen {
        height: calc(100vh - 110px);
        max-height: calc(100vh - 110px);
    }
    
    .game-info > div {
        font-size: 0.8rem;
    }
    
    .start-screen, .game-over-screen {
        padding: 15px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .game-controls button {
        width: auto;
        min-width: 100px;
    }
    
    #gameCanvas {
        max-height: calc(100vh - 180px);
        min-height: 200px;
    }
    
    .lang-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .advanced-controls-btn,
    .theme-btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .theme-selector {
        gap: 4px;
    }
}

.day-label {
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Modal Styles */
.modal {
    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: var(--background);
    border: 2px solid var(--wildtech-orange);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    color: var(--text-light);
    box-shadow: 0 4px 20px var(--shadow);
}

.modal-content h3 {
    color: var(--wildtech-orange);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
}

.controls-list {
    margin-bottom: 20px;
}

.controls-list p {
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 123, 0, 0.3);
}

.controls-list strong {
    color: var(--wildtech-orange);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
}

.advanced-controls-btn {
    margin: 20px auto;
    display: block;
}