/* PolyShooter viewer stylesheet: circa-2015 CSS 3, flat lean-paint, Tizen 2.4 / Mali-400 & smartphone safe. */
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #1d4a6e;
    color: #f6f8fa;
    font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#world, #world canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block;
}

#world {
    cursor: grab;
    touch-action: none;
}

#world.is-dragging {
    cursor: grabbing;
}

/* Top-left HUD & Squadron stack */
#hud-left-stack {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 96px;
    z-index: 6;
    pointer-events: none;
}

#hud-top {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-items: center;
    align-items: center;
    pointer-events: none;
}

.hud-pill {
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 5px 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(16, 26, 36, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.26);
    font-size: 13px;
    line-height: 1.25;
    color: #f6f8fa;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hud-tag {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 6px;
    border-radius: 4px;
    background: #4ec98c;
    color: #0e1920;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.6px;
    vertical-align: middle;
}

.hud-title {
    font-weight: bold;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

.hud-stats {
    font-family: monospace;
    font-size: 13px;
}

.stat-label {
    font-family: "Trebuchet MS", Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: #a9c6d8;
    letter-spacing: 0.6px;
    margin-right: 3px;
}

.hud-divider {
    display: inline-block;
    width: 1px;
    height: 12px;
    margin: 0 7px;
    background: rgba(255, 255, 255, 0.25);
    vertical-align: middle;
}

.hud-btn {
    pointer-events: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 6px 5px 0;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(18, 30, 42, 0.88);
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.25;
    font-weight: bold;
    cursor: pointer;
}

.hud-btn-primary {
    background: #1e88e5;
    border-color: #7cc4ff;
}

.hud-btn:hover, .hud-btn:active { background: #2e465c; }
.hud-btn-primary:hover, .hud-btn-primary:active { background: #1565c0; }

/* Top-right utility buttons */
#scene-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 7;
    white-space: nowrap;
}

.scene-button {
    display: inline-block;
    vertical-align: top;
    width: 36px;
    height: 36px;
    padding: 7px;
    margin: 0 0 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.40);
    border-radius: 8px;
    background: rgba(16, 26, 36, 0.84);
    color: #ffffff;
    cursor: pointer;
}

.scene-button svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-off, .is-muted .sound-on { display: none; }
.is-muted .sound-off { display: block; }
.fullscreen-exit, .is-fullscreen .fullscreen-enter { display: none; }
.is-fullscreen .fullscreen-exit { display: block; }

/* Boss Health Bar */
.boss-bar {
    position: fixed;
    top: 52px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 7;
    width: 480px;
    max-width: 88%;
    padding: 7px 12px 9px 12px;
    border-radius: 10px;
    background: rgba(36, 14, 18, 0.92);
    border: 2px solid #ff5252;
    pointer-events: none;
}

.boss-header {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: baseline;
    align-items: baseline;
    margin-bottom: 6px;
}

.boss-name {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ffd56b;
}

.boss-hp-text {
    font-family: monospace;
    font-size: 12px;
    color: #ffd6d6;
}

.boss-track {
    height: 12px;
    border-radius: 6px;
    background: #1a0b0d;
    border: 1px solid #752727;
    overflow: hidden;
}

.boss-fill {
    width: 100%;
    height: 100%;
    background: #ef4444;
}

/* Squadron Party HUD */
.party-hud {
    margin-top: 2px;
    width: auto;
    max-width: 100%;
    pointer-events: none;
}

.p-card {
    display: inline-block;
    vertical-align: top;
    width: 158px;
    padding: 4px 7px;
    margin: 0 5px 4px 0;
    border-radius: 8px;
    background: rgba(16, 26, 36, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-left-width: 4px;
    font-size: 12px;
}

.p-card.is-downed {
    opacity: 0.65;
    border-color: #ef4444;
}

.p-card.is-upgrading {
    background: rgba(54, 42, 12, 0.92);
    border-color: #ffd54f;
}

.p-meta.is-upg-alert {
    padding: 1px 5px;
    border-radius: 4px;
    background: #ffd54f;
    color: #161408;
    font-weight: bold;
}

.p-top {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 3px;
}

.p-name {
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 4px;
}

.p-meta {
    font-family: monospace;
    font-size: 11px;
    color: #ffd56b;
    white-space: nowrap;
}

.mini-bar {
    height: 6px;
    border-radius: 3px;
    background: #0d161e;
    overflow: hidden;
    margin-top: 2px;
}

.mini-fill {
    height: 100%;
    width: 100%;
}

.hp-fill { background: #ef4444; }
.xp-fill { background: #38bdf8; }

/* Center announcement banner */
.center-banner {
    position: fixed;
    top: 24%;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 9;
    padding: 10px 22px;
    border-radius: 12px;
    background: rgba(14, 24, 34, 0.92);
    border: 2px solid #ffd54f;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    max-width: 90%;
    pointer-events: none;
}

.center-banner.is-boss {
    background: rgba(54, 12, 16, 0.94);
    border-color: #ff5252;
    color: #ffd56b;
}

.center-banner.is-upgrade {
    top: 14%;
    background: rgba(46, 36, 10, 0.94);
    border-color: #ffd54f;
    color: #fff2a6;
    font-size: 20px;
}

/* Overlays (Hangar Lobby & Results) */
.overlay-card {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 8;
    width: 520px;
    max-width: 92%;
    max-height: 86%;
    overflow-y: auto;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(15, 25, 36, 0.92);
    border: 2px solid rgba(116, 206, 255, 0.42);
    color: #f6f8fa;
}

.overlay-header {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 12px;
}

.overlay-icon {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    margin-right: 14px;
    background: #ffffff;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.overlay-eyebrow {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1.2px;
    color: #7cd4ff;
}

.overlay-title {
    margin: 2px 0 0 0;
    font-size: 28px;
    line-height: 1.1;
}

.level-banner {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(34, 78, 62, 0.52);
    border: 1px solid rgba(110, 231, 160, 0.44);
    margin-bottom: 12px;
}

.level-picker-row {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.level-nav-btn {
    width: 36px;
    height: 36px;
    line-height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.30);
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.level-nav-btn:hover, .level-nav-btn:active {
    background: rgba(255, 255, 255, 0.20);
}

.level-picker-meta {
    -webkit-flex: 1;
    flex: 1;
    padding: 0 10px;
    min-width: 0;
}

.level-banner-tag {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.9px;
    color: #8bf5a8;
}

.level-banner-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #e4f2e8;
}

.roster-grid {
    margin: 0 -4px 12px -4px;
    font-size: 0;
}

.roster-slot {
    display: inline-block;
    vertical-align: top;
    width: 50%;
    padding: 4px;
    font-size: 13px;
}

.roster-card {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    background: #1d2b38;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.roster-card.is-human {
    background: #1b3c32;
    border-color: #63d98f;
}

.roster-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.roster-name {
    -webkit-flex: 1;
    flex: 1;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.roster-role {
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #d0dde8;
}

.roster-card.is-human .roster-role {
    background: #2e8b4e;
    color: #ffffff;
}

.overlay-actions {
    display: -webkit-flex;
    display: flex;
}

.btn-big {
    -webkit-flex: 1;
    flex: 1;
    padding: 12px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    margin-right: 8px;
}

.btn-big:last-child { margin-right: 0; }
.btn-start { background: #2c9c4e; border: 2px solid #82ef9f; }
.btn-start:hover, .btn-start:active { background: #217a3c; }
.btn-local { background: #1e7fd6; border: 2px solid #7cc4ff; }
.btn-local:hover, .btn-local:active { background: #1565c0; }
.btn-muted { background: #2b3c4d; border: 2px solid #56708a; }

.overlay-hint {
    margin: 10px 0 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #b7cede;
}

.results-badge {
    display: inline-block;
    margin: 10px 0 12px 0;
    padding: 5px 12px;
    border-radius: 8px;
    background: #233749;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    color: #ffd56b;
}

.results-list {
    margin-bottom: 14px;
}

.res-row {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: #1b2b39;
    border-left: 4px solid #ef4444;
    font-size: 14px;
}

.res-stat {
    font-family: monospace;
    color: #ffd56b;
    font-weight: bold;
}

/* Floating Touch-Anywhere Movement Reticle */
.touch-guide {
    position: fixed;
    width: 112px;
    height: 112px;
    margin-left: -56px;
    margin-top: -56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.55);
    background: rgba(16, 28, 40, 0.25);
    pointer-events: none;
    z-index: 6;
}

.touch-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #ffffff;
}

/* Local Screen Play Status Chip */
.local-controls {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 7;
    pointer-events: none;
}

.local-hud-chip {
    pointer-events: auto;
    width: 230px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(16, 26, 36, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.local-chip-top {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 5px;
}

.local-hero-tag {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.7px;
    color: #ffd56b;
}

.local-exit-btn {
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #273949;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

.bar-line {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 4px;
}

.bar-lbl {
    width: 24px;
    font-size: 10px;
    font-weight: bold;
    color: #a9c6d8;
}

.bar-line .mini-bar {
    -webkit-flex: 1;
    flex: 1;
    height: 8px;
    margin-top: 0;
}

.local-weapons {
    margin-top: 5px;
    font-size: 11px;
    color: #d7ebf5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Local 3-Choice Upgrade Modal */
.upgrade-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 660px;
    max-width: 94%;
    max-height: 88%;
    overflow-y: auto;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(16, 26, 38, 0.96);
    border: 2px solid #ffd54f;
    text-align: center;
}

.upgrade-eyebrow {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.4px;
    color: #ffd54f;
}

.upgrade-title {
    margin: 4px 0 14px 0;
    font-size: 24px;
}

.upgrade-cards {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -6px;
}

.upg-card {
    -webkit-flex: 1;
    flex: 1;
    min-width: 175px;
    margin: 6px;
    padding: 14px 12px;
    border-radius: 12px;
    border: 2px solid #5c768e;
    background: #1d2d3d;
    color: #ffffff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.upg-card:hover, .upg-card:active {
    border-color: #ffffff;
    background: #274057;
}

.upg-card.rar-uncommon  { border-color: #4cd964; background: #193426; }
.upg-card.rar-rare      { border-color: #56c6ff; background: #183047; }
.upg-card.rar-epic      { border-color: #c870ff; background: #2c1a40; }
.upg-card.rar-legendary { border-color: #ffb829; background: #422a0e; }

.upg-top {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.upg-badge {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.9px;
    padding: 3px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffd56b;
}

.upg-key {
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.35);
    color: #cfe0ee;
}

.upg-name {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 6px;
}

.upg-desc {
    font-size: 13px;
    line-height: 1.35;
    color: #d0e0ec;
}

.upgrade-hint {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #a9c0d4;
}

/* Canonical Standard RCWeb QR Panel (content-box restored, uniform scale only) */
#qrPanel {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 6;
    width: 166px;
    -webkit-transform-origin: bottom right;
    transform-origin: bottom right;
    -webkit-transform: scale(0.62);
    transform: scale(0.62);
}

#qrPanel.is-compact {
    bottom: 14px;
    -webkit-transform: scale(0.44);
    transform: scale(0.44);
    opacity: 0.76;
}

.rcRoomQrCodeLink, .rcRoomQrCodeLink * {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
}

.rcRoomQrCodeLink {
    display: block;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    text-align: center;
    -webkit-transition: opacity 1s ease;
    transition: opacity 1s ease;
    text-decoration: none;
    -webkit-transform-origin: center;
    transform-origin: center;
    -webkit-transform: scale(1);
    transform: scale(1);
}

.rcTechLabel {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 4px;
    letter-spacing: 0.2em;
    border-radius: 8px 8px 0 0;
}

.rcRoomQrCode {
    width: 150px;
    height: 150px;
}

.rcRoomId {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
    padding: 4px;
    margin: 8px 0 0 0;
    letter-spacing: 0.25em;
    border-radius: 0 0 8px 8px;
}

.conn-status {
    position: fixed;
    left: 14px;
    bottom: 12px;
    z-index: 9;
    font-size: 13px;
    color: #ffe08a;
    pointer-events: none;
}

#diagnostics {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 10;
    margin: 0;
    padding: 8px 10px;
    background: #141a24;
    color: #ffffff;
    font: 12px monospace;
    pointer-events: none;
}

.no-script {
    position: fixed;
    top: 40%;
    width: 100%;
    text-align: center;
}

/* Lean-paint mode for weak signage devices (Tizen 2.4 / Mali-400) */
body.is-lean .hud-pill,
body.is-lean .hud-btn,
body.is-lean .scene-button,
body.is-lean .p-card,
body.is-lean .overlay-card,
body.is-lean .center-banner,
body.is-lean .local-hud-chip,
body.is-lean .upgrade-modal,
body.is-lean .boss-bar {
    background: #14202b;
}
body.is-lean .hud-btn-primary { background: #1e88e5; }
body.is-lean .boss-bar { background: #2e1216; }
body.is-lean .rcRoomQrCodeLink {
    -webkit-transition: none;
    transition: none;
}

/* Compact landscape (e.g. 960x540 TV / tablet) */
@media (max-height: 580px) {
    .overlay-card { padding: 12px 14px; }
    .overlay-icon { width: 46px; height: 46px; }
    .overlay-title { font-size: 24px; }
    .btn-big { padding: 10px 12px; font-size: 15px; }
    .p-card { width: 140px; }
    #qrPanel { -webkit-transform: scale(0.48); transform: scale(0.48); }
    #qrPanel.is-compact { bottom: 10px; -webkit-transform: scale(0.36); transform: scale(0.36); }
}

/* Narrow portrait & smartphone viewer layout (450x960, 390x844) */
@media (max-width: 560px) {
    #hud-left-stack { top: 6px; left: 6px; right: 74px; }
    .hud-pill { padding: 3px 7px; font-size: 11px; line-height: 1.2; margin: 0 4px 4px 0; border-radius: 6px; }
    .hud-tag { padding: 1px 5px; margin-right: 5px; font-size: 10px; letter-spacing: 0.4px; }
    .hud-stats { font-size: 11px; }
    .stat-label { font-size: 9px; margin-right: 2px; letter-spacing: 0.4px; }
    .hud-divider { height: 10px; margin: 0 5px; }
    .hud-btn { padding: 3px 8px; font-size: 11px; line-height: 1.2; margin: 0 4px 4px 0; border-radius: 6px; }
    #scene-controls { top: 6px; right: 6px; }
    .scene-button { width: 30px; height: 30px; padding: 5px; margin: 0 0 0 4px; border-radius: 7px; }
    .scene-button svg { width: 18px; height: 18px; }
    .p-card { width: 132px; padding: 3px 6px; margin: 0 4px 3px 0; }
    .p-name { font-size: 11px; }
    .p-meta { font-size: 10px; }
    .boss-bar { top: 60px; padding: 5px 9px 7px 9px; max-width: 94%; }
    .boss-name { font-size: 11px; }
    .center-banner { font-size: 19px; padding: 7px 14px; top: 28%; }
    .roster-slot { width: 100%; }
    .local-controls { left: 8px; bottom: 8px; }
    .local-hud-chip { width: 206px; padding: 6px 8px; }
    .upg-card { min-width: 100%; margin: 5px 0; padding: 11px 12px; }
    .upgrade-cards { margin: 0; }
    #qrPanel { display: none !important; }
}
