:root {
    --gold: #c5a059;
    --gold-glow: rgba(197, 160, 89, 0.2);
    --ivory: #f8fafc;
    --slate-900: #0f172a;
    --glass: rgba(15, 23, 42, 0.5);
    --glass-border: rgba(197, 160, 89, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #020617;
    color: var(--ivory);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    /* System fonts for "No CDN" compliance */
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

#game-canvas-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

/* UI Wrapper */
#ui-wrapper {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px;
}

/* Luxury Header */
.luxury-header {
    pointer-events: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.header-line {
    width: 30px;
    height: 1px;
    background: var(--gold);
}

#game-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: var(--ivory);
    text-transform: uppercase;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: var(--gold);
    opacity: 0.7;
}

/* Status Region - Single Pill to avoid "doublons" */
#status-region {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

.luxury-pill {
    background: var(--glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 12px 36px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ivory);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    animation: breathe 4s infinite ease-in-out;
    white-space: nowrap;
}

/* Luxury Footer */
.luxury-footer {
    pointer-events: auto;
}

.controls-legend {
    display: flex;
    gap: 25px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
}

.controls-legend kbd {
    color: var(--gold);
    font-weight: 700;
    border: 1px solid rgba(197, 160, 89, 0.4);
    padding: 2px 10px;
    border-radius: 4px;
    margin-right: 8px;
    background: rgba(0, 0, 0, 0.3);
    min-width: 70px;
    text-align: center;
    display: inline-block;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #020617;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transition: opacity 1.2s ease, visibility 1.2s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.luxury-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--gold);
    border-radius: 50%;
    animation: rotate 1.5s linear infinite;
}

#loading-text {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
}

.loader-line-container {
    width: 250px;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

#loader-progress {
    height: 100%;
    width: 0%;
    background: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
    transition: width 0.5s ease;
}

/* Dynamic Turn Colors */
.turn-w { border-color: rgba(255, 255, 255, 0.6); }
.turn-b { border-color: var(--gold); color: var(--gold); }

/* Animations */
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.95; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
    50% { transform: scale(1.03); opacity: 1; box-shadow: 0 15px 60px var(--gold-glow); }
}

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