/* Amőba – megjelenés.
   A tábla mindig négyzetes, és a rendelkezésre álló hely szűkebb oldalához
   igazodik, hogy alacsony ablakban se lógjon ki. */

.ttt-engine-root {
    width: 100%;
    height: 100%;
    overflow: auto;
    color: #2d2440;
    background: linear-gradient(145deg, #eef4ff, #f8f1ff)
}

.ttt-game {
    box-sizing: border-box;
    max-width: 900px;
    min-height: 100%;
    margin: auto;
 
    text-align: center
}

/* ─── Fejléc: ki következik + gombok ─────────────────────────────────── */

.ttt-fejlec {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px
}

.ttt-allapot {
    padding: .5rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    font-weight: 900;
    font-size: clamp(.95rem, 2.2vw, 1.15rem);
    box-shadow: 0 3px 12px rgba(45, 36, 64, .14)
}

.ttt-allapot.vege {
    background: #2d2440;
    color: #fff
}

/* A győzelemhez kellő sorhossz és a tábla mérete. Állandóan látszik, mert a
   pályanévből nem mindig derül ki (pl. „Hetes tábla”). */
.ttt-cel {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: #4a3f6b;
    font-weight: 800;
    font-size: clamp(.85rem, 2vw, 1rem);
    white-space: nowrap;
    box-shadow: inset 0 0 0 2px rgba(124, 92, 214, .28)
}

.ttt-cel-meret {
    padding: .1rem .45rem;
    border-radius: 999px;
    background: rgba(124, 92, 214, .16);
    font-size: .85em;
    font-variant-numeric: tabular-nums
}

.ttt-gombok {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

/* A választott mód kiemelve, hogy egy pillantásra látszódjon */
.ttt-mod.aktiv {
    outline: 3px solid #7c5cff;
    outline-offset: 2px
}

/* ─── Tábla ──────────────────────────────────────────────────────────── */

.ttt-tabla {
    display: grid;
    gap: clamp(3px, .8vw, 7px);
    box-sizing: border-box;
    width: min(100%, 62svh);
    aspect-ratio: 1;
    margin: 0 auto;
    padding: clamp(5px, 1.2vw, 10px);
    border-radius: 18px;
    background-color: #dcd2f5;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 28px rgba(45, 36, 64, .2)
}

.ttt-mezo {
    display: flex;
    align-items: center;
    justify-content: center; aspect-ratio: 1;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, .88);
    cursor: pointer;
    transition: background .15s ease, transform .12s ease
}

.ttt-mezo.ures:hover:not(:disabled) {
    background: #fff8cd;
    transform: scale(1.04)
}

.ttt-mezo:disabled {
    cursor: default
}

.ttt-mezo.jel-x {
    color: #e04a5f
}

.ttt-mezo.jel-o {
    color: #2f7fd6
}

/* A nyerő sor kiemelése */
.ttt-mezo.nyero {
    background: #fff5cc;
    box-shadow: inset 0 0 0 3px #ffc94d
}

.ttt-jel-rajz {
    display: block;
    width: 78%;
    height: 78%;
    object-fit: contain
}

/* Nagy tábláknál kisebb lekerekítés, hogy ne legyen zsúfolt */
.ttt-tabla.meret-7 .ttt-mezo,
.ttt-tabla.meret-8 .ttt-mezo,
.ttt-tabla.meret-9 .ttt-mezo {
    border-radius: 7px
}

@media (max-width: 650px) {
    .ttt-game {
        padding: 10px
    }

    .ttt-tabla {
        width: min(100%, 70svh)
    }

    .ttt-allapot {
        width: 100%
    }
}

/* Alacsony ablakban a magasság szab határt, nem a szélesség */
@media (max-height: 740px) {
    .ttt-tabla {
        width: min(100%, 52svh)
    }
}

@media (prefers-reduced-motion: reduce) {
    .ttt-mezo {
        transition: none
    }

    .ttt-mezo.ures:hover:not(:disabled) {
        transform: none
    }
}
