/* odeKortexia - Core Design System */
:root {
    --bg-dark: #0a1f1f;
    --bg-error: #4a0000;
    --accent-cyan: #4dd4e4;
    --text-light: #e8f4f4;
    --btn-bg: rgba(77, 212, 228, 0.1);
    --btn-border: rgba(77, 212, 228, 0.3);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* Mobil gombvillanás kikapcsolása */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Nincs görgetés a fókusz érdekében */
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s ease;
    overscroll-behavior-y: contain;
    /* Megakadályozza a "pull-to-refresh"-t */
    touch-action: manipulation;
    /* Javítja a reakcióidőt */
}

/* Header & Nav */
.safe-header-bar {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--btn-border);
}

.safe-title {
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-cyan);
}

/* HEADER TUNING */
.safe-header-bar {
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    /* Bal-Közép-Jobb elosztás */
    align-items: center;
    border-bottom: 1px solid rgba(77, 212, 228, 0.1);
    background: rgba(10, 31, 31, 0.95);
    /* Pici átlátszóság */
    backdrop-filter: blur(5px);
    z-index: 100;
}

.safe-title {
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    font-size: 1rem;
    text-transform: uppercase;
}

/* Navigációs ikon gombok */
.nav-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.nav-icon-btn:active {
    background: rgba(77, 212, 228, 0.1);
    color: var(--accent-cyan);
    transform: scale(0.9);
    opacity: 1;
}

/* =========================================
   RESPONZÍV FŐMENÜ (KOMPAKT FIX)
   ========================================= */

/* Biztosítjuk, hogy a Body Flexbox legyen, így a Header nem tolja ki a Main-t */
body {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* A Header fix méretű, nem zsugorodhat */
.safe-header-bar {
    flex-shrink: 0;
}

/* A Main tölti ki a maradék helyet, de nem nőhet túl rajta */
main {
    flex: 1;
    overflow: hidden;
    /* Ez akadályozza meg, hogy kilógjon a képernyőről! */
    display: flex;
    flex-direction: column;
}

/* 1. Főmenü Konténer - Tömör elrendezés */
#main-menu {
    display: flex !important;
    flex-direction: column;
    /* Space-between helyett center + gap, hogy összehúzzuk */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;

    /* Dinamikus rés a blokkok között (Logo - Szöveg - Kerék - Footer) */
    gap: 2vh;

    padding: 10px 20px;
}

/* 2. Brand Szekció - Kisebb margók */
.menu-brand {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    /* A gap kezeli a távolságot */
}

.main-logo {
    width: 15vw;
    /* Kicsit kisebb */
    max-width: 60px;
    /* Szigorúbb limit */
    min-width: 40px;
    height: auto;
    margin-bottom: 0;
    display: block;
}

.brand-title {
    font-size: 1.4rem !important;
    margin: 0 !important;
    line-height: 1.2;
    text-align: center;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    margin-top: 2px;
}

/* 3. Leírás - Kompaktabb */
.menu-description {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: rgba(232, 244, 244, 0.7);
    width: 100%;
    max-width: 380px;
    text-align: center;
    line-height: 1.3;
    margin: 0;
}

/* 4. Menü Kerék - Itt nyerünk sok helyet */
.menu-wheel-wrapper {
    /* Rugalmas, de korlátozott */
    flex-grow: 0;
    flex-shrink: 1;

    /* Csökkentettük a magasságot, hogy ne legyen annyi üres tér */
    height: 35vh;
    min-height: 180px;
    max-height: 280px;
    /* Ez húzza össze a teret alatta/felette! */

    width: 100%;
    max-width: 320px;
    position: relative;
    overflow: hidden;

    /* Maszkolás */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);

    /* Keret/háttér a vizuális tagolásért (opcionális, de segít látni a határokat) */
    /* background: rgba(0,0,0,0.1); border-radius: 20px; */
}

.menu-wheel-container {
    height: 100%;
    /* Ez pozicionálja az aktív elemet középre */
    padding-top: calc(50% - 40px);
    padding-bottom: calc(50% - 40px);

    display: block;
    text-align: center;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 5. Footer - Kicsi és kompakt */
.odek-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    /* Ha maradna hely, tolja le az aljára, de a main overflow miatt látszani fog */
    padding-bottom: 5px;
    opacity: 0.7;
    gap: 2px;
    /* Kicsi sorköz */
}

.odek-logo {
    height: 60px;
    /* Kisebb logó */
    width: auto;
    margin: 2px 0;
}

