/* Nyári Kaland - school-safe visual arcade */

.nyk-wrap {
    --nyk-sky: #80e7ff;
    --nyk-sun: #ffd166;
    --nyk-sand: #ffe7a3;
    --nyk-orange: #ff9f1c;
    --nyk-pink: #ff4d8d;
    --nyk-blue: #118ab2;
    --nyk-green: #2ec4b6;
    --nyk-ink: #153243;
    --nyk-white: rgba(255,255,255,.9);
    position: relative;
    width: min(100%, 1100px);
    height: min(78vh, 720px);
    min-height: 610px;
    margin: 28px auto;
    overflow: hidden;
    border-radius: 34px;
    color: var(--nyk-ink);
    font-family: inherit;
    background:
        radial-gradient(circle at 20% 18%, rgba(255,255,255,.88) 0 3%, transparent 11%),
        linear-gradient(180deg, #68dcff 0%, #9cf0ff 38%, #fff0b7 72%, #ffd28f 100%);
    box-shadow:
        0 24px 70px rgba(17, 138, 178, .24),
        inset 0 0 0 1px rgba(255,255,255,.58);
    isolation: isolate;
}

.nyk-wrap * {
    box-sizing: border-box;
}

.nyk-confetti {
    position: absolute;
    inset: 0;
    z-index: 12;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.nyk-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.nyk-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(.2px);
    opacity: .86;
    animation: nykDrift 8s ease-in-out infinite;
}

.nyk-orb-one {
    width: 160px;
    height: 160px;
    top: 48px;
    left: 70px;
    background: radial-gradient(circle, #fff8cf 0%, #ffd166 52%, rgba(255,209,102,.0) 72%);
    box-shadow: 0 0 54px rgba(255,209,102,.8);
}

.nyk-orb-two {
    width: 120px;
    height: 120px;
    right: 90px;
    top: 95px;
    background: radial-gradient(circle, rgba(255,77,141,.68), rgba(255,77,141,0) 70%);
    animation-delay: -2s;
}

.nyk-orb-three {
    width: 180px;
    height: 180px;
    left: 52%;
    bottom: 86px;
    background: radial-gradient(circle, rgba(46,196,182,.62), rgba(46,196,182,0) 70%);
    animation-delay: -4s;
}

.nyk-wave {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 160px;
    bottom: 0;
    border-radius: 50% 50% 0 0;
    transform-origin: center bottom;
}

.nyk-wave-one {
    bottom: -80px;
    background: rgba(17,138,178,.22);
    animation: nykWave 6s ease-in-out infinite;
}

.nyk-wave-two {
    bottom: -102px;
    background: rgba(46,196,182,.28);
    animation: nykWave 7s ease-in-out infinite reverse;
}

.nyk-cloud {
    position: absolute;
    font-size: 76px;
    opacity: .85;
    filter: drop-shadow(0 10px 18px rgba(21,50,67,.10));
    animation: nykCloud 18s linear infinite;
}

.nyk-cloud-one {
    top: 80px;
    left: -110px;
}

.nyk-cloud-two {
    top: 210px;
    left: -180px;
    font-size: 58px;
    animation-duration: 26s;
    animation-delay: -9s;
}

.nyk-palm {
    position: absolute;
    right: 25px;
    bottom: 25px;
    font-size: 124px;
    transform: rotate(6deg);
    filter: drop-shadow(0 18px 20px rgba(21,50,67,.16));
    animation: nykPalm 4s ease-in-out infinite;
}

.nyk-hud {
    position: absolute;
    z-index: 5;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    width: min(94%, 760px);
    pointer-events: none;
}

.nyk-pill {
    min-width: 116px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.62);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 10px 25px rgba(21,50,67,.12);
    backdrop-filter: blur(12px);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.nyk-pill strong {
    display: inline-block;
    min-width: 28px;
    font-size: 18px;
    color: #0f6f87;
}

.nyk-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
}

.nyk-mascot {
    position: absolute;
    left: 50%;
    bottom: 34px;
    z-index: 3;
    transform: translateX(-50%);
    width: 94px;
    height: 94px;
    display: grid;
    place-items: center;
    transition: left .14s ease-out;
    pointer-events: none;
}

.nyk-mascot-face {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff8cf, #ffd166);
    font-size: 46px;
    box-shadow: 0 14px 28px rgba(251,133,0,.28);
    animation: nykBob 1.2s ease-in-out infinite;
}

.nyk-mascot-shadow {
    position: absolute;
    bottom: 0;
    width: 82px;
    height: 18px;
    border-radius: 999px;
    background: rgba(21,50,67,.18);
    filter: blur(4px);
}

.nyk-start-screen,
.nyk-result {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 35%, rgba(255,255,255,.42), transparent 32%),
        rgba(128,231,255,.10);
    backdrop-filter: blur(4px);
}

