html {
    padding: 0;
    margin: 0;
    color: white;
    font-weight: 700;
}
body {
    display: grid;
    position: relative;
    min-height: 100vh;
    margin: 0;
    grid-template-rows: auto minmax(260px, 1fr) auto auto;
    grid-template-areas:
        "header"
        "main"
        "footer"
        "explanation";
}
main {
    display: grid;
    justify-content: stretch;
    align-items: stretch;
    align-content: start;
    border: 1px solid rgba(0, 0, 0, 0.65);
    grid-area: main;
    grid-template-rows: auto auto;
    grid-template-columns: 1fr 1.5fr 1.5fr;
    grid-template-areas:
        "rocket-div rocket-div rocket-div"
        "time-effect div-1      div-2";
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
    font-family: 'Audiowide';
}
header {
    grid-area: header;
    height: auto;
    width: 100%;
    margin: 10px;
    box-sizing: border-box;
}
.control-panel {
    display: grid;
    width: 98%;
    min-height: 0;
    justify-content: flex-start;
    align-items: start;
    grid-template-columns: 45% 5.5% 45% 2.5%;
    grid-template-areas: "panel-1 . panel-2 .";
    background: rgba(43, 178, 245, 0.15);
    backdrop-filter: blur(1.5px);
    border: 2px solid rgba(140, 220, 255, 0.45);
    border-radius: 2px;
    box-sizing: border-box;
}
.panel-1 {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    grid-area: panel-1;
    padding: 0.5rem 0.75rem;
}
.panel-title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: #c8f3ff;
    text-shadow:
        0 0 6px rgba(120, 220, 255, 0.45),
        0 0 14px rgba(80, 180, 255, 0.28);
}
.panel-primary {
    display: inline-block;
    align-self: flex-start;
    padding: 0.28rem 0.55rem;
    border-bottom: 2px solid rgba(140, 220, 255, 0.5);
    background: rgba(8, 18, 32, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.panel-title.panel-primary {
    margin-bottom: 0.15rem;
}
.panel-2 {
    margin-left: 5vw;
    grid-area: panel-2;
    padding: 0.35rem 0;
}
.path-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0 0;
}
.path-row .control-label {
    margin-right: 0.35rem;
}
.panel-2 .path-btn {
    margin-left: 0;
}
.play-pause-button {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.15rem;
}
.play-pause-btn,
.reset-btn {
    padding: 0.34rem 0.68rem;
    border: 1px solid rgba(140, 220, 255, 0.45);
    border-radius: 7px;
    background: rgba(14, 30, 52, 0.55);
    color: #dff8ff;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 0 11px rgba(88, 188, 248, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform, scale 0.12s ease;
}
.play-pause-btn:hover,
.reset-btn:hover {
    border-color: rgba(190, 245, 255, 0.85);
    box-shadow:
        0 0 14px rgba(100, 198, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
    scale: 1.02;
}

.control-label {
    font-size: 20px;
    color: #c8f3ff;
    text-shadow:
        0 0 6px rgba(120, 220, 255, 0.45),
        0 0 14px rgba(80, 180, 255, 0.28),
        0 0 22px rgba(60, 150, 255, 0.12);
}
.accel-row {
    margin: 0 0 1rem 0;
}
.panel-2 .accel-btn {
    position: relative;
    overflow: hidden;
    padding: 0.42em 0.88em;
    margin-left: 0.8em;
    border: 1px solid rgba(140, 220, 255, 0.5);
    border-radius: 7px;
    color: #e8fcff;
    font-weight: 700;
    font-size: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    background:
        linear-gradient(
            128deg,
            rgba(130, 220, 255, 0.42) 0%,
            rgba(90, 185, 235, 0.55) 24%,
            rgba(200, 245, 255, 0.48) 48%,
            rgba(75, 165, 225, 0.52) 72%,
            rgba(160, 230, 255, 0.45) 100%
        );
    background-size: 220% 220%;
    box-shadow:
        0 0 14px rgba(90, 195, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    text-shadow: 0 1px 2px rgba(0, 40, 70, 0.45);
    transition:
        transform 0.14s ease,
        box-shadow 0.22s ease,
        border-color 0.2s ease,
        background-position 0.35s ease;
}
.panel-2 .accel-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: repeating-linear-gradient(
        108deg,
        transparent 0,
        transparent 3px,
        rgba(255, 255, 255, 0.07) 3px,
        rgba(255, 255, 255, 0.07) 4px
    );
    pointer-events: none;
    mix-blend-mode: overlay;
}
.panel-2 .accel-btn::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: linear-gradient(
        115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.22) 48%,
        transparent 62%
    );
    transform: translateX(-30%) rotate(8deg);
    pointer-events: none;
    opacity: 0.65;
}
.panel-2 .accel-btn:hover {
    background-position: 85% 45%;
    box-shadow:
        0 0 22px rgba(120, 215, 255, 0.55),
        0 0 36px rgba(70, 175, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
}
.panel-2 .accel-btn:hover::after {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.85);
    border-width: 2px;
    scale: 1.02;
}
.panel-2 .accel-btn:active {
    background-position: 35% 60%;
}
.panel-2 .accel-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(20, 50, 70, 0.6),
        0 0 0 4px rgba(140, 220, 255, 0.65),
        0 0 20px rgba(100, 200, 255, 0.4);
    border-width: 2px;
}
/* Selected control: path buttons + Linear/Instant (aria-pressed set in JS). */
.panel-2 .accel-btn[aria-pressed="true"] {
    border-color: rgba(190, 245, 255, 0.95);
    border-width: 2px;
    box-shadow:
        0 0 18px rgba(120, 215, 255, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(0.5px);
    scale: 1.02;
}
.speed-control {
    width: 100%;
    max-width: 320px;
}
.speed {
    width: 100%;
    height: 1.75rem;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.speed:focus {
    outline: none;
}
.speed:focus-visible {
    outline: 2px solid rgba(200, 160, 100, 0.65);
    outline-offset: 4px;
}
/* Wood plank track — WebKit */
.speed::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 5px;
    border: 2px solid #4a3218;
    box-shadow:
        inset 0 2px 4px rgba(255, 248, 235, 0.35),
        inset 0 -3px 8px rgba(35, 22, 10, 0.45),
        0 1px 3px rgba(0, 0, 0, 0.35);
    background:
        repeating-linear-gradient(
            90deg,
            rgba(45, 28, 14, 0.12) 0,
            rgba(45, 28, 14, 0.12) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(60, 38, 18, 0.08) 0,
            rgba(60, 38, 18, 0.08) 3px,
            transparent 3px,
            transparent 3px
        ),
        linear-gradient(
            90deg,
            #d4a574 0%,
            #b88956 35%,
            #8b5a2b 70%,
            #6b4423 100%
        );
}
.speed::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 22px;
    margin-top: -6px;
    border-radius: 4px;
    border: 2px solid #3d2812;
    box-shadow:
        inset 0 1px 0 rgba(255, 235, 210, 0.4),
        inset 0 -2px 5px rgba(30, 18, 8, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.35);
    background:
        linear-gradient(90deg, #7a4f28 0%, #5c381c 50%, #3d2612 100%);
}
.speed::-webkit-slider-thumb:hover {
    filter: brightness(1.08);
}
.speed::-webkit-slider-thumb:active {
    filter: brightness(0.92);
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.45),
        0 1px 2px rgba(0, 0, 0, 0.3);
}
/* Wood plank track — Firefox */
.speed::-moz-range-track {
    height: 14px;
    border-radius: 5px;
    border: 2px solid #4a3218;
    box-shadow:
        inset 0 2px 4px rgba(255, 248, 235, 0.35),
        inset 0 -3px 8px rgba(35, 22, 10, 0.45),
        0 1px 3px rgba(0, 0, 0, 0.35);
    background:
        repeating-linear-gradient(
            0deg,
            rgba(45, 28, 14, 0.12) 0,
            rgba(45, 28, 14, 0.12) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(60, 38, 18, 0.08) 0,
            rgba(60, 38, 18, 0.08) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(
            180deg,
            #d4a574 0%,
            #b88956 35%,
            #8b5a2b 70%,
            #6b4423 100%
        );
}
.speed::-moz-range-thumb {
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 22px;
    border: 2px solid #3d2812;
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255, 235, 210, 0.4),
        inset 0 -2px 5px rgba(30, 18, 8, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.35);
    background:
        linear-gradient(180deg, #7a4f28 0%, #5c381c 50%, #3d2612 100%);
}
.speed::-moz-range-thumb:hover {
    filter: brightness(1.08);
}
.speed::-moz-range-thumb:active {
    filter: brightness(0.92);
}
.line-length-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
    padding: 0 0 0.15rem;
    box-sizing: border-box;
}
.line-length-cap {
    flex: 0 0 auto;
    font-family: "Josefin Sans", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: rgba(200, 230, 255, 0.55);
    line-height: 1;
    user-select: none;
}
.line-length-arm {
    flex: 1;
    min-width: 0.75rem;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(
        90deg,
        rgba(140, 220, 255, 0.15),
        rgba(200, 235, 255, 0.55),
        rgba(140, 220, 255, 0.15)
    );
    box-shadow: 0 0 8px rgba(100, 200, 255, 0.25);
}
.path-length-text {
    flex: 0 1 auto;
    margin: 0;
    font-family: "Josefin Sans", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #c8f3ff;
    text-shadow:
        0 0 8px rgba(120, 220, 255, 0.4),
        0 0 16px rgba(80, 180, 255, 0.2);
    text-align: center;
    white-space: nowrap;
}
.rocket-div {
    display: flex;
    flex-direction: column;
    grid-area: rocket-div;
    align-self: stretch;
    justify-content: center;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
    padding: 0.35rem 0.75rem;
    margin-bottom: 0.6rem;
    box-sizing: border-box;
}
.speed-labels {
    display: flex;
    justify-content: space-between;
    width: 105%;
    color: #ffffff;
    font-family: 'dm serif text';
    font-size: 0.9rem;
}
.minkowski-norm {
    font-family: "DM Serif Text", serif;
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 214, 102, 0.95);
    text-shadow: 0 0 6px rgba(255, 200, 80, 0.3);
    margin-left: 0.5rem;
}
.time-effect {
    display: flex;
    flex-direction: column;
    grid-area: time-effect;
    padding: 0 0.5rem;
    margin: 0.5rem;
    border: 2px solid rgba(140, 220, 255, 0.5);
    border-radius: 2px;
    background: rgba(10, 90, 54, 0.42);
    backdrop-filter: blur(3px);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 0 24px rgba(60, 150, 255, 0.06);
    box-sizing: border-box;
}
.graph-card {
    position: relative;
    min-height: 9rem;
    padding: 0 0.5rem 1rem 1.25rem;
    margin: 0.5rem;
    border: 2px solid rgba(140, 220, 255, 0.5);
    border-radius: 2px;
    background: rgba(10, 90, 54, 0.42);
    backdrop-filter: blur(3px);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 0 24px rgba(60, 150, 255, 0.06);
    box-sizing: border-box;
}
.graph-card .graph-canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 120px;
    display: block;
    border: 1px dashed rgba(140, 220, 255, 0.28);
    border-radius: 1px;
    background: rgba(4, 12, 24, 0.55);
    box-sizing: border-box;
}
.axis-label {
    position: absolute;
    font-family: "Josefin Sans", sans-serif;
    font-size: 0.75rem;
    color: #c8f3ff;
    text-shadow: 0 0 8px rgba(120, 220, 255, 0.35);
    pointer-events: none;
}
.axis-ct {
    left: 0.2rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center center;
}
.axis-x {
    right: 0.55rem;
    bottom: 0.35rem;
}
.div-1 {
    grid-area: div-1;
}
.div-2 {
    grid-area: div-2;
}
.page-footer-hint {
    grid-area: footer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem 0.75rem;
    text-align: center;
    box-sizing: border-box;
}
.footer-scroll-text {
    margin: 0;
    max-width: 36rem;
    font-family: "DM Serif Text", serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: #e8fcff;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.25);
}
.footer-scroll-btn {
    --footer-scroll-grad: linear-gradient(180deg, rgba(0, 195, 255, 0.55) 0%, rgba(10, 21, 56, 0.55) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25rem;
    height: 2.5rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 2px;
    box-sizing: border-box;
    background:
        var(--footer-scroll-grad) padding-box,
        var(--footer-scroll-grad) border-box;
    background-clip: padding-box, border-box;
    background-origin: border-box;
    filter: sepia(20%) contrast(110%);
    backdrop-filter: blur(1px);
    cursor: pointer;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
}
.footer-scroll-btn:hover {
    box-shadow: 0 0 16px rgba(90, 195, 255, 0.45);
    filter: brightness(1.06);
}
.footer-scroll-btn:focus-visible {
    outline: 2px solid rgba(140, 220, 255, 0.75);
    outline-offset: 3px;
}
.chevron-down {
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: -0.5rem;
    border-right: 2.6px solid #c8f3ff;
    border-bottom: 2.6px solid #c8f3ff;
    transform: rotate(45deg) scaleX(1.5) scaleY(1.5);
}

#explanation{
    grid-area: explanation;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
}
.explanation-section {
    font-family: 'Share Tech';
    min-height: 40vh;
    padding: 1.5rem 1.25rem 3rem;
    margin: 0 10px 10px;
    border: 2px solid rgba(140, 220, 255, 0.4);
    border-radius: 2px;
    background: rgba(1, 21, 56, 0.65);
    box-sizing: border-box;
}
.explanation-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-center;
    justify-content: center;
    gap: 1rem 1.5rem;
    width: 100%;
    max-width: 48rem;
    margin-bottom: 0.5rem;
}
.explanation-heading {
    width: 100%;
    margin: 0;
    font-size: 1.35rem;
    color: #c8f3ff;
    text-shadow: 0 0 10px rgba(120, 220, 255, 0.35);
    flex: 1 1 auto;
    text-align: center;
}
.explanation-difficulty {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-width: min(100%, 16rem);
    padding-bottom: 1rem;
    border-bottom: 3px dotted rgba(10, 202, 255, 0.993);
    text-align: left;
}
.explanation-difficulty-label {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(200, 243, 255, 0.95);
}
.explanation-difficulty-select {
    font: inherit;
    font-size: 0.95rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(140, 220, 255, 0.45);
    background: rgba(1, 21, 56, 0.9);
    color: rgba(232, 252, 255, 0.95);
    cursor: pointer;
}
.explanation-difficulty-select:focus {
    outline: 2px solid rgba(140, 220, 255, 0.7);
    outline-offset: 2px;
}
.explanation-audience-hint {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: rgba(180, 210, 220, 0.88);
    font-style: italic;
}
.explanation-panel {
    width: 100%;
    max-width: min(100%, 75rem);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}
