/* ============================================================
   E1MAGIC.RU — DOS THEME
   Чёрный экран, моноширинный шрифт, фосфорное свечение,
   сканлайны ЭЛТ, цвета палитры VGA 437.
   ============================================================ */

html, body {
    margin: 0;
    padding: 0;
    background: #000;
}

body {
    font-family: "Courier New", "Lucida Console", Consolas, monospace;
    font-size: 15px;
    line-height: 1.5;
    color: #e9e9e9;
    background-color: #000;
    min-height: 100vh;
    text-shadow: 0 0 2px rgba(233, 233, 233, 0.15);
}

/* ---------- CRT: виньетка ---------- */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
        transparent 55%,
        rgba(0, 0, 0, 0.4) 100%);
}

/* ---------- фоновая «змейка»: за всем контентом, ненавязчиво ---------- */
#dos-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    image-rendering: pixelated;
}

/* контент поверх фона */
.dos-banner, main {
    position: relative;
    z-index: 1;
}

/* ---------- табло счёта трёх змей (HUD) ---------- */
#dos-score {
    display: none;
    position: fixed;
    bottom: 16px; right: 16px;
    z-index: 9998;
    font-family: "Courier New", "Lucida Console", monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #e9e9e9;
    background: rgba(0, 14, 6, 0.78);
    border: 1px solid #1f8b3a;
    box-shadow: 0 0 10px rgba(51, 255, 102, 0.28), inset 0 0 12px rgba(0, 0, 0, 0.6);
    padding: 6px 11px 8px;
    min-width: 82px;
    pointer-events: none;
}
#dos-score .dos-score-title {
    color: #fff;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    border-bottom: 1px solid #1f8b3a;
    padding-bottom: 3px;
    margin-bottom: 5px;
}
#dos-score .dos-score-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
#dos-score .sc-dot {
    width: 9px; height: 9px;
    display: inline-block;
    flex: none;
    box-shadow: 0 0 6px currentColor;
}
#dos-score b { font-weight: bold; min-width: 3ch; }
@media screen and (min-width: 1180px) {
    #dos-score { display: block; }
}

/* ---------- выделение текста как в DOS ---------- */
::selection {
    background: #00ffff;
    color: #000;
}

/* ---------- скроллбары ---------- */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #000; border-left: 1px solid #333; }
::-webkit-scrollbar-thumb { background: #777; border: 3px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #00ffff; }

/* ---------- ссылки: голубой, при наведении инверсия ---------- */
a {
    color: #33ffff;
    font-weight: bold;
    text-decoration: none;
    transition: none;
}
a:hover {
    background: #00ffff;
    color: #000;
}

@keyframes dos-blink {
    50% { opacity: 0.1; }
}

/* ============================================================
   ЭКРАН ЗАГРУЗКИ (BIOS POST + DOS prompt)
   ============================================================ */
#dos-boot {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10002;
    background: #000;
    color: #33ff66;
    font-family: "Courier New", "Lucida Console", monospace;
    font-size: 15px;
    line-height: 1.5;
    padding: 24px;
    overflow: auto;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.45);
    transition: opacity 0.7s ease;
}
#dos-boot.done {
    opacity: 0;
    pointer-events: none;
}
#dos-boot-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.dos-boot-bottom {
    position: absolute;
    left: 24px;
    bottom: 14px;
}
.dos-skip {
    opacity: 0.6;
    animation: dos-blink 1.2s steps(1) infinite;
}
.dos-romid {
    font-size: 13px;
    opacity: 0.5;
    margin-top: 3px;
}
.dos-sound {
    position: absolute;
    right: 16px;
    bottom: 14px;
    font-size: 13px;
    opacity: 0.5;
}

/* ============================================================
   ЭКРАН ЗАГРУЗКИ ПРИ ПЕРЕХОДАХ МЕЖДУ СТРАНИЦАМИ
   ============================================================ */
#dos-load {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.175s ease;
}
#dos-load.done {
    opacity: 0;
    pointer-events: none;
}
#dos-load-text {
    margin: 0;
    color: #33ff66;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.45);
}

/* ---------- "включение" ЭЛТ при появлении сайта ---------- */
body.booted main {
    animation: crt-on 0.225s ease-out;
}
@keyframes crt-on {
    0%   { transform: scaleY(0.02) scaleX(0.7); filter: brightness(3); opacity: 0.4; }
    60%  { transform: scaleY(1.02) scaleX(1);   filter: brightness(1.6); }
    100% { transform: scale(1);                 filter: brightness(1); opacity: 1; }
}

