/* SOAR: MYSTIK SKIES — minimal HUD pass.
   Four-tribe standings strip; no mana bar; smaller, elegant spell row. */

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    cursor: crosshair;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* --- LOADING --- */
#loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 10px #00ffff, 0 0 30px #0066aa;
    pointer-events: none;
    z-index: 10;
    animation: pulse-glow 1.5s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 30px #00ffff, 0 0 60px #0088ff;
        opacity: 0.7;
    }
}

/* --- HUD LAYER --- */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

/* --- TOP BAR --- */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

/* Tribal-standings strip — four compact pips, one per team. */
#tribe-strip {
    display: flex;
    gap: 6px;
    background: rgba(8, 10, 14, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px;
}

.tribe-pip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px 4px 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease-out, transform 0.2s ease-out;
    min-width: 92px;
}

.tribe-pip[data-team="green"]  .pip-flag { background: #5fc070; box-shadow: 0 0 8px rgba(95, 192, 112, 0.55); }
.tribe-pip[data-team="blue"]   .pip-flag { background: #5fa0c0; box-shadow: 0 0 8px rgba(95, 160, 192, 0.55); }
.tribe-pip[data-team="yellow"] .pip-flag { background: #e6c044; box-shadow: 0 0 8px rgba(230, 192, 68, 0.55); }
.tribe-pip[data-team="red"]    .pip-flag { background: #c04444; box-shadow: 0 0 8px rgba(192, 68, 68, 0.55); }

.pip-flag {
    width: 6px;
    height: 26px;
    border-radius: 2px;
    flex-shrink: 0;
}

.pip-stats {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.pip-name {
    font-size: 9px;
    letter-spacing: 1.4px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.pip-numbers {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    font-feature-settings: 'tnum';
    letter-spacing: 0.3px;
}

.pip-sep {
    margin: 0 4px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

/* Player tribe — gentle highlight without crowding the strip. */
.tribe-pip.is-player {
    background: rgba(95, 192, 112, 0.10);
    box-shadow: inset 0 0 0 1px rgba(95, 192, 112, 0.35);
}

/* Wiped-out tribe — desaturate so survivors stand out. */
.tribe-pip.is-dead .pip-flag,
.tribe-pip.is-dead .pip-numbers {
    opacity: 0.35;
    box-shadow: none;
}
.tribe-pip.is-dead .pip-name {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.4);
}

/* Player HP — slim bar pinned top-right. No big stats box. */
#player-hp {
    width: 220px;
    height: 5px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

#player-hp-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #5fc070, #9ce088);
    transition: width 0.25s ease-out;
}

/* --- BOTTOM BAR --- */
#bottom-bar {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

/* --- SPELL SLOTS --- */
#spells-container {
    display: flex;
    gap: 6px;
}

.spell-slot {
    width: 46px;
    height: 46px;
    background: rgba(8, 10, 14, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease-out;
    position: relative;
    overflow: hidden;
}

.spell-slot .key {
    font-size: 9px;
    position: absolute;
    top: 2px;
    left: 4px;
    opacity: 0.55;
}

.spell-slot .name {
    font-size: 7px;
    font-weight: bold;
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 3px;
    text-transform: uppercase;
}

.spell-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: -2px;
}

.fire-icon  { background: radial-gradient(circle, #FF6A00, #FF4500, #CC2200); }
.air-icon   { background: radial-gradient(circle, #B0E0FF, #87CEEB, #5CACEE); }
.earth-icon { background: radial-gradient(circle, #B8860B, #8B4513, #5C3317); }
.life-icon  { background: radial-gradient(circle, #40E0D0, #00BFFF, #0080AA); }

/* Active spell — calm scale + colour rim, no bouncing animation. */
.spell-slot.active {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.85);
    color: #fff;
    background: rgba(40, 40, 40, 0.85);
}

#spell-0.active { border-color: #FF4500; box-shadow: 0 0 12px rgba(255, 69, 0, 0.55); }
#spell-1.active { border-color: #87CEEB; box-shadow: 0 0 12px rgba(135, 206, 235, 0.55); }
#spell-2.active { border-color: #8B4513; box-shadow: 0 0 12px rgba(139, 69, 19, 0.55); }
#spell-3.active { border-color: #00BFFF; box-shadow: 0 0 12px rgba(0, 191, 255, 0.55); }

/* --- MESSAGE AREA --- */
#message-area {
    position: absolute;
    top: 18%;
    width: 100%;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s, transform 0.4s;
    letter-spacing: 2px;
}

/* --- CONTROLS HINT --- */
#controls-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.28);
    font-size: 10px;
    padding-bottom: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
