/* Base reset, page frame and loading screen. Load order is significant: keep this file's <link> position in index.html. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Baloo 2", "Trebuchet MS", sans-serif;
    background: linear-gradient(135deg, #1c1504 0%, #3d2b00 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#gameContainer {
    background: #2b1b3c;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* The renderer sizes the canvas to the container; it must not add inline layout space. */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#gameCanvas.panning {
    cursor: grabbing;
}

/* Placement mode: the pointer is choosing a cell, not grabbing the board. */
#gameCanvas.placing,
#gameCanvas.placing.panning {
    cursor: crosshair;
}

.hidden {
    display: none !important;
}

/* --- Loading screen (ids match AssetLoader.updateProgress) --- */

#loadingScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    z-index: 100;
}

#gameDescription {
    margin: 2vw;
    text-align: center;
    font-size: 0.8em;
    max-width: 32em;
}

#gameSubTitle {
    margin-top: 0.5em;
    color: #ddd;
    font-size: 0.9em;
}

#loadingProgress {
    margin-top: 20px;
    width: 300px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
}

#loadingBar {
    height: 100%;
    background: #F9B200;
    width: 0%;
    transition: width 0.3s ease;
}

#loadingText {
    margin-top: 10px;
    font-size: 14px;
    color: #aaa;
}

#startButton {
    margin-top: 30px;
    padding: 15px 40px;
    color: #FFC949;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #6F33AE;
    box-shadow: -4px 0 0 0 #0E1540, 4px 0 0 0 #0E1540, 0 4px 0 0 #0E1540, 0 -4px 0 0 #0E1540;
    border-right: 4px solid #341752;
    border-bottom: 4px solid #341752;
    border-top: none;
    border-left: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

#startButton.ready {
    opacity: 1;
    pointer-events: auto;
}

#startButton:hover {
    transform: translateY(-2px);
}

#startButton:active {
    transform: translateY(0);
}

.gameLSIcon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.poweredVizipedia {
    color: #9074AC;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

#poweredVizipediaLS {
    margin-top: 4em;
}

/*
 * An SVG mark has no intrinsic size; without an explicit one the browser
 * renders it far larger than the bitmap it replaced.
 */
.poweredVizipedia img {
    display: block;
    width: 34px;
    height: 34px;
}

/* --- Error screen --- */

#errorScreen {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    color: #ff8f8f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2em;
    font-size: 18px;
    z-index: 200;
}

#errorScreen code {
    display: block;
    margin-top: 1em;
    color: #aaa;
    font-size: 14px;
}

/* The HUD lives in css/hud.css — it is a DOM overlay, not drawn into the canvas. */
