/* General Reset & Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #120902;
    --panel-bg: rgba(36, 22, 10, 0.9);
    --gold: #d4af37;
    --gold-hover: #f3cf65;
    --gold-primary: #d4af37;
    --gold-secondary: #ffe066;
    --gold-dark: #aa8010;
    --brown-border: #52361a;
    --text-parchment: #f6ebd4;
    --text-muted: #c8b18a;
    
    --color-red: #c0392b;
    --color-red-light: #e74c3c;
    --color-blue: #2980b9;
    --color-blue-light: #3498db;
    --color-green: #27ae60;
    --color-green-light: #2ecc71;
    
    --shadow-parchment: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(0, 0, 0, 0.9), 0 0 15px rgba(212, 175, 55, 0.15);
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle, rgba(42, 26, 10, 0.65) 0%, rgba(18, 9, 2, 0.96) 100%), url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-parchment);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #1a0f05;
    border-left: 2px solid var(--brown-border);
}
::-webkit-scrollbar-thumb {
    background: var(--brown-border);
    border-radius: 5px;
    border: 2px solid #1a0f05;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Typography Helpers */
.cinzel-title {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    background: linear-gradient(135deg, #fff3a8 0%, #d4af37 50%, #aa8010 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 1.5px;
}

.text-center { text-align: center; }
.hidden { display: none !important; }

/* Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    background: linear-gradient(to bottom, #2A1A0A, #1C1005);
    border-bottom: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    flex-wrap: nowrap;
}

.nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-left .logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
}

.navbar-logo-img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    transition: height 0.2s ease;
}

.shield-logo {
    position: relative;
    font-size: 32px;
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.swords-cross {
    position: absolute;
    font-size: 20px;
    color: #e2e2e2;
    transform: rotate(45deg);
}

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #fff3a8 0%, #d4af37 50%, #aa8010 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Base navigation menu links (Desktop) */
.nav-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-parchment);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 6px;
    background: rgba(45, 27, 12, 0.6);
    border: 1px solid var(--brown-border);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-menu-link:hover {
    color: #fff;
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-menu-link i {
    color: var(--gold);
    font-size: 14px;
}

.nav-menu-link.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #aa8010 100%);
    color: #1a0f05 !important;
    border-color: var(--gold-light);
    font-weight: 700;
}

.nav-menu-link.btn-gold i {
    color: #1a0f05 !important;
}

.nav-menu-link.btn-brown {
    background: linear-gradient(135deg, #36220f, #23160a);
    border-color: #634322;
    color: var(--text-parchment);
}

.menu-badge-new {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mobile-only {
    display: none !important;
}

.auth-text-full {
    display: inline;
}

.auth-text-short {
    display: none;
}

.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    color: var(--gold-light);
    font-size: 19px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hamburger-btn:hover,
.hamburger-btn:active {
    background: rgba(212, 175, 55, 0.25);
    color: #fff;
    border-color: var(--gold-light);
}

.menu-backdrop {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 64px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
    transition: opacity 0.25s ease;
}

.menu-backdrop.hidden {
    display: none !important;
}

/* User Status Info in Navbar */
.user-status-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 15px 5px 8px;
    border-radius: 25px;
    border: 1px solid var(--brown-border);
}

.nav-avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.nav-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.nav-avatar-wrapper.bronze-border img { border: 2px solid #8b5a2b; }
.nav-avatar-wrapper.silver-border img { border: 2px solid #c0c0c0; }
.nav-avatar-wrapper.gold-border img { border: 2px solid #ffd700; }
.nav-avatar-wrapper.legendary-border img { border: 2px solid #ba55d3; }

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #00ff00;
    border: 2px solid #000;
    border-radius: 50%;
    animation: pulse-green 1.5s infinite;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-meta-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-parchment);
}

.user-meta-balance {
    font-size: 12px;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Buttons System */
.btn {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-decoration: none;
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37, #aa8010);
    border-color: #ffe066;
    color: #1c1005 !important;
    font-weight: 900;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #ffe066, #d4af37);
    color: #120902 !important;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    transform: translateY(-1px);
}

.btn-brown {
    background: linear-gradient(135deg, #36220f, #23160a);
    border-color: #634322;
    color: var(--text-parchment);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

.btn-brown:hover {
    color: #fff;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.btn-red {
    background: linear-gradient(135deg, #7c1a1a, #4a0f0f);
    border-color: #990000;
    color: #ffcccc;
}

.btn-red:hover {
    color: #fff;
    border-color: #ff3333;
}

.btn-wide {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Wax Seal Button */
.btn-seal {
    position: relative;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #8d2121 60%, #5c1111 100%);
    border: 3px double #721616;
    border-radius: 50%;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(0,0,0,0.5);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.btn-seal:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(141, 33, 33, 0.4);
}

.btn-seal:active {
    transform: scale(0.98);
}

.seal-text {
    line-height: 1.2;
    padding: 5px;
    text-shadow: 1px 1px 3px #000;
}

/* Shine Glare Effect on Gold Buttons */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    transition: none;
}

.shine-effect:hover::after {
    left: 130%;
    transition: all 0.8s ease;
}

/* Main Layout Panels */
.main-content {
    flex: 1;
    padding: 40px 20px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.panel {
    display: none;
    width: 100%;
    animation: fade-in 0.4s ease-out;
}

.panel:not(#landing-panel):not(#dashboard-panel):not(#baratok-panel):not(#raktar-panel) {
    max-width: 1200px;
    margin: 0 auto;
}

.panel.active {
    display: block;
}

/* Parchment Card Container */
.parchment-card {
    background: radial-gradient(circle at center, rgba(46, 30, 16, 0.94) 0%, rgba(20, 12, 6, 0.97) 100%);
    border: 2px solid #b29010;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(0, 0, 0, 0.85), 0 0 12px rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(8px);
}

/* 1. Landing Panel */
.welcome-box {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

.welcome-box h1 {
    font-size: 36px;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.shield-graphic {
    color: var(--gold);
    font-size: 60px;
    animation: float 4s ease-in-out infinite;
}

/* Modes Grid */
.modes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mode-icon-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
}

.mode-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px #000);
}

.mode-icon-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 24px;
    color: var(--gold);
    text-shadow: 0 2px 4px #000;
}

.mode-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 15px;
}

.mode-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 20px;
}

.mode-reward {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--brown-border);
}

/* 2. Authenticated Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 40px;
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Modals Backdrops */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 9, 2, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    animation: slide-up 0.3s ease-out;
}

.modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--brown-border);
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--gold);
}

