/* Платформер «Венчик чинит компьютеры». Игра занимает весь экран; слов на экране нет. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #05070d;
    color: #fff;
    font-family: 'Onest', system-ui, sans-serif;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

#v4p-canvas {
    position: fixed;
    inset: 0;
    display: block;
    touch-action: none;
}

/* невидимый блок: его отступы равны безопасным зонам экрана */
#v4p-safe {
    position: fixed;
    inset: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    pointer-events: none;
    visibility: hidden;
}

#v4p-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: rgba(5, 8, 14, 0.72);
}
#v4p-overlay[hidden] { display: none; }

.v4p-screen { display: flex; flex-direction: column; align-items: center; gap: min(18px, 3vh); padding: 2vh 16px; max-height: 100vh; }
.v4p-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* кнопки-значки: большие, без подписей */
.v4p-btn {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s;
}
.v4p-btn:active { transform: scale(0.94); }
/* на лежащем телефоне экран низкий: размеры считаются от его высоты, чтобы всё помещалось */
.v4p-big { width: min(128px, 30vh); height: min(128px, 30vh); background: #4ade80; color: #052e16; font-size: min(60px, 14vh); animation: v4p-pulse 1.4s ease-in-out infinite; }
.v4p-toggle[aria-pressed="true"] { background: rgba(74, 222, 128, 0.85); color: #052e16; }
.v4p-toggle[aria-pressed="false"] { opacity: 0.55; }
@keyframes v4p-pulse { 50% { transform: scale(1.07); } }

.v4p-pose { height: min(28vh, 190px); width: auto; }
.v4p-stars { font-size: min(54px, 11vh); line-height: 1; letter-spacing: 8px; }
.v4p-star-on { color: #fbbf24; }
.v4p-star-off { color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, 0.55); }
.v4p-pile { display: flex; align-items: center; gap: 10px; font-size: min(34px, 8vh); font-weight: 800; }
.v4p-box { width: min(40px, 9vh); height: min(40px, 9vh); border-radius: 8px; background: #c8a26a; box-shadow: inset 0 -14px 0 -4px #22c55e; }

/* панель отладки: для взрослого, вызывается тремя пальцами или F2 */
.v4p-tune {
    position: fixed;
    inset: 8px auto 8px 8px;
    z-index: 5;
    width: min(340px, 80vw);
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    font-size: 13px;
    user-select: text;
}
.v4p-tune label { display: grid; grid-template-columns: 78px 44px 1fr; align-items: center; gap: 6px; padding: 3px 0; }
.v4p-tune output { color: #4ade80; font-variant-numeric: tabular-nums; }
.v4p-tune input { width: 100%; }
.v4p-tune .v4p-btn { width: 44px; height: 44px; font-size: 20px; margin-top: 6px; }

.v4p-noscript { position: fixed; inset: 0; display: grid; place-items: center; }

/* ── карта: компьютерный класс, шесть мониторов в ряд ── */
.v4p-map {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: min(26px, 5vh);
    width: 100vw;
    height: 100vh;
    padding: 2vh max(16px, env(safe-area-inset-left, 0px)) 2vh max(16px, env(safe-area-inset-right, 0px));
    background:
        radial-gradient(ellipse at 25% 20%, rgba(13, 79, 60, 0.6) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 90%, rgba(13, 79, 60, 0.45) 0%, transparent 55%),
        #0a0a14;
}
.v4p-monitors { display: flex; align-items: flex-end; justify-content: center; gap: min(18px, 2.4vw); }
.v4p-monitor {
    position: relative;
    width: min(13vw, 24vh, 150px);
    aspect-ratio: 4 / 3;
    padding: 0;
    border: min(5px, 0.9vh) solid #334155;
    border-radius: 10px;
    background: #0f172a;
    cursor: pointer;
    transition: transform 0.15s;
}
.v4p-monitor::after {
    content: '';
    position: absolute;
    left: 38%; right: 38%; top: 100%;
    height: min(18px, 3.4vh);
    margin-top: min(5px, 0.9vh);
    background: #334155;
    border-radius: 0 0 6px 6px;
}
/* на экране монитора — фон его мира и босс; починенный мир светится зелёным и получает галочку */
.v4p-w1 { background: url('img/plat-bg-class.webp?v=1') center 30% / cover; }
.v4p-w2 { background: url('img/plat-bg-street.webp?v=1') center 40% / cover; }
.v4p-w3 { background: radial-gradient(ellipse at 30% 25%, #0d4f3c 0%, #0a0a14 75%); }
.v4p-w4 { background: url('img/plat-bg-space.webp?v=1') center / cover; }
.v4p-w5 { background: url('img/plat-bg-night.webp?v=1') center 30% / cover; }
.v4p-w6 { background: radial-gradient(circle at 50% 55%, #3b2f0b 0%, #0f172a 75%); }
.v4p-screen-pic { position: absolute; left: 8%; top: 6%; width: 84%; height: 88%; object-fit: contain; pointer-events: none; }
.v4p-screen-ok { position: absolute; right: -12%; top: -16%; width: 36%; height: auto; pointer-events: none; }
.v4p-lit { border-color: #39d353; box-shadow: 0 0 22px rgba(74, 222, 128, 0.55); }
.v4p-off { opacity: 0.45; filter: grayscale(0.7); cursor: default; }
.v4p-fps { position: absolute; left: 0; right: 0; bottom: max(8px, env(safe-area-inset-bottom, 0px)); font-size: 12px; color: rgba(255, 255, 255, 0.45); text-align: center; pointer-events: none; }
.v4p-world-name {
    min-height: 1.2em;
    font-weight: 800;
    font-size: min(26px, 5.6vh);
    line-height: 1.15;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.v4p-next { animation: v4p-pulse 1.3s ease-in-out infinite; border-color: #4ade80; }
.v4p-picks { display: flex; align-items: flex-start; justify-content: center; gap: min(22px, 3vw); }
.v4p-pick-col { display: flex; flex-direction: column; align-items: center; gap: min(6px, 1.2vh); width: min(118px, 26vh); }
.v4p-pick-name { font-weight: 700; font-size: min(14px, 3.4vh); line-height: 1.15; color: rgba(255, 255, 255, 0.85); text-align: center; }
.v4p-pick-locked .v4p-pick-name { opacity: 0.45; }
.v4p-pick-pic { width: 74%; height: 74%; object-fit: contain; pointer-events: none; }
.v4p-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: min(96px, 22vh);
    height: min(96px, 22vh);
    border: 3px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
}
.v4p-pick:disabled { opacity: 0.35; cursor: default; }
.v4p-pick-done { border-color: #4ade80; }
.v4p-pick-boss { border-color: rgba(255, 200, 61, 0.85); }
.v4p-pick-boss.v4p-pick-done { border-color: #4ade80; }
.v4p-dots { font-size: min(20px, 4.6vh); letter-spacing: 3px; line-height: 1; }
.v4p-ministars { font-size: min(15px, 3.4vh); line-height: 1; letter-spacing: 1px; }
.v4p-ministars .v4p-star-off { -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5); }
.v4p-map-pose { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: 8px; height: min(30vh, 150px); width: auto; pointer-events: none; }
.v4p-home { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); top: 12px; width: 56px; height: 56px; font-size: 28px; }

/* карточка «поверни телефон»: без слов */
.v4p-rotate { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(5, 8, 14, 0.9); }
.v4p-phone { width: 74px; height: 130px; border: 6px solid #e2e8f0; border-radius: 14px; animation: v4p-turn 1.6s ease-in-out infinite; }
.v4p-turn { position: absolute; margin-top: 190px; font-size: 44px; color: #4ade80; }
@keyframes v4p-turn { 0%, 20% { transform: rotate(0); } 70%, 100% { transform: rotate(-90deg); } }

@media (prefers-reduced-motion: reduce) {
    .v4p-big, .v4p-next, .v4p-phone { animation: none; }
}
