* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 20%, #cbd5e1 40%, #e0e7ff 60%, #f1f5f9 100%);
    --text-color: #334155;
    --header-text-color: #475569;
    --header-text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    --container-bg: rgba(255, 255, 255, 0.85);
    --container-border: rgba(255, 255, 255, 0.4);
    --container-shadow: 0 20px 64px -12px rgba(148, 163, 184, 0.15), 0 8px 32px -8px rgba(203, 213, 225, 0.3);
    --btn-bg: transparent;
    --btn-text: #475569;
    --btn-border: rgba(148, 163, 184, 0.6);
    --btn-hover-bg: black;
    --btn-hover-text: white;
    --btn-hover-border: black;
    --link-color: #0645ad;
    --link-hover-color: #0b0080;
    --link-visited-color: #0b0080;
    --modal-bg: white;
    --modal-text: #111827;
    --modal-header-border: #e5e7eb;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(148, 163, 184, 0.2);
    --card-hover-border: rgba(148, 163, 184, 0.4);
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(148, 163, 184, 0.3);
    --input-focus-border: rgba(148, 163, 184, 0.6);
    --input-focus-shadow: 0 0 0 4px rgba(148, 163, 184, 0.1), 0 8px 24px rgba(148, 163, 184, 0.15);
    --info-card-bg: rgba(255, 255, 255, 0.8);
    --info-card-border: rgba(148, 163, 184, 0.2);
    --start-card-bg: linear-gradient(145deg, rgba(236, 253, 245, 0.9) 0%, rgba(209, 250, 229, 0.8) 100%);
    --start-card-border: rgba(167, 243, 208, 0.6);
    --start-card-text: #047857;
    --end-card-bg: linear-gradient(145deg, rgba(254, 242, 242, 0.9) 0%, rgba(254, 226, 226, 0.8) 100%);
    --end-card-border: rgba(252, 165, 165, 0.6);
    --end-card-text: #dc2626;
    --page-content-bg: rgba(255, 255, 255, 0.9);
    --page-content-border: rgba(148, 163, 184, 0.2);
    --page-title-color: #475569;
    --page-title-border: rgba(148, 163, 184, 0.2);
    --table-bg: white;
    --table-border: #a2a9b1;
    --table-header-bg: #70747c;
    --table-header-text: white;
    --table-cell-text: #202122;
    --status-bar-bg: rgba(255, 255, 255, 0.7);
    --status-bar-border: rgba(148, 163, 184, 0.2);
    --steps-counter-text: #64748b;
    --steps-counter-border: rgba(148, 163, 184, 0.2);
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1e293b 0%, #334155 20%, #475569 40%, #52525b 60%, #1e293b 100%);
    --text-color: #e2e8f0;
    --header-text-color: #f1f5f9;
    --header-text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    --container-bg: rgba(30, 41, 59, 0.85);
    --container-border: rgba(71, 85, 105, 0.4);
    --container-shadow: 0 20px 64px -12px rgba(0, 0, 0, 0.3), 0 8px 32px -8px rgba(0, 0, 0, 0.5);
    --btn-bg: transparent;
    --btn-text: #e2e8f0;
    --btn-border: rgba(148, 163, 184, 0.6);
    --btn-hover-bg: white;
    --btn-hover-text: black;
    --btn-hover-border: white;
    --link-color: #60a5fa;
    --link-hover-color: #93c5fd;
    --link-visited-color: #93c5fd;
    --modal-bg: #1e293b;
    --modal-text: #e2e8f0;
    --modal-header-border: #334155;
    --card-bg: rgba(51, 65, 85, 0.7);
    --card-border: rgba(71, 85, 105, 0.2);
    --card-hover-border: rgba(71, 85, 105, 0.4);
    --input-bg: rgba(51, 65, 85, 0.8);
    --input-border: rgba(71, 85, 105, 0.3);
    --input-focus-border: rgba(71, 85, 105, 0.6);
    --input-focus-shadow: 0 0 0 4px rgba(71, 85, 105, 0.1), 0 8px 24px rgba(71, 85, 105, 0.15);
    --info-card-bg: rgba(51, 65, 85, 0.8);
    --info-card-border: rgba(71, 85, 105, 0.2);
    --start-card-bg: linear-gradient(145deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 95, 70, 0.3) 100%);
    --start-card-border: rgba(110, 231, 183, 0.6);
    --start-card-text: #a7f3d0;
    --end-card-bg: linear-gradient(145deg, rgba(252, 165, 165, 0.2) 0%, rgba(220, 38, 38, 0.3) 100%);
    --end-card-border: rgba(252, 165, 165, 0.6);
    --end-card-text: #fca5a5;
    --page-content-bg: rgba(30, 41, 59, 0.9);
    --page-content-border: rgba(71, 85, 105, 0.2);
    --page-title-color: #f1f5f9;
    --page-title-border: rgba(71, 85, 105, 0.2);
    --table-bg: #1e293b;
    --table-border: #475569;
    --table-header-bg: #334155;
    --table-header-text: #e2e8f0;
    --table-cell-text: #cbd5e1;
    --status-bar-bg: rgba(51, 65, 85, 0.7);
    --status-bar-border: rgba(71, 85, 105, 0.2);
    --steps-counter-text: #94a3b8;
    --steps-counter-border: rgba(71, 85, 105, 0.2);
}

