/* PolyCrash smartphone controller CSS: circa-2015 CSS 3, touch-first, live car damage diagram below controls. */
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: #141922;
    color: #f4f7fa;
    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: 720px;
    margin: 0 auto;
    padding: 8px 10px 12px 10px;
}

.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: #232c3d;
    border: 1px solid #3c4c66;
    color: #e9f1f8;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.backLink:active {
    background: #33435e;
}

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

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

.panel {
    margin-bottom: 8px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #1d2432;
    border: 1px solid #323f56;
}

/* Driver Header */
.carHeader {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.carSwatch {
    width: 44px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    border-radius: 10px;
    background: #f7b824;
    border: 2px solid #ffffff;
    color: #18140d;
    font-size: 18px;
    font-weight: bold;
    margin-right: 10px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

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

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

.carSub {
    font-size: 12px;
    color: #b4c5d6;
}

.statChips {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.statChip {
    min-width: 52px;
    margin-left: 6px;
    padding: 5px 7px;
    border-radius: 8px;
    background: #141a24;
    border: 1px solid #303d52;
    text-align: center;
}

.chipLbl {
    display: block;
    font-size: 9px;
    font-weight: bold;
    color: #93abc2;
    letter-spacing: 0.7px;
}

.statChip strong {
    font-family: monospace;
    font-size: 15px;
    color: #ffd54f;
}

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

.nameLabel {
    font-size: 12px;
    font-weight: bold;
    color: #a9bfd0;
    margin-right: 7px;
}

.nameInput {
    -webkit-flex: 1;
    flex: 1;
    min-width: 80px;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid #3f506b;
    background: #131821;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
}

.storageNotice {
    font-size: 11px;
    color: #ffd54f;
    margin-left: 6px;
}

.btnAction {
    margin-left: 8px;
    padding: 8px 13px;
    border-radius: 8px;
    border: 2px solid #ffd54f;
    background: #e59819;
    color: #18140d;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.btnAction.btnAlt {
    background: #2b7a4b;
    border-color: #7ee3a2;
    color: #ffffff;
}

/* Main Driving Controls */
.driveDeck {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: stretch;
    align-items: stretch;
    margin-bottom: 8px;
    min-height: 158px;
}

.driveDeck.is-wrecked {
    opacity: 0.52;
}

.steerPad {
    -webkit-flex: 1.25;
    flex: 1.25;
    display: -webkit-flex;
    display: flex;
    margin-right: 8px;
    touch-action: none;
}

.pedalPad {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    touch-action: none;
}

.padBtn {
    -webkit-flex: 1;
    flex: 1;
    border-radius: 13px;
    border: 2px solid #435573;
    background: #222c3e;
    color: #ffffff;
    font-family: inherit;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    min-height: 74px;
    touch-action: none;
}

.steerBtn:first-child {
    margin-right: 6px;
}

.padSub {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 0.9px;
    color: #bdd0e4;
}

.gasBtn {
    background: #225c36;
    border-color: #54c778;
    font-size: 21px;
    margin-bottom: 6px;
}

.revBtn {
    background: #6c2424;
    border-color: #e66767;
    font-size: 20px;
}

.padBtn.is-active {
    background: #e59819;
    border-color: #fff2b2;
    color: #18140d;
}

.padBtn.is-active .padSub {
    color: #2b200c;
}

/* Car Damage Diagram Panel (explicitly below controls!) */
.damagePanel {
    background: #171d28;
    border-color: #3a4a66;
}

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

.damageTitle {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.2px;
    color: #b4c7db;
}

.damageStatus {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.7px;
    background: #1f4b2f;
    color: #8bf5a8;
}

.damageStatus.is-warn {
    background: #5c4314;
    color: #ffd54f;
}

.damageStatus.is-danger {
    background: #6b1f1f;
    color: #ff9c9c;
}

.damageStatus.is-wrecked {
    background: #b71c1c;
    color: #ffffff;
}

.damagePct {
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    color: #e9f1f8;
}

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

.diagramWrap {
    width: 176px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    margin-right: 10px;
    padding: 4px;
    border-radius: 10px;
    background: #10151e;
    border: 1px solid #2b384d;
}

.carDiagram {
    width: 100%;
    height: auto;
    display: block;
}

.diagDir {
    fill: #7f96b0;
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
}

.dmgPart {
    stroke: #0e131b;
    stroke-width: 2;
}

.dmgCore {
    stroke: #11161f;
    stroke-width: 2;
}

.diagCoreLbl {
    fill: #11161f;
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
}

.diagCabin {
    fill: #273244;
    stroke: #4c5f7d;
    stroke-width: 1.5;
}

.diagGlass {
    fill: #121a26;
}

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

.dmgRow {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 6px;
}

.dmgName {
    width: 58px;
    font-size: 11px;
    font-weight: bold;
    color: #b7cae0;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.dmgTrack {
    -webkit-flex: 1;
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #293346;
    overflow: hidden;
    margin: 0 7px;
}

.dmgBar {
    height: 100%;
    width: 0%;
    background: #39d353;
}

.dmgVal {
    width: 32px;
    text-align: right;
    font-family: monospace;
    font-size: 11px;
    color: #dbe6f2;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.dmgTip {
    margin-top: 6px;
    font-size: 11px;
    color: #93abc2;
}

/* Utility Footer */
.utilBar {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.utilBtn {
    padding: 7px 11px;
    margin: 0 6px 4px 0;
    border-radius: 8px;
    border: 1px solid #3c4d69;
    background: #202838;
    color: #dbe6f2;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.utilBtn.is-on {
    background: #225c36;
    border-color: #54c778;
    color: #ffffff;
}

.statusHint {
    font-size: 11px;
    color: #8fa6bd;
    margin-bottom: 4px;
}

/* Compact phone width tweak */
@media (max-width: 360px) {
    .diagramWrap {
        width: 144px;
        margin-right: 8px;
    }
    .dmgName {
        width: 50px;
        font-size: 10px;
    }
}