/* Forms Styling */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.input-medieval {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--brown-border);
    border-radius: 4px;
    padding: 10px 12px;
    color: var(--text-parchment);
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-medieval:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.password-input-wrapper {
    position: relative;
    display: flex;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.btn-toggle-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-checkbox input {
    margin-top: 2px;
}

/* 3. Profile Panel */
.profile-split {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-top: 20px;
}

.profile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.avatar-huge-wrapper {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-huge {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.medieval-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(0,0,0,0), var(--brown-border) 50%, rgba(0,0,0,0));
}

.profile-footer {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* 4. Leaderboard Panel */
.leaderboard-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.table-container {
    background: #1c1c1c;
    border: 2px solid var(--brown-border);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background: #252525;
    padding: 15px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    border-bottom: 2px solid var(--brown-border);
    font-size: 14px;
}

.leaderboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.leaderboard-table tbody tr {
    transition: background 0.2s;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Golden row highlighting for top-ranked current user */
.leaderboard-table tbody tr.user-row {
    background: rgba(212, 175, 55, 0.08);
    border-left: 4px solid var(--gold);
}

.sticky-user-row {
    position: sticky;
    bottom: 0;
    background: #1a1a1a;
    border-top: 3px double var(--gold);
    box-shadow: 0 -5px 10px rgba(0,0,0,0.4);
}

.sticky-user-row td {
    font-weight: bold;
    color: var(--gold);
}

.avatar-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* 5. Shop Panel & Avatar Rarity Borders */
.shop-wrapper {
    width: 100%;
}

.shop-header {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 25px;
    gap: 15px;
}

.shop-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.crown-display-large {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: bold;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 8px 20px;
    color: var(--gold);
}

.premium-shop {
    margin-bottom: 40px;
}

.premium-shop h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 18px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.package-card {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--brown-border);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.package-card:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.pack-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.bronze-pack { color: #cd7f32; }
.silver-pack { color: #c0c0c0; }
.gold-pack { color: #ffd700; }
.legendary-pack { color: #d4af37; text-shadow: 0 0 10px rgba(212, 175, 55, 0.4); }

.package-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: #fff;
    margin-bottom: 5px;
}

.price-tag {
    font-weight: 600;
    color: var(--gold);
}

.shop-sub {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    margin-bottom: 20px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.avatar-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.avatar-card:hover {
    transform: translateY(-3px);
}

.avatar-card-img-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 12px;
    overflow: hidden;
}

.avatar-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar Rarity styles */
.bronze-border { border: 3px solid #8d5e38; }
.silver-border {
    border: 3px solid #b3b3b3;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0) 70%);
}
.gold-border {
    border: 3px solid var(--gold);
    box-shadow: inset 0 0 10px rgba(212,175,55,0.4), 0 0 15px rgba(212,175,55,0.3);
}
.legendary-border {
    border: 3px solid #ba55d3;
    animation: pulse-legendary 2s infinite;
}

.avatar-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    color: #fff;
    margin-bottom: 4px;
}

.rarity-tag {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.rarity-tag.bronze { color: #cd7f32; }
.rarity-tag.silver { color: #a6a6a6; }
.rarity-tag.gold { color: var(--gold); }
.rarity-tag.legendary { color: #ba55d3; }

.avatar-card-btn {
    margin-top: auto;
    width: 100%;
}

/* 6. Game csarnok (Lobby) */
.lobby-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.lobby-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.mode-shield-btn {
    background: rgba(0,0,0,0.5);
    border: 2px solid var(--brown-border);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.mode-shield-btn:hover {
    border-color: var(--gold);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.15);
}

.shield-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shield-icon {
    font-size: 50px;
    color: var(--gold);
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 5px #000);
}

.mode-shield-btn h3 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: #fff;
    margin-bottom: 10px;
}

.mode-shield-btn span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Matchmaking Status */
.matchmaking-status {
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 45px;
    box-shadow: var(--shadow-parchment);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.compass-spinner {
    font-size: 60px;
    color: var(--gold);
}

.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
}

/* 7. Game Board */
.game-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    width: 100%;
    margin-bottom: 180px; /* Spacer for bottom quiz drawer */
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-info-card {
    background: #1c1005;
    border: 2px solid var(--gold);
    border-radius: 4px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.game-info-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 5px;
}

.phase-badge {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    color: #fff;
    text-transform: uppercase;
}

/* Scorecards */
.players-scorecards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scorecard {
    background: rgba(0,0,0,0.4);
    border: 2px solid var(--brown-border);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scorecard.red-border { border-color: var(--color-red); }
.scorecard.blue-border { border-color: var(--color-blue); }
.scorecard.green-border { border-color: var(--color-green); }

.scorecard.active-attacker {
    box-shadow: 0 0 10px #ffc107;
    animation: border-pulse 1.5s infinite;
}

.scorecard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scorecard-name {
    font-weight: bold;
    font-size: 14px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 140px;
}

.scorecard-points {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 14px;
    color: var(--gold);
}

.scorecard-towers {
    display: flex;
    gap: 6px;
}

.tower-icon {
    font-size: 16px;
    color: var(--gold);
    transition: color 0.5s;
    filter: drop-shadow(0 1px 2px #000);
}

.tower-icon.destroyed {
    color: #4a4a4a;
}

/* Map area */
.game-map-area {
    background: radial-gradient(circle at center, rgba(38, 24, 12, 0.9) 0%, rgba(13, 8, 4, 0.98) 100%);
    border: 3px double var(--gold);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85), inset 0 0 50px rgba(0, 0, 0, 0.9), 0 0 15px rgba(212, 175, 55, 0.15);
    height: auto;
    aspect-ratio: 841 / 595;
    width: 100%;
    max-height: 75vh;
    position: relative;
}

.game-instruction-banner {
    background: rgba(28, 14, 5, 0.95);
    border: 2px solid var(--gold);
    color: var(--gold);
    padding: 10px 24px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: fade-in 0.3s ease-out;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.game-instruction-banner.my-turn {
    background: rgba(44, 25, 10, 0.95);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

#map-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map-container svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

/* Interactive SVG paths styling */
.megye {
    fill: #eedfbe !important;
    fill-opacity: 0.9 !important;
    stroke: #42301c !important;
    stroke-width: 1.2px !important;
    stroke-linejoin: round;
    transition: fill 0.3s, fill-opacity 0.3s, stroke 0.3s, stroke-width 0.3s, filter 0.3s;
    cursor: pointer;
    vector-effect: non-scaling-stroke;
}

.megye:hover {
    fill-opacity: 1;
    filter: brightness(1.15);
    stroke: #ffd700 !important;
    stroke-width: 2.2px !important;
}

/* Map color states for owners */
.megye.red {
    fill: rgba(192, 57, 43, 0.75) !important;
    stroke: #ff9f89 !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 0 5px rgba(192, 57, 43, 0.5));
    transition: fill 0.8s ease, stroke 0.8s ease;
}
.megye.blue {
    fill: rgba(43, 108, 176, 0.75) !important;
    stroke: #90cdf4 !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 0 5px rgba(43, 108, 176, 0.5));
    transition: fill 0.8s ease, stroke 0.8s ease;
}
.megye.green {
    fill: rgba(47, 133, 90, 0.75) !important;
    stroke: #9ae6b4 !important;
    stroke-width: 1.5px !important;
    filter: drop-shadow(0 0 5px rgba(47, 133, 90, 0.5));
    transition: fill 0.8s ease, stroke 0.8s ease;
}

/* Pulse animations for selectable / targeted counties */
.megye.valid-target {
    animation: pulse-county-valid 1.5s infinite;
    stroke: var(--gold) !important;
    stroke-width: 2.2px !important;
    fill: #ffd700 !important;
}

/* Quiz Modal Content Card */
.quiz-modal-content {
    max-width: 700px;
    border: 2px solid var(--gold);
    padding: 0;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.quiz-modal-backdrop {
    background: rgba(18, 9, 2, 0.35) !important;
    backdrop-filter: none !important;
}

.quiz-timer-container {
    width: 100%;
    height: 5px;
    background: #110803;
}

.quiz-timer-bar {
    height: 100%;
    width: 100%;
    background: var(--color-red);
    transition: width 0.1s linear;
}

.quiz-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.quiz-question-box {
    text-align: center;
}

.quiz-question {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}

.quiz-inputs {
    width: 100%;
}

/* MC 4-grid buttons */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.option-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--brown-border);
    border-radius: 4px;
    padding: 12px;
    color: var(--text-parchment);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

.option-btn:active {
    background: rgba(212, 175, 55, 0.15);
}

.option-btn.selected {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 8px var(--gold);
}

.option-btn.correct {
    border-color: var(--color-green) !important;
    background: rgba(40, 167, 69, 0.2) !important;
}

.option-btn.wrong {
    border-color: var(--color-red) !important;
    background: rgba(211, 47, 47, 0.2) !important;
}

/* Estimation guess elements */
.guess-input-box {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.guess-input-box input {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

/* Results panel in Modal */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.result-item {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--brown-border);
    border-radius: 4px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-item.winner {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

.result-item h3 {
    font-size: 16px;
}

/* Animations declarations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes spin-animation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-animation {
    animation: spin-animation 4s linear infinite;
}

@keyframes pulse-legendary {
    0% {
        box-shadow: 0 0 10px rgba(186, 85, 211, 0.4), inset 0 0 10px rgba(186, 85, 211, 0.2);
        border-color: #ba55d3;
    }
    50% {
        box-shadow: 0 0 20px rgba(186, 85, 211, 0.8), inset 0 0 15px rgba(186, 85, 211, 0.4);
        border-color: #ff66ff;
    }
    100% {
        box-shadow: 0 0 10px rgba(186, 85, 211, 0.4), inset 0 0 10px rgba(186, 85, 211, 0.2);
        border-color: #ba55d3;
    }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0px rgba(0, 255, 0, 0.7); }
    100% { box-shadow: 0 0 0 8px rgba(0, 255, 0, 0); }
}

@keyframes border-pulse {
    0% { border-color: var(--brown-border); }
    50% { border-color: var(--gold); }
    100% { border-color: var(--brown-border); }
}

@keyframes pulse-county-valid {
    0% { fill-opacity: 0.6; }
    50% { fill-opacity: 0.9; }
    100% { fill-opacity: 0.6; }
}

/* Responsive Grid columns adjustments */
@media (max-width: 900px) {
    .modes-grid, .profile-split, .package-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 0 15px !important;
        gap: 20px !important;
    }
    
    .game-container {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-bottom: 220px !important;
    }
    
    .game-sidebar {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .game-info-card {
        padding: 8px 12px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        text-align: left !important;
    }
    
    .game-info-card h4 {
        margin: 0 !important;
        font-size: 14px !important;
    }
    
    .phase-badge {
        margin: 0 !important;
        font-size: 10px !important;
        padding: 2px 8px !important;
    }
    
    .players-scorecards {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    
    .scorecard {
        flex: 1 !important;
        padding: 6px 8px !important;
        background: rgba(0,0,0,0.5) !important;
        border-width: 1.5px !important;
        min-width: 0 !important;
    }
    
    .scorecard-avatar-wrapper {
        display: none !important;
    }
    
    .scorecard-name {
        font-size: 11px !important;
        max-width: 70px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .scorecard-points {
        font-size: 12px !important;
    }
    
    .scorecard-towers {
        gap: 2px !important;
        margin-top: 2px !important;
    }
    
    .scorecard-towers .tower-icon {
        font-size: 10px !important;
    }
    
    .audio-control-box {
        display: none !important;
    }

    .game-progress-bar-container {
        padding: 10px !important;
        margin-top: 10px !important;
    }

    .step-phase-header {
        display: none !important;
    }

    .step-circle {
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
        line-height: 18px !important;
    }
    
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* Castle Icons on the Map */
.castle-group {
    pointer-events: none;
    user-select: none;
}

.castle-bg {
    stroke: #ffffff;
    stroke-width: 1.5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: fill 0.3s;
}

.castle-bg.red { fill: var(--color-red); }
.castle-bg.blue { fill: var(--color-blue); }
.castle-bg.green { fill: var(--color-green); }

.castle-icon {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Valid Source flashing outline */
.valid-source {
    stroke: #ffd700 !important;
    stroke-width: 2.5px !important;
    cursor: pointer;
    animation: pulse-county-source 1.5s infinite;
    fill: #e67e22 !important;
}

@keyframes pulse-county-source {
    0% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1.0; }
    100% { stroke-opacity: 0.5; }
}

/* County Value Label Overlay */
.county-value-text {
    fill: rgba(246, 235, 212, 0.7);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.9));
}

/* Capture Animation Flash */
.capture-flash {
    animation: flash-capture-keyframes 0.8s ease-out;
}

@keyframes flash-capture-keyframes {
    0% {
        fill: #ffffff !important;
        stroke: #ffd700 !important;
        stroke-width: 4px !important;
        filter: drop-shadow(0 0 15px #ffd700);
    }
    50% {
        fill: #ffd700 !important;
        stroke: #ffffff !important;
        stroke-width: 3px !important;
        filter: drop-shadow(0 0 10px #ffffff);
    }
    100% {
        /* Let transition back to owner styles */
    }
}

/* Siege Indicators */
.under-siege {
    animation: pulse-siege-keyframes 1.5s infinite;
}

@keyframes pulse-siege-keyframes {
    0% { fill: rgba(139, 0, 0, 0.75) !important; stroke: #ff3333 !important; }
    50% { fill: rgba(255, 51, 51, 0.75) !important; stroke: #ffffff !important; }
    100% { fill: rgba(139, 0, 0, 0.75) !important; stroke: #ff3333 !important; }
}

.siege-group {
    pointer-events: none;
    user-select: none;
}

.siege-bg {
    fill: rgba(26, 18, 12, 0.9);
    stroke: #ff3333;
    stroke-width: 2px;
    filter: drop-shadow(0 2px 6px rgba(255, 51, 51, 0.5));
}

.siege-sword-left {
    animation: clash-left-keyframes 0.8s infinite ease-in-out;
}

.siege-sword-right {
    animation: clash-right-keyframes 0.8s infinite ease-in-out;
}

@keyframes clash-left-keyframes {
    0% {
        transform: translate(-10px, -10px) rotate(45deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    50% {
        transform: translate(0px, 0px) rotate(135deg);
    }
    70% {
        transform: translate(-2px, -2px) rotate(130deg);
    }
    100% {
        transform: translate(0px, 0px) rotate(135deg);
    }
}

@keyframes clash-right-keyframes {
    0% {
        transform: translate(10px, -10px) rotate(-45deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    50% {
        transform: translate(0px, 0px) rotate(-135deg);
    }
    70% {
        transform: translate(2px, -2px) rotate(-130deg);
    }
    100% {
        transform: translate(0px, 0px) rotate(-135deg);
    }
}

/* Premium Floating Toast Notifications */
#toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(26, 18, 12, 0.95);
    border: 1px solid var(--gold-border);
    color: #f6ebd4;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    min-width: 280px;
    max-width: 420px;
    transform: translateX(125%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 16px;
}

.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-success i {
    color: #4caf50;
}

.toast-error {
    border-left: 4px solid #f44336;
}

.toast-error i {
    color: #f44336;
}

.toast-info {
    border-left: 4px solid #d4af37;
}

.toast-info i {
    color: #d4af37;
}

/* Shop and Inventory Tabs */
.shop-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 10px;
}

.shop-tab-btn, .inventory-tab-btn {
    background: rgba(26, 18, 12, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 24px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.shop-tab-btn:hover, .inventory-tab-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.shop-tab-btn.active, .inventory-tab-btn.active {
    background: linear-gradient(135deg, #8b0000, #4a0000);
    color: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.castle-icon-img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* --- Friends & Chat Panel Styles --- */
.friends-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.friends-sidebar {
    background: var(--panel-bg);
    border: 2px solid var(--brown-border);
    border-radius: 8px;
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--brown-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friend-item:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
}

.friend-item.active {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--brown-border);
    overflow: hidden;
    margin-right: 12px;
    position: relative;
    background: #000;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-info {
    flex-grow: 1;
    min-width: 0;
}

.friend-username {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
}

.status-dot.offline {
    background: #7f8c8d;
}

/* Chat Message Bubbles */
.chat-msg-row {
    display: flex;
    margin-bottom: 10px;
    width: 100%;
}

.chat-msg-row.sent {
    justify-content: flex-end;
}

.chat-msg-row.received {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.chat-msg-row.sent .chat-bubble {
    background: #007aff;
    color: #fff;
    border: 1px solid #0056b3;
    border-bottom-right-radius: 2px;
}

.chat-msg-row.received .chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--brown-border);
    border-bottom-left-radius: 2px;
}

.chat-time {
    font-size: 9px;
    color: rgba(255,255,255,0.4);
    display: block;
    text-align: right;
    margin-top: 4px;
}

.chat-msg-row.received .chat-time {
    color: var(--text-muted);
}

/* Custom Lobby Grid & Slots */
.custom-lobby-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.lobby-slot {
    background: var(--panel-bg);
    border: 2px solid var(--brown-border);
    border-radius: 8px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 270px;
    justify-content: space-between;
}

.lobby-slot.occupied.red {
    border-color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.15);
}

.lobby-slot.occupied.blue {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.15);
}

.lobby-slot.occupied.green {
    border-color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.15);
}

.slot-status {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: var(--gold-secondary);
    letter-spacing: 1px;
}

.slot-username {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: #fff;
    margin: 10px 0;
}

/* Invite Banner Animation */
@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Override shield selection columns */
.lobby-selection {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 768px) {
    .lobby-selection {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    .friends-layout {
        grid-template-columns: 1fr !important;
    }
}

/* --- Navigation Badge --- */
.nav-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold-primary);
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    font-family: Arial, sans-serif;
    line-height: 1;
}

.friend-item-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    margin-left: auto;
    font-family: Arial, sans-serif;
    line-height: 1;
}

/* --- Chat Invite Card --- */
.chat-invite-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid var(--gold-primary);
    border-radius: 6px;
    padding: 12px;
    margin: 5px 0;
    max-width: 280px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.chat-invite-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--gold-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-invite-desc {
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-style: italic;
}

.chat-invite-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.chat-invite-actions .btn-small {
    padding: 5px 12px;
    font-size: 11px;
}

/* --- Game Progress Indicator Bar --- */
.game-progress-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px solid var(--gold-primary);
    border-radius: 6px;
    padding: 25px 20px 12px 20px;
    margin-top: 5px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    position: relative;
    overflow: visible;
}

.progress-step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-phase-header {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
    transition: all 0.3s ease;
}

.step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(43, 29, 14, 0.95);
    border: 2px solid var(--brown-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.progress-connector {
    flex-grow: 1;
    height: 3px;
    background: var(--brown-border);
    margin: 0 5px;
    transition: background 0.4s ease;
}

/* Active Step State */
.progress-step-wrapper.active .step-circle {
    background: var(--gold-primary);
    border-color: var(--gold-secondary);
    color: #1a120c;
    box-shadow: 0 0 12px var(--gold-secondary);
    transform: scale(1.18);
}

.progress-step-wrapper.active .step-phase-header {
    color: var(--gold-secondary);
    text-shadow: 0 0 5px rgba(212,175,55,0.6);
}

/* Completed Step State */
.progress-step-wrapper.completed .step-circle {
    background: var(--gold-secondary);
    border-color: var(--gold-primary);
    color: #1a120c;
}

.progress-step-wrapper.completed .step-phase-header {
    color: var(--gold-primary);
}

.progress-connector.completed {
    background: var(--gold-secondary);
}

/* --- Modern Responsive Navigation Bar & Mobile Drawer --- */
@media (max-width: 992px) {
    .navbar {
        height: 64px !important;
        padding: 0 14px !important;
        flex-wrap: nowrap !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
        justify-content: space-between !important;
    }
    
    .nav-left {
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }
    
    .navbar-logo-img {
        height: 38px !important;
    }
    
    .logo-text {
        font-size: 18px !important;
        letter-spacing: 0.5px !important;
    }
    
    .nav-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
    }
    
    .hamburger-btn {
        display: flex !important;
    }
    
    .auth-text-full {
        display: none !important;
    }
    
    .auth-text-short {
        display: inline !important;
    }
    
    .nav-auth-btn {
        padding: 7px 12px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }
    
    .nav-logout-btn {
        display: none !important; /* Visible inside mobile drawer */
    }
    
    .user-status-block {
        padding: 4px 10px 4px 6px !important;
        gap: 8px !important;
    }
    
    .user-status-block .nav-avatar-wrapper {
        width: 32px !important;
        height: 32px !important;
    }
    
    .desktop-only-meta {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    /* Mobile Drawer Menu */
    #nav-menu-zone {
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        width: 100% !important;
        max-height: calc(100vh - 64px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: linear-gradient(180deg, #241407 0%, #150b04 100%) !important;
        border-bottom: 3px solid var(--gold) !important;
        border-top: 1px solid var(--brown-border) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.95) !important;
        padding: 16px 16px 30px 16px !important;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        z-index: 9999 !important;
        backdrop-filter: blur(10px) !important;
    }
    
    #nav-menu-zone.open {
        display: flex !important;
        animation: mobileMenuIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    
    @keyframes mobileMenuIn {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    #nav-menu-zone .nav-menu-link,
    #nav-menu-zone .btn {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        padding: 12px 16px !important;
        font-size: 14.5px !important;
        margin: 0 !important;
        border-radius: 6px !important;
        background: rgba(45, 27, 12, 0.7) !important;
        border: 1px solid rgba(139, 90, 43, 0.5) !important;
    }
    
    #nav-menu-zone .nav-menu-link:hover,
    #nav-menu-zone .nav-menu-link:active {
        background: rgba(212, 175, 55, 0.2) !important;
        border-color: var(--gold) !important;
        color: #fff !important;
    }
    
    .mobile-auth-wrapper {
        width: 100%;
        margin-bottom: 6px;
    }
    
    .mobile-auth-cta {
        width: 100% !important;
        justify-content: center !important;
        padding: 13px 18px !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, #aa8010 0%, #d4af37 50%, #aa8010 100%) !important;
        color: #1a0f05 !important;
        border: 2px solid var(--gold-light) !important;
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.35) !important;
    }
    
    .menu-section-title {
        font-family: 'Cinzel', serif !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        color: var(--gold) !important;
        text-transform: uppercase !important;
        letter-spacing: 1.5px !important;
        padding: 8px 4px 2px 4px !important;
        opacity: 0.9;
    }
    
    .menu-divider {
        height: 1px !important;
        background: linear-gradient(90deg, transparent 0%, var(--brown-border) 50%, transparent 100%) !important;
        margin: 6px 0 !important;
    }
    
    .mobile-user-drawer-card {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 14px !important;
        background: rgba(45, 27, 12, 0.8) !important;
        border: 1.5px solid var(--gold) !important;
        border-radius: 8px !important;
        cursor: pointer;
        margin-bottom: 6px;
    }
    
    .mobile-user-drawer-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    
    .mobile-user-drawer-name {
        font-family: 'Cinzel', serif;
        font-weight: 700;
        font-size: 16px;
        color: var(--gold-light);
    }
    
    .mobile-user-drawer-crowns {
        font-size: 13px;
        color: var(--text-parchment);
    }
    
    .mobile-user-drawer-arrow {
        color: var(--gold);
        font-size: 14px;
    }
    
    .mobile-logout-btn {
        background: rgba(192, 57, 43, 0.25) !important;
        border-color: rgba(192, 57, 43, 0.6) !important;
        color: #ff9999 !important;
        justify-content: center !important;
        font-weight: 700 !important;
        margin-top: 6px !important;
    }
    
    .mobile-logout-btn i {
        color: #ff9999 !important;
    }
}

@media (max-width: 380px) {
    .logo-text {
        font-size: 15.5px !important;
    }
    .navbar-logo-img {
        height: 34px !important;
    }
    .navbar {
        padding: 0 8px !important;
    }
    .auth-text-short {
        display: none !important; /* Shows key icon only */
    }
    .nav-auth-btn {
        padding: 7px 9px !important;
    }
}


/* --- Floating In-Game Chat Widget --- */
.ingame-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ingame-chat-toggle-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #b29010);
    border: 2px solid var(--gold-border);
    color: #1a120c;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), 0 0 10px rgba(212,175,55,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.ingame-chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.8), 0 0 15px rgba(212,175,55,0.6);
}

.ingame-chat-toggle-btn .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1a120c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.ingame-chat-window {
    width: 320px;
    height: 420px;
    background: rgba(26, 18, 12, 0.95);
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    overflow: hidden;
    animation: ingame-chat-slide-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.ingame-chat-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--gold-border);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingame-chat-header h4 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 15px;
    color: var(--gold-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingame-chat-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.ingame-chat-close-btn:hover {
    color: #e74c3c;
}

.ingame-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

.ingame-msg-item {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
    border: 1px solid rgba(212,175,55,0.15);
}

.ingame-msg-item.red {
    background: rgba(192, 57, 43, 0.15);
    border-color: rgba(192, 57, 43, 0.4);
    align-self: flex-start;
}

.ingame-msg-item.blue {
    background: rgba(43, 108, 176, 0.15);
    border-color: rgba(43, 108, 176, 0.4);
    align-self: flex-start;
}

.ingame-msg-item.green {
    background: rgba(47, 133, 90, 0.15);
    border-color: rgba(47, 133, 90, 0.4);
    align-self: flex-start;
}

.ingame-msg-item.self {
    align-self: flex-end;
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-primary);
}

.ingame-msg-sender {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 3px;
}

.ingame-msg-sender.red { color: #ff9f89; }
.ingame-msg-sender.blue { color: #90cdf4; }
.ingame-msg-sender.green { color: #9ae6b4; }
.ingame-msg-sender.self { color: var(--gold-secondary); }

.ingame-msg-text {
    color: #f6ebd4;
}

.ingame-chat-input-form {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.4);
}

.ingame-chat-input-form input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 12px 15px;
    color: #fff;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.ingame-chat-input-form input:focus {
    outline: none;
}

.ingame-chat-input-form button {
    background: transparent;
    border: none;
    color: var(--gold-primary);
    padding: 0 15px;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.ingame-chat-input-form button:hover {
    color: var(--gold-secondary);
}

/* Hide ingame-chat-widget when quiz-drawer is active (not hidden) */
#quiz-drawer:not(.hidden) ~ #ingame-chat-widget {
    display: none !important;
}

/* Mobile layout for Toast Notifications */
@media (max-width: 768px) {
    #toast-container {
        top: 75px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        max-width: 400px;
        align-items: center;
    }
    
    .toast {
        min-width: 0;
        width: 100%;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- High Contrast Light Parchment Card Design --- */
.parchment-card {
    background: linear-gradient(to right, rgba(0,0,0,0.015), rgba(0,0,0,0) 8%, rgba(0,0,0,0) 92%, rgba(0,0,0,0.015)), 
                radial-gradient(circle at center, #fdfcf6 0%, #f4ead0 100%) !important;
    border: 2px solid #bda272 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 40px rgba(186, 161, 115, 0.25) !important;
    color: #2c1a0c !important;
}

/* Force dark readable text inside parchment cards */
.parchment-card p, 
.parchment-card label, 
.parchment-card span:not(.chat-badge), 
.parchment-card li,
.parchment-card td,
.parchment-card th,
.parchment-card h4,
.parchment-card div:not(.quiz-timer-bar):not(.option-btn):not(.btn):not(.avatar-huge-wrapper):not(.logo-container):not(.shield-logo):not(.status-dot):not(.chat-messages) {
    color: #2b1d0c !important;
}

/* Subtitle and helper text */
.parchment-card .welcome-text, 
.parchment-card .medieval-subtitle,
.parchment-card .mode-desc {
    color: #3f2a14 !important;
}

/* Headings inside parchment cards */
.parchment-card h1,
.parchment-card h2,
.parchment-card h3,
.parchment-card .cinzel-title {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: #4a3118 !important;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.9) !important;
    font-weight: 900 !important;
}

/* Lobby slots styling */
.parchment-card .lobby-slot {
    background: rgba(189, 163, 116, 0.12) !important;
    border: 2px solid #d4c09f !important;
}
.parchment-card .lobby-slot .slot-username {
    color: #2b1a0a !important;
}

/* Input Fields Overrides */
.parchment-card .input-medieval {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1.5px solid #bda272 !important;
    color: #2b1a0a !important;
}
.parchment-card .input-medieval:focus {
    border-color: #aa8010 !important;
    box-shadow: 0 0 6px rgba(170, 128, 16, 0.3) !important;
}

/* Matchmaking Status */
.parchment-card .matchmaking-status {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 20px 0 !important;
}

/* Shop and Inventory package / item cards */
.parchment-card .package-card,
.parchment-card .avatar-card {
    background: rgba(189, 163, 116, 0.12) !important;
    border: 1.5px solid #d4c09f !important;
}
.parchment-card .package-card:hover,
.parchment-card .avatar-card:hover {
    border-color: #aa8010 !important;
    box-shadow: 0 6px 15px rgba(189, 163, 116, 0.25) !important;
}
.parchment-card .package-card h4,
.parchment-card .avatar-card h4 {
    color: #2b1a0a !important;
}

/* Mode card highlights */
.mode-card {
    border: 2.5px solid #bda272 !important;
}

/* Adjust Ambient Lighting of Page Background */
body {
    background: radial-gradient(circle, rgba(54, 34, 15, 0.5) 0%, rgba(18, 9, 2, 0.96) 100%), url('background.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
}

/* --- Mobile view responsive overrides --- */
@media (max-width: 900px) {
    /* Center align everything inside panels on mobile */
    .panel, 
    .welcome-box, 
    .profile-card, 
    .friends-layout, 
    .shop-wrapper, 
    .lobby-wrapper {
        text-align: center !important;
    }
    
    .profile-split,
    .friends-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }
    
    .profile-left, 
    .profile-right,
    .friends-sidebar,
    .chat-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Shop / Inventory Header responsive layout */
    .shop-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    .shop-tabs {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    .shop-tab-btn, .inventory-tab-btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
    
    /* Form centering */
    form {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .form-group {
        width: 100% !important;
        max-width: 320px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .form-group label {
        text-align: center !important;
        margin-bottom: 6px !important;
    }
    
    .input-medieval {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* Grids centering and responsive columns */
    .modes-grid, 
    .custom-lobby-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px !important;
    }
    
    .shop-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    .package-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        width: 100% !important;
    }
    
    @media (max-width: 600px) {
        .shop-grid,
        .package-grid {
            grid-template-columns: 1fr !important;
        }
    }
    
    .mode-card, 
    .package-card, 
    .avatar-card, 
    .lobby-slot {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }
    
    /* Buttons centering */
    .btn, button:not(.hamburger-btn):not(.btn-toggle-pwd):not(.ingame-chat-toggle-btn) {
        margin: 5px auto !important;
    }
    
    /* Friends list elements */
    .friends-list-grid {
        align-items: center !important;
        width: 100% !important;
    }
    
    .friend-item {
        width: 100% !important;
        max-width: 300px !important;
        justify-content: center !important;
    }
}

/* Medieval Toggle Switch */
.slider-toggle::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3.5px;
    background-color: var(--gold-secondary);
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider-toggle {
    background-color: #d4af37;
}
input:checked + .slider-toggle::before {
    transform: translateX(24px);
    background-color: #1c1005;
}

/* Mobile Menu Backdrop Overlay */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    z-index: 98;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

/* --- Modernized Landing Page Hero & Split Layout --- */
.landing-hero-wrapper {
    max-width: 1240px;
    margin: 15px auto 25px auto;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.landing-hero-banner {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 3px double var(--gold);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85);
    background: #180d04;
}

.hero-cover-image {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    filter: brightness(0.98) contrast(1.04);
}

.hero-overlay-bar {
    background: linear-gradient(180deg, rgba(28, 16, 6, 0.96) 0%, rgba(16, 8, 3, 0.99) 100%);
    border-top: 2px solid var(--brown-border);
    padding: 20px 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hero-bar-left {
    flex: 1;
    min-width: 280px;
}

.hero-slogan {
    font-family: 'Cinzel', serif;
    font-size: 21px;
    font-weight: 900;
    color: var(--gold-light);
    margin: 0 0 6px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-subtext {
    margin: 0;
    font-size: 14px;
    color: var(--text-parchment);
    line-height: 1.5;
}

.hero-bar-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-large {
    padding: 11px 22px;
    font-size: 14.5px;
    letter-spacing: 0.5px;
}

.welcome-features-bar {
    padding: 14px 20px;
    border: 1.5px solid var(--brown-border);
    background: rgba(22, 12, 5, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    text-align: center;
    margin: 18px 0 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--gold-light);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.feature-divider {
    opacity: 0.35;
    color: var(--gold);
}

/* Landing Page Split Layout & Symmetrical Alignment */
.landing-split-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px 50px 20px;
    box-sizing: border-box;
}

.landing-left-column {
    flex: 0 0 calc(67% - 15px);
    max-width: calc(67% - 15px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.landing-right-column {
    flex: 0 0 calc(33% - 15px);
    max-width: calc(33% - 15px);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 85px;
    width: 100%;
}

.landing-left-column .welcome-box,
.landing-left-column .parchment-card {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
    text-align: left;
    padding: 26px 28px;
}

.landing-left-column .welcome-box h1,
.landing-left-column .welcome-box h2 {
    text-align: left;
    margin-bottom: 12px;
}

.landing-right-column .welcome-box,
.landing-right-column .parchment-card {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
    padding: 22px;
}

/* Display toggles for responsive ads */
.mobile-only-ad {
    display: none !important;
}

@media (max-width: 992px) {
    .landing-hero-wrapper {
        padding: 0 12px;
        margin: 10px auto 18px auto;
    }
    .landing-hero-banner {
        border-radius: 8px !important;
        border: 2px solid var(--gold) !important;
    }
    .hero-overlay-bar {
        padding: 16px 14px;
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    .hero-slogan {
        justify-content: center;
        font-size: 17px;
        line-height: 1.35;
        text-align: center;
    }
    .hero-subtext {
        font-size: 13px;
        line-height: 1.45;
        text-align: center;
    }
    .hero-bar-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    .hero-bar-actions button {
        width: 100%;
        padding: 12px 18px;
        font-size: 14px;
    }
    .welcome-features-bar {
        padding: 10px 12px !important;
        gap: 8px !important;
        margin: 12px 0 0 0 !important;
        justify-content: center !important;
    }
    .welcome-features-bar .feature-divider {
        display: none !important;
    }
    .welcome-features-bar .feature-item {
        background: rgba(45, 27, 12, 0.7) !important;
        border: 1px solid rgba(139, 90, 43, 0.6) !important;
        padding: 4px 10px !important;
        border-radius: 12px !important;
        font-size: 11.5px !important;
        white-space: nowrap !important;
    }
    .landing-split-container {
        flex-direction: column;
        gap: 24px;
        padding: 0 12px 30px 12px;
    }
    .landing-left-column,
    .landing-right-column {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .landing-right-column {
        position: static;
        gap: 20px;
        margin-top: 10px;
    }
    #landing-panel .landing-right-column {
        display: flex !important;
    }
    .ad-container, 
    .hirdetes-doboz {
        display: flex !important;
        min-height: 110px !important;
        height: auto !important;
        padding: 8px !important;
    }
    .mobile-only-ad {
        display: flex !important;
    }
    .dashboard-sidebar .oldalsav-hirdetes {
        display: none !important;
    }
}

/* --- UI/UX Upgrades (Antigravity Javaslatok) --- */

/* County Hover Glow */
.megye:hover {
    fill-opacity: 1 !important;
    filter: brightness(1.25) drop-shadow(0 0 10px #d4af37) !important;
    stroke: #ffd700 !important;
    stroke-width: 2px !important;
}

/* Siege FX (Flashing warning glow on active battle counties) */
.megye.siege {
    animation: siege-glow 0.8s infinite alternate;
    stroke: #ff3c00 !important;
    stroke-width: 2.5px !important;
}
@keyframes siege-glow {
    from {
        filter: drop-shadow(0 0 3px #ff3c00) brightness(0.85);
    }
    to {
        filter: drop-shadow(0 0 12px #ff8800) brightness(1.25);
    }
}

/* Animated Attack Arrow Overlay */
.attack-arrow {
    stroke: #ffffff;
    stroke-width: 3.5px;
    stroke-dasharray: 8 6;
    stroke-linecap: round;
    fill: none;
    animation: attack-dash 1s linear infinite;
    filter: drop-shadow(0 0 4px #ff3c00);
}
@keyframes attack-dash {
    to {
        stroke-dashoffset: -28;
    }
}

/* Glassmorphism Card Style */
.glassmorphism-card {
    background: rgba(42, 28, 13, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.45) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
}

/* --- Seasonal Themes & Accents --- */

/* 1. Winter Theme */
body.theme-winter {
    --bg-gradient: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%) !important;
    --brown-border: #415a77 !important;
    --gold: #8ecae6 !important;
    --gold-secondary: #219ebc !important;
    background-color: #0d1b2a !important;
}
body.theme-winter::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.15;
    z-index: -2;
    pointer-events: none;
}

/* 2. Autumn Theme */
body.theme-autumn {
    --bg-gradient: linear-gradient(135deg, #3a2215 0%, #1e110b 100%) !important;
    --brown-border: #b05c2e !important;
    --gold: #d4833b !important;
    --gold-secondary: #f4a261 !important;
    background-color: #1e110b !important;
}
body.theme-autumn::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.18;
    z-index: -2;
    pointer-events: none;
}

/* 3. Summer Theme */
body.theme-summer {
    --bg-gradient: linear-gradient(135deg, #5b3f12 0%, #2f1d07 100%) !important;
    --brown-border: #d4af37 !important;
    --gold: #ffd166 !important;
    --gold-secondary: #ffb703 !important;
    background-color: #2f1d07 !important;
}
body.theme-summer::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1473448912268-2022ce9509d8?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.14;
    z-index: -2;
    pointer-events: none;
}

/* 4. Spring Theme */
body.theme-spring {
    --bg-gradient: linear-gradient(135deg, #1c3322 0%, #0d1e13 100%) !important;
    --brown-border: #52796f !important;
    --gold: #ffb5a7 !important;
    --gold-secondary: #fec5bb !important;
    background-color: #0d1e13 !important;
}
body.theme-spring::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1462275646964-a0e3386b89fa?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.16;
    z-index: -2;
    pointer-events: none;
}

/* 5. Halloween Theme */
body.theme-halloween {
    --bg-gradient: linear-gradient(135deg, #1d1135 0%, #0c051a 100%) !important;
    --brown-border: #b85d18 !important;
    --gold: #fb8500 !important;
    --gold-secondary: #ffb703 !important;
    background-color: #0c051a !important;
}
body.theme-halloween::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1509248961158-e54f6934749c?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.22;
    z-index: -2;
    pointer-events: none;
}

/* 6. Christmas Theme */
body.theme-christmas {
    --bg-gradient: linear-gradient(135deg, #2d0b10 0%, #150305 100%) !important;
    --brown-border: #1a5f36 !important;
    --gold: #d4af37 !important;
    --gold-secondary: #f8961e !important;
    background-color: #150305 !important;
}
body.theme-christmas::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1544816155-12df9643f363?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.18;
    z-index: -2;
    pointer-events: none;
}

/* 7. August 20 Theme */
body.theme-august20 {
    --bg-gradient: linear-gradient(135deg, #0e201c 0%, #050d0a 100%) !important;
    --brown-border: #a22c29 !important;
    --gold: #d4af37 !important;
    --gold-secondary: #386f52 !important;
    background-color: #050d0a !important;
}
body.theme-august20::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1531685222403-f928502d2b30?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.2;
    z-index: -2;
    pointer-events: none;
}

/* 8. March 15 Theme */
body.theme-march15 {
    --bg-gradient: linear-gradient(135deg, #2b1f1d 0%, #150e0d 100%) !important;
    --brown-border: #386f52 !important;
    --gold: #c1121f !important;
    --gold-secondary: #fdf0d5 !important;
    background-color: #150e0d !important;
}
body.theme-march15::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&q=80&w=1920') no-repeat center center fixed;
    background-size: cover;
    opacity: 0.15;
    z-index: -2;
    pointer-events: none;
}

/* Unified Falling Particles Animation */
.snowflake, .leaf, .summer-particle, .spring-particle, .halloween-particle, .christmas-particle, .august20-particle, .march15-particle {
    position: absolute;
    top: -25px;
    user-select: none;
    z-index: 1000;
    pointer-events: none;
    animation: fall-seasonal linear infinite;
}

@keyframes fall-seasonal {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) rotate(180deg) translateX(25px);
        opacity: 0.75;
    }
    100% {
        transform: translateY(105vh) rotate(360deg) translateX(-25px);
        opacity: 0.15;
    }
}

/* --- Battle Pass Styles --- */
.bp-modal-content {
    max-width: 850px !important;
    background: #2a1c0d url('background.jpg') no-repeat center center !important;
    background-size: cover !important;
}
.bp-header-banner {
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid var(--brown-border);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bp-header-banner-left {
    text-align: left;
}
.bp-progress-container {
    margin: 15px 0;
    position: relative;
    flex: 1;
    max-width: 400px;
}
.bp-progress-bar-bg {
    width: 100%;
    height: 22px;
    background: #120902;
    border: 1.5px solid var(--brown-border);
    border-radius: 11px;
    overflow: hidden;
    position: relative;
}
.bp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f39c12);
    width: 0%;
    transition: width 0.5s ease;
}
.bp-progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 0;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    line-height: 22px;
    text-shadow: 1px 1px 2px #000;
}
.bp-levels-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 15px;
}
.bp-level-row {
    display: flex;
    align-items: center;
    background: rgba(42, 28, 13, 0.7);
    border: 1px solid var(--brown-border);
    border-radius: 6px;
    padding: 8px 12px;
    position: relative;
    transition: all 0.3s;
}
.bp-level-row.reached {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(82, 54, 26, 0.4);
}
.bp-level-number {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: bold;
    width: 60px;
    text-align: center;
    border-right: 1.5px solid var(--brown-border);
    margin-right: 15px;
    color: #d4af37;
}
.bp-track-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}
.bp-track-col.free-track {
    border-right: 1px dashed var(--brown-border);
}
.bp-track-col.premium-track {
    background: rgba(212, 175, 55, 0.03);
}
.bp-reward-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bp-reward-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #120902;
    border: 1.5px solid var(--brown-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}
.bp-reward-icon.premium-border {
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}
.bp-reward-name {
    font-size: 13px;
    font-weight: 600;
}
.bp-claim-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

/* Dynamic Hover Tooltip styles */
#map-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 10000;
    transition: opacity 0.15s ease;
    min-width: 180px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1.5px solid var(--brown-border);
    background: rgba(42, 28, 13, 0.95);
    border-radius: 4px;
    padding: 8px 12px;
    color: #ffffff;
    display: none;
}
#player-tooltip {
    position: absolute;
    z-index: 10001;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 2px solid var(--gold);
    background: rgba(42, 28, 13, 0.98);
    border-radius: 4px;
    padding: 12px;
    color: #ffffff;
    display: none;
}
.tooltip-title {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    border-bottom: 1px solid var(--brown-border);
    padding-bottom: 4px;
    margin-bottom: 6px;
    color: #d4af37;
}
.tooltip-body {
    font-size: 12px;
}
.tooltip-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    border-top: 1px dashed var(--brown-border);
    padding-top: 8px;
}

/* Game Footer styling */
.game-footer {
    margin-top: 50px;
    padding: 25px 15px;
    border-top: 2px solid #bda272;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to top, #1C1005, #2A1A0A);
    border-radius: 0;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    width: 100%;
    box-sizing: border-box;
    clear: both;
}

.game-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.game-footer .footer-links a {
    color: var(--gold) !important;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game-footer .footer-links a:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px var(--gold);
}

.game-footer .footer-copyright {
    color: var(--text-muted) !important;
    font-size: 11px;
    margin: 5px 0 0 0;
    font-family: 'Georgia', serif;
}

/* Protection to make saving/dragging images hard */
img, image, .scorecard-avatar-wrapper, .avatar-huge-wrapper, .shop-item-img-wrapper {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Block navbar interactions during active game */
.navbar.blocked {
    position: relative;
}
.navbar.blocked::after {
    content: 'A csata folyamatban van...';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 9999;
    cursor: not-allowed;
    text-shadow: 1px 1px 2px #000;
}

/* --- High Contrast Battle Pass inside Parchment Card --- */
.parchment-card .bp-progress-card {
    background: rgba(186, 161, 115, 0.15) !important;
    border: 1.5px solid #bda272 !important;
    box-shadow: inset 0 0 10px rgba(186, 161, 115, 0.1) !important;
}

.parchment-card .bp-progress-card h4 {
    color: #4a3118 !important;
}

.parchment-card .progress-bar-container {
    background: #e6dfc7 !important;
    border: 1px solid #bda272 !important;
}

.parchment-card .bp-track-headers {
    border-bottom: 2px solid #bda272 !important;
    color: #4a3118 !important;
}

.parchment-card .bp-track-headers > div {
    border-right-color: #bda272 !important;
}

.parchment-card .bp-level-row {
    background: #fffdf9 !important;
    border: 1.5px solid #bda272 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04) !important;
}

.parchment-card .bp-level-row.reached {
    background: #fdfbf1 !important;
    border-color: #d4af37 !important;
    box-shadow: 0 3px 8px rgba(212, 175, 55, 0.1) !important;
}

.parchment-card .bp-level-number {
    border-right: 1.5px solid #bda272 !important;
    color: #8b6508 !important;
    background: transparent !important;
}

.parchment-card .bp-track-col.free-track {
    border-right: 1px dashed #bda272 !important;
}

.parchment-card .bp-track-col.premium-track {
    background: rgba(212, 175, 55, 0.05) !important;
}

.parchment-card .bp-reward-icon {
    background: #fdfcf7 !important;
    border: 1.5px solid #bda272 !important;
}

.parchment-card .bp-reward-icon.premium-border {
    border-color: #d4af37 !important;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.2) !important;
}

.parchment-card .bp-reward-name {
    color: #2c1a0c !important;
}

.facebook-header-link:hover {
    transform: scale(1.15);
}