.nyk-result[hidden] {
    display: none;
}

.nyk-glass,
.nyk-result-card {
    position: relative;
    width: min(94%, 720px);
    padding: clamp(24px, 4vw, 44px);
    border-radius: 34px;
    text-align: center;
    background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(255,255,255,.55));
    border: 1px solid rgba(255,255,255,.78);
    box-shadow:
        0 26px 70px rgba(21,50,67,.20),
        inset 0 1px 0 rgba(255,255,255,.9);
    overflow: hidden;
}

.nyk-glass:before,
.nyk-result-card:before {
    content: "";
    position: absolute;
    inset: -80px;
    background:
        conic-gradient(from 90deg, transparent 0deg, rgba(255,255,255,.7) 30deg, transparent 65deg, transparent 360deg);
    animation: nykShimmer 5s linear infinite;
    opacity: .48;
    pointer-events: none;
}

.nyk-glass > *,
.nyk-result-card > * {
    position: relative;
    z-index: 1;
}

.nyk-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,159,28,.17);
    color: #8a4d00;
    font-weight: 800;
    letter-spacing: .02em;
}

.nyk-glass h2,
.nyk-result-card h3 {
    margin: 0 0 12px;
    font-size: clamp(42px, 7vw, 82px);
    line-height: .95;
    color: var(--nyk-ink);
    text-shadow: 0 4px 0 rgba(255,255,255,.75);
}

.nyk-glass p {
    max-width: 620px;
    margin: 0 auto 26px;
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.5;
    font-weight: 600;
}

.nyk-rules {
    display: grid;
    grid-template-columns: repeat(5, minmax(82px, 1fr));
    gap: 12px;
    margin: 20px auto 28px;
    max-width: 630px;
}

.nyk-rules div {
    min-height: 108px;
    padding: 14px 8px;
    border-radius: 22px;
    background: rgba(255,255,255,.58);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.58);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nyk-rules span {
    font-size: 34px;
    line-height: 1;
}

.nyk-rules strong {
    margin-top: 4px;
    font-size: 24px;
    color: var(--nyk-blue);
}

.nyk-rules small {
    font-weight: 800;
    color: rgba(21,50,67,.74);
}

.nyk-start,
.nyk-restart {
    appearance: none;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 16px 34px;
    font-size: 18px;
    font-weight: 900;
    color: #2a1700;
    background:
        linear-gradient(135deg, #ffd166, #ff9f1c 58%, #ff7b00);
    box-shadow:
        0 16px 34px rgba(255,159,28,.35),
        inset 0 1px 0 rgba(255,255,255,.5);
    transition: transform .16s ease, box-shadow .16s ease;
}

.nyk-start:hover,
.nyk-restart:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 42px rgba(255,159,28,.42);
}

.nyk-close {
    position: absolute;
    top: 15px;
    right: 16px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(21,50,67,.08);
    color: var(--nyk-ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.nyk-item {
    position: absolute;
    z-index: 4;
    top: -80px;
    width: var(--size, 64px);
    height: var(--size, 64px);
    border: 0;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: calc(var(--size, 64px) * .55);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.95), rgba(255,255,255,.45) 55%, rgba(255,255,255,.2)),
        linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.38));
    border: 1px solid rgba(255,255,255,.68);
    box-shadow:
        0 16px 30px rgba(21,50,67,.16),
        inset 0 1px 0 rgba(255,255,255,.8);
    animation: nykFall var(--speed, 4s) linear forwards, nykWiggle 1.4s ease-in-out infinite;
}

.nyk-item:focus-visible {
    outline: 4px solid rgba(255,77,141,.5);
}

.nyk-item:hover {
    transform: scale(1.08);
}

.nyk-danger {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.9), rgba(255,77,141,.36) 58%, rgba(255,77,141,.26)),
        linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,77,141,.28));
}

