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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background: #141a24;
    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: 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: #232d3f;
    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: #243144;
    color: #a9c6df;
}

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

.panel {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #1d2533;
    border: 1px solid #313e54;
}

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

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

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

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

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

.rankBadge {
    min-width: 56px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #283347;
    border: 1px solid #495d7d;
    text-align: center;
    font-family: monospace;
    font-size: 18px;
    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: #b8c9d9;
    margin-right: 8px;
}

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

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

.trackRow {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin-bottom: 8px;
}

.btnSmall {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    border: 1px solid #4c6082;
    background: #283448;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.trackMeta {
    -webkit-flex: 1;
    flex: 1;
    text-align: center;
    padding: 0 8px;
}

.trackName {
    font-size: 16px;
    font-weight: bold;
}

.trackDetail {
    font-size: 12px;
    color: #8cc9ff;
}

.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: #2e9d4f;
    border: 2px solid #7ee89c;
}

.btnPrimary:active {
    background: #22783b;
}

.btnSecondary {
    margin-left: 8px;
    background: #1e7fd6;
    border: 2px solid #79c2ff;
}

/* Telemetry bar */
.telePanel {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 8px 10px;
}

.teleItem {
    margin-right: 14px;
    text-align: center;
}

.teleLabel {
    display: block;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.8px;
    color: #9bb1c6;
}

.teleVal {
    font-family: monospace;
    font-size: 16px;
    color: #ffffff;
}

.teleBoost {
    -webkit-flex: 1;
    flex: 1;
}

.boostBar {
    height: 11px;
    margin-top: 3px;
    border-radius: 6px;
    background: #10151e;
    border: 1px solid #3c4c66;
    overflow: hidden;
}

.boostFill {
    width: 70%;
    height: 100%;
    background: #fb8c00;
}

/* Main driving deck */
.driveDeck {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: stretch;
    align-items: stretch;
    margin-bottom: 10px;
}

.steerPad {
    -webkit-flex: 1.25;
    flex: 1.25;
    display: -webkit-flex;
    display: flex;
    margin-right: 10px;
    padding: 6px;
    border-radius: 16px;
    background: #1c2432;
    border: 2px solid #35455e;
    touch-action: none;
}

.pedalPad {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    padding: 6px;
    border-radius: 16px;
    background: #1c2432;
    border: 2px solid #35455e;
    touch-action: none;
}

.pedalBottom {
    display: -webkit-flex;
    display: flex;
    -webkit-flex: 1;
    flex: 1;
    margin-top: 6px;
}

.padBtn {
    -webkit-flex: 1;
    flex: 1;
    min-height: 118px;
    border-radius: 12px;
    border: 2px solid #53688a;
    background: #273348;
    color: #ffffff;
    font-family: inherit;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    touch-action: none;
    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;
}

.steerBtn {
    min-height: 168px;
    font-size: 46px;
    line-height: 1;
}

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

.padSub {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.80);
}

.boostBtn {
    min-height: 82px;
    background: #d9760c;
    border-color: #ffd579;
    font-size: 20px;
}

.brakeBtn {
    min-height: 76px;
    background: #b82d2a;
    border-color: #ff9a94;
    font-size: 17px;
}

.gasBtn {
    min-height: 76px;
    margin-left: 6px;
    background: #2b9348;
    border-color: #82eb9e;
    font-size: 17px;
}

.padBtn.is-active {
    background: #ffffff;
    border-color: #ffffff;
    color: #141a24;
}

.padBtn.is-active .padSub {
    color: #141a24;
}

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

.utilBtn {
    padding: 9px 12px;
    margin: 0 8px 6px 0;
    border-radius: 8px;
    border: 1px solid #445572;
    background: #232d3f;
    color: #e4edf5;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.utilBtn.is-on {
    background: #1f4f32;
    border-color: #66d98a;
    color: #eafff0;
}

.statusHint {
    font-size: 12px;
    color: #9cb2c7;
    margin-bottom: 6px;
}

/* Compact landscape phone optimization */
@media (orientation: landscape) and (max-height: 500px) {
    .shell { padding: 6px 10px; }
    .panel { padding: 6px 10px; margin-bottom: 6px; }
    .carSwatch { width: 38px; height: 38px; line-height: 34px; font-size: 15px; }
    .steerBtn { min-height: 126px; }
    .boostBtn { min-height: 60px; }
    .brakeBtn, .gasBtn { min-height: 58px; }
    .nameRow { display: none; }
}
