/* --- ALAPVETŐ VÁLTOZÓK ÉS BEÁLLÍTÁSOK --- */
:root { 
    --paper: #fdfaf1; 
    --line: #e0dcd0; 
    --gold: #d4af37; 
    --handwritten: 'Kalam', cursive; 
}

body { 
    font-family: var(--handwritten); 
    background: url('../images/background.jpg') no-repeat center center fixed; 
    background-size: cover; 
    margin: 0; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    overflow-x: hidden; 
    user-select: none; 
    padding-top: 15px;
}

/* --- BEJELENTKEZÉS ÉS INPUTOK --- */
.card-face input { 
    width: 100%; 
    padding: 12px; 
    margin: 8px 0; 
    border: 2px solid var(--line); 
    border-radius: 10px; 
    font-family: var(--handwritten); 
    font-size: 18px; 
    box-sizing: border-box; 
}

/* A régi bejelentkezés gomb stílusa */
.btn-main { 
    font-family: var(--handwritten); 
    background: var(--gold); 
    color: black; 
    padding: 12px; 
    border: none; 
    border-radius: 10px; 
    width: 100%; 
    cursor: pointer; 
    margin: 10px 0; 
    font-size: 20px; 
    font-weight: 700;
    box-shadow: 0 4px 0px rgba(0,0,0,0.2);
}

.btn-main:active { transform: translateY(2px); box-shadow: none; }



* --- KICSI, ELEGÁNS RENDSZERÜZENET (ALERT) --- */
#custom-alert {
    position: fixed !important;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff !important;
    color: #333333 !important;
    padding: 10px 25px !important;
    border-radius: 8px !important;
    border: 1px solid #1a2a6c !important; /* Elegáns sötétkék keret */
    z-index: 1000000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    font-family: 'Kalam', cursive !important;
    font-size: 16px !important;
    text-align: center;
    white-space: nowrap;
    transition: top 0.4s ease-in-out !important;
    display: block !important;
}

#custom-alert.show {
    top: 25px !important;
}


/* --- FELUGRÓ ÜZENET (TOAST) --- */
#next-player-toast {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    padding: 25px 55px;
    border: 6px solid #fff;
    font-size: 42px;
    font-weight: 900;
    z-index: 130000;
    pointer-events: none;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border-radius: 20px;
    text-transform: uppercase;
    text-shadow: 3px 3px 5px rgba(0,0,0,0.5);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
#next-player-toast.show { transform: translate(-50%, -50%) scale(1) rotate(-3deg); }

/* --- JÁTÉKTERÜLET (AZ EREDETI DIZÁJN ALAPJÁN) --- */
#game-area { 
    display: none; 
    opacity: 0; 
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    z-index: 10; 
    margin: 20px auto;
}

#game-area.visible { display: block; opacity: 1; transform: translateY(0); }

.main-frame { 
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d); 
    padding: 10px; 
    border-radius: 15px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.7); 
    position: relative; 
    z-index: 20; 
}

.inner-board { background: var(--paper); border-radius: 5px; position: relative; overflow: visible; }

.header-top { 
    background: #222; 
    height: 50px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 15px; 
    border-bottom: 3px solid #000; 
}

.header-top h2 { color: var(--gold); margin: 0; font-size: 20px; text-transform: uppercase; }

.dice-header-img { 
    position: absolute; 
    right: -25px; 
    top: -20px; 
    height: 80px; 
    z-index: 9999; 
    pointer-events: none; 
    filter: drop-shadow(5px 5px 10px rgba(0,0,0,0.5)); 
}

table { border-collapse: collapse; table-layout: fixed; width: auto; background: #fff; }

th { 
    padding: 10px 5px; 
    color: white; 
    border: 1px solid rgba(0,0,0,0.4); 
    font-size: 18px; 
    text-shadow: 2px 2px 3px rgba(0,0,0,0.6); 
    background-image: url('https://www.transparenttextures.com/patterns/crinkled-paper.png'); 
    background-blend-mode: multiply; 
}

.active-p { 
    animation: activePulse 1.5s infinite ease-in-out; 
    box-shadow: inset 0 0 20px white, 0 0 15px white !important; 
    z-index: 15; 
}

@keyframes activePulse { 50% { filter: brightness(1.3); } }

td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 36px; position: relative; }

