:root {
    --primary: #2c3e50;
    --accent: #e67e22;
    --success: #27ae60;
    --danger: #c0392b;
    --bg: #ecf0f1;
    --text: #34495e;
    --white: #ffffff;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 600px;
    height: 90vh;
    background: var(--white);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 20px;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.2s ease-in-out 0s 2;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1s infinite ease-in-out;
}

/* Menu Screen */
#menu-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 3rem;
    color: var(--primary);
    letter-spacing: 5px;
    margin-bottom: 5px;
}

.menu-logo {
    width: 200px; /* Vagy bármilyen más méret px-ben */
    height: auto;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.subtitle {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 40px;
}

.game-modes {
    display: grid;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.mode-btn, .primary-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover, .primary-btn:hover {
    background: var(--accent);
    transform: scale(1.02);
}

.secondary-btn {
    margin-top: 20px;
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.game-info {
    text-align: center;
}

#display-mode {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent);
}

#display-category {
    font-weight: bold;
    font-size: 1.2rem;
}

.timer-display {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--danger);
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px 0;
}

.visual-container {
    height: 200px;
    display: flex;
    justify-content: center;
}

#hangman-drawing {
    height: 100%;
}

.draw-part {
    stroke: var(--primary);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    opacity: 0.1; /* Megmutatjuk halványan vagy teljesen elrejtjük */
    transition: opacity 0.3s;
}

.draw-part.visible {
    opacity: 1;
}

.word-placeholder {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: bold;
}

.blind-text {
    font-size: 0.9rem;
    color: var(--accent);
    margin-top: 15px;
    font-weight: bold;
    min-height: 1.2rem;
}

/* Keyboard rows */
.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.key {
    background: #e0e0e0;
    border: none;
    min-width: 35px;
    padding: 12px 8px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.1s;
    font-size: 0.9rem;
}

.key:hover:not(:disabled) {
    background: #ccc;
}

.key.correct {
    background: var(--success) !important;
    color: white;
}

.key.wrong {
    background: #ddd;
    color: #999;
    opacity: 0.5;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    font-weight: bold;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Modals */
.modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 80%;
    max-width: 400px;
}

#word-definition {
    background: #fff3e0;
    padding: 10px;
    border-radius: 8px;
    font-style: italic;
    color: var(--accent);
    margin: 10px 0;
    font-size: 0.9rem;
    border-left: 4px solid var(--accent);
}

.result-details {
    margin: 20px 0;
}

#target-word {
    color: var(--success);
    font-size: 1.5rem;
}

/* Name Save Area */
.name-save-area {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #bdc3c7;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    transition: all 0.3s;
}

#player-name {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100%;
    max-width: 250px;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s;
    outline: none;
    background: white;
}

#player-name:focus {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(230, 126, 34, 0.15);
    background: #fff;
}

#player-name:hover {
    border-color: #bdc3c7;
}

#save-score-btn {
    background: var(--success);
    transition: transform 0.2s;
}

#save-score-btn:hover {
    transform: translateY(-2px);
    background: #219150;
}

#save-score-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.primary-btn.small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* Leaderboard */
.modal-content.large {
    width: 90%;
    max-width: 500px;
}

.leaderboard-table-wrapper {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

#leaderboard-table th, #leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

#leaderboard-table th {
    background: #f8f9fa;
    color: var(--primary);
    position: sticky;
    top: 0;
}

tr:nth-child(1) td:nth-child(2) { font-weight: bold; color: gold; }
tr:nth-child(2) td:nth-child(2) { font-weight: bold; color: silver; }
tr:nth-child(3) td:nth-child(2) { font-weight: bold; color: #cd7f32; }

/* Mobile Tweaks */
@media (max-width: 480px) {
    #app {
        height: 100vh;
        border-radius: 0;
    }
    .word-placeholder { font-size: 1.5rem; }
    .key { padding: 15px 2px; font-size: 0.9rem; }
}

/* Névbeviteli Csoport Dizájn */
.name-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    width: 100%;
    align-items: center;
}

#initial-player-name {
    width: 100%;
    max-width: 280px;
    padding: 15px;
    border: 3px solid #eee;
    border-radius: 15px;
    font-size: 1.2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#initial-player-name:focus {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(230, 126, 34, 0.15);
}

.small-text {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 10px;
}

    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.popup h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.popup button {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #2ecc71;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

.popup button:hover {
    background-color: #27ae60;
}

#difficulty {
    margin-top: 20px;
}

.difficulty-button {
    font-size: 18px;
    padding: 10px 20px;
    margin: 5px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.difficulty-button:hover {
    background-color: #c0392b;
}

/*Sepul's edit*/
#newGame {
    display: block;
    margin: auto auto 5px auto;
}