body {
    font-family: 'Georgia', serif;
    background-color: #2c241b;
    color: #3e2723;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('https://www.transparenttextures.com/patterns/dark-wood.png'); /* Opcionális textúra */
}

.game-container {
    width: 800px;
    max-width: 95%;
    background-color: #f4e4bc; /* Pergamen szín */
    border: 10px solid #5d4037;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    padding: 20px;
    position: relative;
}

/* Karakterlap stílus */
.character-sheet {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #5d4037;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.avatar {
    font-size: 3rem;
    margin-right: 20px;
    background: #d7ccc8;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #5d4037;
}

.stats h2 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats p {
    margin: 2px 0;
    font-weight: bold;
}

.xp-bar-container {
    width: 200px;
    height: 15px;
    background-color: #d7ccc8;
    border: 1px solid #3e2723;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background-color: #4caf50;
    width: 0%;
    transition: width 0.5s ease-in-out;
}

/* Taverna és Játékvászon */
.game-view {
    position: relative;
    display: flex;
    justify-content: center;
}

canvas {
    background-color: #3e2723; /* Padló alapszín */
    border: 4px solid #281a14;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    cursor: crosshair;
}

/* Interakciós prompt */
#interaction-prompt {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    border: 2px solid #fff;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}


/* Karakter készítő ui */
.creation-card {
    text-align: center;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-card {
    cursor: pointer;
    background: #d7ccc8;
    padding: 10px 15px;
    border: 2px solid #5d4037;
    border-radius: 5px;
    transition: all 0.2s;
    user-select: none;
}

.radio-card:hover {
    background: #bcaaa4;
}

.radio-group input[type="radio"]:checked + span {
    font-weight: bold;
    color: #3e2723;
}

.radio-card:has(input:checked) {
    background: #FFD54F; /* Gold highlight */
    transform: scale(1.05);
    border-color: #e65100;
}

/* Auth Form Stílusok */
.auth-container {
    background: transparent; /* Overlay adja a hátteret */
    padding: 10px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.auth-container h2 { color: #5d4037; margin-top: 0; }
.auth-container p { color: #3e2723; }

.auth-container input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #5d4037;
    background: #fff8e1;
    color: #3e2723;
    font-weight: bold;
    border-radius: 5px;
    box-sizing: border-box;
}
.auth-container input::placeholder {
    color: #8d6e63;
}

/* Chrome/Edge Autofill javítás: Világos háttér, sötét betű */
.auth-container input:-webkit-autofill,
.auth-container input:-webkit-autofill:hover, 
.auth-container input:-webkit-autofill:focus, 
.auth-container input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #fff8e1 inset !important;
    -webkit-text-fill-color: #3e2723 !important;
    transition: background-color 5000s ease-in-out 0s;
}

.teacher-label {
    cursor: pointer;
    color: #3e2723;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.auth-container button {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
}
.auth-toggle {
    margin-top: 15px;
    font-size: 1rem;
    color: #5d4037; 
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    padding: 8px;
    border-radius: 5px;
    display: inline-block;
    border: none;
}
.auth-toggle:hover { 
    background-color: rgba(93, 64, 55, 0.1);
    color: #3e2723;
    text-decoration: none;
}
.server-status {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 0.8em;
    color: #7f8c8d;
    opacity: 0.7;
}
.server-status.online { color: #2ecc71; }
.server-status.offline { color: #e74c3c; }

/* Overlay rendszer */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay-content {
    background: #d7ccc8;
    padding: 20px;
    border-radius: 10px;
    border: 5px solid #5d4037;
    width: 80%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.paper-bg {
    background: #fff8e1;
    border: 1px dashed #3e2723;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f44336;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

/* Kockajáték stílusok */
.gambling-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.gambling-area input {
    padding: 8px;
    font-size: 1.2rem;
    width: 100px;
    text-align: center;
    border: 2px solid #5d4037;
    border-radius: 5px;
    background: #fff8e1;
    color: #3e2723;
    font-weight: bold;
}

.result-box {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    min-height: 1.5em;
    padding: 10px;
    border-radius: 5px;
    width: 80%;
}
.result-win { background-color: #c8e6c9; color: #2e7d32; border: 1px solid #2e7d32; }
.result-loss { background-color: #ffcdd2; color: #c62828; border: 1px solid #c62828; }
.result-draw { background-color: #e0e0e0; color: #616161; border: 1px solid #616161; }


.quest-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.quest-card {
    background: #efebe9;
    border: 2px solid #8d6e63;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    text-align: center;
}

.quest-card:hover {
    transform: translateY(-3px);
    background: #fff;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.quest-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: #a1887f;
    border-color: #5d4037;
}

.quest-card h3 {
    margin-top: 0;
    font-size: 1rem;
}

.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: white;
    margin-bottom: 5px;
}

.diff-easy { background-color: #4caf50; }
.diff-medium { background-color: #ff9800; }
.diff-hard { background-color: #f44336; }

.problem-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

input[type="text"] {
    padding: 10px;
    font-size: 1rem;
    width: 80%;
    display: block;
    margin: 0 auto;
    border: 2px solid #8d6e63;
    background: #fff;
    font-family: 'Georgia', serif;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #5d4037;
    color: #f4e4bc;
    border: none;
    border-radius: 3px;
    font-family: 'Georgia', serif;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background-color: #3e2723;
}

button.secondary {
    background-color: #8d6e63;
}

.hidden {
    display: none !important;
}

.message {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.message.success { background-color: #c8e6c9; color: #2e7d32; }
.message.error { background-color: #ffcdd2; color: #c62828; }
.message.info { background-color: #e3f2fd; color: #0277bd; border: 1px solid #0277bd; }
.message.levelup { background-color: #fff9c4; color: #fbc02d; border: 2px solid #fbc02d; animation: pulse 1s infinite; }

@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

/* Kockaj�t�k anim�ci� */
.dice-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
}

.dice-box {
    text-align: center;
}

.dice {
    font-size: 4rem;
    line-height: 1;
    display: inline-block;
    color: #3e2723;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.dice.rolling {
    animation: shake 0.5s infinite;
    color: #d84315;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.dice-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #5d4037;
    margin-top: 5px;
}


/* Biztos CSS Kock�k */
.css-dice {
    width: 60px;
    height: 60px;
    background-color: white;
    border: 2px solid #3e2723;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 6px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    gap: 2px;
}

.css-dice .dot {
    background-color: #3e2723;
    border-radius: 50%;
    align-self: center;
    justify-self: center;
    width: 10px;
    height: 10px;
    visibility: hidden; /* Alapb�l minden p�tty rejtett */
}

/* P�tty�k poz�ci�i */
/* .dot:nth-child(1) -> bal-fels� */
/* .dot:nth-child(5) -> k�z�p */
/* .dot:nth-child(9) -> jobb-als� */

/* 1-es dob�s: csak a k�z�ps� */
.show-1 .dot:nth-child(5) { visibility: visible; }

/* 2-es dob�s: bal-fels�, jobb-als� */
.show-2 .dot:nth-child(1),
.show-2 .dot:nth-child(9) { visibility: visible; }

/* 3-as dob�s: bal-fels�, k�z�p, jobb-als� */
.show-3 .dot:nth-child(1),
.show-3 .dot:nth-child(5),
.show-3 .dot:nth-child(9) { visibility: visible; }

/* 4-es dob�s: sarkok */
.show-4 .dot:nth-child(1),
.show-4 .dot:nth-child(3),
.show-4 .dot:nth-child(7),
.show-4 .dot:nth-child(9) { visibility: visible; }

/* 5-�s dob�s: sarkok + k�z�p */
.show-5 .dot:nth-child(1),
.show-5 .dot:nth-child(3),
.show-5 .dot:nth-child(5),
.show-5 .dot:nth-child(7),
.show-5 .dot:nth-child(9) { visibility: visible; }

/* 6-os dob�s: oszlopok */
.show-6 .dot:nth-child(1),
.show-6 .dot:nth-child(3),
.show-6 .dot:nth-child(4),
.show-6 .dot:nth-child(6),
.show-6 .dot:nth-child(7),
.show-6 .dot:nth-child(9) { visibility: visible; }

