/* Check OS type (check_os_type) — стили. Токены инструмента поверх темы сайта
   (assets/css/theme.css). Префикс .ostype (короткие классы конфликтуют с Bootstrap — урок voice_recorder).
   Семейство карточек — как у my_hostname/resolution; большой зелёный ответ — наследие legacy. */

.ostype {
    --ostype-w: 800px;
    --ostype-surface: var(--tls-surface);
    --ostype-border:  var(--tls-border);
    --ostype-muted:   var(--tls-text-muted);
    --ostype-green:   #5eac38;             /* большой ответ — зелёный legacy (как my_hostname) */
    --ostype-warn:    #b3771d;
    /* «тёмный кремний»: плата и чип героя */
    --ostype-board-1:   #101d2c;           /* плата: градиент, верх */
    --ostype-board-2:   #0b1420;           /* плата: градиент, низ */
    --ostype-chip-1:    #1d2937;           /* корпус чипа */
    --ostype-chip-2:    #131c28;
    --ostype-chip-edge: #2e405a;
    --ostype-pin:       #8fa3b8;           /* ножки */
    --ostype-glow-64:   #7dff9a;           /* свечение: зелёный */
    --ostype-glow-32:   #ffb562;           /* тёплый янтарь */
    --ostype-glow-unk:  #ffc46b;           /* «не знаю» */
    --ostype-dim:       #93a7bd;           /* приглушённый текст на плате */
    --ostype-bits-fz: clamp(3rem, 12vw, 5.2rem);
    --ostype-pad: 20px;
    --ostype-gap: 12px;
    max-width: var(--ostype-w);
    margin: 0 auto;
}


/* =====================================================================
   Карточки (общий вид)
   ===================================================================== */
.ostype__card {
    background: var(--ostype-surface);
    border: 1px solid var(--ostype-border);
    border-radius: var(--tls-radius);
    box-shadow: var(--tls-shadow);
    padding: var(--ostype-pad);
    min-width: 0;
}

/* =====================================================================
   Герой: большой ответ
   ===================================================================== */
.ostype__hero {
    text-align: center;
    position: relative;
    overflow: hidden;
    border-color: #223146;
    background:
        radial-gradient(circle at 16% 18%, rgba(96, 150, 255, .10), transparent 42%),
        radial-gradient(circle at 84% 82%, rgba(96, 255, 170, .07), transparent 40%),
        linear-gradient(160deg, var(--ostype-board-1), var(--ostype-board-2) 65%);
}
/* дорожки платы: тонкая сетка */
.ostype__hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(122, 164, 255, .06) 0 1px, transparent 1px 54px),
        repeating-linear-gradient(90deg, rgba(122, 164, 255, .06) 0 1px, transparent 1px 54px);
}
.ostype__hero > * { position: relative; }

.ostype__head {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.ostype__hero .ostype__label { color: var(--ostype-dim); }
.ostype__label {
    font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ostype-muted);
}