.dev-label {
    font-size: 0.6rem;
    color: var(--accent-cyan);
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.2;
}

/* ALACSONY KÉPERNYŐ FIX */
@media (max-height: 600px) {
    .menu-description {
        display: none;
    }

    .menu-wheel-wrapper {
        height: 50vh;
        max-height: none;
    }

    /* Több helyet adunk a keréknek, ha nincs szöveg */
    .odek-footer {
        padding-bottom: 2px;
    }
}

/* =========================================
   VISUAL HAPTICS (IOS FALLBACK)
   ========================================= */

/* SIKER: Egy nagyon gyors, befelé irányuló cián villanás */
@keyframes phantom-success {
    0% {
        box-shadow: inset 0 0 0 0px transparent;
    }

    30% {
        box-shadow: inset 0 0 30px 0px rgba(77, 212, 228, 0.4);
    }

    100% {
        box-shadow: inset 0 0 0 0px transparent;
    }
}

.haptic-success-anim {
    animation: phantom-success 0.15s ease-out forwards;
}

/* HIBA: Oldalirányú rázkódás (már volt, de itt pontosítjuk) */
@keyframes phantom-error {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
        border-left: 5px solid #ff4d4d;
        border-right: 5px solid #ff4d4d;
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

.haptic-error-anim {
    animation: phantom-error 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

/* SZINTLÉPÉS: Egész képernyős, lassabb pulzálás */
@keyframes phantom-levelup {
    0% {
        background-color: var(--bg-dark);
    }

    50% {
        background-color: rgba(77, 212, 228, 0.2);
    }

    100% {
        background-color: var(--bg-dark);
    }
}

.haptic-levelup-anim {
    animation: phantom-levelup 0.6s ease-in-out;
}

/* Feladat konténer */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-block {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

/* Stroop Specifikus elemek */
#stroop-word {
    font-size: clamp(3rem, 15vw, 5rem);
    /* Dinamikus méretezés mobilra */
    margin-bottom: 3rem;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Gombok */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.color-btn {
    background: var(--btn-bg);
    border: 2px solid var(--btn-border);
    color: var(--text-light);
    padding: 20px 10px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.color-btn:active {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    transform: scale(0.95);
}

/* Funkcionális animációk */
.error-shake {
    animation: shake 0.2s cubic-bezier(.36, .07, .19, .97) both;
    background-color: var(--bg-error) !important;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 0, 0);
    }
}

/* Fullscreen gomb stílusa */
#fullscreen-btn {
    background: none;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

/* HUD Sáv */
.hud-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(77, 212, 228, 0.2);
    margin-bottom: 20px;
    color: rgba(232, 244, 244, 0.7);
}

.hud-item span {
    color: var(--accent-cyan);
    font-weight: bold;
}

/* Modal Overlay (Instrukciókhoz) */
.modal-overlay {
    display: none;
    /* Alapból rejtve */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 31, 31, 0.95);
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.modal-content {
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Multicolor szöveg (5. szinthez) */
.multi-char {
    display: inline-block;
    transition: transform 0.2s;
}

/* TMT Pontok */
.tmt-node {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: rgba(10, 31, 31, 0.9);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    user-select: none;
    box-shadow: 0 0 10px rgba(77, 212, 228, 0.2);
}

.tmt-node:active {
    transform: scale(0.9);
}

/* Ha már sikeresen összekötöttük */
.tmt-node.visited {
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-cyan);
}

/* Ha épp ez a következő célpont (opcionális segédlet) */
.tmt-node.active-target {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(77, 212, 228, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(77, 212, 228, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(77, 212, 228, 0);
    }
}

/* =========================================
   2. MODUL: TRAIL MAKING (HIÁNYZÓ RÉSZ)
   ========================================= */

/* A teljes képernyős játéktér konténere */
#trail-making {
    display: none;
    /* Alapból rejtve, a JS kapcsolja be */
    position: fixed;
    /* Kiemeljük a dokumentum folyamból */
    top: 0;
    left: 0;
    width: 100vw;
    /* Teljes szélesség */
    height: 100vh;
    /* Teljes magasság */
    background-color: var(--bg-dark);
    z-index: 50;
    /* Minden más tartalom (pl. header) fölé kerül */
    overflow: hidden;
    /* Megakadályozza a görgetést játék közben */
}

/* A vonalak vászna */
#tmt-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Átengedjük a kattintást az alatta lévő elemekre */
    z-index: 1;
}