body {
    font-family: 'Alef', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-color);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

[dir="rtl"] body {
    direction: rtl;
}

[dir="ltr"] body {
    direction: ltr;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: var(--header-text-color);
    margin-bottom: 30px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: center;
    border-radius: 12px;
}

.footer-links > p > a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 900;
}

.personal-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.personal-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kofi-widget {
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background-color: transparent;
}

.kofi-widget iframe {
    border: none;
    border-radius: 8px;
}

.header-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 5px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(148, 163, 184, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
}

.material-icons {
    color: var(--header-text-color);
}

.theme-toggle-btn .material-icons {
    font-size: 24px;
}

.lang-selector {
    position: relative;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 5px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(148, 163, 184, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
}

.lang-btn .flag {
    font-size: 24px;
}

.lang-dropdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lang-dropdown-overlay.active {
    display: flex;
}

.lang-dropdown {
    display: none; /* Hidden by default, shown by JS when overlay is active */
    position: absolute;
    top: 60px;
    right: 10px;
    background: var(--modal-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 1001;
    animation: fadeIn 0.2s ease-out;
}

.lang-dropdown-overlay.active .lang-dropdown {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    font-family: 'Alef', sans-serif;
    font-size: 1em;
    color: var(--modal-text);
}

.lang-option:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}

.lang-option .flag {
    font-size: 20px;
}

.help-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(148, 163, 184, 0.1);
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 48px rgba(148, 163, 184, 0.2);
    color: #475569;
}

.help-btn .material-icons {
    font-size: 32px;
}

@media (max-width: 768px) {
    .header-controls {
        top: 10px;
        right: 10px;
    }

    .lang-btn {
        width: 44px;
        height: 44px;
    }

    .lang-btn .flag {
        font-size: 20px;
    }

    .help-btn {
        padding: 8px;
    }

    .help-btn .material-icons {
        font-size: 28px;
    }
}

.header h1 {
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    font-size: 3em;
    margin-bottom: 10px;
    color: var(--header-text-color);
    text-shadow: var(--header-text-shadow);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Player Count Display */
.player-count-display {
    background: var(--container-bg);
    border-radius: 8px;
    padding: 16px 24px;
    margin-bottom: 16px;
    box-shadow: var(--container-shadow);
    backdrop-filter: blur(16px);
    border: 1px solid var(--container-border);
    text-align: center;
    transition: all 0.3s ease;
}

.player-count-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1em;
    color: var(--text-color);
    font-weight: 600;
}

.player-count-icon {
    font-size: 1.3em;
}

.player-count-text {
    direction: rtl;
}

@media (max-width: 768px) {
    .player-count-display {
        padding: 12px 20px;
        margin-bottom: 12px;
    }
    
    .player-count-info {
        font-size: 1em;
        gap: 8px;
    }
}

.game-container {
    background: var(--container-bg);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--container-shadow);
    margin-bottom: 24px;
    backdrop-filter: blur(24px);
    border: 1px solid var(--container-border);
}

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        border-radius: 10px;
    }
}

.menu-screen, .game-screen {
    display: none;
}

.menu-screen.active, .game-screen.active {
    display: block;
}

.btn {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 2px solid var(--btn-border);
    padding: 16px 32px;
    border-radius: 6px;
    font-size: 1.1em;
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    margin: 12px;
    min-width: 160px;
}

.btn:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 2px solid var(--btn-border);
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 1.1em;
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

