/* riftshift.css — Riftshift HUD, touch controls, arsenal menu and captions. Dark glass identity (fg-* tokens). */

.rs-hud, .rs-controls, .rs-world-labels, .rs-render-error {
    font: 600 12px/1.3 var(--font-mono, monospace);
    letter-spacing: 0;
    box-sizing: border-box;
    color: #fff;
    position: absolute;
    z-index: 12;
}
.rs-hud *, .rs-controls *, .rs-world-labels * { box-sizing: border-box; letter-spacing: 0; }

/* turn / battle clocks — chip row just under the topbar */
.rs-hud {
    top: calc(48px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}
.rs-hud > span {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font: 600 11px var(--font-mono, monospace);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.rs-turn-clock { border-color: rgba(124, 77, 255, 0.6); }
.rs-urgent { color: #ff1744; border-color: rgba(255, 23, 68, 0.5); }

/* name + hp tags over the fighters */
.rs-world-labels { left: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 10; }
.rs-world-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    max-width: 110px;
    white-space: nowrap;
}
.rs-world-name {
    margin-bottom: 2px;
    padding: 1px 7px;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font: 700 10px/16px var(--font-mono, monospace);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.rs-world-hp {
    min-width: 30px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(0, 230, 118, 0.18);
    color: #00e676;
    font: 700 11px/16px var(--font-mono, monospace);
    text-align: center;
}
.rs-world-label[data-team="1"] .rs-world-hp { background: rgba(255, 23, 68, 0.2); color: #ff5c7a; }
.rs-label-active .rs-world-hp { outline: 1px solid #9579ff; box-shadow: 0 0 10px rgba(124, 77, 255, 0.5); }
.rs-world-labels [hidden] { display: none !important; }

.rs-render-error {
    top: calc(90px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.92);
    border: 1px solid rgba(255, 23, 68, 0.5);
    color: #ff1744;
    text-align: center;
    pointer-events: none;
}
.rs-render-error[hidden] { display: none; }

/* ---- touch controls ---- */
.rs-controls {
    inset: 0;
    background: none;
    border: 0;
    pointer-events: none;
    --rs-edge: 12px;
    --rs-bottom: max(var(--rs-edge), env(safe-area-inset-bottom));
    --rs-right: max(var(--rs-edge), env(safe-area-inset-right));
    --rs-left: max(var(--rs-edge), env(safe-area-inset-left));
}
/* the pad (.sgp) sizes and styles its own buttons */
.rs-zoom button, .rs-weapon-menu button {
    position: relative;
    min-width: 44px;
    padding: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font: 700 17px var(--font-mono, monospace);
    cursor: pointer;
    touch-action: none;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
.rs-controls button:focus-visible { outline: 2px solid #9579ff; outline-offset: 2px; }
.rs-controls button:disabled { opacity: 0.4; cursor: default; }
.rs-controls button:active:not(:disabled):not(.rs-fire),
.rs-controls button[aria-pressed=true],
.rs-controls button[aria-expanded=true] {
    background: rgba(124, 77, 255, 0.5);
    border-color: #9579ff;
    box-shadow: 0 0 16px rgba(124, 77, 255, 0.5);
}
.rs-controls [hidden] { display: none !important; }

/* fuel gauge in the left cluster's empty top-right cell beside FLY, so the pad grows no taller over the map */
.rs-fuel {
    grid-area: 1 / 3;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font: 600 10px/12px var(--font-mono, monospace);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    text-align: center;
    text-shadow: 0 1px 2px #000;
    /* above the stick zone: its dark base would otherwise dim the readout in stick mode */
    position: relative;
    z-index: 1;
}
.rs-fuel-track {
    height: 6px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.rs-fuel-fill { display: block; height: 100%; width: var(--rs-fuel, 100%); background: #00e676; box-shadow: 0 0 8px rgba(0, 230, 118, 0.6); }
.rs-low-fuel .rs-fuel-fill { background: #ff1744; box-shadow: 0 0 8px rgba(255, 23, 68, 0.6); }
.rs-low-fuel .rs-fuel { color: #ff5c7a; }
.rs-thrusting .sgp-arm[data-action=thrust] { background: rgba(124, 77, 255, 0.5); border-color: #9579ff; box-shadow: 0 0 16px rgba(124, 77, 255, 0.5); }

/* FIRE (face X / J): the conic ring is the charge meter: purple while charging, green at full power, red on overhold */
.rs-actions .rs-fire {
    background: conic-gradient(#7c4dff var(--rs-charge, 36deg), rgba(255, 255, 255, 0.12) 0);
    flex-direction: column;
    isolation: isolate;
}
.rs-controls .sgp-btn.rs-fire { border: 0; border-radius: 50%; }
.rs-fire:before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    z-index: -1;
}
.rs-fire .rs-charge-percent { font: 700 11px/1 var(--font-mono, monospace); font-variant-numeric: tabular-nums; }
/* the warning floats in the empty cell above FIRE */
.rs-fire .rs-charge-warning {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    font: 600 9px/12px var(--font-mono, monospace);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 1px 2px #000;
    pointer-events: none;
}
.rs-charging .rs-fire { box-shadow: 0 0 16px rgba(124, 77, 255, 0.5); }
.rs-ready .rs-fire { background: conic-gradient(#00e676 var(--rs-charge, 36deg), rgba(255, 255, 255, 0.12) 0); box-shadow: 0 0 16px rgba(0, 230, 118, 0.5); }
.rs-ready .rs-charge-warning { color: #00e676; }
.rs-overhold .rs-fire { background: conic-gradient(#ff1744 var(--rs-charge, 36deg), rgba(255, 255, 255, 0.12) 0); box-shadow: 0 0 16px rgba(255, 23, 68, 0.6); }
.rs-overhold .rs-fire:before { background: rgba(120, 18, 36, 0.92); }
.rs-overhold .rs-charge-warning { color: #fff; }

/* map zoom: + / - / fit-all column under the clocks, clear of both thumb clusters in either orientation */
.rs-zoom {
    position: absolute;
    left: var(--rs-left);
    top: calc(90px + env(safe-area-inset-top, 0px));
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rs-zoom button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 20px;
    line-height: 1;
}
.rs-zoom [data-zoom=fit] { font-size: 9px; letter-spacing: 0.5px; }

/* arsenal menu: glass card like the end-of-match card */
.rs-weapon-menu {
    position: absolute;
    right: var(--rs-menu-right, var(--rs-right));
    bottom: var(--rs-menu-bottom, var(--rs-bottom));
    z-index: 4;
    width: min(360px, calc(100% - var(--rs-left) - var(--rs-menu-right, var(--rs-right))));
    max-height: min(440px, var(--rs-menu-height, 0px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: pan-y;
    pointer-events: auto;
    padding: 10px;
    border-radius: 16px;
    background: rgba(17, 17, 17, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
.rs-menu-title {
    flex: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-left: 6px;
    font: 700 12px var(--font-mono, monospace);
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}
.rs-menu-title button { width: 44px; height: 44px; font-size: 20px; }
.rs-weapon-list {
    display: grid;
    grid-auto-rows: minmax(44px, max-content);
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.rs-weapon-list button {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 4px 10px 4px 6px;
    border-radius: 10px;
    border-width: 1px;
    font: 600 12px var(--font-mono, monospace);
    text-align: left;
    touch-action: pan-y;
}
.rs-weapon-list strong { text-align: right; font-variant-numeric: tabular-nums; }
.rs-weapon-icon { display: block; width: 40px; height: 40px; background: center / contain no-repeat; flex: none; }
.rs-weapon-icon-0{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3ERocket%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%2040%2039%2015c7-3%2012-2%2012-2s1%205-2%2012L24%2050l-2-12Z%22%20fill%3D%22%23e7eee9%22%2F%3E%3Cpath%20d%3D%22m39%2015%2010%2010%202-12Z%22%20fill%3D%22%23e97162%22%2F%3E%3Cpath%20d%3D%22m16%2035-7%202-3%2014%2013-8M29%2047l-2%2011%2014-4%201-9%22%20fill%3D%22%2355bcc4%22%2F%3E%3Ccircle%20cx%3D%2235%22%20cy%3D%2229%22%20r%3D%224%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22m15%2047-5%207m10-4-3%207%22%20stroke%3D%22%23edbf43%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-1{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EHeavy%20rocket%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m9%2024%208-9%2029%209%2010%2017-17%208-28-9Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22m46%2024%2010%2017-17%208Z%22%20fill%3D%22%23edbf43%22%2F%3E%3Cpath%20d%3D%22m21%2017-3%2024%207%202%204-23m8%203-5%2022%207%203%206-23%22%20fill%3D%22%23edbf43%22%2F%3E%3Cpath%20d%3D%22m16%2016%202-7%2015%204-2%207M12%2032l-7-2-2%2010%209%202%22%20fill%3D%22%23e7eee9%22%2F%3E%3Cpath%20d%3D%22m27%2044-2%2011%208%202%203-10%22%20fill%3D%22%2340565d%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-2{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EGrenade%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cellipse%20cx%3D%2230%22%20cy%3D%2239%22%20rx%3D%2217%22%20ry%3D%2220%22%20fill%3D%22%236e9670%22%2F%3E%3Cpath%20d%3D%22M16%2030h28M13%2040h34M17%2050h26M25%2022v34m10-34v34%22%20fill%3D%22none%22%20stroke%3D%22%23344b42%22%20stroke-width%3D%223%22%2F%3E%3Cpath%20d%3D%22M24%2022V12h13l9%209%205%2022-6%202-6-22Z%22%20fill%3D%22%23dce8e7%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2211%22%20r%3D%226%22%20fill%3D%22none%22%20stroke%3D%22%23edbf43%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-3{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EShotgun%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%2038%2013-7%209%206-10%2017L4%2049Z%22%20fill%3D%22%23d57463%22%2F%3E%3Cpath%20d%3D%22m19%2031%2034-17%206%2010-33%2019Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22m26%2029%2027-15%203%205-27%2015M31%2034l25-14%203%204-25%2015%22%20fill%3D%22%23b8cccd%22%2F%3E%3Cpath%20d%3D%22m22%2036%2017-10%205%208-17%209Z%22%20fill%3D%22%23d57463%22%2F%3E%3Cpath%20d%3D%22m26%2043%205%205%207-7%22%20fill%3D%22none%22%2F%3E%3Cpath%20d%3D%22m50%208%203-5m7%209%203-2%22%20stroke%3D%22%23edbf43%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-4{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EProximity%20mine%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%2038c0-7%2011-13%2024-13s24%206%2024%2013v8c0%208-48%208-48%200Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cellipse%20cx%3D%2232%22%20cy%3D%2237%22%20rx%3D%2224%22%20ry%3D%2211%22%20fill%3D%22%2355bcc4%22%2F%3E%3Cpath%20d%3D%22m19%2030%207-10h12l7%2010-13%206Z%22%20fill%3D%22%23b8cccd%22%2F%3E%3Cpath%20d%3D%22M13%2035V23h6v15m26%200V23h6v12%22%20fill%3D%22%23edbf43%22%2F%3E%3Ccircle%20cx%3D%2232%22%20cy%3D%2224%22%20r%3D%225%22%20fill%3D%22%23ed7661%22%2F%3E%3Cpath%20d%3D%22M26%2013q6-5%2012%200m-16-6q10-8%2020%200%22%20fill%3D%22none%22%20stroke%3D%22%2355bcc4%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-5{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EIncendiary%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m22%2022%2020-3%207%2031q1%207-6%208l-15%202q-7%200-8-6l-4-23Z%22%20fill%3D%22%23f08032%22%2F%3E%3Cpath%20d%3D%22m22%2023-1-10%2014-2%203%2010Z%22%20fill%3D%22%23dce8e7%22%2F%3E%3Cpath%20d%3D%22m20%2012%2016-2%201%206-16%202Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22m19%2037%2026-4%202%2011-26%204Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22M33%2012Q23%203%2038%203q-1%207%208%202%204%2013-7%2017%203-7-6-10Z%22%20fill%3D%22%23edbf43%22%2F%3E%3Cpath%20d%3D%22m31%2037-3%206%2010-2%22%20fill%3D%22none%22%20stroke%3D%22%23f6e4c6%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}.rs-weapon-icon-6{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20role%3D%22img%22%20aria-labelledby%3D%22title%22%3E%3Ctitle%20id%3D%22title%22%3EToxic%20flask%3C%2Ftitle%3E%3Cg%20stroke%3D%22%2323383f%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M25%2018h14v12l13%2017q7%2013-10%2013H22Q5%2060%2012%2047l13-17Z%22%20fill%3D%22%23c3e6d6%22%2F%3E%3Cpath%20d%3D%22m19%2040-7%2012q-2%206%2010%206h20q12%200%2010-6l-7-12Z%22%20fill%3D%22%23b3df59%22%2F%3E%3Cpath%20d%3D%22M22%209h20v10H22Z%22%20fill%3D%22%2340565d%22%2F%3E%3Cpath%20d%3D%22m32%2040%209%209-9%209-9-9Z%22%20fill%3D%22%2340565d%22%2F%3E%3Ccircle%20cx%3D%2232%22%20cy%3D%2247%22%20r%3D%222.3%22%20fill%3D%22%23e7eee9%22%2F%3E%3Cpath%20d%3D%22M50%2022q-8%2010%200%2010t0-10Z%22%20fill%3D%22%23b3df59%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")}
.rs-controls.fg-touch-hidden { display: none; }

/* speech bubbles over the fighters */
.rs-speech-bubbles { position: absolute; pointer-events: none; z-index: 11; }
.rs-caption {
    position: absolute;
    width: max-content;
    max-width: 220px;
    padding: 5px 10px;
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e0e0e0;
    font: 500 12px/1.3 var(--font-sans, sans-serif);
    text-align: left;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    pointer-events: none;
    letter-spacing: 0;
}
.rs-caption:after {
    content: '';
    position: absolute;
    left: var(--rs-tail, 50%);
    bottom: -5px;
    width: 8px;
    height: 8px;
    background: rgba(17, 17, 17, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transform: translateX(-50%) rotate(45deg);
}
.rs-caption[data-side=top]:after { bottom: auto; top: -5px; transform: translateX(-50%) rotate(225deg); }
.rs-caption[data-side=left]:after { left: -5px; top: var(--rs-tail, 50%); bottom: auto; transform: translateY(-50%) rotate(135deg); }
.rs-caption[data-side=right]:after { left: auto; right: -5px; top: var(--rs-tail, 50%); bottom: auto; transform: translateY(-50%) rotate(-45deg); }
.rs-caption[hidden], .rs-speech-bubbles[hidden] { display: none !important; }

@media (max-width: 420px) {
    .rs-controls { --rs-edge: 8px; }
    .rs-hud { gap: 6px; }
    .rs-hud > span { padding: 0 10px; font-size: 10px; }
}
/* short landscape: tighter chips; the zoom buttons form a row under them, clear of the three-row pad and its stick zone */
@media (max-height: 450px) {
    .rs-controls { --rs-edge: 8px; }
    .rs-hud { top: calc(44px + env(safe-area-inset-top, 0px)); }
    .rs-hud > span { height: 28px; font-size: 10px; }
    .rs-zoom { top: calc(80px + env(safe-area-inset-top, 0px)); flex-direction: row; }
}