/* A gombok (csomópontok) rétege */
#tmt-nodes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* =========================================
   3. SZUPERMESTER SZINT (Kapszula Stílus)
   ========================================= */

/* Ha egy elem megkapja a 'wide' osztályt, kapszula alakú lesz */
.tmt-node.wide {
    width: auto !important;
    /* Felülírjuk a fix 50px-et */
    min-width: 60px;
    height: 40px;
    /* Kicsit laposabb */
    border-radius: 20px;
    /* Kapszula forma */
    padding: 0 15px;
    /* Szöveg ne érjen a széléhez */
    font-size: 0.9rem;
    /* Kisebb betű, hogy kiférjen */
    aspect-ratio: auto;
    /* Kikapcsoljuk a négyzetes arányt */

    /* Igazítás javítása */
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    /* Ne törjön a szöveg */
    z-index: 10;
    /* Legyen biztosan felül */
}

/* =========================================
   FŐMENÜ JAVÍTÁS (Tökéletes Közép)
   ========================================= */

#main-menu {
    /* Flexbox a közpre igazításhoz */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Függőleges közép */
    align-items: center;
    /* Vízszintes közép */

    /* Méretezés javítása: */
    width: 100%;
    height: 100%;
    /* NEM 100vh, hanem a szülő (main) magassága! */

    gap: 40px;
    padding: 0;
    margin: 0;
}

/* JS-vezérelt elrejtés támogatása */
#main-menu[style*="display: none"] {
    display: none !important;
}

#main-menu h1 {
    margin: 0;
    padding: 0;
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 1.2;
    text-align: center;
}

.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 320px;
}

/* =========================================
   VISSZASZÁMLÁLÓ (3-2-1 START)
   ========================================= */
#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 31, 31, 0.98);
    /* Szinte teljesen sötét háttér */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    /* Minden felett legyen */
    cursor: none;
    /* Ne zavarjon az egér */
}

#countdown-number {
    font-size: clamp(10rem, 30vw, 20rem);
    font-weight: 900;
    color: #ff4d4d;
    text-shadow: 0 0 50px rgba(255, 77, 77, 0.5);

    /* FONTOS: Alapból legyen láthatatlan! 
       Így amikor a JS újraindítja az animációt, nem villan be a szám teli fénnyel. 
       Az animáció fogja láthatóvá tenni (opacity: 1). */
    opacity: 0;

    /* Nem kell ide infinite animáció, a JS kezeli */
}

/* A finomított "Mozi-stílusú" animáció maradhat a régi */
@keyframes pulseCount {
    0% {
        opacity: 0;
        transform: scale(2);
        /* Kintről... */
    }

    10% {
        opacity: 1;
        transform: scale(1);
        /* ...beüt középre */
    }

    80% {
        opacity: 1;
        transform: scale(1);
        /* Kitart */
    }

    100% {
        opacity: 0;
        transform: scale(0.8);
        /* Elhalványul */
    }
}

/* =========================================
   3. SACCADIC MODUL STÍLUSOK (NEON & SHAPES)
   ========================================= */

:root {
    /* ÚJ: Neon piros a zavaró elemekhez */
    --accent-red-neon: #ff073a;
}

/* Közös alaposztály minden Saccadic elemnek */
.sac-item {
    position: absolute;
    width: 50px;
    height: 50px;
    /* Alapból kör, hacsak nem írjuk felül */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: popInTarget 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 10;
}

/* Kicsi méret */
.sac-item.small {
    width: 30px;
    height: 30px;
}

/* --- SZÍNEK --- */

/* A CÉLPONT (Target) - Neon Türkiz */
.sac-target {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan), 0 0 30px var(--accent-cyan);
    /* Dupla ragyogás */
}

/* A CSALI (Distractor) - Neon Piros (JAVÍTVA) */
.sac-distractor {
    background-color: var(--accent-red-neon);
    box-shadow: 0 0 15px var(--accent-red-neon), 0 0 30px var(--accent-red-neon);
    /* Dupla ragyogás */
    /* Kivettük az opacity-t, hogy vakító legyen! */
    z-index: 9;
    /* Kicsit a célpont alatt */
}

/* --- ALAKZATOK (ÚJ) --- */

/* Négyzet */
.sac-item.square {
    border-radius: 0 !important;
    /* Felülírjuk a kört */
}