.btn-secondary {
    background: var(--btn-bg);
    color: var(--steps-counter-text);
    border: 2px solid var(--btn-border);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1em;
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

.btn-outline {
    background: var(--btn-bg);
    color: var(--steps-counter-text);
    border: 2px solid var(--btn-border);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: inline-block;
}

.btn-outline:hover {
    background-color: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    border-color: var(--btn-hover-border);
}

.daily-completed-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.daily-completed-actions button {
    flex: 1;
    min-width: 120px;
    font-size: 0.85em;
    padding: 8px 12px;
}

.next-challenge-countdown {
    margin-top: 10px;
}

/* Help Modal Styles */
.help-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.help-modal-overlay.active {
    display: flex;
}

.help-modal {
    background: var(--modal-bg);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

[dir="rtl"] .help-modal {
    direction: rtl;
}

[dir="ltr"] .help-modal {
    direction: ltr;
}

.tooltip-content {
    background: var(--modal-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

[dir="rtl"] .tooltip-content {
    direction: rtl;
}

[dir="ltr"] .tooltip-content {
    direction: ltr;
}


[dir="rtl"] .typewriter-text {
    direction: rtl;
}

[dir="ltr"] .typewriter-text {
    direction: ltr;
}

.player-count-text {
}

[dir="rtl"] .player-count-text {
    direction: rtl;
}

[dir="ltr"] .player-count-text {
    direction: ltr;
}

.path-page {
    flex: 1;
    font-size: 1em;
    color: var(--text-color);
    text-align: start;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .path-number {
        margin-inline-end: 8px;
    }
    
    .path-arrow {
        margin-inline-start: 8px;
    }
}

@media (max-width: 480px) {
    .path-number {
        margin-inline-end: 6px;
    }
    
    .path-arrow {
        margin-inline-start: 6px;
    }
}

.help-modal-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-header-border);
    margin-bottom: 20px;
}

.help-modal-header h2 {
    margin: 0;
    color: var(--modal-text);
    font-family: 'Alef', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
}

.help-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-close:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.help-modal-close .material-icons {
    font-size: 20px;
}

.help-modal-content {
    padding: 0 20px 20px 20px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lobby-header {
    text-align: center;
    margin-bottom: 40px;
}

.lobby-header h2 {
    font-family: 'Alef', sans-serif;
    font-size: 2.2em;
    color: var(--header-text-color);
    margin-bottom: 12px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(148, 163, 184, 0.1);
}

.lobby-subtitle {
    font-size: 1.2em;
    color: var(--steps-counter-text);
    margin: 0;
    font-weight: 400;
    opacity: 0.8;
}

.game-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: stretch;
    margin-bottom: 50px;
    max-width: 800px;
    margin-inline-start: auto;
    margin-inline-end: auto;
}

.game-mode-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 36px 28px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    backdrop-filter: blur(16px);
    will-change: transform;
}

.game-mode-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--card-hover-border);
}



.game-mode-card h3 {
    font-family: 'Alef', sans-serif;
    color: var(--header-text-color);
    font-size: 1.4em;
    margin-bottom: 12px;
    font-weight: 600;
}

.game-mode-card p {
    color: var(--steps-counter-text);
    margin-bottom: 24px;
    font-size: 1em;
    line-height: 1.6;
    flex-grow: 1;
    opacity: 0.9;
}

.game-mode-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 400;
    font-size: 1.1em;
    opacity: 0.7;
}

.game-mode-divider::before,
.game-mode-divider::after {
    content: '';
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, rgba(148, 163, 184, 0.3), transparent);
    margin: 12px 0;
}

.join-room-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.join-room-form input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--input-bg);
    backdrop-filter: blur(12px);
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    width: 100%;
}

.join-room-form input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    background: rgba(255, 255, 255, 0.95);
}