.ostype__report-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1px solid #33475f; background: rgba(255, 255, 255, .04); border-radius: 8px;
    padding: .25rem .6rem; font-size: .8rem; color: #9fc0ff; cursor: pointer;
    white-space: nowrap;
}
.ostype__report-btn:hover { border-color: #9fc0ff; }
.ostype__report-btn:focus { outline: none; }

.ostype__answer { margin-top: .9rem; }

.ostype__chipwrap { position: relative; display: inline-block; margin: 6px 14px 10px; max-width: calc(100% - 28px); }

/* ножки корпуса */
.ostype__pins { position: absolute; pointer-events: none; }
.ostype__pins--top, .ostype__pins--bottom {
    left: 16px; right: 16px; height: 7px;
    background: repeating-linear-gradient(90deg, var(--ostype-pin) 0 7px, transparent 7px 19px);
}
.ostype__pins--top { top: -7px; }
.ostype__pins--bottom { bottom: -7px; }
.ostype__pins--left, .ostype__pins--right {
    top: 16px; bottom: 16px; width: 7px;
    background: repeating-linear-gradient(0deg, var(--ostype-pin) 0 7px, transparent 7px 19px);
}
.ostype__pins--left { left: -7px; }
.ostype__pins--right { right: -7px; }

/* корпус чипа */
.ostype__chip {
    position: relative;
    min-width: min(430px, 100%);
    padding: 1.5rem 1.8rem 1.3rem;
    background: linear-gradient(155deg, var(--ostype-chip-1), var(--ostype-chip-2));
    border: 1px solid var(--ostype-chip-edge);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}
/* key-dot — метка первого пина, как на настоящем корпусе */
.ostype__chip::after {
    content: ''; position: absolute; top: 10px; left: 10px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #31435c; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6);
}

.ostype__osname {
    display: block;
    font-size: clamp(1.8rem, 7.4vw, 3rem);
    font-weight: 700; line-height: 1.1;
    color: var(--ostype-glow-64);
    overflow-wrap: anywhere;
    text-shadow: 0 0 18px rgba(125, 255, 154, .45), 0 0 52px rgba(125, 255, 154, .22);
}
.ostype__answer[data-state="done"] .ostype__osname { animation: ostype-on .5s ease-out, ostype-glow 3.4s ease-in-out .5s infinite; }
@keyframes ostype-on { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes ostype-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(.82); }
}
@media (prefers-reduced-motion: reduce) {
    .ostype__answer[data-state="done"] .ostype__osname { animation: none; }
}
.ostype__answer[data-state="loading"] .ostype__osname {
    font-size: 1.4rem; font-weight: 400; color: var(--ostype-dim); text-shadow: none; padding: 1rem 0;
}
.ostype__answer[data-state="unknown"] .ostype__osname {
    font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--ostype-glow-unk);
    text-shadow: 0 0 18px rgba(255, 196, 107, .35); padding: .5rem 0 .15rem;
}
.ostype__kernel { display: block; margin-top: .2rem; font-size: 1.05rem; color: #c3d3e8; }
.ostype__kernel b { color: #eaf2fc; }

/* строки «метка: значение» в карточках */
.ostype__rows { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .9rem; }
.ostype__rows li { display: flex; justify-content: space-between; gap: .6rem; padding: .16rem 0; }
.ostype__rows li span { color: var(--ostype-muted); }
.ostype__rows li b { text-align: right; overflow-wrap: anywhere; }

/* блок «чего браузер не видит» */
.ostype__hidden { margin-top: var(--ostype-gap); }
.ostype__hidden-text { margin: .5rem 0 0; font-size: .92rem; color: var(--tls-text); line-height: 1.5; }

.ostype__note {
    margin: .75rem auto 0; max-width: 620px;
    font-size: .88rem; color: var(--ostype-dim);
}


.ostype__copy-fallback { margin: .6rem 0 0; font-size: .85rem; color: #ff9f9f; }
.ostype__report-text {
    display: block; width: 100%; margin-top: .6rem;
    font-size: .85rem; font-family: Consolas, Menlo, monospace;
    background: rgba(255, 255, 255, .05); color: #d7e3f2;
    border: 1px solid #33475f; border-radius: var(--tls-radius); padding: .6rem .75rem;
}
.ostype__report-text:focus { outline: none; box-shadow: none; border-color: var(--ostype-border); }

/* тост «скопировано» */
.ostype__toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    background: #1f2733; color: #fff; font-size: .88rem; padding: .5rem .9rem;
    border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); z-index: 1085;
}

/* =====================================================================
   Инфографика: система слой за слоем (пирамида-стек)
   ===================================================================== */
.ostype__stack-card { margin-top: var(--ostype-gap); }
.ostype__stack { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: .75rem; }
.ostype__slab {
    display: flex; justify-content: space-between; align-items: baseline; gap: .8rem;
    border-radius: 9px; padding: .5rem 1rem;
    color: #fff; box-shadow: 0 2px 6px rgba(17, 24, 39, .18);
    min-width: 0;
}
.ostype__slab--apps   { width: min(300px, 82%);  background: linear-gradient(160deg, #79b3ff, #5d97ec); }
.ostype__slab--os     { width: min(360px, 90%);  background: linear-gradient(160deg, #4b83e8, #3a6cc7); }
.ostype__slab--kernel { width: min(420px, 96%);  background: linear-gradient(160deg, #315a97, #27497c); }
.ostype__slab--cpu    { width: min(470px, 100%); background: linear-gradient(160deg, #1f3a5c, #16293f); }
.ostype__slab-label {
    font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; white-space: nowrap;
}
.ostype__slab-val { font-weight: 700; font-size: .95rem; text-align: right; overflow-wrap: anywhere; }

/* =====================================================================
   Сетка карточек деталей
   ===================================================================== */
.ostype__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));  /* minmax(0,1fr) — равные колонки, см. _common.md */
    gap: var(--ostype-gap);
    margin-top: var(--ostype-gap);
}

.ostype__grid .ostype__card { display: flex; flex-direction: column; padding: .9rem 1rem; }

.ostype__card-head {
    display: flex; align-items: center; gap: .5rem;
    color: var(--ostype-muted); font-size: .82rem;
    letter-spacing: .04em; text-transform: uppercase;
}
.ostype__card-head .bi {
    color: var(--tls-accent); font-size: 1rem;
    background: #e8eefc; border-radius: 8px; padding: .3rem;
}
.ostype__card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ostype__card-value {
    margin-top: .45rem;
    font-size: 1.25rem; font-weight: 700; line-height: 1.2;
    overflow-wrap: anywhere;
}

.ostype__card-sub { margin-top: auto; padding-top: .35rem; font-size: .8rem; color: var(--ostype-muted); }

/* карточка браузера короче соседней с настройками — значение заполняет высоту по центру,
   без пустой зоны (правило «равная высота карточек — без дыр», см. _common.md) */
.ostype__card--browser .ostype__card-value { flex: 1; display: flex; align-items: center; }

.ostype__more { display: inline-block; margin-top: .2rem; font-size: .8rem; text-decoration: none; }
.ostype__more:hover { text-decoration: underline; }

/* =====================================================================
   Список «что смотреть в самой ОС» (внутри карточки «чего браузер не видит»)
   ===================================================================== */
.ostype__oslist { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .92rem; }
.ostype__oslist li { margin-bottom: .25rem; }
.ostype__oslist code {
    background: #f4f5f7; border: 1px solid var(--ostype-border); border-radius: 6px;
    padding: .05rem .4rem; font-size: .85em; color: var(--tls-text);
}

/* =====================================================================
   Адаптив
   ===================================================================== */
@media (max-width: 560px) {

    .ostype__card { padding: 14px; }
    .ostype__label { font-size: .74rem; }
    .ostype__kernel { font-size: .92rem; }
    .ostype__note { font-size: .82rem; }

    .ostype__chipwrap { margin: 4px 10px 8px; max-width: calc(100% - 20px); }
    .ostype__chip { min-width: 0; width: 100%; padding: 1.1rem 1rem 1rem; }
    .ostype__pins--top, .ostype__pins--bottom { height: 5px; left: 12px; right: 12px; }
    .ostype__pins--top { top: -5px; } .ostype__pins--bottom { bottom: -5px; }
    .ostype__pins--left, .ostype__pins--right { width: 5px; top: 12px; bottom: 12px; }
    .ostype__pins--left { left: -5px; } .ostype__pins--right { right: -5px; }

    .ostype__slab { padding: .4rem .7rem; }
    .ostype__slab-val { font-size: .85rem; }

    .ostype__grid { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
    .ostype__grid .ostype__card { padding: .7rem .8rem; }
    .ostype__card-value { font-size: 1.1rem; margin-top: .3rem; }
}
