* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: #041017;
    color: #eafcff;
    font-family: "Trebuchet MS", Arial, sans-serif;
    overscroll-behavior: none;
}

body {
    background: radial-gradient(circle at 50% 12%, #123341 0, #071920 34%, #030b0f 82%);
    touch-action: manipulation;
}

button,
a {
    font: inherit;
}

.control-shell {
    width: 100%;
    max-width: 540px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 14px 18px;
}

.topbar {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.eyebrow,
.telemetry span,
.task-kicker,
.room-label,
.network-card,
.action-sub-label {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 1px;
}

.eyebrow {
    color: #6ebcc9;
    font-size: 9px;
    font-weight: bold;
}

h1 {
    margin: 2px 0 0;
    font-family: Impact, "Arial Narrow", sans-serif;
    font-size: 31px;
    font-weight: normal;
    letter-spacing: 2px;
    line-height: 1;
}

h1 span {
    color: #ffc13e;
}

.back-link {
    display: inline-block;
    padding: 10px 12px;
    border: 1px solid #366878;
    color: #9edbe4;
    background-color: #071a22;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: bold;
    text-decoration: none;
}

.identity-card,
.task-card,
.network-card {
    border: 1px solid #245363;
    background-color: rgba(5, 23, 30, 0.94);
}

.identity-card {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    min-height: 67px;
    margin-top: 13px;
    padding: 11px 13px;
    border-left: 4px solid #19ccd5;
}

.suit-light {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    border: 3px solid #d8ffff;
    border-radius: 50%;
    background-color: hsl(188, 90%, 58%);
    box-shadow: 0 0 15px hsl(188, 90%, 58%);
}

.identity-copy {
    min-width: 0;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
}

.player-name,
.status-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-name {
    font-size: 17px;
    font-weight: bold;
}

.status-text {
    margin-top: 3px;
    color: #75a5af;
    font-size: 11px;
}

.room-label {
    padding-left: 8px;
    color: #ffc653;
    font-size: 10px;
    font-weight: bold;
}

.telemetry {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    margin: 9px -4px 0;
}

.telemetry div {
    width: 33.33%;
    margin: 0 4px;
    padding: 9px 8px;
    border: 1px solid #173d49;
    background-color: #06171e;
    text-align: center;
}

.telemetry span,
.telemetry strong {
    display: block;
}

.telemetry span {
    color: #547b85;
    font-size: 8px;
}

.telemetry strong {
    margin-top: 2px;
    color: #effdff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 18px;
}

.task-card {
    min-height: 111px;
    margin-top: 9px;
    padding: 13px 14px;
    border-top: 3px solid #35798c;
}

.task-card.ready {
    border-top-color: #ffbd3b;
}

.task-card.critical {
    border-top-color: #ff4d42;
}

.task-kicker,
#stationName,
.action-hint {
    display: block;
}

.task-kicker {
    color: #6a9ba6;
    font-size: 8px;
}

#stationName {
    overflow: hidden;
    margin-top: 5px;
    color: #f4fdff;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-hint {
    min-height: 16px;
    margin-top: 4px;
    color: #89b2bb;
    font-size: 11px;
}

.repair-track {
    height: 9px;
    margin-top: 10px;
    padding: 2px;
    border: 1px solid #224c58;
    background-color: #031016;
}

.repair-bar {
    width: 0;
    height: 100%;
    background-color: #2adccb;
    -webkit-transition: width 0.12s linear;
    transition: width 0.12s linear;
}

.controls {
    margin-top: 10px;
}

.move-pad {
    position: relative;
    width: 270px;
    height: 190px;
    margin: 0 auto;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.direction,
.pad-core {
    position: absolute;
    width: 76px;
    height: 62px;
}

.direction {
    border: 1px solid #40798a;
    border-radius: 4px;
    color: #b9f3f6;
    background-color: #0a2a35;
    box-shadow: inset 0 -5px 0 #061b23;
    font-size: 25px;
    cursor: pointer;
    touch-action: none;
}

.direction.active {
    border-color: #ffd05b;
    color: #ffd05b;
    background-color: #314025;
    box-shadow: inset 0 -2px 0 #1a2817;
    -webkit-transform: translateY(3px);
    transform: translateY(3px);
}

.direction-up {
    top: 0;
    left: 97px;
}

.direction-left {
    top: 64px;
    left: 18px;
}

.direction-right {
    top: 64px;
    right: 18px;
}

.direction-down {
    bottom: 0;
    left: 97px;
}

.pad-core {
    top: 64px;
    left: 97px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    border: 1px solid #1a4653;
    color: #3f6c76;
    background-color: #05171e;
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    letter-spacing: 2px;
}

.action-button {
    display: block;
    width: 100%;
    min-height: 88px;
    margin-top: 9px;
    padding: 11px;
    border: 2px solid #3e6570;
    border-bottom-width: 8px;
    border-radius: 5px;
    color: #6e8b92;
    background-color: #102329;
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.action-button.ready {
    border-color: #e79824;
    color: #17201a;
    background-color: #ffc144;
}

.action-button.critical {
    border-color: #c42f2a;
    color: #ffffff;
    background-color: #ff4d42;
}

.action-button.active {
    border-bottom-width: 3px;
    -webkit-transform: translateY(5px);
    transform: translateY(5px);
}

.action-button:disabled {
    cursor: default;
}

.action-label,
.action-sub-label {
    display: block;
}

.action-label {
    font-family: Impact, "Arial Narrow", sans-serif;
    font-size: 26px;
    font-weight: normal;
    letter-spacing: 1.5px;
}

.action-sub-label {
    margin-top: 3px;
    font-size: 9px;
}

.network-card {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    margin-top: 11px;
    padding: 9px 11px;
    color: #7aa2ab;
    font-size: 9px;
}

.network-dot {
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background-color: #ffad32;
}

.network-dot.connected {
    background-color: #2bdbb8;
    box-shadow: 0 0 8px #2bdbb8;
}

.pulse-text {
    margin-left: auto;
    color: #ffbe45;
    font-weight: bold;
}

.pulse-text.success {
    color: #45e4c4;
}

.pulse-text.danger {
    color: #ff564c;
}

@media (max-height: 710px) {
    .control-shell {
        padding-top: 8px;
    }

    .identity-card {
        min-height: 56px;
        margin-top: 7px;
        padding: 7px 10px;
    }

    .telemetry {
        margin-top: 6px;
    }

    .telemetry div {
        padding: 6px;
    }

    .task-card {
        min-height: 86px;
        margin-top: 6px;
        padding: 8px 11px;
    }

    .repair-track {
        margin-top: 6px;
    }

    .move-pad {
        -webkit-transform: scale(0.82);
        transform: scale(0.82);
        margin-top: -17px;
        margin-bottom: -17px;
    }

    .action-button {
        min-height: 72px;
        margin-top: 3px;
    }

    .network-card {
        margin-top: 6px;
    }
}

@media (orientation: landscape) and (max-height: 540px) {
    .control-shell {
        max-width: 800px;
        padding: 8px 12px;
    }

    .topbar,
    .identity-card,
    .telemetry,
    .task-card,
    .network-card {
        width: 46%;
    }

    .controls {
        position: absolute;
        top: 8px;
        right: 12px;
        width: 50%;
    }

    .move-pad {
        margin-top: 0;
    }
}
