.toolPicker {
    position: fixed;
    display: none;
    background: brown;
    top: 0;
    left: 0;
    min-height: 100%;
    padding: 1em;
    border-radius: 0px 0px 15px 15px;
}

.objectTooltip {
    position: absolute;
    z-index: 2;
    display: none;
    pointer-events: none;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #eceff1;
    font: 12px sans-serif;
    /* No wrapping, but details on their own lines */
    white-space: pre;
}

.timeDisplay {
    position: fixed;
    z-index: 2;
    /* Clear of the notch and rounded corners on phones */
    top: calc(12px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    pointer-events: none;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: #eceff1;
    font: 14px sans-serif;
}

.collisionNotifications {
    position: fixed;
    z-index: 2;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    pointer-events: none;
}

.collisionNotification {
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #eceff1;
    font: 13px sans-serif;
    transition: opacity 0.5s;
}

.collisionNotification.hidden {
    opacity: 0;
}

.collisionNotificationDate {
    margin-top: 2px;
    color: #90a4ae;
    font-size: 11px;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: #263238;
    /* No pull-to-refresh, text selection or grey flash on tap */
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.objectInfo {
    position: fixed;
    z-index: 2;
    display: none;
    left: calc(12px + env(safe-area-inset-left));
    /* Above the view buttons */
    bottom: calc(64px + env(safe-area-inset-bottom));
    min-width: 200px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #eceff1;
    font: 13px sans-serif;
    pointer-events: none;
}

.objectInfoTitle {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: bold;
}

.objectInfoRows {
    display: grid;
    grid-template-columns: auto auto;
    gap: 3px 14px;
}

.objectInfoLabel {
    color: #90a4ae;
}

.speedControl {
    position: fixed;
    z-index: 2;
    /* Under the date */
    top: calc(48px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 6px;
}

.speedControl button {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #eceff1;
    font: 16px sans-serif;
    cursor: pointer;
}

.speedControl button:active {
    background: rgba(255, 255, 255, 0.15);
}

.speedLabel {
    min-width: 56px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: #eceff1;
    font: 14px sans-serif;
    text-align: center;
}

.rocketHud {
    position: fixed;
    z-index: 2;
    display: none;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    width: 260px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #eceff1;
    font: 13px sans-serif;
}

.rocketHud > div {
    margin-bottom: 4px;
}

.rocketHudHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

.rocketHud button {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #eceff1;
    font: 12px sans-serif;
    padding: 4px 10px;
    cursor: pointer;
}

.rocketHud button:disabled {
    opacity: 0.4;
    cursor: default;
}

.rocketHudFuel {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.rocketHudFuel > div {
    height: 100%;
}

.rocketHudStatus {
    color: #b0bec5;
}

.rocketWorkshop {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.rocketWorkshopTitle {
    margin-bottom: 4px;
    font-weight: bold;
}

.rocketWorkshopRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.rocketAbort,
.rocketAssist {
    width: 100%;
    margin-top: 6px;
}

/* Turn and thrust buttons, only on touch screens while playing */
.rocketControls {
    position: fixed;
    z-index: 2;
    display: none;
    right: calc(12px + env(safe-area-inset-right));
    /* Above the view buttons */
    bottom: calc(64px + env(safe-area-inset-bottom));
    gap: 10px;
    touch-action: none;
}

@media (pointer: coarse) {
    .rocketControls.active {
        display: flex;
    }
}

.rocketControls button {
    width: 60px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.6);
    color: #eceff1;
    font: 24px sans-serif;
    touch-action: none;
}

.rocketControls .rocketControl-thrust {
    width: 76px;
    height: 76px;
    border-radius: 38px;
}

.rocketControls button:active {
    background: rgba(255, 255, 255, 0.2);
}

.viewButtons {
    position: fixed;
    z-index: 2;
    left: calc(12px + env(safe-area-inset-left));
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    gap: 8px;
}

.viewButtons button {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #eceff1;
    font: 14px sans-serif;
    cursor: pointer;
}

.viewButtons button:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Phones: smaller texts, notifications at the top, out of the way of the buttons */
@media (max-width: 600px) {
    .timeDisplay {
        font-size: 12px;
    }

    .collisionNotifications {
        /* Under the date and the speed control */
        top: calc(100px + env(safe-area-inset-top));
        bottom: auto;
        max-width: 70vw;
    }

    .collisionNotification {
        font-size: 12px;
    }

    /* Under the speed control, notifications on the other side */
    .rocketHud {
        top: calc(100px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
        right: auto;
        width: 48vw;
        font-size: 11px;
    }

    .collisionNotifications {
        max-width: 44vw;
    }
}

canvas{
    display: block;
    overflow: hidden;
}

/* Objects are drawn on a transparent canvas above the galaxy layer */
#cnvs {
    position: relative;
    z-index: 1;
    /* Fingers move the camera, not the page */
    touch-action: none;
}

.galaxy {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}
