@font-face {
    font-family: "ATDT VGA";
    src: url("/assets/fonts/Web437_IBM_VGA_8x16.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body.dosbbs-modem-active {
    overflow: hidden !important;
}

#dosbbs-modem-overlay {
    --dosbbs-green: #58ff79;
    --dosbbs-amber: #ffd25a;
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    overflow: hidden;
    background: #000;
    color: #cfcfcf;
    font-family: "ATDT VGA", monospace;
    image-rendering: pixelated;
    opacity: 0;
    visibility: hidden;
    transition: opacity 480ms ease, visibility 0s linear 480ms;
}

#dosbbs-modem-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,.018) 0,
        rgba(255,255,255,.018) 1px,
        transparent 1px,
        transparent 4px
    );
    opacity: .32;
}

#dosbbs-modem-overlay.dosbbs-modem-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 480ms ease;
}

.dosbbs-modem-content {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(.992);
    transition: opacity 260ms ease, transform 260ms ease;
}

#dosbbs-modem-overlay.dosbbs-modem-show .dosbbs-modem-content {
    opacity: 1;
    transform: scale(1);
}

.dosbbs-modem-status {
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 3;
    min-height: 3.2em;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.35;
    white-space: pre;
    color: #dcdcdc;
    text-shadow: 0 0 5px rgba(255,255,255,.10);
}

.dosbbs-modem-cursor {
    display: none;
    margin-left: 1px;
}

.dosbbs-modem-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 72px 20px 24px;
}