/* Háromszög (clip-path megoldással a legtisztább) */
.sac-item.triangle {
    border-radius: 0 !important;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    /* A sima box-shadowt levágja a clip-path, ezért drop-shadow szűrőt használunk */
    box-shadow: none !important;
}

.sac-target.triangle {
    filter: drop-shadow(0 0 10px var(--accent-cyan));
}

.sac-distractor.triangle {
    filter: drop-shadow(0 0 10px var(--accent-red-neon));
}

/* Animáció (marad a régi) */
@keyframes popInTarget {
    from {
        transform: translate(-50%, -50%) scale(0);
    }

    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* =========================================
   4. ANTI-SACCADE MODUL STÍLUSOK
   ========================================= */

/* Oldalsó fix pontok (Gombok) */
.as-marker {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(232, 244, 244, 0.2);
    /* Halvány keret */
    border-radius: 50%;
    background-color: rgba(10, 31, 31, 0.5);
    cursor: pointer;
    transition: all 0.1s ease;
    /* Touch-target növelése a biztosabb találatért */
    position: relative;
}

/* Aktív állapot (érintéskor felvillan) */
.as-marker:active,
.as-marker.tapped {
    background-color: rgba(232, 244, 244, 0.1);
    border-color: var(--accent-cyan);
    transform: scale(0.95);
}

/* Középső doboz */
#as-stimulus-box {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* A Nyíl */
#as-arrow {
    font-size: 5rem;
    font-weight: 900;
    color: var(--text-light);
    display: none;
    /* Alapból rejtve */
}

/* Nyíl Irányok */
.arrow-left {
    transform: rotate(180deg);
}

.arrow-right {
    transform: rotate(0deg);
}

/* --- SZÍNKÓDOK A KEVERT SZINTHEZ --- */
/* Zöld nyíl = Pro-saccade (Arra nézz, amerre mutat) */
.arrow-pro {
    color: #4dff4d !important;
    text-shadow: 0 0 15px #4dff4d;
}

/* Piros nyíl = Anti-saccade (Az ellenkező irányba nézz) */
.arrow-anti {
    color: #ff4d4d !important;
    text-shadow: 0 0 15px #ff4d4d;
}

/* =========================================
   5. FLANKER MODUL STÍLUSOK (HARDCORE MODE)
   ========================================= */

#flk-play-area {
    touch-action: none;
}

.flk-hint {
    font-size: 0.9rem;
    color: rgba(232, 244, 244, 0.7);
    margin-bottom: 3rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: bold;
}

/* A nyilak tárolója */
#flk-stimulus {
    display: flex;
    gap: 10px;
    /* Kicsit nagyobb köz, hogy olvashatóbb legyen */
    margin-bottom: 3rem;
    height: 80px;
    align-items: center;
    justify-content: center;
}

/* KÖZÖS STÍLUS MINDEN NYÍLNAK */
.flk-arrow {
    font-size: 4rem;
    /* Egységes nagy méret */
    font-weight: 900;
    line-height: 1;
    user-select: none;

    /* Egységes szín: Így nincs vizuális segítség! */
    color: var(--accent-cyan);
    text-shadow: 0 0 15px rgba(77, 212, 228, 0.4);

    /* Nincs méretkülönbség a center és flanker között */
    transform: scale(1);
    transition: transform 0.1s;
}

/* Opcionális: Ha mégis kell egy MINIMÁLIS térbeli elválasztás, 
   hogy tudjuk, melyik a közepe, de ne színnel */
.flk-arrow.center {
    /* Csak egy nagyon pici méretnövelés vagy semmi. 
       A tudományos tesztben SEMMI nincs. 
       Ha ezt kiveszed, brutál nehéz lesz. */
    /* transform: scale(1.05); */
    z-index: 2;

}

/* Gombok konténere */
.flk-controls {
    display: flex;
    gap: 40px;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .flk-arrow {
        font-size: 3rem;
        gap: 5px;
    }

    .flk-controls {
        margin-top: 30px;
        opacity: 0.6;
    }
}

/* =========================================
   6. MOT (Multiple Object Tracking) STYLES
   ========================================= */

/* Státuszjelző a HUD-ban (pl. "KERESD!") */
#mot-status {
    font-weight: 900;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

/* Ha épp választani kell, villogjon kicsit */
.status-action {
    animation: blinkText 1s infinite;
    color: var(--accent-red-neon) !important;
}

