@font-face {
    font-family: 'Luckiest Guy';
    src: url('../fonts/LuckiestGuy-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


/* BALOO 2 - Regular */
@font-face {
    font-family: 'Baloo';
    src: url('../fonts/Baloo2-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* BALOO 2 - Medium */
@font-face {
    font-family: 'Baloo';
    src: url('../fonts/Baloo2-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* BALOO 2 - SemiBold */
@font-face {
    font-family: 'Baloo';
    src: url('../fonts/Baloo2-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* BALOO 2 - Bold */
@font-face {
    font-family: 'Baloo';
    src: url('../fonts/Baloo2-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* BALOO 2 - ExtraBold */
@font-face {
    font-family: 'Baloo';
    src: url('../fonts/Baloo2-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


:root {
    --font-display-luckiest: 'Luckiest Guy', Arial, sans-serif;
    --font-display-baloo: 'Baloo', Arial, sans-serif;
}

[hidden] { display:none !important; }
body { background:#9CADF4; font-family:var(--font-display-baloo) !important;}

/* Vypnutie natívnych browser/WebView click efektov */
* {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea,
[role="button"],
[tabindex] {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:focus,
button:active,
a:focus,
a:active,
[role="button"]:focus,
[role="button"]:active {
    outline: none;
    box-shadow: none;
}
button,
a,
[role="button"] {
    user-select:none;
    -webkit-user-select:none;
    -webkit-touch-callout:none;
}

#app-screens { width:min(100%,500px); height:100dvh; margin:auto; padding: 0; color:#263478; }
.app-screen { position:relative; width:100%;height:100%;overflow:hidden;background:#dfe3fb url('../img/ui/laboratory_v2.png') center/100% 100% no-repeat;isolation:isolate; }
.app-screen button { font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent; }
.app-screen button:focus-visible,.app-dialog button:focus-visible { outline:none;}
.app-screen svg,.app-dialog svg {width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;}
.app-screen button:active:not(:disabled):not(.ui-3slice) { filter:none; }

/* Reusable delayed press state. App.js adds .is-pressing before executing
   data-route / data-action, so the feedback is visible before navigation/modal. */
.app-screen button {
    --press-distance:2px;
    --press-scale:.985;
}

.app-screen button.is-pressing:not(.ui-3slice) {
    filter:brightness(.93);
}
.home-top {position:absolute;top:2%;left:2%;right:2%;display:flex;align-items:center;gap:7px;height:8%;z-index:5;}
.profile-button {display:flex;align-items:center;gap:7px;padding:0;border:0;background:#4c66a470;border-radius:30px 10px 10px 30px;min-width:0;flex:1;height:70%;color:white!important;}
.profile-avatar {display:grid;place-items:center;width:clamp(40px,12vw,63px);aspect-ratio:1;flex-shrink:0;background:linear-gradient(#8edcff,#4ca1cf);border:3px solid white;border-radius:50%;box-shadow:0 3px 7px #4359a777;}
.profile-avatar svg {width:70%;height:70%;fill:#f5fbff;stroke:#24376d;}
.home-name {font-size:clamp(11px,3.2vw,16px);font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.home-level {display:inline-grid;place-items:center;flex-shrink:0;width:36px;height:43px;clip-path:polygon(50% 0,100% 22%,95% 78%,50% 100%,5% 78%,0 22%);background:linear-gradient(145deg,#3ee6ff,#0664b7);color:white;font-size:22px;font-weight:900;filter:drop-shadow(0 2px 2px #18375b);border:3px solid #ffc74b;}
.currency-button {display:flex;align-items:center;gap:5px;border:0;background:#4c66a480;border-radius:13px;color:white!important;font-size:clamp(15px,4.4vw,23px)!important;padding:5px;}
.particle-vial {width:14px;height:30px;border:2px solid #bbf8ff;background:linear-gradient(100deg,#06a8dc,#a6ffff,#009ee5);border-radius:5px;transform:rotate(25deg);box-shadow:0 0 5px #13cfff;}
.currency-plus {border-radius:50%;background:#00c9ed;padding:0 5px;box-shadow:inset 0 1px 2px white;font-size:24px;}
.glass-icon {display:grid;place-items:center;flex-shrink:0;border:1px solid #fff;background:linear-gradient(#f5f6ff,#d8ddff);border-radius:12px;width:40px;height:40px;box-shadow:0 3px 3px #8186c64f;font-size:29px!important;}
.settings-icon {background:linear-gradient(#7383bc,#263978);color:white!important;border-color:#9caad7;}
.home-hero {position:absolute;top:11%;height:31%;left:5%;right:5%;}
.home-atom {position:relative;width:145px;height:145px;margin:auto;}
.home-hero .home-atom {height:60%;width:auto;aspect-ratio:1;}
.hero-core {position:absolute;width:58%;height:58%;left:21%;top:21%;object-fit:contain;filter:drop-shadow(0 0 9px #42d7ff);animation:core-spin 16s linear infinite;}
.hero-orbit {position:absolute;inset:4%;border:1.6px solid #e0fdff;border-radius:50%;box-shadow:0 0 5px #62d8ff;}
.orbit-one {transform:rotate(-30deg) scaleY(.62);}.orbit-two{transform:rotate(45deg) scaleY(.7);}
.hero-electron {position:absolute;inset:7%;animation:electron-orbit 5s linear infinite;transform:rotate(var(--phase));}
.hero-electron img {position:absolute;left:40%;top:-9%;width:20%;height:20%;object-fit:contain;filter:drop-shadow(0 0 4px #6aeaff);}
.game-logo {position:absolute;top:53%;width:100%;margin:0;text-align:center;line-height:.94;font-weight:1000;letter-spacing:-2px;transform:rotate(-2deg);filter:drop-shadow(0 5px 0 #27385c);}
.game-logo span {display:block;font-size:clamp(30px,9vw,47px);color:#4ce2ff;-webkit-text-stroke:1.5px #143b7d;text-shadow:0 -2px white,0 3px #0563a9;}
.game-logo strong {display:block;font-size:clamp(48px,14vw,74px);color:#ff777e;-webkit-text-stroke:1.5px #672547;text-shadow:0 -2px #fff0ed,0 4px #b93852;}
.home-actions {position:absolute;left:15%;right:15%;top:43%;display:grid;gap:12px;z-index:3;}
.soft-button {display:flex;align-items:center;justify-content:center;gap:12px;padding:12px;border:1px solid white;border-radius:17px;background:linear-gradient(#fff,#dde1ff);box-shadow:0 4px 4px #616caa60;font-size:clamp(15px,4.2vw,22px)!important;font-weight:bold!important;}
.flask-bubbles {position:absolute;overflow:hidden;pointer-events:none;z-index:1;clip-path:polygon(30% 0,70% 0,100% 100%,0 100%);}
.flask-bubbles--blue {left:0;top:52%;width:16%;height:10%;}.flask-bubbles--pink{right:0;top:58%;width:16%;height:10%;}
.flask-bubbles i {position:absolute;bottom:-10px;left:var(--x);width:var(--size);height:var(--size);border:1px solid #ffffffbb;border-radius:50%;box-shadow:0 0 3px white;animation:bubble-rise var(--duration) var(--delay) linear infinite;}
.home-chambers {
    position:absolute;
    left:0%;
    right:0%;
    bottom:12%;
    height:24%;
    display:flex;
    gap:0;
    align-items:end;
    z-index:2;
    transform:translate(0,-5px) scale(.92);
    transform-origin:center bottom;
}
.chamber {position:relative;display:flex;flex-direction:column;align-items:center;width:33.333%;height:100%;padding:0;border:0;background:none!important;}
.chamber-art {position:relative;display:block;width:100%;flex:1;min-height:0;}
.chamber-frame {position:absolute;inset:0;width:100%;height:100%;z-index:2;}
.chamber-glass {position:absolute;top:24%;bottom:25%;left:20%;right:20%;border:1px solid var(--energy);border-radius:0 0 15% 15%;box-shadow:inset 0 0 12px var(--energy),0 0 7px var(--energy);background:#e1eaff30;overflow:hidden;}
.chamber-fill {position:absolute;bottom:0;left:0;right:0;height:calc(var(--fill)*100%);background:linear-gradient(to top,var(--energy),transparent);transition:height .6s ease;box-shadow:inset 0 0 10px var(--energy);}
.chamber-fill>i {position:absolute;top:0;left:0;right:0;height:7px;border:1px solid white;border-radius:50%;background:var(--energy);box-shadow:0 0 7px var(--energy);}
.chamber-marks {position:absolute;inset:0;}.chamber-marks i{position:absolute;left:35%;width:30%;height:1px;background:#ffffffb0;}
.chamber-atom {position:absolute;width:45%;aspect-ratio:1;bottom:8%;left:27.5%;border-radius:50%;background:radial-gradient(circle at 30% 25%,white,var(--energy) 25%,#20315a 100%);box-shadow:0 0 10px var(--energy);animation:chamber-float 3s ease-in-out infinite;}
.chamber-atom i,.chamber-atom b,.chamber-atom em {position:absolute;width:30%;height:30%;border-radius:50%;background:radial-gradient(circle at 30% 25%,white,var(--energy));box-shadow:0 0 4px var(--energy);}
.chamber-atom i{left:-22%;top:60%;}.chamber-atom b{right:-22%;top:60%;}.chamber-atom em{top:-20%;left:35%;}
.chamber:nth-child(2) .chamber-atom{animation-delay:-1s;}.chamber:nth-child(3) .chamber-atom{animation-delay:-2s;}
.chamber-name {
    position:absolute;
    bottom:9%;
    left:0;
    right:0;
    text-align:center;
    color:white;
    font-size:10px;
    font-weight:900;
    z-index:3;
    text-shadow:0 0 5px var(--energy);
}
.chamber-meter{display:flex;gap:2px;width:66%;height:7px;margin-top:3px;}.chamber-meter i{flex:1;background:#74789f;border:1px solid #939ac6;border-radius:2px;}.chamber-meter .filled{background:var(--energy);box-shadow:0 0 4px var(--energy);}
.chamber-count {
    font-size:11.5px;
    font-weight:800;
    color:#253777;
    margin-top:3px;
}
.home-nav {position:absolute;bottom:0;left:0;right:0;height:10%;min-height:53px;display:flex;border-top:1px solid white;border-radius:20px 20px 0 0;background:linear-gradient(#e7ebffc9,#eeeafff2);box-shadow:0 -2px 6px #707de430;z-index:4;}
.home-nav button {position:relative;flex:1;border:0;background:none;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;font-weight:bold;font-size:12px;}
.home-nav svg {width:28px;height:28px;fill:#919ac6;}.home-nav .active{color:#0086eb;}.home-nav .active svg{fill:#39dbff;filter:drop-shadow(0 0 3px #0bf);}.home-nav .active:after{content:'';height:4px;border-radius:3px;background:#08d9ff;width:48%;position:absolute;bottom:5px;box-shadow:0 0 5px #00d9ff;}
.sub-screen {background-image:linear-gradient(#e7eaffdd,#f2effbe8),url('../img/ui/laboratory_v2.png');}
.sub-header {display:flex;align-items:center;justify-content:space-between;padding:16px 12px;gap:8px;}.sub-header h1{font-size:20px;text-align:center;margin:0;}
.sub-content {padding:12px 20px;overflow:auto;height:calc(100% - 145px);}.screen-lead{font-size:12px;line-height:1.5;text-align:center;color:#63739d;}
.mode-list{display:flex;flex-direction:column;gap:16px;}.mode-card{display:flex;align-items:center;gap:14px;text-align:left;border:1px solid white;border-radius:20px;background:linear-gradient(#fff,#dce8ff);padding:23px 18px;box-shadow:0 4px 7px #8391c44f;}.mode-card span:nth-child(2){flex:1;}.mode-card b{display:block;font-size:20px;}.mode-card small{display:block;margin-top:6px;}.mode-card:disabled{opacity:.45;cursor:default;}
.tutorial-content {text-align:center;}.tutorial-demo{margin:15px 0 25px;}.tutorial-title{font-size:23px;}.tutorial-text{line-height:1.7;min-height:100px;font-size:16px;}.step-counter{color:#7181ab;}.tutorial-controls{display:flex;gap:12px;justify-content:center;margin-top:25px;}.soft-button.primary{background:linear-gradient(#25e3f5,#00adcf);color:white;}.soft-button:disabled{opacity:.4;}.tutorial-dots{display:flex;gap:7px;justify-content:center;}.tutorial-dots i{width:8px;height:8px;background:#bfc9e9;border-radius:50%;}.tutorial-dots .active{background:#0cc9e5;}
.bonus-info{display:flex;gap:15px;padding:15px 0;border-bottom:1px solid #c5cdec;}.bonus-info>span{font-size:30px;color:#0085e8;min-width:32px;}.bonus-info h2{font-size:15px;margin:0 0 6px;}.bonus-info p{margin:0;font-size:14px;line-height:1.5;color:#627095;}
.profile-content{text-align:center;}.large-avatar{width:100px;height:100px;display:grid;place-items:center;margin:25px auto;border-radius:50%;background:linear-gradient(#7fe2ff,#479dcf);border:4px solid white;}.large-avatar svg{width:70px;height:70px;stroke:white;}
body:not([data-screen="game"]) .reaction-tests,body:not([data-screen="game"]) .atom-performance-panel {display:none!important;}
.home-effects-paused *, .app-screen[hidden] * {animation-play-state:paused!important;}
@keyframes electron-orbit{from{transform:rotate(var(--phase));}to{transform:rotate(calc(var(--phase) + 360deg));}}
@keyframes core-spin{to{transform:rotate(360deg);}}
@keyframes bubble-rise{0%{transform:translateY(0);opacity:0;}20%{opacity:.8;}100%{transform:translateY(-100px);opacity:0;}}
@keyframes chamber-float{50%{transform:translateY(-4px);}}
@media (max-height:650px){.home-top{gap:4px;}.home-level{width:28px;height:34px;font-size:17px;}.profile-avatar{width:38px;}.glass-icon{width:34px;height:34px;}.home-actions{gap:9px;}.game-logo span{font-size:30px;}.game-logo strong{font-size:49px;}.home-nav svg{width:22px;height:22px;}.chamber-count{font-size:10px;}}
@media (prefers-reduced-motion:reduce){.app-screen *{animation:none!important;transition:none!important;}}
body[data-screen="game"] #app-screens {display:none;}

/* =========================================================
   HLAVNÁ OBRAZOVKA – HEADER
   Veľkosti meníš iba tu.
   ========================================================= */
.home-top {
    --profile-width: 34%;
    --profile-height: 29px;
    --particles-width: 25%;
    --particles-height: 29px;
    --settings-size: 36px;

    position:absolute;
    top:1.6%;
    left:2.5%;
    right:2.5%;
    height:auto;
    display:flex;
    align-items:center;
    gap:7px;
    z-index:5;
}

/* Spoločný lesklý modrofialový materiál */
.profile-button,
.currency-button {
    position:relative;
    box-sizing:border-box;
    border:1px solid rgba(104,126,190,.34);
    background:
        linear-gradient(180deg,
            rgba(70,88,153,.96) 0%,
            rgba(79,98,165,.95) 48%,
            rgba(91,109,176,.94) 100%);
    box-shadow:
        inset 0 3px 5px rgba(27,39,98,.30),
        inset 0 1px 2px rgba(24,35,88,.24),
        inset 0 -1px 1px rgba(200,215,255,.12),
        0 1px 1px rgba(255,255,255,.10);
    color:#fff!important;
    text-shadow:0 1px 2px rgba(29,40,100,.72);
}

/* Jemný horný odlesk */
.profile-button::before,
.currency-button::before {
    content:"";
    position:absolute;
    pointer-events:none;
    left:8%;
    right:8%;
    top:1px;
    height:2px;
    border-radius:999px;
    background:linear-gradient(90deg,
        transparent,
        rgba(27,38,96,.20) 18%,
        rgba(27,38,96,.32) 50%,
        rgba(27,38,96,.20) 82%,
        transparent);
}

/* MENO + AVATAR */
.profile-button {
    flex:0 0 var(--profile-width);
    width:var(--profile-width);
    height:var(--profile-height);
    min-width:0;
    margin-left:16px;
    padding:0 7px 0 29px;
    border-radius:999px;
    display:flex;
    align-items:center;
    overflow:visible;
}

/* Bez veľkého vnútorného odlesku – predloha má čistejší, matnejší pás. */
.profile-button::after { content:none; }

.profile-avatar {
    position:absolute;
    z-index:3;
    left:-16px;
    top:50%;
    width:calc(var(--profile-height) + 17px);
    height:calc(var(--profile-height) + 17px);
    transform:translateY(-50%);
    display:grid;
    place-items:center;
    box-sizing:border-box;
    border:4px solid #edf2ff;
    border-radius:50%;
    background:
        radial-gradient(circle at 38% 27%,
            rgba(255,255,255,.42) 0 8%,
            rgba(255,255,255,.12) 24%,
            transparent 43%),
        linear-gradient(145deg,
            #cbd7f7 0%,
            #b2c1ec 42%,
            #98aae2 70%,
            #8396d5 100%);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.70),
        inset 0 -3px 4px rgba(66,84,158,.20),
        0 0 0 2px rgba(121,145,214,.72),
        0 2px 5px rgba(45,61,132,.25);
}

.profile-avatar::before { content:none; }
.profile-avatar img {
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
    border-radius:50%;
}

.profile-avatar svg {
    position:relative;
    z-index:2;
    width:59%;
    height:59%;
    fill:none;
    stroke:#40569a;
    stroke-width:2.2;
}

.home-name {
    position:relative;
    z-index:2;
    flex:1;
    min-width:0;
    max-width:none;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:left;
    color:#fff;
    font-size:clamp(10px,2.65vw,13px);
    font-weight:800;
}

.home-level {
    position:absolute;
    z-index:5;
    right:3px;
    top:-6px;
    width:20px;
    height:24px;
    transform:none;
    clip-path:polygon(50% 0,100% 22%,95% 78%,50% 100%,5% 78%,0 22%);
    background:linear-gradient(145deg,#3ee6ff,#0664b7);
    color:#fff;
    font-size:17px;
    font-weight:900;
    filter:drop-shadow(0 2px 2px #18375b);
}

/* ČASTICE */
.currency-button {
    flex:0 0 var(--particles-width);
    width:var(--particles-width);
    height:var(--particles-height);
    min-width:0;
    margin-left:auto;
    padding:0 25px 0 27px;
    border-radius:calc(var(--particles-height) / 2);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:visible;
}

.currency-button b {
    position:relative;
    z-index:2;
    width:100%;
    text-align:center;
    font-size:clamp(10px,2.65vw,13px);
}

/* Samostatná častica */
.particle-vial {
    display:block;
    position:absolute;
    z-index:3;
    left:-6px;
    top:50%;
    width:calc(var(--particles-height) + 5px);
    height:calc(var(--particles-height) + 5px);
    transform:translateY(-50%);
    border:0;
    border-radius:50%;
    background:
        radial-gradient(circle at 35% 27%,#fff 0 5%,#9ffaff 6% 10%,#1ed5f5 17%,#039be4 43%,#0872ce 69%,#17499d 100%);
    box-shadow:
        inset 0 3px 4px rgba(255,255,255,.72),
        inset 0 -4px 5px rgba(0,60,145,.38),
        0 0 7px rgba(0,223,255,.90);
}

.particle-vial::before,
.particle-vial::after {
    content:"";
    position:absolute;
    left:-14%;
    top:29%;
    width:128%;
    height:43%;
    box-sizing:border-box;
    border:1.7px solid rgba(118,245,255,.92);
    border-radius:50%;
    box-shadow:0 0 4px rgba(0,222,255,.65);
}
.particle-vial::before { transform:rotate(31deg); }
.particle-vial::after  { transform:rotate(-31deg); }

/* Samostatné + */
.currency-plus {
    display:grid;
    place-items:center;
    position:absolute;
    z-index:4;
    right:-4px;
    top:50%;
    width:calc(var(--particles-height) + 1px);
    height:calc(var(--particles-height) + 1px);
    transform:translateY(-50%);
    box-sizing:border-box;
    padding:0;
    border:2px solid #72dfff;
    border-radius:50%;

    background:linear-gradient(180deg,#42dfff,#078de4 70%,#096bc3);
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.65),
        inset 0 -3px 4px rgba(0,65,154,.35),
        0 0 0 2px rgba(30,94,191,.55);

    color:#fff;
    
    font-size:26px;
    font-weight:700;
    line-height:1;
    text-shadow:0 1px 2px rgba(22,75,157,.55);
}

.currency-plus::before,
.currency-plus::after {
    content:none;
}

.settings-icon {
    width:var(--settings-size);
    height:var(--settings-size);
    flex:0 0 var(--settings-size);
    padding:0;
    border:0;
    background:transparent;
}

.main-sprite {
    display: block;
    background-image: url('../img/ui/icons-main.png');
    background-repeat: no-repeat;
    background-size: 200% 600%;
}

.settings-sprite { width: 100%; height: 100%; background-position: 100% 40%; }

.home-hero {
    top: 9.2%;
    left: 7%;
    right: 7%;
    height: 32.5%;
}

.home-big-atom {
    position: absolute;
    top: -15%;
    left: 50%;
    width: 150px;
    aspect-ratio: 1;
    transform: translateX(-50%) translateY(-10px);
    background-image: url('../img/spritesheets/main_big_atom_v2.png');
    background-repeat: no-repeat;
    background-size: 800% 800%;
    background-position: 0 0;
    animation: main-big-atom 2.667s steps(1,end) infinite;
    filter: drop-shadow(0 4px 7px rgba(13,92,181,.28));
}

.game-logo-image {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 246px;
    height: auto;
    object-fit: contain;
    transform: translateX(-50%) translateY(-25%);
    filter: drop-shadow(0 5px 4px rgba(24,45,108,.32));
}

.home-actions {
    left: 16.5%;
    right: 16.5%;
    top: 47.5%;
    gap: 8px;
}
.home-actions svg {
    width:32px;
    height:32px;
    overflow:visible;

    filter:
        drop-shadow(0 1px 0 #4b2209)
        drop-shadow(0 1px 0 #2d1205);
}

.home-actions svg path {
    fill:#fff;
    stroke:#4b2209;
    stroke-width:1.8px;
    stroke-linejoin:round;
    stroke-linecap:round;
    paint-order:stroke fill;
}
.home-actions .play-button .ui-3slice__content svg {
    width:30px;
     height:30px;
}
.home-actions .tutorial-button .ui-3slice__content svg {
    width:16px;
     height:16px;
}


.home-nav {
    border: 0;
    background: rgba(231,235,255,.82);
}

.home-nav svg { display: none; }
.home-nav button { padding-top: 4px; }

.nav-sprite {
    width: clamp(31px,8vw,42px);
    height: clamp(31px,8vw,42px);
}

.nav-sprite--home { background-position: 0 0; }
.nav-sprite--person { background-position: 0 20%; }
.nav-sprite--gift { background-position: 0 100%; }
.home-nav .active .nav-sprite--home { background-position: 100% 0; }
.home-nav .active .nav-sprite--person { background-position: 100% 20%; }
.home-nav .active .nav-sprite--gift { background-position: 100% 100%; }

.chamber-frame { object-fit: contain; }

@keyframes main-big-atom {
    0%      { background-position: 0% 0%; }
    1.5625% { background-position: 14.2857% 0%; }
    3.125%  { background-position: 28.5714% 0%; }
    4.6875% { background-position: 42.8571% 0%; }
    6.25%   { background-position: 57.1429% 0%; }
    7.8125% { background-position: 71.4286% 0%; }
    9.375%  { background-position: 85.7143% 0%; }
    10.9375%{ background-position: 100% 0%; }

    12.5%   { background-position: 0% 14.2857%; }
    14.0625%{ background-position: 14.2857% 14.2857%; }
    15.625% { background-position: 28.5714% 14.2857%; }
    17.1875%{ background-position: 42.8571% 14.2857%; }
    18.75%  { background-position: 57.1429% 14.2857%; }
    20.3125%{ background-position: 71.4286% 14.2857%; }
    21.875% { background-position: 85.7143% 14.2857%; }
    23.4375%{ background-position: 100% 14.2857%; }

    25%     { background-position: 0% 28.5714%; }
    26.5625%{ background-position: 14.2857% 28.5714%; }
    28.125% { background-position: 28.5714% 28.5714%; }
    29.6875%{ background-position: 42.8571% 28.5714%; }
    31.25%  { background-position: 57.1429% 28.5714%; }
    32.8125%{ background-position: 71.4286% 28.5714%; }
    34.375% { background-position: 85.7143% 28.5714%; }
    35.9375%{ background-position: 100% 28.5714%; }

    37.5%   { background-position: 0% 42.8571%; }
    39.0625%{ background-position: 14.2857% 42.8571%; }
    40.625% { background-position: 28.5714% 42.8571%; }
    42.1875%{ background-position: 42.8571% 42.8571%; }
    43.75%  { background-position: 57.1429% 42.8571%; }
    45.3125%{ background-position: 71.4286% 42.8571%; }
    46.875% { background-position: 85.7143% 42.8571%; }
    48.4375%{ background-position: 100% 42.8571%; }

    50%     { background-position: 0% 57.1429%; }
    51.5625%{ background-position: 14.2857% 57.1429%; }
    53.125% { background-position: 28.5714% 57.1429%; }
    54.6875%{ background-position: 42.8571% 57.1429%; }
    56.25%  { background-position: 57.1429% 57.1429%; }
    57.8125%{ background-position: 71.4286% 57.1429%; }
    59.375% { background-position: 85.7143% 57.1429%; }
    60.9375%{ background-position: 100% 57.1429%; }

    62.5%   { background-position: 0% 71.4286%; }
    64.0625%{ background-position: 14.2857% 71.4286%; }
    65.625% { background-position: 28.5714% 71.4286%; }
    67.1875%{ background-position: 42.8571% 71.4286%; }
    68.75%  { background-position: 57.1429% 71.4286%; }
    70.3125%{ background-position: 71.4286% 71.4286%; }
    71.875% { background-position: 85.7143% 71.4286%; }
    73.4375%{ background-position: 100% 71.4286%; }

    75%     { background-position: 0% 85.7143%; }
    76.5625%{ background-position: 14.2857% 85.7143%; }
    78.125% { background-position: 28.5714% 85.7143%; }
    79.6875%{ background-position: 42.8571% 85.7143%; }
    81.25%  { background-position: 57.1429% 85.7143%; }
    82.8125%{ background-position: 71.4286% 85.7143%; }
    84.375% { background-position: 85.7143% 85.7143%; }
    85.9375%{ background-position: 100% 85.7143%; }

    87.5%   { background-position: 0% 100%; }
    89.0625%{ background-position: 14.2857% 100%; }
    90.625% { background-position: 28.5714% 100%; }
    92.1875%{ background-position: 42.8571% 100%; }
    93.75%  { background-position: 57.1429% 100%; }
    95.3125%{ background-position: 71.4286% 100%; }
    96.875% { background-position: 85.7143% 100%; }
    98.4375%, 100% { background-position: 100% 100%; }
}

@media (max-height:650px) {
    .home-top {
        --profile-width:34%;
        --profile-height:27px;
        --particles-width:25%;
        --particles-height:27px;
        --settings-size:34px;
        gap:4px;
    }
    
}

/* =========================================================
   HLAVNÁ OBRAZOVKA – HEADER – FINÁLNE ROZMERY
   Hodnoty doladené cez Header Tuner.
   ========================================================= */
.home-top {
    top:12px;
    gap:23px;
}

.profile-button {
    flex:0 0 150px;
    width:150px;
    max-width:150px;
    height:22px;
    transform:translateX(1px);
}

.profile-avatar {
    width:40px;
    height:40px;
    border-width:0;
    padding:0;
    left:-14px;
    transform:translateY(calc(-50% + 1px));
}

.profile-avatar img {
    width:100%;
    height:100%;
}

.home-name {
    font-size:10px;
    transform:translateX(2px);
}

.home-level {
    width:26px;
    height:30px;
    right:-6px;
    top:-11px;
    font-size:14px;
}

.currency-button {
    flex:0 0 87px;
    width:87px;
    max-width:87px;
    height:22px;
    transform:translateX(-6px);
}

.particle-vial {
    width:32px;
    height:32px;
    left:-7px;
    transform:translateY(-50%);
}

.currency-button b {
    font-size:10px;
}

.currency-plus {
    width:20px;
    height:20px;
    right:-1px;
    transform:translateY(-50%);
    font-size:18px;
}

.settings-icon {
    width:34px;
    height:34px;
    flex:0 0 34px;
}

/* =========================================================
   HLAVNÁ OBRAZOVKA – PROFIL HRÁČA
   Avatar + 3-slice meno + level badge.
   Táto sekcia je finálna autorita pre profil v home headeri.
   ========================================================= */

/* Klikateľný profil je iba kontajner; grafiku tvoria vnútorné PNG vrstvy. */
.home-top .profile-button {
    position:relative;
    flex:0 0 170px;
    width:170px;
    max-width:170px;
    height:34px;
    min-width:0;
    margin:0;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    overflow:visible;
    transform:translateX(1px);
    display:block;
}

/* Ruší starý dekoratívny odlesk pôvodného CSS profilu. */
.home-top .profile-button::before,
.home-top .profile-button::after {
    content:none;
}

/* ---------- Avatar ---------- */
.home-top .profile-avatar {
    position:absolute;
    z-index:4;
    left:-2px;
    top:50%;
    width:52px;
    height:49px;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    transform:translateY(-50%);
    overflow:visible;
    display:block;
}

/*
 * Portrait clip:
 * - hore je oblasť rozšírená, takže vlasy/hlava môžu prečnievať nad rám,
 * - dole končí presne na spodku rámu, takže avatar pod rám nepretečie.
 */
 .home-top .profile-avatar__background {
    position:absolute;
    z-index:0;

    left:7%;
    right:7%;
    top:7%;
    bottom:7%;

    border-radius:20%;
    overflow:hidden;

    background:linear-gradient(
        to bottom,
        #1268b8 0%,
        #249cdd 18%,
        #65d8fb 50%,
        #249cdd 82%,
        #1268b8 100%
    );

    pointer-events:none;
}
.home-top .profile-avatar__portrait-clip {
    position:absolute;
    z-index:3;

    left:-35%;
    right:-35%;
    top:-50%;
    bottom:7%;

    overflow:hidden;
    pointer-events:none;
}

.home-top .profile-avatar__portrait {
    position:absolute;
    left:50%;
    bottom:0;

    width:48px;
    height:auto;
    max-width:none;

    transform:translateX(-50%);
    object-fit:contain;
    border-radius:0;
}

.home-top .profile-avatar__frame {
    position:absolute;
    z-index:2;

    inset:0;
    width:100%;
    height:100%;

    object-fit:fill;
    border-radius:0;
    pointer-events:none;
}
.home-top .profile-avatar::after {
    content:"";
    position:absolute;
    z-index:4;

    left:0;
    right:0;
    bottom:0;

    width:100%;
    height:100%;

    background:
        url('../img/ui/profile-frame.png')
        center / 100% 100%
        no-repeat;

    /* zobrazíme iba spodnú časť rámu */
    clip-path:inset(72% 0 0 0);

    pointer-events:none;
}
/* ---------- 3-slice lišta mena ---------- */
.home-top .profile-nameplate.ui-3slice {
    position:absolute;
    z-index:2;
    display:block;
    left:39px;
    top:50%;
    width:118px;
    height:28px;
    transform:translateY(-50%);
    overflow:visible;
    --ui-shadow:drop-shadow(0 2px 2px rgba(18,48,105,.48));
}

.home-top .profile-nameplate .ui-3slice__content {
    box-sizing:border-box;
    padding:0 24px 0 16px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
}

.home-top .home-name {
    position:relative;
    z-index:1;
    display:block;
    flex:1;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:left;
    color:#fff;
    font-size:11px;
    font-weight:900;
    line-height:1;
    text-shadow:
        0 1px 1px rgba(7,23,58,.95),
        0 2px 2px rgba(7,23,58,.70);
    transform:none;
    font-family:var(--font-display-baloo);
    font-size:11px;
    font-weight:700;
}

/* ---------- Level / rank ---------- */
.home-top .home-level {
    position:absolute;
    z-index:5;
    right:-2px;
    top:50%;
    width:35px;
    height:39px;
    transform:translateY(-50%);
    display:grid;
    place-items:center;
    clip-path:none;
    background:none;
    border:0;
    filter:drop-shadow(0 2px 2px rgba(20,45,95,.45));
}

.home-top .home-level img {
    position:absolute;
    z-index:0;
    inset:0;
    width:100%;
    height:100%;
    object-fit:fill;
}

.home-top .home-level b {
    position:relative;
    z-index:1;
    color:#fff;
    font-size:15px;
    font-weight:900;
    line-height:1;
    text-shadow:
        0 1px 1px rgba(5,24,64,.95),
        0 2px 2px rgba(5,24,64,.72);
}

/* Malé výšky: profil ostáva čitateľný, iba sa mierne zmenší. */
@media (max-height:650px) {
    .home-top .profile-button {
        width:160px;
        max-width:160px;
        flex-basis:160px;
        height:32px;
    }

    .home-top .profile-avatar {
        width:49px;
        height:46px;
    }

    .home-top .profile-nameplate.ui-3slice {
        left:37px;
        width:111px;
        height:26px;
    }

    .home-top .home-level {
        width:33px;
        height:37px;
    }
}

/* =========================================================
   HLAVNÁ OBRAZOVKA – ČASTICE – PNG GRAFIKA
   ========================================================= */
.home-top .currency-button {
    position:relative;
    flex:0 0 90px;
    width:90px;
    max-width:90px;
    height:27px;
    min-width:0;
    margin-left:auto;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    overflow:visible;
    transform:translateX(-6px);
    display:block;
    color:#fff!important;
    text-shadow:none;
}

.home-top .currency-button::before,
.home-top .currency-button::after {
    content:none;
}

.home-top .particles-panel {
    position:absolute;
    z-index:1;
    left:10px;
    top:50%;
    width:79px;
    height:25px;
    transform:translateY(-50%);
    object-fit:fill;
    pointer-events:none;
}

.home-top .particle-vial {
    position:absolute;
    z-index:3;
    left:-6px;
    top:50%;
    width:31px;
    height:auto;
    max-width:none;
    transform:translateY(-50%) rotate(-8deg);
    display:block;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    object-fit:contain;
    pointer-events:none;
}

.home-top .particle-vial::before,
.home-top .particle-vial::after {
    content:none;
}

.home-top .currency-button b {
    position:absolute;
    z-index:2;
    left:31px;
    right:26px;
    top:50%;
    width:auto;
    transform:translateY(-50%);
    text-align:center;
    color:#fff;
    
    font-size:11px;
    font-weight:700;
    line-height:1;

}

.home-top .currency-plus {
    position:absolute;
    z-index:4;
    right:2px;
    top:50%;
    width:21px;
    height:21px;
    max-width:none;
    transform:translateY(-50%);
    display:block;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    object-fit:contain;
    pointer-events:none;
}
.home-top .currency-plus::before,.home-top .currency-plus::after {content:none;}
@media (max-height:650px) {
    .home-top .currency-button {width:100px;max-width:100px;flex-basis:100px;height:30px;}
    .home-top .particles-panel {width:87px;height:28px;}
    .home-top .particle-vial {width:36px;}
    .home-top .currency-plus {width:28px;height:28px;}
    .home-top .currency-button b {font-size:14px;}
}



/* =========================================================
   HLAVNÁ OBRAZOVKA – NASTAVENIA – PNG TLAČIDLO
   ========================================================= */
.home-top .settings-icon {
    position:relative;
    width:34px;
    height:34px;
    flex:0 0 34px;
    padding:0;
    border:0;
    border-radius:0;
    background:none;
    box-shadow:none;
    overflow:visible;
}

.home-top .settings-button-bg {
    position:absolute;
    z-index:1;
    inset:0;
    width:100%;
    height:100%;
    display:block;
    object-fit:contain;
    pointer-events:none;
}

.home-top .settings-button-icon {
    position:absolute;
    z-index:2;
    left:50%;
    top:50%;
    width:58%;
    height:58%;
    display:block;
    object-fit:contain;
    transform:translate(-50%,-50%);
    pointer-events:none;
}


/* =========================================================
   SPODNÁ NAVIGÁCIA – CSS TLAČIDLÁ + PNG IKONY
   Aktívny stav používa existujúcu triedu .active.
   ========================================================= */
/* =========================================================
   SPODNÁ NAVIGÁCIA – CSS TLAČIDLÁ + PNG IKONY
   ========================================================= */

.home-nav {
    position:absolute;
    z-index:4;
    left:0;
    right:0;
    bottom:0;

    height:72px;
    min-height:0;

    display:flex;
    overflow:visible;

    /* horná hrana panelu:
       1px tmavá
       4px svetlejšia
       1px najsvetlejšia */
    border:0;
    border-top:1px solid #061b42;

    background:
        linear-gradient(
            to bottom,
            #27659b 0px,
            #27659b 4px,
            #3b86b9 4px,
            #3b86b9 5px,
            #0d3975 5px,
            #0d3975 100%
        );

    border-radius:0;

    box-shadow:none;

    /* tlačidlá budú presahovať nad panel */
    padding-top:0;
    
    padding-left:10px;
padding-right:10px;
}


/* =========================================================
   TLAČIDLO
   ========================================================= */

.home-nav button {
    position:relative;

    flex:1 1 0;
    min-width:0;
    height:100%;

    margin:0;
    padding:5px 2px 7px;

    border:1px solid #071e49;
    border-radius:10px;

    overflow:hidden;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:1px;

    background:
        linear-gradient(
            180deg,
            #235b98 0%,
            #194a83 48%,
            #123b73 100%
        );

    box-shadow:
        inset 0 3px 0 rgba(102,190,255,.30),
        inset 0 -3px 0 rgba(3,25,65,.42),
        0 2px 0 #061b43;

    color:#fff;

    
    font-size:15px;
    font-weight:600;
    line-height:1;

    text-shadow:
        0 1px 0 #071b42,
        0 2px 1px rgba(2,13,36,.85);
        
        transform:translateY(-5px);
}

.app-screen .home-nav button:active:not(:disabled),
.app-screen .home-nav button.is-pressing {
    transform:translateY(0) scale(.97) !important;
    filter:brightness(.82);
}
/* =========================================================
   HORNÝ ZAOBLENÝ LESK
   ========================================================= */

.home-nav button::before {
    content:"";

    position:absolute;
    z-index:0;

    left:7px;
    right:7px;
top:1px;
height:10px;

border-radius:8px 8px 50% 50%;

border-top:4px solid rgba(112,201,255,.55);

    background:
        linear-gradient(
            to bottom,
            rgba(105,200,255,.16),
            transparent
        );

    pointer-events:none;
    left:2px;
right:2px;
top:0;
height:6px;
border-radius:5px 5px 25% 25%;
border-top:4px solid rgba(112,201,255,.65);
}


/* =========================================================
   AKTÍVNE TLAČIDLO
   ========================================================= */

.home-nav button.active {
    background:
        linear-gradient(
            180deg,
            #249cff 0%,
            #1487ee 47%,
            #0869d0 100%
        );

    box-shadow:
        inset 0 3px 0 rgba(112,235,255,.80),
        inset 0 -3px 0 rgba(3,67,166,.48),
        0 2px 0 #061b43;

    color:#fff;
}


/* Aktívny horný lesk */

.home-nav button.active::before {
    border-top-color:rgba(151,240,255,.90);

    background:
        linear-gradient(
            to bottom,
            rgba(115,231,255,.22),
            transparent
        );
}


/* =========================================================
   IKONY
   ========================================================= */

.home-nav .nav-icon {
    position:relative;
    z-index:1;

    display:block;

    width:31px;
    height:31px;
    flex:0 0 31px;

    object-fit:contain;

    filter:
        drop-shadow(0 2px 1px rgba(4,24,62,.65));

    pointer-events:none;
}


/* =========================================================
   TEXT
   ========================================================= */

.home-nav button span {
    position:relative;
    z-index:1;

    display:block;

    white-space:nowrap;

    pointer-events:none;
}


/* =========================================================
   SPODNÁ SVIETIACA ČIARA AKTÍVNEHO TLAČIDLA
   ========================================================= */

.home-nav button.active::after {
    content:"";

    position:absolute;
    z-index:2;

    left:25%;
    right:25%;
    bottom:5px;

    width:auto;
    height:3px;

    border-radius:999px;

    background:#9dffff;

    box-shadow:
        0 0 3px #66f5ff,
        0 0 7px rgba(64,229,255,.85);
}


/* =========================================================
   STARÉ SPRITESHEET IKONY VYPÍNAME
   ========================================================= */

.home-nav .nav-sprite,
.home-nav svg {
    display:none;
}


/* =========================================================
   MENŠIE VÝŠKY DISPLEJA
   ========================================================= */

@media (max-height:650px) {

    .home-nav {
        height:62px;
    }

    .home-nav button {
        padding:4px 2px 6px;
        font-size:13px;
        border-radius:14px;
    }

    .home-nav button::before {
        left:6px;
        right:6px;
        top:3px;
        height:8px;
        border-radius:10px 10px 50% 50%;
    }

    .home-nav .nav-icon {
        width:27px;
        height:27px;
        flex-basis:27px;
    }

    .home-nav button.active::after {
        bottom:4px;
        height:3px;
    }
}


/* =========================================================
   ZJEDNOTENÝ PRESS EFEKT – HEADER
   Vonkajší button nemení svoju pozičnú transformáciu.
   ========================================================= */
.home-top .settings-button-bg,
.home-top .settings-button-icon,
.home-top .particles-panel,
.home-top .particle-vial,
.home-top .currency-plus,
.home-top .currency-button b {
    transition:transform 70ms ease-out, filter 70ms ease-out;
    transform-origin:50% 55%;
}

.home-top .settings-icon.is-pressing .settings-button-bg {
    transform:translateY(2px) scale(.985);
    filter:brightness(.93);
}
.home-top .settings-icon.is-pressing .settings-button-icon {
    transform:translate(-50%,calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}

.home-top .currency-button.is-pressing .particles-panel {
    transform:translateY(calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}
.home-top .currency-button.is-pressing .particle-vial {
    transform:translateY(calc(-50% + 2px)) rotate(-8deg) scale(.985);
    filter:brightness(.93);
}
.home-top .currency-button.is-pressing .currency-plus {
    transform:translateY(calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}
.home-top .currency-button.is-pressing b {
    transform:translateY(calc(-50% + 2px)) scale(.985);
}


/* Profil: press iba na grafike vo vnútri, nie na .profile-button.
   Tým sa zachová jeho pozičný translateX a nič neuhne do boku. */
.home-top .profile-avatar,
.home-top .profile-nameplate,
.home-top .home-level {
    transition:transform 70ms ease-out, filter 70ms ease-out;
    transform-origin:50% 55%;
}

.home-top .profile-button.is-pressing .profile-avatar {
    transform:translateY(calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}

.home-top .profile-button.is-pressing .profile-nameplate {
    transform:translateY(calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}

.home-top .profile-button.is-pressing .home-level {
    transform:translateY(calc(-50% + 2px)) scale(.985);
    filter:brightness(.93);
}

/* =========================================================
   REACTION CHAMBERS – PNG ASSETY + PROGRAMOVÉ NAPLNENIE
   Finálna autorita; prepisuje pôvodnú prototypovú grafiku komôr.
   ========================================================= */
.home-chambers {
    left:1%;
    right:1%;
    bottom:9%;
    height:25%;
    gap:0;
    align-items:flex-end;
    transform:translateY(-4px) scale(.98);
    transform-origin:center bottom;
}

.home-chambers .chamber {
    position:relative;
    display:block;
    flex:1 1 33.333%;
    width:33.333%;
    height:100%;
    min-width:0;
    margin:0;
    padding:0;
    border:0;
    background:none !important;
    overflow:visible;
}

.home-chambers .chamber-art {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
}

.home-chambers .chamber-body {
    position:absolute;
    z-index:3;
    left:50%;
    bottom:0;
    width:100%;
    height:100%;
    max-width:none;
    object-fit:contain;
    transform:translateX(-50%);
    pointer-events:none;
}

/* Efekty sú pod PNG komory, takže ich sklo prirodzene prekryje. */
.home-chambers .chamber-effects {
    position:absolute;
    z-index:2;
    left:17%;
    right:17%;
    top:25%;
    bottom:27%;
    overflow:hidden;
    border-radius:8% 8% 14% 14%;
    pointer-events:none;
}

.home-chambers .chamber-light-fx {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:fill;
    opacity:calc(.08 + var(--fill) * .94);
    mix-blend-mode:screen;
    animation:chamberLightPulse 2.8s ease-in-out infinite alternate;
}

.home-chambers .chamber-glow {
    position:absolute;
    z-index:1;
    left:5%;
    right:5%;
    bottom:-5%;
    width:90%;
    height:38%;
    object-fit:fill;
    opacity:.9;
    mix-blend-mode:screen;
    animation:chamberGlowPulse 2.2s ease-in-out infinite alternate;
}

.home-chambers .chamber-particles {
    position:absolute;
    z-index:2;
    inset:4% 3% 5%;
    transform:translateY(5px);
}

.home-chambers .chamber-particle {
    position:absolute;
    left:var(--px);
    top:var(--py);
    width:38%;
    height:auto;
    max-width:none;
    transform:translate(-50%,-50%) scale(var(--ps));
    transform-origin:center;
    object-fit:contain;
    filter:drop-shadow(0 0 5px var(--energy));
    animation:chamberParticleFloat var(--duration) ease-in-out var(--delay) infinite alternate;
}

.home-chambers .chamber-bubbles {
    position:absolute;
    z-index:3;
    left:8%;
    right:8%;
    bottom:7%;
    width:84%;
    height:54%;
    object-fit:contain;
    opacity:.9;
    mix-blend-mode:screen;
    animation:chamberBubbles 3.6s ease-in-out infinite alternate;
}

/* Sloty s naplnením sú CSS – obrázok komory obsahuje iba prázdne miesto. */
.home-chambers .chamber-progress {
    position:absolute;
    z-index:5;
    left:24%;
    right:24%;
    bottom:16%;
    height:8%;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:2px;
    pointer-events:none;
    transform: translateY(-8px);
}

.home-chambers .chamber-progress i {
    flex:1 1 0;
    height:62%;
    min-width:0;
    border:1px solid rgba(4,20,52,.92);
    border-radius:999px;
    background:rgba(5,34,70,.78);
    box-shadow:inset 0 1px 2px rgba(0,0,0,.55);
}

.home-chambers .chamber-progress i.filled {
    border-color:rgba(213,251,255,.78);
    background:var(--energy);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.75),
        0 0 4px var(--energy),
        0 0 8px color-mix(in srgb,var(--energy) 75%,transparent);
}

/* =========================================================
   REACTION CHAMBER – STAVY
   ========================================================= */


/* ---------------------------------------------------------
   PRÁZDNA KOMORA
   --------------------------------------------------------- */

/* žiadne častice */
.chamber.is-empty .chamber-particles {
    display: none;
}

/* žiadne bublinky */
.chamber.is-empty .chamber-bubbles {
    display: none;
}

/* vypnúť glow */
.chamber.is-empty .chamber-glow {
    opacity: 0 !important;
}

/* vypnúť light FX */
.chamber.is-empty .chamber-light-fx {
    opacity: 0 !important;
}


/* ---------------------------------------------------------
   PLNÁ KOMORA
   --------------------------------------------------------- */

/* výraznejšia žiara */
.chamber.is-full .chamber-glow {
    opacity: 1 !important;
    animation: chamberFullGlow 1.4s ease-in-out infinite alternate;
}

.chamber.is-full .chamber-light-fx {
    opacity: 1 !important;
    animation: chamberFullLight 1.4s ease-in-out infinite alternate;
}


/* pulz žiary */

@keyframes chamberFullGlow {

    0% {
        transform: scale(.97);
        filter: brightness(1);
    }

    100% {
        transform: scale(1.04);
        filter: brightness(1.35);
    }
}


/* pulz vnútorného svetla */

@keyframes chamberFullLight {

    0% {
        opacity: .70;
    }

    100% {
        opacity: 1;
    }
}


/* =========================================================
   OTVORIŤ
   ========================================================= */

.chamber-open {

    position: absolute;

    left: 50%;
top: -2px;
bottom: auto;

    z-index: 20;

    transform: translateX(-50%);

    padding: 4px 15px 2px;

    white-space: nowrap;


    font-size: 12px;
    font-weight: 700;

    color: #fff;

    text-shadow:
        0 1px 0 rgba(0,0,0,.65),
        0 2px 2px rgba(0,0,0,.45);

    background:
        linear-gradient(
            to bottom,
            color-mix(in srgb, var(--energy) 75%, white),
            var(--energy)
        );

    border: 2px solid rgba(255,255,255,.7);

    border-radius: 4px;

    box-shadow:
        0 2px 0 rgba(0,0,0,.45),
        0 0 8px var(--energy);

    pointer-events: none;

    animation:
        chamberOpenFloat
        1.05s
        ease-in-out
        infinite
        alternate;
}


/* malá šípka smerujúca na komoru */

.chamber-open::before {
    content: "";

    position: absolute;

    left: 50%;
    bottom: -7px;
    top: auto;

    width: 10px;
    height: 10px;

    background: inherit;

    border-right: 2px solid rgba(255,255,255,.7);
    border-bottom: 2px solid rgba(255,255,255,.7);

    transform:
        translateX(-50%)
        rotate(45deg);
}


/* jemné poskakovanie */

@keyframes chamberOpenFloat {
    from {
        transform:
            translateX(-50%)
            translateY(0);
    }

    to {
        transform:
            translateX(-50%)
            translateY(-4px);
    }
}
/* Starý prototyp komory sa už nepoužíva. */
.home-chambers .chamber-frame,
.home-chambers .chamber-glass,
.home-chambers .chamber-fill,
.home-chambers .chamber-marks,
.home-chambers .chamber-atom,
.home-chambers .chamber-sparks,
.home-chambers .chamber-name,
.home-chambers .chamber-meter,
.home-chambers .chamber-count {
    display:none !important;
}

@keyframes chamberParticleFloat {
    0% {
        transform:translate(-50%,-50%)
                  translate(var(--dx1),var(--dy1))
                  rotate(var(--rot1))
                  scale(var(--ps));
    }
    100% {
        transform:translate(-50%,-50%)
                  translate(var(--dx2),var(--dy2))
                  rotate(var(--rot2))
                  scale(var(--ps));
    }
}

@keyframes chamberGlowPulse {
    from { transform:scale(.96); filter:brightness(.90); }
    to   { transform:scale(1.04); filter:brightness(1.18); }
}

@keyframes chamberLightPulse {
    from { filter:brightness(.90); }
    to   { filter:brightness(1.12); }
}

@keyframes chamberBubbles {
    from { transform:translateY(3px); }
    to   { transform:translateY(-4px); }
}

@media (prefers-reduced-motion:reduce) {
    .home-chambers .chamber-light-fx,
    .home-chambers .chamber-glow,
    .home-chambers .chamber-particle,
    .home-chambers .chamber-bubbles { animation:none !important; }
}


/* Plná komora: krátke upozorňujúce zatrasenie.
   Interval spúšťania je v ReactionChambers.js (fullShakeIntervalMs). */
.home-chambers .chamber.is-full.is-shaking .chamber-art {
    animation:chamberFullShake .62s ease-in-out;
}

@keyframes chamberFullShake {
    0%,100% { transform:translate(0,0) rotate(0); }
    15%     { transform:translate(-3px,0) rotate(-1deg); }
    30%     { transform:translate(3px,0) rotate(1deg); }
    45%     { transform:translate(-2px,0) rotate(-.7deg); }
    60%     { transform:translate(2px,0) rotate(.7deg); }
    75%     { transform:translate(-1px,0) rotate(-.3deg); }
    90%     { transform:translate(1px,0) rotate(.3deg); }
}

@media (prefers-reduced-motion:reduce) {
    .home-chambers .chamber.is-full.is-shaking .chamber-art {
        animation:none !important;
    }
}

/* =========================================================
   SETTINGS + LANGUAGE MODALS — FINAL / SINGLE AUTHORITY
   ========================================================= */

.app-modal {
    position:fixed;
    inset:0;
    z-index:1500;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom));
    background:#15264d70;
    backdrop-filter:blur(5px);
    color:#293677;
}

.app-dialog {
    width:min(100%,390px);
    max-height:94dvh;
    overflow:auto;
    box-sizing:border-box;
    padding:18px;

    /* hrúbka gradientového rámu */
    border:3px solid transparent;
    border-radius:23px;

    /*
       1. vrstva = vnútro modalu
       2. vrstva = gradient rámu
    */
    background:
        radial-gradient(
            ellipse at 50% 42%,
            #f8f9ff 0%,
            #f0f3ff 34%,
            #e2e8ff 70%,
            #cbd6fb 100%
        ) padding-box,

        linear-gradient(
            180deg,
            #ffffff 0%,
            #edf1ff 20%,
            #c6d1f6 65%,
            #8299df 100%
        ) border-box;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.8),
        inset 0 -2px 3px rgba(70,91,166,.12),
        0 4px 10px rgba(31,48,108,.20);

    font-family:var(--font-display-baloo);
}

.app-dialog header {
    display:grid;
    grid-template-columns:44px 1fr 44px;
    align-items:center;
    gap:8px;
    margin-bottom:14px;
}

.app-dialog h2 {
    margin:0;
    color:#233b8e;
    font-family:var(--font-display-baloo);
    font-size:20px;
    font-weight:700;
    line-height:1;
    letter-spacing:.1px;
    text-align:center;
}

.app-dialog p { line-height:1.6; }
.app-dialog button { color:inherit; font:inherit; cursor:pointer; }

.modal-header-spacer {
    width:44px;
    height:44px;
}

.modal-image-button {
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    padding:0;
    border:0;
    border-radius:11px;
    background:transparent !important;
    transition:transform 80ms ease,filter 80ms ease;
}

.modal-image-button img {
    width:100%;
    height:100%;
    display:block;
    object-fit:contain;
    pointer-events:none;
    filter:drop-shadow(0 1px 0 rgba(255,255,255,.9));
}

.modal-image-button.is-pressing {
    transform:translateY(3px) scale(.96);
    filter:brightness(.91) drop-shadow(0 1px 1px rgba(55,72,140,.25));
}

.setting-icon-img {
    width:36px;
    height:36px;
    flex:0 0 36px;
    object-fit:contain;
    pointer-events:none;
    filter:
        drop-shadow(0 1px 0 rgba(255,255,255,.9))
        drop-shadow(0 2px 2px rgba(42,60,133,.22));
}

.settings-group {
    padding:4px 14px;
    border:1px solid #bdcaf0;
    border-radius:16px;
    background:
        linear-gradient(180deg,
            rgba(255,255,255,.62) 0%,
            rgba(241,244,255,.48) 48%,
            rgba(219,226,252,.62) 100%);
    box-shadow:
        inset 0 1px 0 #fff,
        inset 0 2px 3px rgba(255,255,255,.45),
        inset 0 -1px 0 rgba(100,127,204,.42),
        0 2px 3px rgba(60,82,155,.14);
}

.app-setting {
    min-height:64px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 0;
}

.app-setting > span:nth-child(2) {
    flex:1;
    color:#233b8e;
    font-size:15px;
    font-weight:600;
}

.app-setting output {
    min-width:30px;
    font-size:14px;
    font-weight:600;
}

.app-setting input[type=range] {
    display:block;
    width:100%;
    margin:13px 0 0;
    accent-color:#07bff2;
    filter:drop-shadow(0 1px 1px rgba(35,62,130,.20));
}

.app-setting input[type=checkbox] {
    appearance:none;
    position:relative;
    width:45px;
    height:27px;
    border:1px solid rgba(30,117,185,.45);
    border-radius:20px;
    background:linear-gradient(180deg,#9eadd5,#bcc7e4);
    box-shadow:
        inset 0 2px 4px rgba(40,61,130,.28),
        0 1px 1px rgba(255,255,255,.9);
    cursor:pointer;
}

.app-setting input[type=checkbox]:checked {
    border-color:#078dc9;
    background:linear-gradient(180deg,#24dcf4 0%,#08bde9 48%,#029bd9 100%);
    box-shadow:
        inset 0 2px 2px rgba(255,255,255,.50),
        inset 0 -2px 3px rgba(0,91,167,.25),
        0 2px 3px rgba(29,93,165,.20);
}

.app-setting input[type=checkbox]::after {
    content:'';
    position:absolute;
    top:2px;
    left:2px;
    width:21px;
    height:21px;
    border-radius:50%;
    background:#fff;
    box-shadow:
        inset 0 1px 1px #fff,
        0 1px 3px rgba(32,62,131,.38);
    transition:transform .15s;
}

.app-setting input[type=checkbox]:checked::after {
    transform:translateX(18px);
}

/* Shared raised row material */
.settings-link,
.language-list button {
    position:relative;
    box-sizing:border-box;
    width:100%;
    display:flex;
    align-items:center;
    border:1px solid #b5c5f0;
    border-radius:14px;
    background:
        linear-gradient(180deg,
            #e9eafe 0%,
            #e2e5fd 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,1),
        inset 0 -1px 0 rgba(91,119,201,.50),
        0 1px 1px rgba(61,83,158,.18);
    transition:transform 80ms ease,filter 80ms ease,box-shadow 80ms ease;
}

/* No pseudo-elements: they were the source of the visible white strip. */
.settings-link::before,
.settings-link::after,
.language-list button::before,
.language-list button::after {
    content:none;
}

.settings-link {
    min-height:64px;
    justify-content:flex-start;
    gap:12px;
    margin-top:10px;
    padding:10px 14px;
    font-weight:600;
}

.settings-link > span {
    flex:1;
    color:#233b8e;
    text-align:left;
}

.settings-link b {
    padding:7px 12px;
    border:1px solid #c4d0fa;
    border-radius:18px;
    background:linear-gradient(180deg,#f3f5ff 0%,#e1e7ff 100%);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        0 1px 2px rgba(76,96,170,.12);
    font-size:14px;
    font-weight:500;
}

.settings-chevron {
    color:#263e91;
    font-style:normal;
    font-size:29px;
    font-weight:700;
    line-height:1;
    text-shadow:0 1px 0 rgba(255,255,255,.9);
}

.settings-note {
    color:#6877aa;
    font-size:12px;
}

.settings-link.is-pressing,
.language-list button.is-pressing {
    transform:translateY(2px) scale(.988);
    filter:brightness(.94);
    box-shadow:
        inset 0 2px 4px rgba(97,115,174,.20),
        inset 0 -1px 0 rgba(91,119,201,.45);
}

.app-dialog footer {
    margin-top:58px;
    color:#7687b3;
    font-size:12px;
    text-align:center;
}

/* LANGUAGE — rows intentionally overlap by 1px so their borders touch.
   This removes the visual gap while keeping each row rounded. */
.language-list {
    display:flex;
    flex-direction:column;
    gap:0;
}

.language-list button {
    min-height:54px;
    justify-content:flex-start;
    gap:14px;
    margin:0;
    padding:6px 14px;
    font-size:15px;
    font-weight:600;
}

.language-list button + button {
    margin-top:-2px;
}

.language-list button > span {
    flex:1;
    text-align:left;
}

.language-list button:disabled {
    opacity:.5;
    cursor:default;
}

.language-flag {
    width:38px;
    height:38px;
    flex:0 0 38px;
    object-fit:contain;
    pointer-events:none;
}

.language-radio {
    position:relative;
    box-sizing:border-box;
    width:23px;
    height:23px;
    flex:0 0 23px;
    border:2px solid #91a9ec;
    border-radius:50%;
}

.language-list button[aria-pressed="true"] .language-radio {
    border-color:#00aef1;
    box-shadow:0 0 0 1px #00aef133;
}

.language-list button[aria-pressed="true"] .language-radio::after {
    content:'';
    position:absolute;
    inset:3px;
    border-radius:50%;
    background:#00b9f2;
    box-shadow:inset 0 1px 2px #008ed0;
}

.app-dialog.language-dialog {
    padding:14px 14px 16px;
}

.language-dialog header {
    margin-bottom:10px;
}


/* =========================================================
   HLAVNÁ OBRAZOVKA – ODLESKY ATÓMU
   Pevné odlesky nad sprite atómu; každý bliká v inom čase.
   ========================================================= */
.atom-shine {
    position:absolute;
    z-index:2;
    width:26px;
    height:26px;
    background:url('../img/ui/atom-shine.png') center / contain no-repeat;
    pointer-events:none;
    opacity:0;
    transform-origin:center;
    animation:atomShine 6s ease-in-out infinite;
}

.atom-shine--1 {
    left:calc(50% - 53px);
    top:30px;
    width:50px;
    height:50px;
    animation-delay:-.35s;
}

.atom-shine--2 {
    left:calc(50% + 70px);
    top:55px;
    width:45px;
    height:45px;
    animation-delay:-1.45s;
}

.atom-shine--3 {
    left:calc(50% - 18px);
    top:79px;
    width:40px;
    height:40px;
    animation-delay:-2.35s;
}

@keyframes atomShine {
    0%, 66%, 100% { opacity:0; transform:scale(.35) rotate(-12deg); }
    72%           { opacity:.55; transform:scale(.72) rotate(0deg); }
    77%           { opacity:1; transform:scale(1.18) rotate(10deg); }
    83%           { opacity:.72; transform:scale(.88) rotate(18deg); }
    90%           { opacity:0; transform:scale(.42) rotate(28deg); }
}
