/* Симулятор пентестера, терминальная тема. */

/* --- HUD --- */

.hud2 {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 30;
    background: rgba(6, 10, 6, .97);
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}

@media (min-width: 700px) {
    .hud2 { backdrop-filter: blur(10px); background: rgba(6, 10, 6, .88); }
}

.hud2-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.day-label { font-weight: 800; font-size: 16px; color: var(--ink); }
.day-label::before { content: "~/day$ "; color: var(--green-dim); font-weight: 700; }
.day-label small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

.money {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 800;
    color: var(--green);
    text-shadow: var(--glow);
    white-space: nowrap;
}

.bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 9px;
}

.bar-row { font-size: 12px; }

.bar-row .bar-head {
    display: flex;
    justify-content: space-between;
    color: var(--ink-mute);
    font-weight: 700;
    letter-spacing: .03em;
    margin-bottom: 4px;
}

.bar-track {
    height: 8px;
    border-radius: 2px;
    background: rgba(51, 255, 136, .07);
    border: 1px solid var(--line);
    overflow: hidden;
}

.bar-fill { height: 100%; transition: width .45s cubic-bezier(.2, .9, .3, 1), background .3s; }
.bar-fill.energy { background: var(--green); box-shadow: 0 0 6px var(--green); }
.bar-fill.sanity { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.bar-fill.low { background: var(--red) !important; box-shadow: 0 0 6px var(--red); animation: blink 1.1s infinite; }

.rep-value { font-family: var(--mono); font-weight: 800; color: var(--amber); }

/* --- фазы --- */

.phase-tag { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

.phase-chip {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    background: rgba(51, 255, 136, .05);
    color: var(--ink-mute);
    border: 1px solid var(--line);
}

.phase-chip.on { color: #04120a; background: var(--green); border-color: var(--green); }
.phase-chip.done { color: var(--green); border-color: var(--green-dim); }

.q2-text {
    font-size: clamp(18px, 3.2vw, 24px);
    font-weight: 700;
    line-height: 1.32;
    margin: 6px 0 16px;
}

.opts { display: grid; gap: 9px; }

.opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    min-height: 54px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
    background: #050805;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    animation: fade-up .3s ease both;
    animation-delay: calc(var(--i, 0) * 55ms);
}

.opt > span:not(.letter) { flex: 1; min-width: 0; overflow-wrap: anywhere; }

@media (hover: hover) and (pointer: fine) {
    .opt:hover:not(:disabled):not(.right):not(.wrong) {
        border-color: var(--green);
        color: var(--green);
        box-shadow: var(--glow);
    }
}

.opt .letter {
    flex: 0 0 auto; height: 24px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
    border-radius: var(--r-sm);
    font-family: var(--mono); font-weight: 800;
    background: rgba(51, 255, 136, .08); color: var(--green-dim);
}
.opt .letter::before { content: "["; }
.opt .letter::after { content: "]"; }
.opt.right { border-color: var(--green); background: rgba(51, 255, 136, .12); box-shadow: var(--glow); }
.opt.right .letter { background: var(--green); color: #04120a; }
.opt.wrong { border-color: var(--red); background: rgba(255, 85, 85, .1); }
.opt.wrong .letter { background: var(--red); color: #140404; }

/* --- событие --- */

.event-card { border-color: rgba(255, 180, 84, .5); }

.event-kicker {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 6px;
}
.event-kicker::before { content: "[!] "; }

/* --- дельты статов --- */

.delta-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

.delta {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 13px;
    padding: 4px 9px;
    border-radius: var(--r-sm);
    background: rgba(51, 255, 136, .05);
    border: 1px solid var(--line);
}

.delta.plus { color: var(--green); }
.delta.minus { color: var(--red); }

/* --- магазин --- */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 11px;
}

.shop-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 14px;
    background: #050805;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    position: relative;
    overflow: hidden;
    color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
    .shop-item:hover:not(:disabled) { border-color: var(--green); box-shadow: var(--glow); }
}

.shop-item.pending { opacity: .55; pointer-events: none; border-color: var(--green); }
.shop-item .emoji { font-size: 28px; line-height: 1; }
.shop-item .name { font-weight: 800; font-size: 15px; color: var(--ink); }
.shop-item .desc { font-size: 13px; color: var(--ink-dim); font-weight: 400; line-height: 1.35; flex: 1; }
.shop-item .price { font-family: var(--mono); font-weight: 800; color: var(--green); }
.shop-item.blocked { opacity: .4; }

.shop-item .owned-badge {
    position: absolute;
    top: 8px; right: 8px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--r-sm);
    background: var(--green);
    color: #04120a;
}

.inv-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

.inv-chip {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: var(--r-sm);
    background: rgba(51, 255, 136, .08);
    border: 1px solid var(--green-dim);
    color: var(--ink-dim);
}

/* --- итог дня --- */

.report-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    flex-wrap: wrap;
}

.report-line:last-child { border-bottom: none; }

.rescue-box {
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 85, 85, .5);
    background: rgba(255, 85, 85, .08);
}

/* --- финал --- */

.ending-card { text-align: center; padding: 34px 22px; }

.final-score {
    font-family: var(--mono);
    font-size: clamp(48px, 13vw, 92px);
    font-weight: 800;
    line-height: 1;
    color: var(--green);
    text-shadow: 0 0 20px var(--green);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.stat-box {
    background: #050805;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    padding: 13px;
    text-align: center;
}

.stat-box b { display: block; font-family: var(--mono); font-size: 23px; color: var(--green); }
.stat-box span { font-size: 12px; color: var(--ink-mute); }

/* --- дневник --- */

.diary {
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-mute);
    font-family: var(--mono);
    line-height: 1.7;
}

.diary::before { content: "$ cat ~/.bash_history"; display: block; color: var(--green-dim); margin-bottom: 6px; }

@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .shop-item { padding: 11px; gap: 4px; }
    .shop-item .emoji { font-size: 24px; }
    .shop-item .name { font-size: 14px; }
    .shop-item .desc { display: none; }
    .shop-item .delta-row { margin-top: 6px; gap: 4px; }
    .shop-item .delta { font-size: 11px; padding: 3px 6px; }
    .bars { grid-template-columns: 1fr 1fr; }
}