@keyframes blinkText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Canvas érintéskezelés javítása */
#mot-canvas {
    touch-action: none;
    /* Letiltja a görgetést/nagyítást */
    cursor: crosshair;
}

/* =========================================
   7. N-BACK TASK STYLES
   ========================================= */

#nback-task {
    display: flex;
    /* Flexbox a függőleges rendezéshez */
    align-items: center;
    justify-content: space-between;
    /* Széthúzzuk a tartalmat */
}

.nback-grid-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-height: 50vh;
    /* Hogy maradjon hely a gombnak */
}

.nback-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 80vw;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    /* Tökéletes négyzet */
}

.nback-cell {
    background-color: rgba(77, 212, 228, 0.1);
    border: 2px solid rgba(77, 212, 228, 0.3);
    border-radius: 8px;
    transition: all 0.1s ease;
}

/* Aktív cella (amikor felvillan) */
.nback-cell.active {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan);
    transform: scale(0.95);
}

/* Visszajelzések (Border színek) */
.nback-grid.feedback-success .nback-cell {
    border-color: #2ecc71;
    /* Zöld keret mindenhol */
}

.nback-grid.feedback-error .nback-cell {
    border-color: #e74c3c;
    /* Piros keret mindenhol */
}

/* Kontrollok */
.nback-controls {
    width: 100%;
    text-align: center;
    padding-bottom: 20px;
}

.action-btn {
    width: 80%;
    padding: 20px;
    font-size: 1.2rem;
    background-color: rgba(77, 212, 228, 0.15);
    border-color: var(--accent-cyan);
}

.action-btn:active {
    background-color: var(--accent-cyan);
    color: var(--bg-dark);
}

.nback-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
}

/* =========================================
   SCROLL WHEEL MENU (BLOCK LAYOUT FIX)
   ========================================= */

.menu-wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    height: 320px;
    /* Kicsit növeltem a helyet */
    margin: 0 auto;
    overflow: hidden;
    z-index: 10;

    /* Hardveres gyorsítás kényszerítése (Android fix) */
    transform: translateZ(0);

    /* Maszkolás */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 75%, transparent 100%);
}

.wheel-highlight {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 80px;
    transform: translateY(-50%);
    background: rgba(77, 212, 228, 0.05);
    border-top: 1px solid rgba(77, 212, 228, 0.2);
    border-bottom: 1px solid rgba(77, 212, 228, 0.2);
    pointer-events: none;
    z-index: 0;
}

.menu-wheel-container {
    height: 100%;
    overflow-y: scroll;
    /* Scroll kényszerítése */
    scroll-snap-type: y mandatory;

    /* --- A VÁLTOZÁS LÉNYEGE: BLOCK, NEM FLEX --- */
    display: block;
    text-align: center;
    /* Hogy a gombok középen legyenek */

    /* Padding a görgetés elejéhez és végéhez */
    padding-top: 120px;
    padding-bottom: 120px;
    box-sizing: border-box;

    /* Scrollbar elrejtése */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.menu-wheel-container::-webkit-scrollbar {
    display: none;
}

.wheel-btn {
    /* Fix méretek kényszerítése */
    display: block;
    /* Blokkosítás */
    width: 90%;
    height: 80px !important;
    /* Kényszerítjük */
    min-height: 80px !important;
    /* Kényszerítjük */
    margin: 0 auto 20px auto;
    /* Középre igazítás + alsó térköz */

    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;

    /* Flex csak a gomb BELSEJÉBEN legyen a szöveghez */
    display: flex;
    align-items: center;
    padding: 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;

    scroll-snap-align: center;
    transition: transform 0.2s, opacity 0.2s, border-color 0.2s;
}

/* Aktív állapot */
.wheel-btn.active-item {
    background: rgba(77, 212, 228, 0.1);
    border-color: var(--accent-cyan);
    color: #fff;
    transform: scale(1.05);
    opacity: 1;
}

.wheel-btn:not(.active-item) {
    opacity: 0.5;
    transform: scale(0.95);
}

/* =========================================
   8. RULE SWITCHER (SZABÁLYVÁLTÓ) STYLES
   ========================================= */

#ruleswitch-task {
    display: flex;
    justify-content: space-between;
}

.rs-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
}

.rs-dealer-area {
    text-align: center;
    margin-bottom: 20px;
}

.rs-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    letter-spacing: 1px;
}

