/* ==========================================================================
   skins/rail.css — the departure board. Amber on black, split-flap cells.
   ========================================================================== */

[data-skin=rail] {
    --board-bg: #0a0a0a;
    --board-cell: #161616;
    --board-ink: #ffb62e;
    --board-dim: #8a6520;
    --chart-line: #ffb62e;
}

.hero--rail {
    max-width: 540px;
    align-items: stretch;
}

.board {
    width: 100%;
    padding: 14px 16px 16px;
    border-radius: 8px;
    background: var(--board-bg);
    border: 1px solid #262626;
    box-shadow: inset 0 0 40px rgba(255, 182, 46, .05), var(--shadow-1);
    font-family: var(--font-mono);
    color: var(--board-ink);
}

.board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--board-dim);
    padding-bottom: 10px;
    border-bottom: 1px solid #262626;
}

.board-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-head span:last-child {
    letter-spacing: .06em;
    flex-shrink: 0;
}

.board-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 0 12px;
}

.board-cap,
.board-unit {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .16em;
    color: var(--board-dim);
    white-space: nowrap;
}

.board-digits {
    display: flex;
    gap: 5px;
}

/* ---------------- split-flap cells ---------------- */
.flap {
    display: block;
    width: clamp(38px, 12vw, 56px);
    height: clamp(54px, 17vw, 78px);
    border-radius: 4px;
    background: var(--board-cell);
    overflow: hidden;
    /* The seam across the middle is what makes it read as a flap rather than
       a box with a number in it. */
    box-shadow: inset 0 -1px 0 #000, inset 0 1px 0 #2a2a2a;
}

.flap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #000;
    z-index: 2;
}

.flap-char {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: clamp(2.1rem, 9vw, 3.1rem);
    font-weight: 700;
    line-height: 1;
    font-feature-settings: "tnum";
    color: var(--board-ink);
}

.flap.flip .flap-char {
    animation: flapDrop .22s cubic-bezier(.4, 0, .2, 1);
}

@keyframes flapDrop {
    0% {
        transform: rotateX(-72deg);
        opacity: .35;
    }

    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flap.flip .flap-char {
        animation: none;
    }
}

/* ---------------- figures ---------------- */
.board-split {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #262626;
}

.board-cell {
    text-align: center;
    min-width: 0;
}

.board-cell .k {
    display: block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--board-dim);
    margin-bottom: 3px;
}

.board-cell .v {
    display: block;
    font-size: 1.0625rem;
    font-weight: 700;
    font-feature-settings: "tnum";
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------- class band ---------------- */
.board-class {
    height: 26px;
    margin-top: 12px;
    border-radius: 4px;
    background: #161616;
    overflow: hidden;
}

.board-class-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: linear-gradient(90deg, #4a3510, #ffb62e);
    transition: width .3s linear;
}

.board-class-fill[data-class=veryfast],
.board-class-fill[data-class=fast] {
    background: linear-gradient(90deg, #4a1010, #ff5c5c);
}

.board-class-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #fff;
    mix-blend-mode: difference;
}

/* ---------------- the page around it ---------------- */
[data-skin=rail] .stat {
    background: #101010;
    border: 1px solid #262626;
    box-shadow: none;
}

[data-skin=rail] .stat .k {
    color: var(--board-dim);
}

[data-skin=rail] .stat .v {
    color: var(--board-ink);
    font-weight: 700;
}

[data-skin=rail] .stat .v .u {
    color: var(--board-dim);
}

[data-skin=rail] .card {
    background: #101010;
    border: 1px solid #262626;
    box-shadow: none;
}

[data-skin=rail] .card-title {
    color: var(--board-dim);
}

[data-skin=rail] .bar-wrap {
    background: #262626;
}

[data-skin=rail] .bar {
    background: var(--board-ink);
}
