/* Global Dark Theme for Comte Harebourg Simulator site (excluding simulator UI specifics) */
/* Typography: Inter variable font (loaded via index.html) */

:root {
    --bg: #0b0e14; /* page background */
    --surface: #0f1320; /* raised surface */
    --surface-2: #121722; /* panels/cards */
    --border: #1d2430; /* soft borders */
    --text: #e6e9ef; /* primary text */
    --muted: #9aa4b2; /* secondary text */
    --brand: #72a4f2; /* primary accent */
    --brand-2: #7be3ff; /* secondary accent */
    --success: #2bd576;
    --danger: #ff6b6b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* Base */
* {
    box-sizing: border-box;
}

html, body, #app {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

/* Links */
a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Headings */
h1, h2, h3 {
    line-height: 1.2;
    margin: 0 0 .6rem;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 1.25rem;
}

h3 {
    font-size: 1.125rem;
    margin-top: 1rem;
}

/* Layout helpers */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
}

.section {
    padding: 24px 0;
}

.card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--brand);
    color: #001a33;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
}

.btn:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border-color: #2a2f3a;
}

.btn.ghost {
    background: transparent;
    color: var(--brand);
    border-color: transparent;
}

/* Utilities */
.text-muted {
    color: var(--muted);
}

.prose p {
    margin: .5rem 0 1rem;
}

.prose ul {
    margin: .25rem 0 1rem 1.25rem;
}

.prose li {
    margin: .25rem 0;
}

/* Header (used in Landing) */
.site-header {
    background: transparent;
}

.site-header .brand {
    font-weight: 800;
    letter-spacing: .2px;
}

.site-header nav {
    display: flex;
    gap: 14px;
    margin-left: auto;
    align-items: center;
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 24px;
    align-items: center;
}

.hero h1 {
    font-size: 40px;
}

.hero p {
    color: var(--muted);
    margin: 0 0 18px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
}

/* Footer adjustments live in App.vue but use these variables */

/* Simulator-specific safeguards (do not alter core simulator component) */
#map-selection select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: auto;
    height: 32px;
    line-height: 1.2;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #666;
    background: #1f1f1f;
    color: #fff;
}

#edit-mode input[type="number"],
#edit-mode input[type="button"],
#edit-mode textarea,
#edit-mode input[type="checkbox"] {
    font: 14px/1.3 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

#edit-mode textarea {
    background: #1f1f1f;
    color: #fff;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 8px;
}

/* Fix for simulator wall overlay images distorted by global img max-width */
#map .cell > .wall {
    max-width: none !important;
}

/* Ensure simulator map selection container wraps its content (select is 32px tall) */
#map-selection {
    height: auto !important;
    min-height: 36px;
    align-items: center;
}

body.route-simulator #kofi {
    position: absolute;
    left: 164px;
    top: 20px;
    z-index: 19;
}

body:not(.route-simulator) #kofi {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
}