.label { 
    background: rgba(0,0,0,0.05); 
    font-weight: bold; 
    font-size: 18px; 
    padding: 0 12px; 
    color: #222; 
    width: 130px; 
}

.cell-val { 
    width: 55px; 
    height: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 22px; 
    font-weight: 700; 
    color: #1a2a6c; 
    cursor: pointer; 
}

/* --- MENÜ GOMBOK --- */
.btn-menu {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #555 0%, #333 100%);
    color: #fff;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 14px 0;
    width: 90%;
    max-width: 260px;
    margin: 8px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-start {
    background: linear-gradient(180deg, #28a745 0%, #1e7e34 100%) !important;
    border: 1px solid #145523 !important;
}

.btn-sub {
    background: var(--paper) !important;
    color: #666 !important;
    border: 1px solid #ccc !important;
    font-size: 14px;
    margin-top: 15px;
}

/* --- INTERAKTÍV ELEMEK --- */
.bubble-picker { 
    position: absolute; top: -65px; left: 50%; transform: translateX(-50%) scale(0); 
    display: flex; gap: 12px; z-index: 10000; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    pointer-events: none; 
}

.bubble-picker.active { transform: translateX(-50%) scale(1); pointer-events: auto; }

.comic-bubble { 
    background: white; border: 3px solid #000; border-radius: 50%; 
    width: 48px; height: 48px; display: flex; justify-content: center; align-items: center; 
    font-size: 20px; font-weight: 700; box-shadow: 4px 4px 0px rgba(0,0,0,0.2); cursor: pointer; 
}

#custom-numpad { 
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); 
    background: rgba(34, 34, 34, 0.98); padding: 20px; border-radius: 25px; 
    display: grid; grid-template-columns: repeat(3, 85px); gap: 12px; 
    z-index: 11000; border: 4px solid var(--gold); transition: 0.3s;
}

#custom-numpad.active { transform: translate(-50%, -50%) scale(1); }

.num-btn { background: #fff; border: 3px solid #000; border-radius: 12px; height: 75px; font-family: var(--handwritten); font-size: 28px; font-weight: 700; cursor: pointer; }

/* --- MOBIL --- */
@media screen and (max-width: 600px) {
    #game-area { transform: scale(0.88) translateY(10px); transform-origin: top center; }
    .label { width: 100px !important; font-size: 15px !important; }
    .cell-val { width: 45px !important; font-size: 18px !important; }
    th { font-size: 15px !important; padding: 8px 3px !important; }
    .header-top h2 { font-size: 16px !important; }
    .dice-header-img { height: 60px !important; right: -15px !important; top: -15px !important; }
}

#info-bar { display: flex; gap: 10px; margin-top: 15px; z-index: 50; flex-wrap: wrap; justify-content: center; }
.info-bubble { color: white; font-size: 16px; background: rgba(0,0,0,0.7); padding: 8px 20px; border-radius: 50px; border: 1px solid var(--gold); }


/* 1. A fő konténer, amiben a panelek vannak */
.main-container {
    position: relative;
    overflow: hidden; /* Fontos: ne lógjanak ki a csúszó panelek */
    perspective: 1200px; /* A 3D hatás mélysége */
}

/* 2. Egységes osztály minden panelnek (Főmenü, Ranglista, Játék, stb.) */
.game-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    
    /* Alapállapot: láthatatlan és jobbra kint */
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%) rotateY(-10deg);
    
    /* Az animáció finomsága */
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 3. Az aktív panel állapota (ami épp látszik) */
.game-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) rotateY(0deg);
    z-index: 10;
}

/* 4. A távozó panel állapota (ami épp kicsúszik balra) */
.game-panel.exit {
    opacity: 0;
    transform: translateX(-100%) rotateY(10deg);
    z-index: 1;
}
