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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow: hidden;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(79, 172, 254, 0.5);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Screen */
#login-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 400px;
}

.login-form h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Tabs */
#login-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* Retro Terminal Style Buttons for Game Controls */
#end-turn-btn {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #002211;
    border: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 6px 14px;
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.2);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#end-turn-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
    filter: brightness(1.1);
}

/* Scanning line effect on hover */
#end-turn-btn:hover:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.15), 
        transparent);
    animation: scan-line 2s infinite;
}

@keyframes scan-line {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Ready pulse — add .ready class via JS when player can end day */
#end-turn-btn.ready {
    animation: endDayPulse 2s ease-in-out infinite;
}

@keyframes endDayPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 136, 0.2); }
    50% { box-shadow: 0 0 14px rgba(0, 255, 136, 0.5); }
}

/* Click effect */
#end-turn-btn:active:not(:disabled),
#leave-game-btn:active {
    transform: scale(0.98);
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.6);
}

#end-turn-btn:disabled,
#end-turn-btn.disabled {
    background: #1a1a1a;
    color: #666666;
    border: 1px solid #444444;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
}

#end-turn-btn:disabled:hover,
#end-turn-btn.disabled:hover {
    background: #1a1a1a;
    color: #666666;
    border-color: #444444;
    box-shadow: none;
    transform: none;
    filter: none;
}

#leave-game-btn {
    background: #000000;
    color: #FF6B6B;
    border: 2px solid #FF6B6B;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 12px 24px;
    border-radius: 0;
    box-shadow: 
        0 0 10px rgba(255, 107, 107, 0.3),
        inset 0 0 10px rgba(255, 107, 107, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

#leave-game-btn:hover {
    background: #330000;
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 215, 0, 0.1);
    transform: none; /* Remove the translateY transform */
}

/* Add a subtle scanning line effect on hover for leave button */
#leave-game-btn:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.2), 
        transparent);
    animation: scan-line 2s infinite;
}

/* Game Admin Button Terminal Style */
#game-admin-btn {
    background: #000000;
    color: #9A44FF;
    border: 2px solid #9A44FF;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 12px 24px;
    border-radius: 0;
    box-shadow: 
        0 0 10px rgba(154, 68, 255, 0.3),
        inset 0 0 10px rgba(154, 68, 255, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0 10px;
}

#game-admin-btn:hover {
    background: #220033;
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 215, 0, 0.1);
}

/* Add a subtle scanning line effect on hover for admin button */
#game-admin-btn:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.2), 
        transparent);
    animation: scan-line 2s infinite;
}

/* Terminal button click effect for admin button */
#game-admin-btn:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 5px rgba(255, 215, 0, 0.8),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Game Admin Button Class (generic class styling) */
.btn-admin {
    background: #000000;
    color: #9A44FF;
    border: 2px solid #9A44FF;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 12px 24px;
    border-radius: 0;
    box-shadow: 
        0 0 10px rgba(154, 68, 255, 0.3),
        inset 0 0 10px rgba(154, 68, 255, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0 10px;
}

.btn-admin:hover {
    background: #220033;
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(255, 215, 0, 0.1);
}

.btn-admin:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.2), 
        transparent);
    animation: scan-line 2s infinite;
}

.btn-admin:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 5px rgba(255, 215, 0, 0.8),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Top Off Resources Button */
#topoff-resources-btn {
    background: #000000;
    color: #FFD700;
    border: 2px solid #FFD700;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 0;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3), inset 0 0 10px rgba(255, 215, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 0 4px;
}

#topoff-resources-btn:hover {
    background: #332200;
    color: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), inset 0 0 15px rgba(255, 215, 0, 0.1);
}

#topoff-resources-btn:active {
    transform: scale(0.98);
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(180deg, #002200 0%, #001100 100%);
    color: #00ff88;
    border: 1px solid #00aa66;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.8rem;
    padding: 8px 18px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #003300 0%, #001a00 100%);
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.4);
}

