/* Симулятор жизни дежурного. */

/* --- HUD --- */

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

/* Размытие под липкой шапкой — самый дорогой сценарий композитинга на среднем
   Android, а фон и так почти непрозрачный. Оставляем его только настольным. */
@media (min-width: 700px) {
    .hud2 { backdrop-filter: blur(14px); background: rgba(10, 12, 20, .86); }
}

.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: 17px;
}

.day-label small {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-mute);
}

.money {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 800;
    color: var(--lime);
    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: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.bar-track {
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .45s cubic-bezier(.2, .9, .3, 1), background .3s;
}

.bar-fill.energy { background: linear-gradient(90deg, var(--cyan), #6ef7c9); }
.bar-fill.sanity { background: linear-gradient(90deg, var(--violet), var(--pink)); }
.bar-fill.low { background: var(--red) !important; 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: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    color: var(--ink-mute);
    border: 1px solid transparent;
}

.phase-chip.on {
    color: #08090f;
    background: var(--cyan);
}

.phase-chip.done { color: var(--lime); border-color: rgba(200, 255, 61, .35); }

.q2-text {
    font-size: clamp(19px, 3.3vw, 25px);
    font-weight: 750;
    line-height: 1.3;
    margin: 6px 0 16px;
}

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

.opt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 15px 17px;
    min-height: 56px;
    font-weight: 600;
    line-height: 1.35;
    background: #0d1120;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    animation: fade-up .34s cubic-bezier(.2, 1.3, .4, 1) 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(--cyan);
        background: #172041;
    }
}
.opt .letter {
    flex: 0 0 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 8px;
    font-family: var(--mono); font-weight: 800;
    background: rgba(255, 255, 255, .07); color: var(--ink-dim);
}
.opt.right { border-color: var(--lime); background: rgba(200, 255, 61, .13); }
.opt.right .letter { background: var(--lime); color: #0d1400; }
.opt.wrong { border-color: var(--pink); background: rgba(255, 61, 139, .12); }
.opt.wrong .letter { background: var(--pink); color: #1a0410; }

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

.event-card {
    border-color: rgba(255, 194, 71, .45);
    background:
        radial-gradient(80% 100% at 0% 0%, rgba(255, 194, 71, .13), transparent 60%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
}

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

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

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

.delta {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
}

.delta.plus { color: var(--lime); }
.delta.minus { color: var(--pink); }

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

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

.shop-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    padding: 15px;
    background: #11152a;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    position: relative;
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    .shop-item:hover:not(:disabled) {
        border-color: var(--lime);
        transform: translateY(-3px);
    }
}

/* Покупка идёт через сеть: карточка должна сразу показать, что её нажали. */
.shop-item.pending {
    opacity: .55;
    pointer-events: none;
    border-color: var(--violet);
}

.shop-item .emoji { font-size: 30px; line-height: 1; }

.shop-item .name { font-weight: 800; font-size: 16px; }

.shop-item .desc {
    font-size: 13px;
    color: var(--ink-dim);
    font-weight: 500;
    line-height: 1.35;
    flex: 1;
}

.shop-item .price {
    font-family: var(--mono);
    font-weight: 800;
    color: var(--lime);
}

.shop-item.blocked { opacity: .42; }

.shop-item .owned-badge {
    position: absolute;
    top: 9px; right: 9px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--violet);
    color: #0a0616;
}

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

.inv-chip {
    font-size: 13px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(167, 107, 255, .14);
    border: 1px solid rgba(167, 107, 255, .35);
}

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

.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: 15px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255, 90, 90, .45);
    background: rgba(255, 90, 90, .1);
}

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

.ending-card {
    text-align: center;
    padding: 34px 22px;
    background:
        radial-gradient(70% 100% at 50% 0%, rgba(200, 255, 61, .16), transparent 70%),
        linear-gradient(180deg, var(--panel), var(--panel-2));
}

.final-score {
    font-family: var(--mono);
    font-size: clamp(52px, 13vw, 100px);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--lime), var(--cyan), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

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

.stat-box b {
    display: block;
    font-family: var(--mono);
    font-size: 24px;
    color: var(--cyan);
}

.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;
}

/* .toast переехал в base.css — он нужен обеим играм. */

/* --- телефон -------------------------------------------------------------- */

@media (max-width: 560px) {
    /* 17 товаров в одну колонку — это три с половиной тысячи пикселей скролла
       каждый игровой день. Две колонки, описание уезжает в тост после покупки. */
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .shop-item { padding: 11px; gap: 4px; }
    .shop-item .emoji { font-size: 26px; }
    .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; }
}