.explanation-panel[hidden] {
    display: none !important;
}
.explanation-lead-row {
    --explanation-side-w: clamp(13vw, 14vw, 15vw);
    display: grid;
    grid-template-columns: var(--explanation-side-w) 1fr var(--explanation-side-w);
    grid-template-areas: "sideL text sideR";
    column-gap: 1rem;
    row-gap: 0.75rem;
    align-items: start;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.explanation-side--left {
    grid-area: sideL;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}
.explanation-lead-row > .explanation-lead {
    grid-area: text;
    min-width: 0;
    max-width: 42rem;
    width: 100%;
    margin: 0;
    justify-self: center;
}
.explanation-side--right {
    grid-area: sideR;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}
.explanation-figure {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--explanation-side-w);
    border: 1px dashed rgba(140, 220, 255, 0.55);
    box-shadow: 0 0 12px rgba(100, 200, 255, 0.35);
    border-radius: 4px;
    background: rgba(0, 24, 58, 0.55);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.explanation-figure img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}
.explanation-figure:not(:has(img)) {
    display: none;
}
.explanation-lead {
    margin: 0;
    max-width: 42rem;
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(232, 252, 255, 0.92);
    font-weight: 400;
}
.explanation-lead-row.explanation-lead-spaced {
    margin-top: 1rem;
}
.explanation-lead-row.explanation-lead-spaced-tight {
    margin-top: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px dotted rgba(10, 202, 255, 0.993);
}