.dosbbs-modem-stack {
    width: min(920px, 96vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.dosbbs-modem-shell {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 12px 14px 16px;
    border: 1px solid #3e3e3e;
    background: linear-gradient(180deg, #0b0b0b 0%, #050505 100%);
    box-shadow: inset 0 0 0 1px #151515, 0 14px 38px rgba(0,0,0,.72);
}

.dosbbs-ice-modem {
    width: min(800px, 100%);
    position: relative;
    overflow: hidden;
    border-left: 4px solid #57a8ff;
    border-right: 4px solid #57a8ff;
    border-top: 8px solid #2d58c6;
    border-bottom: 7px solid #9fd8ff;
    background: #05070b;
    box-shadow:
        inset 0 0 0 1px #163d7b,
        inset 0 -8px 0 rgba(45,88,198,.16),
        0 0 10px rgba(87,168,255,.10);
    padding: 8px 18px 10px;
}

.dosbbs-ice-modem::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(to right, rgba(87,168,255,.08) 0 9px, transparent 9px 10px),
        repeating-linear-gradient(to bottom, rgba(255,255,255,.015) 0 1px, transparent 1px 4px);
    mix-blend-mode: screen;
    opacity: .24;
}

.dosbbs-ice-title,
.dosbbs-ice-subtitle,
.dosbbs-ice-info-row,
.dosbbs-led-panel,
.dosbbs-ice-bottom,
.dosbbs-ice-rule {
    position: relative;
    z-index: 1;
}

.dosbbs-ice-title {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    color: #f0f0f0;
    font-size: clamp(12px, 1.65vw, 16px);
    line-height: 1;
    text-align: center;
}

.dosbbs-ice-title .dosbbs-brand { color: #f2f2f2; }
.dosbbs-ice-title .dosbbs-model { color: #ffe36e; }
.dosbbs-ice-title .dosbbs-type { color: #bdbdbd; }

.dosbbs-ice-subtitle {
    margin-top: 3px;
    text-align: center;
    color: #bdbdbd;
    font-size: clamp(11px, 1.45vw, 14px);
    line-height: 1;
}

.dosbbs-ice-subtitle .dosbbs-proto { color: #ffbf55; }
.dosbbs-ice-subtitle .dosbbs-speed { color: #f2f2f2; }

.dosbbs-ice-rule {
    height: 10px;
    margin: 7px 0 5px;
    color: #2d58c6;
    overflow: hidden;
    white-space: nowrap;
    line-height: 10px;
}

.dosbbs-ice-rule::before {
    content: "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓";
}

.dosbbs-ice-info-row {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 18px;
    width: min(520px, 86%);
    margin: 0 auto 12px;
}

.dosbbs-ice-window {
    min-width: 0;
    border: 2px double #57a8ff;
    background: #02050a;
    padding: 7px 8px 6px;
    text-align: center;
    line-height: 1;
    box-shadow: inset 0 0 0 1px #163d7b;
    color: #f2f2f2;
    font-size: clamp(11px, 1.4vw, 14px);
}

.dosbbs-ice-window.dosbbs-ready { color: #7dff98; }

.dosbbs-led-panel {
    width: min(650px, calc(100% - 56px));
    margin: 0 auto 11px;
    padding: 12px 18px 9px;
    border: 2px solid #2d58c6;
    background: linear-gradient(180deg, #07101d 0%, #02050a 100%);
    box-shadow: inset 0 0 0 1px #0d2347, inset 0 6px 16px rgba(0,0,0,.55);
}

.dosbbs-led-panel::before {
    content: "STATUS INDICATORS";
    position: absolute;
    top: -0.7em;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 .8em;
    background: #05070b;
    color: #57a8ff;
    font-size: clamp(8px, 1vw, 11px);
    letter-spacing: .10em;
    white-space: nowrap;
}

.dosbbs-led-bank {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.dosbbs-led {
    min-width: 0;
    text-align: center;
    color: #5d5d5d;
    font-size: clamp(9px, 1.25vw, 12px);
}

.dosbbs-led-dot {
    display: block;
    width: 8px;
    height: 8px;
    margin: 4px auto 0;
    border-radius: 50%;
    background: #111;
    border: 1px solid #373737;
}

.dosbbs-led.dosbbs-on { color: #d9d9d9; }
.dosbbs-led.dosbbs-on .dosbbs-led-dot {
    background: var(--dosbbs-green);
    border-color: #bdffcb;
    box-shadow: 0 0 7px rgba(88,255,121,.88);
}

.dosbbs-led.dosbbs-amber.dosbbs-on .dosbbs-led-dot {
    background: var(--dosbbs-amber);
    border-color: #fff1a7;
    box-shadow: 0 0 7px rgba(255,210,90,.88);
}

.dosbbs-ice-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    width: min(650px, calc(100% - 56px));
    margin: 0 auto;
    color: #747474;
    font-size: clamp(10px, 1.2vw, 12px);
    line-height: 1;
}

.dosbbs-ice-vents {
    height: 10px;
    min-width: 0;
    overflow: hidden;
    color: #6d6d6d;
    white-space: nowrap;
}

.dosbbs-ice-vents::before {
    content: "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░";
}

.dosbbs-ice-feet {
    width: min(610px, 82%);
    height: 7px;
    margin: 8px auto -17px;
    position: relative;
    z-index: 1;
}

.dosbbs-ice-feet::before,
.dosbbs-ice-feet::after {
    content: "";
    position: absolute;
    top: 0;
    width: 120px;
    height: 7px;
    background: #6d6d6d;
    border: 1px solid #303030;
}

.dosbbs-ice-feet::before { left: 30px; }
.dosbbs-ice-feet::after { right: 30px; }

.dosbbs-modem-state {
    min-height: 1.2em;
    color: #666;
    font-size: clamp(10px, 1.35vw, 13px);
    letter-spacing: .06em;
    text-align: center;
}

@media (max-width: 620px) {
    .dosbbs-modem-status { top: 12px; left: 12px; }
    .dosbbs-modem-stage { padding: 72px 8px 16px; }
    .dosbbs-modem-shell { padding: 8px 6px 12px; }
    .dosbbs-ice-modem { padding: 7px 8px 9px; border-left-width: 3px; border-right-width: 3px; }
    .dosbbs-ice-title { gap: 7px; }
    .dosbbs-ice-info-row { width: 94%; gap: 7px; }
    .dosbbs-led-panel { width: calc(100% - 16px); padding: 10px 7px 7px; }
    .dosbbs-led-bank { gap: 2px; }
    .dosbbs-led-dot { width: 7px; height: 7px; }
    .dosbbs-ice-bottom { width: calc(100% - 16px); gap: 6px; }
    .dosbbs-ice-feet { width: 88%; }
    .dosbbs-ice-feet::before,
    .dosbbs-ice-feet::after { width: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    #dosbbs-modem-overlay,
    .dosbbs-modem-content {
        transition-duration: 1ms;
    }
}
