* { box-sizing: border-box; }

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0f14;
    color: #e8e8e8;
    font-family: "Courier New", Courier, monospace;
}

/* Fixed 960x600 logical size; game.js scales it to fill the viewport
   while preserving the aspect ratio. */
#stage {
    position: relative;
    width: 960px;
    height: 600px;
    flex-shrink: 0;
    transform-origin: center center;
    box-shadow: 0 0 40px #000;
}

#canvas {
    display: block;
    background: #0d0f14;
}

/* ---------- overlays ---------- */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(8, 10, 16, 0.82);
    text-align: center;
}

.hidden { display: none !important; }

h1 {
    font-size: 56px;
    letter-spacing: 8px;
    margin: 0;
    color: #ffb347;
    text-shadow: 0 0 18px rgba(255, 120, 40, 0.55), 3px 3px 0 #401800;
}

h2 {
    font-size: 30px;
    letter-spacing: 4px;
    margin: 0 0 6px;
    color: #ffb347;
}

.tagline { color: #9aa4b0; margin: 0; }
.hint { color: #6d7681; font-size: 13px; margin-top: 18px; }

button {
    font-family: inherit;
    font-size: 15px;
    color: #e8e8e8;
    background: #232a36;
    border: 1px solid #46536a;
    border-radius: 4px;
    padding: 7px 16px;
    cursor: pointer;
}
button:hover { background: #2f3a4d; }
button.big {
    font-size: 20px;
    padding: 10px 34px;
    background: #7a3a12;
    border-color: #b06a2c;
}
button.big:hover { background: #96491a; }

select {
    font-family: inherit;
    font-size: 14px;
    color: #e8e8e8;
    background: #232a36;
    border: 1px solid #46536a;
    border-radius: 4px;
    padding: 4px 6px;
}

.row { display: flex; gap: 12px; align-items: center; }
.presets { display: flex; gap: 10px; }

/* ---------- setup slots ---------- */

#slots { display: flex; flex-direction: column; gap: 8px; }

.slot {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(35, 42, 54, 0.6);
    border: 1px solid #38414f;
    border-radius: 6px;
    padding: 6px 12px;
}
.slot .slotnum { width: 20px; color: #9aa4b0; }
.slot.off select:not(.selControl), .slot.off .flagchip { opacity: 0.25; }

.flagchip {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 15px;
    border: 1px solid #111;
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
}
.flagchip i { display: block; height: 5px; }
.flagchip b {
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 55%;
}

/* ---------- HUD ---------- */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(8, 10, 16, 0.72);
    border-bottom: 1px solid #2a3240;
    font-size: 13px;
}

.hud-group { display: flex; align-items: center; gap: 5px; }
.hudval b { color: #ffb347; }
.hudbtn { padding: 3px 8px; font-size: 12px; }

#btnFire {
    background: #8c1d1d;
    border-color: #d04a4a;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 6px 18px;
}
#btnFire:hover { background: #ab2626; }
#btnFire:disabled { opacity: 0.4; cursor: default; }

#hudName { font-weight: bold; }
#hudHp { color: #5fd35f; }

/* ---------- banner ---------- */

#banner {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 24px;
    letter-spacing: 2px;
    color: #ffe9a8;
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    transition: opacity 0.4s;
}

/* ---------- score tables ---------- */

table {
    border-collapse: collapse;
    font-size: 16px;
    min-width: 420px;
}
td, th {
    padding: 6px 16px;
    border-bottom: 1px solid #38414f;
    text-align: left;
}
th { color: #9aa4b0; font-weight: normal; }
td.score { text-align: right; color: #ffb347; font-weight: bold; }
tr.dead td { color: #6d7681; }