.nyk-golden {
    box-shadow:
        0 0 0 5px rgba(255,209,102,.25),
        0 0 42px rgba(255,209,102,.78),
        0 18px 34px rgba(251,133,0,.24);
    animation: nykFall var(--speed, 4s) linear forwards, nykGoldPulse .75s ease-in-out infinite alternate;
}

.nyk-freeze {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.95), rgba(128,231,255,.46) 58%, rgba(17,138,178,.18)),
        linear-gradient(145deg, rgba(255,255,255,.72), rgba(128,231,255,.28));
}

.nyk-pop {
    animation: nykPop .24s ease forwards !important;
}

.nyk-floating-score {
    position: absolute;
    z-index: 11;
    font-size: 22px;
    font-weight: 1000;
    color: #0f6f87;
    text-shadow: 0 2px 0 rgba(255,255,255,.8);
    pointer-events: none;
    animation: nykScoreFloat .72s ease forwards;
}

.nyk-spark {
    position: absolute;
    z-index: 9;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    pointer-events: none;
    box-shadow: 0 0 18px currentColor;
    animation: nykSpark .64s ease-out forwards;
}

.nyk-wrap.nyk-running .nyk-start-screen {
    display: none;
}

.nyk-wrap.nyk-hidden {
    display: none;
}

.nyk-wrap.nyk-speedup {
    animation: nykBackgroundPulse 1.2s ease-in-out infinite;
}

.nyk-result-card {
    width: min(94%, 560px);
}

.nyk-trophy {
    font-size: 74px;
    margin-bottom: 8px;
    animation: nykTrophy 1.1s ease-in-out infinite;
}

.nyk-result-card h3 {
    font-size: clamp(34px, 5vw, 56px);
}

.nyk-final-line {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
}

.nyk-rank {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: 800;
    color: #0f6f87;
}

@keyframes nykFall {
    to {
        top: calc(100% + 90px);
        rotate: 24deg;
    }
}

@keyframes nykWiggle {
    0%, 100% { margin-left: 0; }
    50% { margin-left: 14px; }
}

@keyframes nykGoldPulse {
    from { scale: 1; filter: brightness(1); }
    to { scale: 1.13; filter: brightness(1.18); }
}

@keyframes nykPop {
    to {
        opacity: 0;
        scale: 1.9;
        rotate: 28deg;
    }
}

@keyframes nykScoreFloat {
    to {
        opacity: 0;
        transform: translateY(-44px) scale(1.2);
    }
}

@keyframes nykSpark {
    to {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(.1);
    }
}

@keyframes nykDrift {
    0%, 100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(18px,-12px) scale(1.06); }
}

@keyframes nykWave {
    0%, 100% { transform: translateX(0) scaleY(1); }
    50% { transform: translateX(4%) scaleY(1.12); }
}

@keyframes nykCloud {
    from { transform: translateX(0); }
    to { transform: translateX(calc(1100px + 280px)); }
}

@keyframes nykPalm {
    0%, 100% { transform: rotate(6deg); }
    50% { transform: rotate(1deg); }
}

@keyframes nykBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes nykShimmer {
    to { transform: rotate(360deg); }
}

@keyframes nykTrophy {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-7px) rotate(5deg); }
}

@keyframes nykBackgroundPulse {
    0%, 100% { filter: saturate(1); }
    50% { filter: saturate(1.25) brightness(1.03); }
}

@media (max-width: 760px) {
    .nyk-wrap {
        min-height: 640px;
        height: 78vh;
        border-radius: 24px;
    }

    .nyk-hud {
        top: 10px;
        gap: 7px;
    }

    .nyk-pill {
        min-width: 92px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .nyk-pill strong {
        font-size: 15px;
    }

    .nyk-rules {
        grid-template-columns: repeat(3, 1fr);
    }

    .nyk-rules div {
        min-height: 86px;
    }

    .nyk-rules span {
        font-size: 28px;
    }

    .nyk-glass h2 {
        font-size: 46px;
    }

    .nyk-item {
        --size: 56px;
        border-radius: 18px;
    }

    .nyk-palm {
        font-size: 86px;
        right: 6px;
    }

    .nyk-mascot {
        bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nyk-wrap *,
    .nyk-wrap *:before,
    .nyk-wrap *:after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