/* ============================================================
   МЕНЮ (панель как в DOS-программе)
   ============================================================ */
.dos-menu {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: #000;
    border-bottom: 2px solid #e9e9e9;
}
.dos-menu > a,
.dos-dropdown > a {
    color: #e9e9e9;
    padding: 4px 12px;
    font-weight: bold;
}
.dos-menu > a:hover,
.dos-dropdown > a:hover {
    background: #00ffff;
    color: #000;
}

.dos-dropdown { position: relative; }
.dos-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 340px;
    background: #e9e9e9;
    color: #000;
    border: 1px solid #000;
    box-shadow: 4px 4px 0 #555;
    z-index: 10003;
}
.dos-dropdown:hover .dos-dropdown-menu,
.dos-dropdown.open .dos-dropdown-menu {
    display: block;
}
.dos-dropdown-menu a {
    display: block;
    color: #000;
    font-weight: normal;
    padding: 5px 14px;
    border-bottom: 1px solid #999;
    white-space: nowrap;
}
.dos-dropdown-menu a:last-child { border-bottom: 0; }
.dos-dropdown-menu a:hover {
    background: #00ffff;
    color: #000;
}

/* ============================================================
   ШАПКА И КОНТЕНТ
   ============================================================ */
.dos-banner {
    max-width: 1000px;
    margin: 58px auto 14px;
    padding: 8px 10px;
    border: double 4px #00ffff;
    color: #00ffff;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}

main {
    max-width: 1000px;
    margin: 0 auto 90px;
    padding: 14px 18px 30px;
    text-align: left;
}

h1, h2, h3, h4, h5 {
    color: #fff;
    margin: 22px 0 10px;
    font-weight: bold;
}
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 17px; }
h4, h5 { font-size: 16px; }
h1::before { content: "## "; color: #00ffff; }
h5::before { content: "■ "; color: #00ffff; }

/* ---------- списки как в README ---------- */
ul, ol {
    padding-left: 1.2em;
    margin: 8px 0;
}
li {
    display: block;
    margin: 3px 0;
    padding-left: 2ch;
    position: relative;
}
li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: #00ffff;
}

/* ---------- картинки ---------- */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 1px solid #444;
    padding: 2px;
    background: #000;
}

/* ---------- единый размер картинок в контенте ----------
   Все фото/превью одной шириной, по центру. !important гасит
   разрозненные inline width (512/520/960px/60%) в страницах. */
main img {
    width: 440px !important;
    max-width: 100%;
    height: auto;
}

/* ---------- видео: по центру, каждое на своей строке ---------- */
main video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px auto;
}

/* ---------- зум по клику (как было) ---------- */
.scale { display: inline-block; }
main .scale {
    display: block;
    width: fit-content;
    margin: 12px auto;
}
.scale img {
    transition: transform 1s;
    display: block;
}
.scale img:hover { cursor: zoom-in; }
.scale img:active { transform: scale(1.5); }

/* ---------- таблицы ---------- */
table {
    border-collapse: collapse;
    margin: 10px auto;
}
td, th {
    border: 1px solid #888;
    padding: 3px 8px;
}
th {
    background: #222;
    color: #00ffff;
}
tr:nth-child(even) td { background: #111; }

/* ---------- разделители ---------- */
hr {
    border: 0;
    border-top: 1px dashed #888;
    margin: 14px 0;
}

/* ============================================================
   СТАТУС-БАР (как в командной строке)
   ============================================================ */
.dos-status {
    margin-top: 50px;
    padding-top: 10px;
    border-top: 2px solid #e9e9e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #999;
}
.dos-status .ready {
    color: #33ff66;
    font-weight: bold;
}
.dos-cursor {
    display: inline-block;
    color: #e9e9e9;
    animation: dos-blink 1s steps(1) infinite;
}

/* ============================================================
   МОБИЛЬНЫЕ
   ============================================================ */
@media screen and (max-width: 700px) {
    body { font-size: 13px; }
    .dos-menu {
        position: static;
    }
    .dos-banner {
        margin-top: 12px;
        letter-spacing: 0;
        font-size: 12px;
    }
    .dos-dropdown-menu { min-width: 260px; }
    h1 { font-size: 18px; }
    h5 { font-size: 14px; }
}