.how-to-play {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.how-to-play h3 {
    font-family: 'Alef', sans-serif;
    color: #333;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

.instructions {
    display: grid;
    gap: 15px;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    transition: transform 0.25s ease, border-color 0.25s ease;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    will-change: transform;
}

.instruction-step:hover {
    transform: translateX(4px) translateY(-1px);
    border-color: var(--card-hover-border);
}

.step-number {
    background: transparent;
    color: var(--header-text-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
    flex-shrink: 0;
    border: 1px solid var(--input-border);
}

.instruction-step span:last-child {
    color: var(--steps-counter-text);
    font-size: 1em;
    line-height: 1.6;
    opacity: 0.9;
}

.input-group {
    margin: 20px 0;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--input-bg);
    backdrop-filter: blur(12px);
}

.input-group input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    background: rgba(255, 255, 255, 0.95);
}

.game-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.info-card {
    background: var(--info-card-bg);
    padding: 28px 24px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--info-card-border);
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    will-change: transform;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(148, 163, 184, 0.05) 0%, rgba(203, 213, 225, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.info-card:hover::before {
    opacity: 1;
}

.info-card.start-card {
    border-color: var(--start-card-border);
    background: var(--start-card-bg);
}

.info-card.end-card {
    border-color: var(--end-card-border);
    background: var(--end-card-bg);
}

.info-card h3 {
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    font-size: 1.2em;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.info-card.start-card h3 {
    color: var(--start-card-text);
}

.info-card.end-card h3 {
    color: var(--end-card-text);
}

.info-card .page-name {
    font-family: 'Alef', sans-serif;
    font-weight: 700;
    font-size: 1.4em;
    line-height: 1.3;
    color: var(--text-color);
    position: relative;
    z-index: 2;
    min-height: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-card.start-card .page-name {
    color: var(--start-card-text);
}

.info-card.end-card .page-name {
    color: var(--end-card-text);
}

.page-name-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.info-icon-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    z-index: 1000;
    pointer-events: auto;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.info-icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
}

.info-icon-btn .material-icons {
    font-size: 16px;
    color: #6366f1;
}

.tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.tooltip-content {
    background: var(--modal-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    direction: rtl;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.tooltip-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--modal-header-border);
    margin-bottom: 20px;
}

.tooltip-header h3 {
    margin: 0;
    color: var(--modal-text);
    font-family: 'Alef', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
}

.tooltip-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooltip-close:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.tooltip-close .material-icons {
    font-size: 20px;
}

.tooltip-body {
    padding: 0 20px 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
}

.tooltip-body p {
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Typewriter Animation */
.typewriter-container {
    display: inline-block;
    position: relative;
}

.typewriter-text {
    display: inline-block;
    overflow: hidden;
    border-left: 2px solid #667eea;
    white-space: nowrap;
    animation: typing 2s steps(40, end), blink-caret 0.75s step-end infinite;
    font-family: 'Alef', sans-serif;
    font-weight: 500;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #667eea;
    }
}

.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
    margin: 0 10px;
}

.loading-dots div {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: loading-dots 1.2s linear infinite;
    transform: translateY(-50%);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation-delay: 0s;
}

.loading-dots div:nth-child(2) {
    left: 32px;
    animation-delay: -0.4s;
}

.loading-dots div:nth-child(3) {
    left: 56px;
    animation-delay: -0.8s;
}

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: translateY(-50%) scale(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.game-arrow {
    font-size: 2.5em;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    opacity: 0.7;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.page-content {
    width: 100%;
    background: var(--page-content-bg);
    border: 1px solid var(--page-content-border);
    border-radius: 8px;
    padding: 32px;
    margin: 24px 0;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Alef', sans-serif;
    line-height: 1.7;
    backdrop-filter: blur(16px);
}

.page-title {
    font-family: 'Alef', sans-serif;
    font-size: 2.2em;
    font-weight: 600;
    color: var(--page-title-color);
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--page-title-border);
    transition: all 0.4s ease;
}

.page-title.start-page {
    color: var(--start-card-text);
    border-bottom-color: rgba(167, 243, 208, 0.4);
    background: linear-gradient(90deg, rgba(236, 253, 245, 0.6) 0%, transparent 100%);
    padding: 18px;
    border-radius: 16px;
    margin: -18px -18px 24px -18px;
}

.page-title.end-page {
    color: var(--end-card-text);
    border-bottom-color: rgba(252, 165, 165, 0.4);
    background: linear-gradient(90deg, rgba(254, 242, 242, 0.6) 0%, transparent 100%);
    padding: 18px;
    border-radius: 16px;
    margin: -18px -18px 24px -18px;
    animation: endPageGlow 2s infinite alternate;
}

@keyframes endPageGlow {
    0% { box-shadow: 0 0 16px rgba(252, 165, 165, 0.2); }
    100% { box-shadow: 0 0 32px rgba(252, 165, 165, 0.4); }
}

/* Victory Animation Styles */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: victoryFadeIn 0.5s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.victory-content {
    text-align: center;
    color: white;
    font-family: 'Alef', sans-serif;
    animation: victoryBounce 1s ease-out;
    max-width: 90vw;
    width: 100%;
}

.victory-title {
    font-size: 4em;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b, #d97706);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: victoryGlow 2s ease-in-out infinite alternate;
}

.victory-message {
    font-size: 1.8em;
    margin-bottom: 30px;
}

.victory-stats {
    font-size: 1.4em;
    margin-bottom: 40px;
    font-weight: 600;
}

.victory-button {
    padding: 15px 30px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Alef', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
}

.victory-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Mobile responsive styles for victory screen */
@media (max-width: 768px) {
    .victory-overlay {
        padding: 15px;
        justify-content: flex-start;
        padding-top: 60px;
    }
    
    .victory-content {
        max-width: 95vw;
        padding: 20px 15px;
    }
    
    .victory-title {
        font-size: 2.5em;
        margin-bottom: 15px;
        line-height: 1.2;
    }
    
    .victory-message {
        font-size: 1.3em;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .victory-stats {
        font-size: 1.1em;
        margin-bottom: 25px;
    }
    
    .victory-button {
        padding: 12px 24px;
        font-size: 1em;
        margin: 8px auto;
        width: 100%;
        max-width: 280px;
    }
    
    /* Adjust path display for mobile */
    .victory-content .path-display {
        margin: 15px 0;
        font-size: 0.9em;
    }
    
    .victory-content .path-step {
        padding: 8px 12px;
        margin: 5px 0;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .victory-overlay {
        padding: 10px;
        padding-top: 50px;
    }
    
    .victory-content {
        padding: 15px 10px;
    }
    
    .victory-title {
        font-size: 2em;
        margin-bottom: 12px;
    }
    
    .victory-message {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .victory-stats {
        font-size: 1em;
        margin-bottom: 20px;
    }
    
    .victory-button {
        padding: 10px 20px;
        font-size: 0.9em;
        max-width: 250px;
    }
}

.emoji-rain {
    position: absolute;
    font-size: 2em;
    animation: emojiRain 3s linear infinite;
    pointer-events: none;
}

/* Path display styles */
.winning-path {
    margin: 20px 0;
    text-align: right;
}

.winning-path > div {
    background: var(--page-content-bg);
    padding: 15px;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.path-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 8px 12px;
    background: var(--container-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.path-number {
    background: #6366f1;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    margin-inline-end: 12px;
    flex-shrink: 0;
}

.path-page {
    flex: 1;
    font-size: 1em;
    color: var(--text-color);
    text-align: start;
    line-height: 1.4;
}

.path-arrow {
    margin-inline-start: 12px;
    font-size: 1.2em;
    color: #6366f1;
}

.start-page {
    border-inline-start: 4px solid var(--start-card-text);
}

.end-page {
    border-inline-start: 4px solid var(--end-card-text);
}

/* Share button and animation container styles */
.share-button {
    background: #28a745 !important;
    margin-bottom: 15px !important;
}

.animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Mobile responsive styles for path display */
@media (max-width: 768px) {
    .winning-path > div {
        padding: 12px;
        max-height: 250px;
    }
    
    .path-item {
        padding: 6px 10px;
        margin: 6px 0;
    }
    
    .path-number {
        width: 20px;
        height: 20px;
        font-size: 0.8em;
        margin-left: 8px;
    }
    
    .path-page {
        font-size: 0.9em;
    }
    
    .path-arrow {
        margin-right: 8px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .winning-path > div {
        padding: 10px;
        max-height: 200px;
    }
    
    .path-item {
        padding: 5px 8px;
        margin: 4px 0;
    }
    
    .path-number {
        width: 18px;
        height: 18px;
        font-size: 0.75em;
        margin-left: 6px;
    }
    
    .path-page {
        font-size: 0.85em;
    }
    
    .path-arrow {
        margin-right: 6px;
        font-size: 0.9em;
    }
}

@keyframes victoryFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes victoryBounce {
    0% { transform: scale(0.5) translateY(50px); opacity: 0; }
    50% { transform: scale(1.1) translateY(-20px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes victoryGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes emojiRain {
    0% { 
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #f59e0b;
    border-radius: 50%;
    animation: firework 2s ease-out infinite;
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 #f59e0b;
    }
    100% {
        transform: scale(20);
        opacity: 0;
        box-shadow: 
            0 0 0 20px transparent,
            0 0 0 40px transparent,
            0 0 0 60px transparent;
    }
}

.article-content {
    font-family: 'Alef', sans-serif;
    color: var(--text-color);
    font-size: 1.1em;
    line-height: 1.7;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4 {
    font-family: 'Alef', sans-serif;
    color: var(--header-text-color);
    margin: 20px 0 10px 0;
    font-weight: 700;
}

.article-content h1 { font-size: 1.8em; }
.article-content h2 { font-size: 1.5em; }
.article-content h3 { font-size: 1.3em; }
.article-content h4 { font-size: 1.1em; }

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin: 10px 0 15px 20px;
}

.wiki-link {
    color: var(--link-color);
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    display: inline;
}

.wiki-link:hover {
    color: var(--link-hover-color);
    background-color: #f0f8ff;
}

.wiki-link:visited {
    color: var(--link-visited-color);
}

/* Table styles for better responsiveness */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    background: var(--table-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Alef', sans-serif;
    table-layout: fixed; /* Force equal column distribution */
    word-wrap: break-word;
}

table.wikitable {
    border: 1px solid var(--table-border);
    background: var(--table-bg);
}

table.wikitable th,
table.wikitable td {
    border: 1px solid var(--table-border);
    padding: 8px 10px; /* Slightly more padding for wrapped text */
    text-align: right;
    vertical-align: top;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Make wikitable tables more compact by default */
table.wikitable {
    border-spacing: 0;
    border-collapse: collapse;
    background: var(--table-bg); /* Very light gray background */
}

/* Allow text wrapping for very long content to prevent excessive width */
table.wikitable td:has(br),
table.wikitable th:has(br) {
    white-space: normal;
    word-wrap: break-word;
}

table.wikitable th {
    background: var(--table-header-bg); /* Gray header row */
    font-weight: 600;
    color: var(--table-header-text); /* White text for better contrast */
}

table.wikitable td {
    color: var(--table-cell-text);
}

/* Tables now fit container width - no horizontal scrolling needed */

/* Mobile table adjustments */
@media (max-width: 768px) {
    table {
        font-size: 14px !important;
        margin: 10px 0;
    }
    
    table.wikitable th,
    table.wikitable td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 12px !important;
    }
    
    table.wikitable th,
    table.wikitable td {
        padding: 4px 6px;
    }
}

/* Additional table enhancements */
table caption {
    font-weight: 600;
    color: var(--header-text-color);
    margin-bottom: 8px;
    text-align: center;
    font-size: 1.1em;
}

/* Ensure tables don't break the layout */
.page-content table {
    max-width: 100%;
    box-sizing: border-box;
}

/* Tables now fit container width - no horizontal scrolling needed */

.status-bar {
    background: var(--status-bar-bg);
    padding: 18px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    border: 1px solid var(--status-bar-border);
    backdrop-filter: blur(20px);
}

.steps-counter {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--steps-counter-text);
    text-align: center;
    padding: 0 18px;
    border-inline-end: 1px solid var(--steps-counter-border);
    border-inline-start: 1px solid var(--steps-counter-border);
}

.article-content ul, .article-content ol {
    margin: 10px 0 15px 20px;
    padding-inline-start: 20px;
}

table.wikitable th,
table.wikitable td {
    border: 1px solid var(--table-border);
    padding: 8px 10px; /* Slightly more padding for wrapped text */
    text-align: start;
    vertical-align: top;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.tooltip-overlay {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.victory-overlay {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: victoryFadeIn 0.5s ease-out;
    padding: 20px;
    box-sizing: border-box;
}

.winning-path {
    margin: 20px 0;
    text-align: start;
}

.path-number {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    margin-inline-end: 12px;
    flex-shrink: 0;
}

.path-arrow {
    margin-inline-start: 12px;
    font-size: 1.2em;
    color: var(--text-color);
}

.loading-dots div:nth-child(1) {
    inset-inline-start: 8px;
    animation-delay: 0s;
}

.loading-dots div:nth-child(2) {
    inset-inline-start: 32px;
    animation-delay: -0.4s;
}

.loading-dots div:nth-child(3) {
    inset-inline-start: 56px;
    animation-delay: -0.8s;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #f59e0b;
    border-radius: 50%;
    animation: firework 2s ease-out infinite;
    inset-inline-start: 50%;
}

.emoji-rain {
    position: absolute;
    font-size: 2em;
    animation: emojiRain 3s linear infinite;
    pointer-events: none;
    inset-inline-start: 50%;
}

#messages {
    position: fixed;
    top: 50%;
    /* inset-inline-start: 50%; */
    transform: translateX(-50%);
    z-index: 10001;
    max-width: 500px;
    width: 90%;
    pointer-events: none;
}

.copy-feedback {
    position: fixed;
    top: 50%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    z-index: 1000001;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    animation: fadeInOut 2s ease-in-out;
}

.help-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.player-name {
    font-size: 1.1em;
    color: var(--steps-counter-text);
    text-align: start;
    opacity: 0.9;
}

.opponent-info {
    font-size: 1.1em;
    color: var(--steps-counter-text);
    text-align: end;
    opacity: 0.9;
}

.loading {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    opacity: 0.8;
}

#messages {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    max-width: 500px;
    width: 90%;
    pointer-events: none;
}

#messages > div {
    pointer-events: auto;
    margin-bottom: 10px;
    animation: messageSlideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid transparent;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 12px;
    border-color: #fecaca;
    font-weight: 600;
}

.success {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 12px;
    border-color: #a7f3d0;
    font-weight: 600;
}

.info {
    background: #dbeafe;
    color: #1e40af;
    padding: 15px;
    border-radius: 12px;
    border-color: #93c5fd;
    font-weight: 600;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.room-id {
    font-family: monospace;
    font-size: 1.2em;
    font-weight: 600;
    background: var(--input-bg);
    padding: 14px 18px;
    border-radius: 6px;
    text-align: center;
    margin: 12px 0;
    border: 1px solid var(--input-border);
    backdrop-filter: blur(12px);
}

.clickable-room-code:hover {
    background: var(--btn-hover-bg) !important;
    color: var(--btn-hover-text) !important;
    transform: scale(1.02);
    border-color: var(--btn-hover-border) !important;
}

.clickable-room-code:hover div {
    color: var(--btn-hover-text) !important;
}

.copy-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    z-index: 1000001;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* Twemoji styling */
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
    display: inline-block;
}

.mode-icon img.emoji {
    height: 1.2em;
    width: 1.2em;
    vertical-align: -0.1em;
}

.page-title img.emoji,
.lobby-header img.emoji {
    height: 1em;
    width: 1em;
    vertical-align: -0.1em;
}

/* Fix for mode-icon containers */
.mode-icon {
    font-size: 3em;
    margin-bottom: 15px;
    line-height: 1;
}

.mode-icon .emoji,
.mode-icon img.emoji {
    height: 1em !important;
    width: 1em !important;
    max-height: 1em !important;
    max-width: 1em !important;
}

/* Mobile responsive styles for game interface */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        border-radius: 10px;
    }
    
    .status-bar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 15px;
    }

    .steps-counter {
        border: none;
        border-top: 2px solid var(--steps-counter-border);
        border-bottom: 2px solid var(--steps-counter-border);
        padding: 8px 0;
    }

    .player-name, .opponent-info {
        text-align: center;
    }

    .game-info {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 15px 0;
    }

    .info-card {
        padding: 15px;
        font-size: 0.9em;
    }

    .info-card h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .info-card .page-name {
        font-size: 1.2em;
        min-height: 1.4em;
    }
    
    .game-arrow {
        font-size: 1.8em;
        margin: 5px 0;
    }

    .game-arrow::before {
        content: '⬇️';
    }

    .status-bar {
        position: sticky;
        top: 0;
        z-index: 100;
        margin: 0 -20px 15px -20px;
        border-radius: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .header h1 {
        font-size: 2em;
    }

    .game-modes {
        display: flex;
        flex-direction: column;
        align-items: center;
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: none;
    }

    .game-mode-card {
        width: 100%;
        padding: 25px 20px;
        min-height: 180px;
    }


    .page-content {
        padding: 20px;
        max-height: none;
    }

    .page-title {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .game-container {
        padding: 15px;
    }
    
    .status-bar {
        padding: 10px;
    }
    
    .info-card {
        padding: 12px;
    }
    
    .info-card h3 {
        font-size: 1em;
    }
    
    .info-card .page-name {
        font-size: 1.1em;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.5em;
    }
}