/* PolyShooter smartphone controller CSS: circa-2015 CSS 3, flexbox only, touch-first portrait & landscape. */
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: #101b26;
    color: #f4f8fb;
    font-family: "Trebuchet MS", "Segoe UI", Arial, Helvetica, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.shell {
    max-width: 680px;
    margin: 0 auto;
    padding: 10px 12px 14px 12px;
}

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

.backLink {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #1c2c3c;
    border: 1px solid #39556e;
    color: #eaf5fb;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.backLink:active { background: #294058; }

.commsBadge {
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 12px;
    background: #20303e;
    color: #a9c6d8;
}

.commsBadge.is-ok {
    background: #1c442d;
    color: #8bf5a8;
}

.panel {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #172533;
    border: 1px solid #2b4257;
}

/* Pilot identity */
.heroHeader {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.heroSwatch {
    width: 46px;
    height: 46px;
    line-height: 42px;
    text-align: center;
    border-radius: 11px;
    background: #ef4444;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 17px;
    font-weight: bold;
    margin-right: 10px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.heroMeta {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
}

.heroTitle {
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.heroSub {
    font-size: 12px;
    color: #a9c6d8;
}

.upgBadge {
    min-width: 54px;
    padding: 7px 9px;
    border-radius: 9px;
    background: #223548;
    border: 1px solid #486882;
    text-align: center;
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    color: #ffd56b;
}

.nameRow {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
}

.nameLabel {
    font-size: 13px;
    font-weight: bold;
    color: #b5cede;
    margin-right: 8px;
}

.nameInput {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #3f5c74;
    background: #0e1821;
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    -webkit-user-select: text;
    user-select: text;
}

.storageNotice {
    margin-left: 8px;
    font-size: 11px;
    color: #ffd56b;
}

/* Hangar strip */
.lobbyLevelRow {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.btnLvlNav {
    width: 38px;
    height: 38px;
    line-height: 34px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #48647c;
    background: #223548;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.btnLvlNav:active { background: #334e68; }

.lobbyLevelMeta {
    -webkit-flex: 1;
    flex: 1;
    padding: 0 8px;
    min-width: 0;
}

.lobbyTitle {
    font-size: 14px;
    font-weight: bold;
    color: #63d98f;
}

.lobbySub {
    font-size: 12px;
    color: #c2d6e4;
    margin: 2px 0 0 0;
}

.actionRow {
    display: -webkit-flex;
    display: flex;
}

.btnPrimary, .btnSecondary {
    -webkit-flex: 1;
    flex: 1;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
}

.btnPrimary { background: #2c9c4e; border: 2px solid #82ef9f; }
.btnPrimary:active { background: #22783b; }
.btnSecondary { margin-left: 8px; background: #1e7fd6; border: 2px solid #7cc4ff; }

/* Stats & Weapons */
.barsRow {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 7px;
}

.barGroup {
    -webkit-flex: 1;
    flex: 1;
    margin-right: 10px;
}

.barLabels {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    font-size: 11px;
    color: #b7cede;
    margin-bottom: 3px;
}

.barTrack {
    height: 10px;
    border-radius: 5px;
    background: #0d161f;
    border: 1px solid #354e63;
    overflow: hidden;
}

.barFill {
    height: 100%;
    width: 100%;
}

.hpFill { background: #ef4444; }
.xpFill { background: #38bdf8; }
.bossFill { background: #ef4444; }

.killsBox {
    min-width: 56px;
    text-align: center;
}

.killsLabel {
    display: block;
    font-size: 10px;
    font-weight: bold;
    color: #9cb9cc;
}

.killsVal {
    font-family: monospace;
    font-size: 17px;
    color: #ffd56b;
}

.weaponStrip {
    font-size: 12px;
    font-weight: bold;
    color: #d7ebf5;
    padding-top: 6px;
    border-top: 1px solid #2a3e50;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Boss alert strip */
.bossStrip {
    background: #2f1417;
    border-color: #d44343;
}

.bossRow {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    color: #ffd56b;
    margin-bottom: 5px;
}

.bossTrack { border-color: #7d2c2c; }

/* Compact combat mode: hide callsign editor while actively flying so stick + upgrades fit cleanly without scrolling */
.shell.is-playing .heroHeader {
    margin-bottom: 0;
}
.shell.is-playing .nameRow {
    display: none;
}

/* Attention pulse when an upgrade is ready beneath the active flight stick */
@-webkit-keyframes upgPulse {
    0%   { border-color: #ffd54f; background-color: #2b2612; }
    50%  { border-color: #fff59d; background-color: #3d3314; }
    100% { border-color: #ffd54f; background-color: #2b2612; }
}
@keyframes upgPulse {
    0%   { border-color: #ffd54f; background-color: #2b2612; }
    50%  { border-color: #fff59d; background-color: #3d3314; }
    100% { border-color: #ffd54f; background-color: #2b2612; }
}

.shell.has-upgrade .joyDeck {
    padding: 8px 10px;
    border: 2px solid #ffd54f;
}

.shell.has-upgrade .joyPad {
    height: 158px;
}

.shell.has-upgrade .joyBase {
    width: 138px;
    height: 138px;
}

.shell.has-upgrade .joyKnob {
    width: 52px;
    height: 52px;
    margin-left: -26px;
    margin-top: -26px;
}

.shell.has-upgrade .autoHint {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #ffd54f;
    color: #161408;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.6px;
}

/* Upgrade Selection Panel (sits directly underneath the active flight stick) */
.upgradePanel {
    padding: 9px 10px;
    background: #2b2612;
    border: 2px solid #ffd54f;
    -webkit-animation: upgPulse 1.1s ease-in-out infinite;
    animation: upgPulse 1.1s ease-in-out infinite;
}

.upgradeHeader {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 7px;
}

.upgradeEyebrow {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #ffe066;
}

.upgradeStep {
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 5px;
    background: #ffd54f;
    color: #161408;
}

.upgradeCards {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.upgCard {
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 6px;
    border-radius: 10px;
    border: 2px solid #5c768e;
    background: #1d2d3d;
    color: #ffffff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.upgCard:last-child { margin-bottom: 0; }
.upgCard:active { background: #2c455d; border-color: #ffffff; }
.upgCard.rar-uncommon  { border-color: #4cd964; background: #193426; }
.upgCard.rar-rare      { border-color: #56c6ff; background: #183047; }
.upgCard.rar-epic      { border-color: #c870ff; background: #2c1a40; }
.upgCard.rar-legendary { border-color: #ffb829; background: #422a0e; }

.upgCardTop {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 3px;
}

.upgCardBadge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.7px;
    padding: 2px 6px;
    margin-right: 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffd56b;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.upgCardName {
    font-size: 15px;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.upgCardDesc {
    font-size: 12px;
    line-height: 1.28;
    color: #d4e4f0;
}

/* Analog Touch Flight Stick Deck */
.joyDeck {
    text-align: center;
    padding: 12px;
}

.downedBanner {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #47181c;
    border: 1px solid #ef4444;
    color: #ffd56b;
    font-size: 12px;
    font-weight: bold;
}

.joyPad {
    position: relative;
    width: 100%;
    height: 248px;
    border-radius: 14px;
    background: #0f1924;
    border: 2px solid #2e485f;
    touch-action: none;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    overflow: hidden;
}

.joyPad.is-active {
    border-color: #63d98f;
    background: #122130;
}

.joyBase {
    position: relative;
    width: 196px;
    height: 196px;
    border-radius: 50%;
    background: #162534;
    border: 2px solid #3c5c78;
}

.joyAxisH, .joyAxisV {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
}

.joyAxisH { left: 16px; right: 16px; top: 50%; height: 1px; }
.joyAxisV { top: 16px; bottom: 16px; left: 50%; width: 1px; }

.joyDir {
    position: absolute;
    font-size: 11px;
    font-weight: bold;
    color: #7ea1bc;
    letter-spacing: 0.6px;
}

.joyN { top: 8px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.joyS { bottom: 8px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.joyW { left: 12px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.joyE { right: 12px; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }

.joyKnob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 68px;
    height: 68px;
    margin-left: -34px;
    margin-top: -34px;
    border-radius: 50%;
    background: #ef4444;
    border: 3px solid #ffffff;
}

.autoHint {
    margin-top: 9px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.7px;
    color: #8cc4e8;
}

.utilBar {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 4px 2px;
}

.utilBtn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #3f5c74;
    background: #1b2c3b;
    color: #eaf5fb;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.statusHint {
    font-size: 12px;
    color: #93b3c9;
    margin-left: 10px;
    text-align: right;
}

@media (max-height: 640px) {
    .joyPad { height: 204px; }
    .joyBase { width: 168px; height: 168px; }
    .joyKnob { width: 58px; height: 58px; margin-left: -29px; margin-top: -29px; }
}