.btn-primary:disabled,
.btn-primary.disabled {
    background: #111;
    color: #555;
    border-color: #333;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-primary:disabled:hover,
.btn-primary.disabled:hover {
    transform: none;
    box-shadow: none;
    background: #111;
}

.btn-secondary {
    background: transparent;
    color: #4CAF50;
    border: 1px solid #2a6b2a;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.8rem;
    padding: 8px 18px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.06);
    border-color: #4CAF50;
    color: #00ff88;
    transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

/* Tertiary — minimal emphasis for low-priority actions */
.btn-tertiary {
    background: transparent;
    color: #6fbf73;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-tertiary:hover {
    color: #00ff88;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Error Messages */
.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* Main Menu Screen */
#menu-screen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    flex-direction: column;
}

.menu-container {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

.menu-header h1 {
    font-size: 3rem;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.menu-btn {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Styles - Retro Terminal Theme */
.modal {
    position: fixed;
    z-index: 10500; /* Must be above map canvas (1000), header (1500), map overlay (1600), tooltips (10000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #000000;
    border: 3px solid #00FF88;
    padding: 0;
    max-width: none;
    width: 80vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0 20px #00FF88;
    font-family: 'Courier New', monospace;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #00FF88;
    color: #000000;
    border-bottom: 2px solid #00FF88;
}

.modal-header h2 {
    margin: 0;
    color: #000000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 16px;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #000000;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.close:hover {
    background: #000000;
    color: #00FF88;
    padding: 2px 6px;
}

.modal form {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* Retro Modal Form Styles */
.modal .form-group {
    margin-bottom: 1rem;
}

.modal .form-group label {
    display: block;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 12px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #00FF88;
    background: #000000;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    transition: all 0.2s ease;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #FFD700;
    color: #FFD700;
    box-shadow: 0 0 10px #FFD700;
}

.modal .form-group input::placeholder {
    color: #006644;
    opacity: 1;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Retro Modal Buttons */
.modal .btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #00FF88;
    background: #000000;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    text-transform: uppercase;
    font-size: 12px;
}

.modal .btn:hover {
    background: #00FF88;
    color: #000000;
    box-shadow: 0 0 10px #00FF88;
}

.modal .btn-primary {
    border-color: #FFD700;
    color: #FFD700;
}

.modal .btn-primary:hover {
    background: #FFD700;
    color: #000000;
    box-shadow: 0 0 10px #FFD700;
}

.modal .btn-secondary {
    border-color: #FF6B6B;
    color: #FF6B6B;
}

.modal .btn-secondary:hover {
    background: #FF6B6B;
    color: #000000;
    box-shadow: 0 0 10px #FF6B6B;
}

/* Build modal form rows (island/carrier/unit) */
.modal .modal-body {
    padding: 1rem 1.5rem 0 1.5rem;
}

.modal .form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.modal .form-row label {
    min-width: 80px;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    font-size: 12px;
}

.modal .form-row select {
    flex: 1;
    padding: 0.5rem 2rem 0.5rem 0.6rem;
    border: 2px solid #00FF88;
    background: #000000;
    color: #00FF88;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #00FF88 50%),
                      linear-gradient(135deg, #00FF88 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(0.8em), calc(100% - 11px) calc(0.8em);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.modal .form-row select:focus {
    outline: none;
    border-color: #FFD700;
    color: #FFD700;
    box-shadow: 0 0 10px #FFD700;
}

.modal .build-cost-breakdown {
    color: #CCFFDD;
    font-size: 12px;
    padding: 0 1.5rem 1rem 1.5rem;
}

/* Readonly island row look */
.modal #build-modal-island-row.readonly select {
    opacity: 0.85;
    cursor: not-allowed;
    border-style: dashed;
}

/* ========================== */
/* Game Alert Modal (themed)  */
/* ========================== */
.game-alert-overlay {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.game-alert-overlay.active {
    opacity: 1;
}

.game-alert-box {
    background: #0a0a0a;
    border: 3px solid #FFD700;
    min-width: 340px;
    max-width: 520px;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 30px #FFD700, inset 0 0 15px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.game-alert-overlay.active .game-alert-box {
    transform: scale(1);
}

.game-alert-header {
    padding: 10px 16px;
    background: #FFD700;
    border-bottom: 2px solid currentColor;
}

.game-alert-title {
    color: #000000;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.game-alert-body {
    padding: 20px 20px 12px;
}

.game-alert-message {
    color: #CCFFDD;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.game-alert-footer {
    padding: 8px 20px 16px;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.game-alert-btn {
    padding: 8px 32px;
    --btn-color: #FFD700;
    border: 2px solid var(--btn-color);
    background: #000000;
    color: var(--btn-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.game-alert-btn:hover,
.game-alert-btn:focus {
    background: var(--btn-color);
    color: #000000;
    box-shadow: 0 0 10px var(--btn-color);
    outline: none;
}

/* Game List - Retro Terminal Style */
.game-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: #000000;
}

/* Retro Scrollbar for Game List */
.game-list::-webkit-scrollbar {
    width: 8px;
}

.game-list::-webkit-scrollbar-track {
    background: #000000;
    border: 1px solid #00FF88;
}

.game-list::-webkit-scrollbar-thumb {
    background: #00FF88;
    border: 1px solid #000000;
}

.game-list::-webkit-scrollbar-thumb:hover {
    background: #FFD700;
}

.game-item {
    background: #001100;
    border: 2px solid #00FF88;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    color: #00FF88;
}

.game-item:hover {
    background: #003300;
    border-color: #FFD700;
    color: #FFD700;
    box-shadow: 0 0 10px #00FF88;
}

.game-item h3 {
    margin-bottom: 0.5rem;
    color: inherit;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
}

.game-item p {
    color: inherit;
    margin-bottom: 0.3rem;
    font-size: 12px;
    opacity: 0.9;
}

/* My Games styling */
.game-item.my-game {
    border-left: 4px solid #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
}

.game-item.my-game .rejoin-hint {
    color: #00ff00;
    font-style: italic;
    font-size: 11px;
    margin-top: 0.5rem;
}

/* Joinable Games styling */
.game-item.joinable-game {
    border-left: 4px solid #ffaa00;
    background-color: rgba(255, 170, 0, 0.1);
}

.game-item.joinable-game .join-hint {
    color: #ffaa00;
    font-style: italic;
    font-size: 11px;
    margin-top: 0.5rem;
}

/* Toast Messages */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.error {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.toast.success {
    background: linear-gradient(45deg, #00b894, #00a085);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        min-width: 300px;
        margin: 1rem;
    }
    
    .menu-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        width: 80vw;
        max-width: none;
        max-height: 80vh;
        overflow: hidden;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Game Admin Modal - 1980s/1990s Terminal Styling */
.admin-section {
    background: #000000;
    border: 2px solid #00ff00;
    border-radius: 0;
    padding: 15px;
    margin: 10px 0;
    font-family: 'Courier New', 'Lucida Console', monospace;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
    position: relative;
}

.admin-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 98%,
        rgba(0, 255, 0, 0.03) 100%
    );
    pointer-events: none;
}

.admin-section h4 {
    color: #00ff00;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 5px;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

.admin-section h4::before {
    content: '> ';
    color: #00ff00;
    font-weight: bold;
}

/* Two-column admin grid layout */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-section.compact {
    margin: 0;
    padding: 12px;
}

.admin-section.full-height {
    flex: 1;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 1200px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-control {
    margin: 10px 0;
    display: block;
    font-family: 'Courier New', monospace;
}

.admin-control.inline {
    display: block;
}

.admin-control label {
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.admin-control .input-group {
    display: block;
    margin-top: 5px;
}

.control-desc {
    color: #00aa00;
    font-size: 10px;
    font-style: normal;
    margin-top: 3px;
    display: block;
    font-family: 'Courier New', monospace;
}

.control-desc::before {
    content: '  // ';
    color: #008800;
}

.retro-input, .retro-select {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
    text-shadow: 0 0 3px #00ff00;
}

.retro-input:focus, .retro-select:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    background: #001100;
}

.retro-checkbox {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    width: 15px;
    height: 15px;
    border-radius: 0;
    margin-right: 8px;
    appearance: none;
    position: relative;
    vertical-align: middle;
}

.retro-checkbox:checked::before {
    content: 'X';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.invite-link-container {
    display: block;
    margin-top: 8px;
}

.invite-link {
    width: 100%;
    font-size: 10px;
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
    font-family: 'Courier New', monospace;
    padding: 8px 10px;
    border-radius: 0;
    margin-bottom: 8px;
    box-sizing: border-box;
    text-shadow: 0 0 3px #00ff00;
}

.invite-link-container .btn {
    display: inline-block;
    margin-right: 10px;
    font-size: 11px;
    padding: 6px 12px;
    font-family: 'Courier New', monospace;
    border-radius: 0;
    text-transform: uppercase;
}

.player-admin-list {
    background: #000000;
    border: 2px solid #00ff00;
    border-radius: 0;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.admin-player-item {
    display: block;
    padding: 8px 0;
    margin: 5px 0;
    border-bottom: 1px solid #004400;
    color: #00ff00;
}

.admin-player-item:hover {
    background: #001100;
    border-bottom-color: #00ff00;
}

.admin-player-info {
    display: block;
    margin-bottom: 5px;
}

.player-name {
    font-weight: bold;
    color: #00ff00;
    font-size: 13px;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
    display: block;
    margin-bottom: 2px;
}

.player-name::before {
    content: '[';
    color: #00aa00;
}

.player-name::after {
    content: ']';
    color: #00aa00;
}

.player-affiliation {
    font-size: 11px;
    color: #00aa00;
    display: block;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.player-affiliation .alliance-badge {
    background: none;
    color: #00aa00;
    padding: 0;
    border: none;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 5px;
}

.player-affiliation .alliance-badge::before {
    content: '(';
    color: #006600;
}

.player-affiliation .alliance-badge::after {
    content: ')';
    color: #006600;
}

.player-affiliation .nation-info {
    color: #00aa00;
    font-weight: bold;
}

.admin-no-players {
    text-align: center;
    padding: 20px;
    color: #00aa00;
    font-style: normal;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.admin-no-players::before {
    content: '> ';
    color: #00ff00;
}

.admin-player-actions {
    display: block;
    margin-top: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 0;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin-right: 5px;
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
}

.btn-small:hover {
    background: #001100;
    color: #00ff00;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Player count statistics - Terminal style */
.player-count-stats {
    background: #000000;
    border: 1px solid #00ff00;
    border-radius: 0;
    padding: 10px;
    margin: 10px 0;
    display: block;
    font-family: 'Courier New', monospace;
}

.player-count-stats .stat-item {
    display: inline-block;
    margin-right: 20px;
    text-align: left;
}

.player-count-stats .stat-value {
    display: inline;
    font-size: 16px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    font-family: 'Courier New', monospace;
}

.player-count-stats .stat-value::before {
    content: '[';
    color: #00aa00;
}

.player-count-stats .stat-value::after {
    content: ']';
    color: #00aa00;
}

.player-count-stats .stat-label {
    font-size: 10px;
    color: #00aa00;
    text-transform: uppercase;
    margin-left: 5px;
    font-family: 'Courier New', monospace;
}

/* Enhanced form styling - Terminal */
.form-row {
    display: block;
    margin: 8px 0;
}

.form-row .form-label {
    display: block;
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.form-row .form-input {
    display: block;
    width: 100%;
}

/* Action button improvements - Terminal */
.admin-action-bar {
    display: block;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #00ff00;
    text-align: center;
}

.admin-action-bar .btn {
    border-radius: 0;
    font-weight: bold;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    margin: 0 5px;
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-size: 11px;
}

.admin-action-bar .btn:hover {
    background: #001100;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

/* Terminal Modal Header Styling */
.modal-content {
    background: #000000;
    border: 2px solid #00ff00;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    max-width: none;
    width: 80vw;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    background: #000000;
    border-bottom: 1px solid #00ff00;
    padding: 10px 15px;
}

.modal-header h3 {
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00ff00;
    margin: 0;
    letter-spacing: 1px;
}

.modal-header h3::before {
    content: '=== ';
    color: #00aa00;
}

.modal-header h3::after {
    content: ' ===';
    color: #00aa00;
}

.close-btn {
    background: #000000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 0;
}

.close-btn:hover {
    background: #001100;
    color: #00ff00;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.modal-body {
    background: #000000;
    padding: 15px;
    font-family: 'Courier New', monospace;
}