/* Kártya stílus */
.rs-card {
    width: 80px;
    height: 110px;
    background: #e8f4f4;
    /* Fehér kártyalap */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: grid;
    /* Rács a 4 elem elrendezéséhez (2x2) */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    justify-items: center;
    align-items: center;
    padding: 10px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

/* Player Area (3 kártya lent) */
.rs-player-area {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.rs-slot {
    cursor: pointer;
    transition: transform 0.1s;
}

.rs-slot:active {
    transform: scale(0.95);
}

/* --- ALAKZATOK (CSS Shapes) --- */
.rs-shape {
    width: 20px;
    height: 20px;
    display: block;
}

/* Kör */
.shape-circle {
    border-radius: 50%;
}

/* Négyzet */
.shape-square {
    border-radius: 3px;
}

/* Háromszög */
.shape-triangle {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid currentColor;
    /* A színt örökli */
    background: transparent !important;
    /* Fontos, mert border hack */
}

/* Csillag (egyszerűsített rombusz a kódkímélésért, vagy "kereszt") */
.shape-cross {
    background: transparent !important;
    position: relative;
}

.shape-cross::before,
.shape-cross::after {
    content: '';
    position: absolute;
    background: currentColor;
}

.shape-cross::before {
    width: 6px;
    height: 20px;
    left: 7px;
    top: 0;
    border-radius: 2px;
}

.shape-cross::after {
    width: 20px;
    height: 6px;
    left: 0;
    top: 7px;
    border-radius: 2px;
}

/* Színek */
.color-red {
    background: #e74c3c;
    color: #e74c3c;
}

.color-blue {
    background: #3498db;
    color: #3498db;
}

.color-green {
    background: #2ecc71;
    color: #2ecc71;
}

.color-yellow {
    background: #f1c40f;
    color: #f1c40f;
}

/* Elrendezések (Számosság) */
/* Ha 1 elem van: középre */
.rs-card[data-count="1"] {
    display: flex;
    justify-content: center;
}

/* Ha 2 elem van: átlóban */
.rs-card[data-count="2"] .rs-shape:nth-child(1) {
    grid-area: 1 / 1;
}

.rs-card[data-count="2"] .rs-shape:nth-child(2) {
    grid-area: 2 / 2;
}

/* Ha 3 elem van: háromszögben */
.rs-card[data-count="3"] .rs-shape:nth-child(1) {
    grid-area: 1 / 1;
    grid-column: span 2;
    justify-self: center;
}

/* 4 elem: mind a 4 sarokban (alapértelmezett) */

/* Animációk */
.shake-card {
    animation: shake 0.3s ease-in-out;
    border: 2px solid #e74c3c;
}

/* =========================================
   10. ORIENTATION GUARD (Javított)
   ========================================= */

/* Alaphelyzet: Nincs figyelmeztetés */
#landscape-warning {
    display: none;
}

/* CSAK akkor szólunk, ha Landscape VAN, DE a magasság kicsi (mobil) */
/* Általában 600px magasság alatt már biztosan telefonról van szó fekvő módban */
@media screen and (orientation: landscape) and (max-height: 600px) {

    .app-container {
        display: none !important;
    }

    body::before {
        content: "↻";
        font-size: 80px;
        display: block;
        margin-bottom: 20px;
        color: var(--accent-cyan);
    }

    body::after {
        content: "A játék telefonon csak álló nézetben optimális. Kérlek, forgasd vissza!";
        font-family: 'Montserrat', sans-serif;
        font-size: 1.1rem;
        text-align: center;
        padding: 0 20px;
        color: var(--text-light);
        display: block;
    }

    body {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100vh;
        width: 100vw;
        background-color: var(--bg-dark);
        margin: 0;
    }
}

/* =========================================
   11. DESKTOP / TABLET OPTIMALIZÁCIÓ
   ========================================= */
/* Hogy monitoron ne nyúljon szét az egész játék 1920 pixel szélesre */
@media screen and (min-width: 768px) {
    body {
        background-color: #050f0f;
        /* Kicsit sötétebb háttér a kereten kívül */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .app-container {
        width: 100%;
        max-width: 480px;
        /* Mobil szélesség szimulálása */
        height: 95vh;
        /* Hogy legyen egy kis kerete */
        border: 1px solid #333;
        border-radius: 20px;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
        overflow: hidden;
        position: relative;
        background-color: var(--bg-dark);
    }

    /* A fullscreen gombot elrejthetjük desktopon, mert ott nem releváns */
    #fullscreen-btn {
        display: none;
    }
}