:root {
    --bg: #06080d;
    --panel: rgba(17, 22, 32, .92);
    --panel-2: #111722;
    --line: rgba(121, 218, 255, .2);
    --cyan: #34d9ff;
    --blue: #2875ff;
    --text: #f4f7fb;
    --muted: #9daabd;
    --beige: #c9c1ad;
    --beige-dark: #8d8676;
    --danger: #ff5c66;
}

* { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 80% 10%, rgba(40, 117, 255, .18), transparent 30rem),
        radial-gradient(circle at 10% 35%, rgba(52, 217, 255, .1), transparent 28rem),
        linear-gradient(145deg, #05070b, #0a0f19 55%, #080b11);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .3;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

a { color: var(--cyan); }
button, input, select { font: inherit; }

.site-shell { width: min(1500px, calc(100% - 32px)); margin: 0 auto; position: relative; }

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 34px 0 22px;
}

.brand { display: flex; align-items: center; gap: 15px; }
.brand-mark {
    width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    background: #05070a; border: 2px solid var(--cyan);
    box-shadow: 0 0 0 5px rgba(52,217,255,.1), 0 0 30px rgba(52,217,255,.25);
    overflow: hidden; padding: 5px;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand h1 { margin: 0; font-size: clamp(24px, 3vw, 42px); letter-spacing: -.04em; line-height: 1; }
.brand p { margin: 6px 0 0; color: var(--muted); }
.live-chip { padding: 8px 13px; border: 1px solid rgba(52,217,255,.35); border-radius: 999px; color: var(--cyan); background: rgba(52,217,255,.08); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.live-chip::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #45ee92; box-shadow: 0 0 12px #45ee92; }

.emulator-grid { display: grid; grid-template-columns: minmax(330px, .82fr) minmax(620px, 1.6fr); gap: 22px; align-items: start; }
.control-panel {
    background: linear-gradient(155deg, rgba(23,30,44,.97), rgba(10,14,22,.97));
    border: 1px solid var(--line); border-radius: 24px; padding: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.05);
}
.panel-kicker { margin: 0; color: var(--cyan); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .16em; }
#boot_options h4 { font-size: 22px; margin: 4px 0 18px; }
.os-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.os-item { display: contents; }
#boot_options input[type="button"] {
    min-height: 50px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 13px;
    color: #eef5ff; text-align: left; font-weight: 720; cursor: pointer;
    background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
    transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
#boot_options input[type="button"]:hover { transform: translateY(-2px); border-color: var(--cyan); background: rgba(52,217,255,.1); box-shadow: 0 8px 25px rgba(40,117,255,.15); }
#boot_options input[type="button"].is-selected { border-color: var(--cyan); color: #fff; background: linear-gradient(135deg, rgba(52,217,255,.24), rgba(40,117,255,.2)); box-shadow: 0 0 0 2px rgba(52,217,255,.12), 0 10px 28px rgba(40,117,255,.24); }
.os-note { display: none; }
.setup-title { margin: 24px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 18px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
input[type="file"], input[type="number"], select { width: 100%; min-width: 0; padding: 10px; color: var(--text); background: #090d15; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; }
.privacy-note { margin: 12px 0; color: var(--muted); font-size: 12px; }
#start_emulation { width: 100%; border: 0; border-radius: 13px; padding: 14px 18px; color: #00131a; font-weight: 900; cursor: pointer; background: linear-gradient(100deg, var(--cyan), #75f0ff 45%, #4d91ff); box-shadow: 0 10px 30px rgba(52,217,255,.2); }

.computer-stage { position: sticky; top: 18px; min-height: 650px; padding: 30px 24px 72px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: radial-gradient(circle at 48% 45%, #202837 0, #10151f 45%, #080b11 72%); box-shadow: 0 24px 80px rgba(0,0,0,.42); }
.computer-stage::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 38px; height: 35px; border-radius: 50%; background: rgba(0,0,0,.72); filter: blur(18px); }
.hardware { display: grid; grid-template-columns: minmax(470px, 1fr) 150px; align-items: end; justify-content: center; gap: 18px; position: relative; z-index: 1; }
.crt-monitor { position: relative; width: 100%; max-width: 780px; margin: 30px auto 0; padding: 28px 28px 66px; border: 4px solid #756f62; border-radius: 42px 42px 30px 30px; background: linear-gradient(145deg, #ddd5c1, #a79f8c 55%, #c9c1ad); box-shadow: inset 4px 5px 7px rgba(255,255,255,.45), inset -9px -9px 15px rgba(65,58,48,.35), 0 28px 50px rgba(0,0,0,.45); }
.crt-screen { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 15px solid #252622; border-radius: 4px; background: #01050a; box-shadow: 0 0 0 3px #716c61; filter: none; }
.crt-screen::after { display: none; content: none; }
.screen-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #76e9ff; background: radial-gradient(circle, rgba(35,91,115,.38), #01050a 68%); }
.screen-placeholder.show-start-message { z-index: 30; }
.screen-placeholder strong { display: block; font: 800 clamp(20px,3vw,38px)/1.1 "Courier New", monospace; text-shadow: 0 0 18px rgba(52,217,255,.65); }
.screen-placeholder span { color: #8ba0ae; font: 13px "Courier New", monospace; }
#screen_container { position: absolute; inset: 0; z-index: 5; overflow: auto; margin: 0; border: 0; background: #fff; filter: none; opacity: 1; }
#screen, #vga { transform-origin: top left; }
#vga { display: block; max-width: none; background: #fff; filter: none; opacity: 1; }
body:not(.emulator-started) #screen_container,
body:not(.emulator-started) #screen,
body:not(.emulator-started) #vga { background: #01050a !important; }
.monitor-controls { position: absolute; left: 32px; right: 32px; bottom: 19px; display: flex; justify-content: flex-end; align-items: center; gap: 9px; }
.monitor-logo { margin-right: auto; color: #575449; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.monitor-button { width: 11px; height: 11px; border-radius: 50%; background: #797363; box-shadow: inset 1px 1px 2px rgba(0,0,0,.5); }
.monitor-led { background: #42e78d; box-shadow: 0 0 9px #42e78d; }
.monitor-neck { width: 25%; height: 40px; margin: -2px auto 0; background: linear-gradient(90deg,#99917f,#d1c9b5,#8c8574); }
.monitor-base { width: 54%; height: 20px; margin: 0 auto; border-radius: 50% 50% 9px 9px; background: linear-gradient(#c9c1ad,#8a8373); box-shadow: 0 8px 12px rgba(0,0,0,.35); }
.tower { position: relative; width: 145px; height: 430px; padding: 26px 16px; border: 3px solid #777061; border-radius: 8px 8px 14px 14px; background: linear-gradient(100deg,#9c9584,#d5cdb9 48%,#a49c89); box-shadow: inset 4px 3px rgba(255,255,255,.3), inset -8px -5px 13px rgba(55,50,43,.24), 14px 24px 35px rgba(0,0,0,.4); }
.tower-badge { color: #4c493f; font-size: 20px; font-weight: 950; font-style: italic; }
.drive { height: 30px; margin-top: 24px; border: 2px solid #777164; background: #282a27; box-shadow: inset 0 8px #111; }
.floppy { height: 48px; margin-top: 14px; border: 2px solid #817a6a; background: #aca591; }
.floppy::after { content: ""; display:block; width: 70%; height: 7px; margin: 18px auto; background: #343532; border-radius: 5px; }
.turbo { margin-top: 32px; padding: 7px; color: #e95d55; background: #191b19; text-align: center; font: 800 22px "Courier New",monospace; }
.tower-power { width: 28px; height: 28px; margin: 28px auto 0; border: 3px solid #777164; border-radius: 50%; background: #bdb5a1; }
.tower-power::after { content:""; display:block; width:6px; height:6px; margin:8px auto; border-radius:50%; background:#43ec92; box-shadow:0 0 8px #43ec92; }
.stage-label { position: absolute; left: 24px; bottom: 18px; z-index: 2; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

#runtime_options { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(8,12,19,.9); }
#runtime_options input[type="button"], #back_to_selection { margin: 4px; padding: 8px 11px; color: var(--text); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: #17202e; cursor: pointer; }
#back_to_selection { border-color: rgba(52,217,255,.35); color: var(--cyan); }
#runtime_infos, #filesystem_panel, #serial { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; color: #b9eaff; background: #03070b; font-family: "Courier New",monospace; }
#runtime_infos, #filesystem_panel { float: none; width: auto; }
.footer { margin: 30px 0; padding: 18px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); }
.footer a { text-decoration: none; }
.phone_keyboard { position: absolute; left: -9999px; width: 0; height: 0; opacity: 0; }
#setup_error { padding: 10px; border-radius: 10px; color: #fff; background: rgba(255,92,102,.18); border: 1px solid rgba(255,92,102,.35); }
#loading { --load-progress:0%; position:relative; overflow:hidden; margin:14px 0 0; padding:12px 14px 19px; border:1px solid rgba(52,217,255,.32); border-radius:10px; color:var(--cyan); background:rgba(52,217,255,.07); font:800 16px/1.2 Inter,system-ui,sans-serif; text-align:center; white-space:normal; }
#loading::before { content:""; position:absolute; left:12px; right:12px; bottom:7px; height:4px; border-radius:99px; background:rgba(255,255,255,.1); }
#loading::after { content:""; position:absolute; left:12px; bottom:7px; width:var(--load-progress); max-width:calc(100% - 24px); height:4px; border-radius:99px; background:linear-gradient(90deg,var(--blue),var(--cyan)); box-shadow:0 0 10px rgba(52,217,255,.7); transition:width .25s ease; }

@media (max-width: 1100px) {
    .emulator-grid { grid-template-columns: 1fr; }
    .computer-stage { position: relative; top: auto; min-height: 0; order: -1; }
}
@media (max-width: 700px) {
    .site-shell { width: min(100% - 18px, 1500px); }
    .hero { align-items: flex-start; padding-top: 20px; }
    .brand p, .live-chip { display: none; }
    .emulator-grid { gap: 12px; }
    .control-panel { padding: 16px; border-radius: 18px; }
    .os-list { grid-template-columns: 1fr; }
    .computer-stage { padding: 12px 8px 62px; border-radius: 18px; }
    .stage-label { left: 12px; bottom: 5px; font-size: 10px; }
    .hardware { grid-template-columns: minmax(0, 1fr) 80px; gap: 6px; }
    .crt-monitor { margin-top: 12px; padding: 12px 12px 37px; border-width: 2px; border-radius: 20px 20px 14px 14px; }
    .crt-screen { border-width: 7px; }
    .monitor-controls { left: 15px; right: 15px; bottom: 10px; }
    .monitor-logo { font-size: 7px; }
    .monitor-button { width: 6px; height: 6px; }
    .monitor-neck { height: 19px; }
    .monitor-base { height: 10px; }
    .tower { width: 78px; height: 250px; padding: 13px 8px; border-width: 2px; }
    .tower-badge { font-size: 10px; }
    .drive { height: 15px; margin-top: 14px; }
    .floppy { height: 24px; margin-top: 8px; }
    .floppy::after { height: 3px; margin-top: 8px; }
    .turbo { margin-top: 15px; padding: 3px; font-size: 11px; }
    .tower-power { width: 16px; height: 16px; margin-top: 15px; border-width: 2px; }
    .tower-power::after { width: 4px; height: 4px; margin: 4px auto; }
    .setup-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
}
