/* Games Randomes — Гвинтики / original metal-and-screws puzzle */
:root{--hv-bg:#101f37;--hv-panel:#203852;--hv-teal:#9af9da;--hv-yellow:#ffe69f}
.hv-wrap,.hv-wrap *{box-sizing:border-box}
.hv-wrap{font:500 16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;color:#e9f6ff;max-width:1250px;margin:0 auto;padding:18px 15px 60px}
.hv-wrap h1,.hv-wrap h2,.hv-wrap h3{color:#fff6ce!important;line-height:1.17!important;letter-spacing:-.02em}
.hv-wrap h1{font-size:clamp(30px,4.4vw,48px)!important;margin:8px 0 11px!important}
.hv-wrap p{color:#c6d8e7}
.hv-wrap a{color:#aef2d4!important}
.hv-eyebrow{font-size:12px;color:#acffe0;letter-spacing:.1em;font-weight:950;text-transform:uppercase}
.hv-intro{max-width:900px;margin:0 0 18px!important;font-size:16px}
#hv-game{position:relative;padding:16px;border:2px solid #6885a9;border-bottom:7px solid #223856;border-radius:24px;background:radial-gradient(ellipse at 23% 0%,#385471,#162942 57%,#101d32);box-shadow:0 14px 32px #0007;overflow:hidden}
#hv-game:fullscreen{width:100vw;height:100dvh;max-width:none;overflow:auto;border:none;border-radius:0;margin:0}
.hv-top{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.hv-brand{display:flex;align-items:center;gap:9px}
.hv-brand-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:13px;border:2px solid #c5f6e5;background:linear-gradient(145deg,#ffe5a9,#80b9c2);box-shadow:0 4px #305970;font-size:26px}
.hv-brand strong{display:block;color:#ffefbd;font-size:23px;font-weight:1000;line-height:1.05}
.hv-brand small{display:block;font-size:12px;color:#b4e5d6;font-weight:800;margin-top:4px}
.hv-stats{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.hv-chip{padding:7px 11px;border:1px solid #7796ae;border-bottom:3px solid #203855;border-radius:10px;background:#284460;font-size:12px;font-weight:800;white-space:nowrap}
.hv-chip b{color:#ffe9a0;font-size:16px;font-variant-numeric:tabular-nums}
.hv-game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,260px);gap:16px;align-items:start}
.hv-main{min-width:0}
.hv-canvasbox{position:relative;width:100%;max-width:670px;margin:auto;aspect-ratio:640/510;background:radial-gradient(ellipse at 50% 50%,#304b6a 0,#0d2543 70%,#071c30 100%);border:3px solid #7dbcae;border-bottom:7px solid #315a7b;border-radius:19px;box-shadow:inset 0 0 38px #071a3399,0 11px 23px #0006;overflow:hidden;touch-action:manipulation;isolation:isolate}
#hv-canvas{display:block;width:100%;height:100%;touch-action:manipulation;cursor:pointer}
.hv-message{position:absolute;top:12px;left:50%;transform:translateX(-50%) translateY(-15px);z-index:9;max-width:86%;min-width:100px;opacity:0;border:2px solid #fff5bf;border-bottom:4px solid #ba8b4c;background:#ffe3a5;border-radius:12px;padding:8px 14px;color:#344451;text-align:center;pointer-events:none;font-weight:950;font-size:14px;transition:opacity .2s,transform .2s}
.hv-message.show{opacity:1;transform:translateX(-50%) translateY(0)}
.hv-bar{height:10px;background:#112339;border:1px solid #7798a6;border-radius:99px;overflow:hidden;margin:10px auto 0;max-width:670px}
.hv-bar > span{display:block;height:100%;width:100%;border-radius:99px;background:linear-gradient(90deg,#7ae2aa,#d4ff93);transition:width .1s}
.hv-bar.danger > span{background:linear-gradient(90deg,#e87158,#ffb879)}
.hv-tray{margin:13px auto 8px;max-width:670px;border:2px solid #688aa8;border-bottom:5px solid #254963;border-radius:17px;background:linear-gradient(145deg,#213c58,#142942);padding:12px}
.hv-tray-header{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;color:#f9ecca;font-size:15px;font-weight:900}
.hv-tray-header span{color:#bdcfdf;font-size:13px}
.hv-tray-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;margin-top:10px}
.hv-tray-slot{aspect-ratio:1;border:2px dashed #65829d;border-radius:10px;background:#0a2036;display:grid;place-items:center;box-shadow:inset 0 3px 6px #0006;position:relative}
.hv-tray-slot.full{border:2px solid #e2e7f4;background:linear-gradient(#486681,#253f59)}
.hv-tray-bolt{width:67%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;font-size:clamp(17px,2vw,27px);font-weight:950;color:#283444;background:var(--screw-color);border:3px solid #ffffffaa;box-shadow:0 3px 7px #0008,inset 0 2px #fff9;line-height:1}
.hv-under-tray{display:flex;gap:7px;justify-content:space-between;flex-wrap:wrap;margin-top:8px;font-size:12px;color:#aecde0;font-weight:800}
.hv-side{display:flex;flex-direction:column;gap:12px}
.hv-panel{padding:16px;border:1px solid #597996;border-bottom:4px solid #233c5e;border-radius:17px;background:linear-gradient(145deg,#2a4464,#192c47)}
.hv-panel h2{font-size:20px!important;margin:0 0 9px!important}
.hv-panel p{font-size:14px;color:#c4deee;line-height:1.55;margin:0 0 8px}
.hv-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.hv-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border:2px solid #79a6bb;border-bottom:4px solid #24405e;border-radius:12px;background:linear-gradient(#48738e,#2a4a6e);color:#fff!important;font:900 13px/1.2 system-ui;cursor:pointer;text-align:center;touch-action:manipulation}
.hv-btn:hover:not(:disabled){filter:brightness(1.12)}
.hv-btn:active:not(:disabled){transform:translateY(2px)}
.hv-btn:focus-visible{outline:3px solid #fff0a4;outline-offset:2px}
.hv-btn:disabled{opacity:.5;cursor:default}
.hv-btn-primary{background:linear-gradient(#faffb5,#9de0ba);color:#264a4b!important;border-color:#fff9c2;border-bottom-color:#578b7d}
.hv-btn-warning{background:linear-gradient(#ffe6a9,#ecaa73);color:#4e392d!important;border-color:#fff5bb;border-bottom-color:#aa7456}
.hv-wide{grid-column:1/-1}
.hv-tip{font-size:13px;line-height:1.6;padding:13px 15px;background:#172c46;border:1px solid #4d7288;border-radius:13px;color:#b9d6de}
.hv-tip b{color:#ffe0a4}
.hv-help{max-width:1000px;margin:32px auto 0}
.hv-help h2{font-size:28px!important}
.hv-help ol{padding-left:24px}
.hv-help li{margin:8px 0;color:#c6ddea}
.hv-overlay{position:absolute;inset:0;display:grid;place-items:center;padding:14px;background:#071c34dd;backdrop-filter:blur(6px);z-index:20}
.hv-overlay[hidden]{display:none!important}
.hv-dialog{max-height:calc(100dvh - 35px);overflow:auto;width:min(95%,480px);border:3px solid #c5f4dc;border-bottom:8px solid #407e82;border-radius:24px;background:linear-gradient(145deg,#3d6480,#213955 75%,#192b48);box-shadow:0 20px 40px #010e22bb;padding:26px;text-align:center}
.hv-dialog-emoji{font-size:60px;line-height:1.15;filter:drop-shadow(0 8px #14344a)}
.hv-dialog h2{font-size:clamp(23px,3vw,33px)!important;margin:11px 0!important;color:#fff0b9!important}
.hv-dialog p{color:#d6ebf3;font-size:15px;line-height:1.6;margin:7px auto 19px}
.hv-dialog-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.hv-dialog-actions .hv-btn{min-width:150px;padding:10px 16px}
.hv-level-dialog{width:min(95%,660px);max-height:calc(100dvh - 35px);overflow:auto;border:3px solid #bde8db;border-bottom:7px solid #417685;border-radius:22px;background:#243e5a;padding:22px}
.hv-level-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hv-level-head h2{font-size:25px!important;margin:0!important}
.hv-level-head .hv-btn{min-width:40px}
.hv-chapters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:17px 0}
.hv-chapter{background:#325573;border:1px solid #9bc6d3;color:#fff;min-height:42px;border-radius:11px;font:900 14px system-ui;cursor:pointer}
.hv-chapter.active{background:#b6f1ce;color:#23433a}
.hv-level-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}
.hv-level{display:grid;place-items:center;min-height:59px;border:1px solid #7cb1bc;border-bottom:3px solid #193d5e;border-radius:9px;background:#346383;color:#fff;font:900 17px system-ui;cursor:pointer}
.hv-level small{font-size:9px;color:#ffe7a3;line-height:1}
.hv-level:disabled{opacity:.4;cursor:default}
.hv-level.active{outline:3px solid #ffe5a0}
#hv-game:fullscreen .hv-game-layout{max-width:1200px;margin:auto}
@media(max-width:850px){.hv-game-layout{grid-template-columns:minmax(0,1fr) 210px;gap:9px}.hv-panel{padding:11px}}
@media(max-width:720px){
.hv-wrap{padding:10px 5px 40px}
.hv-wrap h1{font-size:29px!important}
.hv-intro{font-size:14px}
#hv-game{padding:7px;border-radius:14px}
.hv-top{gap:6px}
.hv-brand-icon{width:38px;height:38px;font-size:22px}
.hv-brand strong{font-size:18px}
.hv-brand small{font-size:10px}
.hv-stats{width:100%;justify-content:space-between;gap:4px}
.hv-chip{padding:5px 7px;font-size:11px}
.hv-chip b{font-size:13px}
.hv-game-layout{display:flex;flex-direction:column}
.hv-main,.hv-side{width:100%}
.hv-canvasbox{border-width:2px;border-bottom-width:5px;border-radius:12px}
.hv-tray{padding:9px;margin-top:9px;border-radius:12px}
.hv-tray-slot{border-radius:6px}
.hv-tray-grid{gap:4px}
.hv-tray-bolt{font-size:16px;border-width:2px}
.hv-side{gap:8px}
.hv-panel{padding:10px}
.hv-panel h2{font-size:16px!important;margin-bottom:6px!important}
.hv-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.hv-btn{min-height:41px;padding:5px 4px;font-size:11px;border-radius:8px}
.hv-wide{grid-column:1/-1}
.hv-tip{font-size:12px;padding:11px}
.hv-dialog{padding:18px;border-radius:17px}
.hv-dialog-actions .hv-btn{min-width:110px}
.hv-level-grid{gap:5px}
.hv-level{min-height:45px;font-size:14px}
}
@media(max-width:390px){.hv-chip{font-size:10px;padding:4px 6px}.hv-chip b{font-size:12px}.hv-tray-grid{gap:3px}}
@media(orientation:landscape) and (max-height:630px){
#hv-game:fullscreen{overflow:auto;padding:5px}
#hv-game:fullscreen .hv-game-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(195px,255px);gap:8px}
#hv-game:fullscreen .hv-canvasbox{height:calc(100dvh - 150px);width:auto;max-width:100%;aspect-ratio:640/510;margin:auto}
#hv-game:fullscreen .hv-side{overflow:auto;max-height:calc(100dvh - 90px)}
#hv-game:fullscreen .hv-panel{padding:8px}
#hv-game:fullscreen .hv-tip{display:none}
}
@media(prefers-reduced-motion:reduce){.hv-bar>span,.hv-message{transition:none}}
