/* StrategyArcade Styles
   Ported from Vigrid's css/style.css, keeping the identical visual identity:
   pure black background, a single user-selectable foreground color driving
   text/borders/button gradients via the --fg-* variables, uppercase bold
   Segoe UI, and the white-glow hover treatment. Game-specific sections
   (hex canvas, unit/terrain panels) are intentionally left behind. */

/* Foreground color variables; rewritten at runtime by SiteUI.applyForegroundColor
   when the user picks a UI color (defaults match Vigrid's "white" scheme) */
:root {
    --fg-primary: #000000;
    --fg-secondary: #ffffff;
    --fg-accent: #f0f0f0;
    --fg-text: #ffffff;
    --fg-border: #ffffff;
    --fg-shadow: rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Site-wide typography and background (identical to Vigrid's body rules) */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #000000;
    color: var(--fg-text);
    overflow: hidden;
    text-transform: uppercase;
    font-weight: bold;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Full-viewport shell (Vigrid's #game-container) */
#site-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar with menu button, user display, and centered site title
   (Vigrid's #game-header) */
#site-header {
    background: #000000;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--fg-border);
    box-shadow: 0 2px 10px var(--fg-shadow);
    position: relative;
    z-index: 3001;
}

/* Menu button + dropdown anchor (Vigrid's #game-menu) */
#site-menu {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1001;
}

#menu-btn {
    background: linear-gradient(135deg, var(--fg-secondary), var(--fg-border));
    color: var(--fg-primary);
    border: 2px solid var(--fg-border);
    padding: 10px 12px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#menu-btn:hover {
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 1.0), 0 0 25px rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.1) !important;
    background: linear-gradient(135deg, #ffffff, #e0e0e0) !important;
    color: #000000 !important;
    font-weight: bold;
}

/* Dropdown revealed by adding the .show class (toggled in main.js) */
#menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #000000;
    border: 2px solid var(--fg-border);
    border-radius: 4px;
    padding: 15px;
    min-width: 200px;
    z-index: 1002;
    display: none;
    box-shadow: 0 4px 12px var(--fg-shadow);
}

#menu-dropdown.show {
    display: block;
}

.menu-section {
    margin-bottom: 15px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section h4 {
    color: var(--fg-accent);
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-section select {
    width: 100%;
    background: #000000;
    color: var(--fg-text);
    border: 1px solid var(--fg-border);
    padding: 6px 8px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    border-radius: 3px;
}

.menu-section select:focus {
    outline: none;
    border-color: var(--fg-secondary);
    box-shadow: 0 0 5px var(--fg-secondary);
}

/* Centered site title in the header (Vigrid's #game-header h1) */
#site-header h1 {
    font-size: 24px;
    color: var(--fg-accent);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px var(--fg-shadow);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Full-screen dark overlay hosting menu screens (Vigrid's #game-menu-overlay) */
#menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

/* Centered menu panel; .active makes a screen visible (Vigrid's .menu-screen) */
.menu-screen {
    background: #000000;
    border: 2px solid var(--fg-border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px var(--fg-shadow);
    min-width: 500px;
    display: none;
}

.menu-screen.active {
    display: block;
}

.menu-screen h2 {
    color: var(--fg-text);
    font-size: 28px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px var(--fg-shadow);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

/* Universal button class (Vigrid's .vigrid-btn, renamed for this site).
   Foreground-color gradient with dark text, snapping to a white glow on hover. */
.sa-btn {
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--fg-secondary), var(--fg-border));
    color: var(--fg-primary);
    border: 2px solid var(--fg-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 120px;
}

.sa-btn:hover {
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 1.0), 0 0 25px rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.1) !important;
    background: linear-gradient(135deg, #ffffff, #e0e0e0) !important;
    color: #000000 !important;
    font-weight: bold;
}

.sa-btn.highlighted {
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 1.0), 0 0 25px rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.1) !important;
    background: linear-gradient(135deg, #ffffff, #e0e0e0) !important;
    color: #000000 !important;
    font-weight: bold;
}

/* Responsive tweaks for the menu panel (subset of Vigrid's media queries) */
@media (max-width: 768px) {
    .menu-screen {
        min-width: 90%;
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .menu-screen {
        min-width: 95%;
        padding: 15px;
    }
}

/* Shared animations (Vigrid's victory/defeat keyframes, reused for messages) */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
