@font-face {
    font-family: 'CustomFont';
    src: url('FONT.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-base: #131313;
    --bg-card: #232323;
    --bg-glass: rgba(35, 35, 35, 0.9);
    --border-glass: rgba(255, 255, 255, 0.08);

    --primary: #00ff44;      /* Neon Green */
    --primary-glow: rgba(0, 255, 68, 0.2);

    --secondary: #991b1b;    /* Deep Red */
    --secondary-glow: rgba(153, 27, 27, 0.2);

    --accent: #888;          /* Muted grey */
    --accent-glow: transparent;

    --success: #00ff44;      /* Green */
    --warning: #f59e0b;      /* Amber */
    --danger: #dc2626;       /* Red */

    --text-main: #f5f5f4;
    --text-muted: #bbb;

    --font-heading: 'CustomFont', sans-serif;
    --font-body: 'CustomFont', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 10% 40%, rgba(0, 255, 68, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 90% 20%, rgba(0, 255, 68, 0.02) 0%, transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.01) 0%, transparent 40%);
    color: var(--text-main);
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
    font-size: 16px;
}

/* Global custom scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 68, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 68, 0.3); }
* { scrollbar-width: thin; scrollbar-color: rgba(0, 255, 68, 0.15) transparent; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    
}

p { margin-bottom: 10px; line-height: 1.6; }
.muted { color: var(--text-muted); font-size: 0.95rem; }

/* Buttons */
.btn {
    border: 1px solid transparent;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-weight: 700;
    letter-spacing: 1px;
    background: transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(1); }
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.97); }

.btn-primary { color: var(--primary); border-color: var(--primary); background: rgba(0, 255, 68, 0.06); }
.btn-primary:hover:not(:disabled) { background: var(--primary); color: #000; box-shadow: 0 0 25px rgba(0, 255, 68, 0.3); }

.btn-success { color: var(--success); border-color: var(--success); background: rgba(101, 163, 13, 0.06); }
.btn-success:hover:not(:disabled) { background: var(--success); color: #000; box-shadow: 0 0 25px rgba(101, 163, 13, 0.3); }

.btn-warning { color: var(--warning); border-color: var(--warning); background: rgba(245, 158, 11, 0.06); }
.btn-warning:hover:not(:disabled) { background: var(--warning); color: #000; box-shadow: 0 0 25px rgba(245, 158, 11, 0.3); }

.btn-danger { color: var(--danger); border-color: var(--danger); background: rgba(220, 38, 38, 0.06); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; box-shadow: 0 0 25px rgba(220, 38, 38, 0.3); }

.btn-accent { color: var(--accent); border-color: var(--accent); background: rgba(136, 136, 136, 0.06); }
.btn-accent:hover:not(:disabled) { background: var(--accent); color: #fff; box-shadow: 0 0 25px rgba(136, 136, 136, 0.3); }

.btn-info { color: var(--primary); border-color: var(--primary); font-weight: 700; background: rgba(0, 255, 68, 0.08); }
.btn-info:hover:not(:disabled) { background: var(--primary); color: #000; box-shadow: 0 0 25px rgba(0, 255, 68, 0.3); }

.btn-secondary { color: var(--primary); border-color: rgba(0, 255, 68, 0.4); background: rgba(0, 255, 68, 0.04); }
.btn-secondary:hover:not(:disabled) { background: var(--primary); color: #000; box-shadow: 0 0 25px rgba(0, 255, 68, 0.3); }

.input-select {
    padding: 10px;
    background: rgba(25, 25, 25, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.input-select:focus { border-color: rgba(0, 255, 68, 0.35); box-shadow: 0 0 12px rgba(0, 255, 68, 0.08); }

/* Panel — dark card style */
.panel {
    background: var(--bg-card);
    border: none;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    border-radius: 20px;
}
.panel:hover { box-shadow: 0 15px 45px rgba(0, 0, 0, 0.55); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Topbar */
.topbar {
    min-height: 55px;
    height: auto;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; justify-content: space-between;
    align-items: center; padding: 6px 15px; z-index: 10;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}
.topbar-logo {
    font-family: var(--font-heading);
    font-size: 20px; font-weight: 900;
    color: var(--primary);
    
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-stats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stat-item {
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(6px);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: visible;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.stat-item:hover {
    border-color: rgba(255,255,255,0.12);
}
.ui-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}
.ui-icon-sm {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}
.ui-icon-lg {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.hp-stat { border-color: rgba(220, 38, 38,0.4); }
.hunger-stat { border-color: rgba(245, 158, 11,0.4); }
.thirst-stat { border-color: rgba(0, 255, 68,0.4); }
.energy-stat { border-color: rgba(0, 255, 68, 0.4); }
.aggro-stat { border-color: rgba(136, 136, 136,0.4); }

.bar-mini { width: 60px; height: 8px; background: #111; border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8); }
.bar-mini-fill { height: 100%; transition: width 0.3s ease-out; }
.hp-fill-bar { background: var(--danger); box-shadow: 0 0 8px var(--danger); transition: width 0.3s ease-out, background 0.3s, box-shadow 0.3s; }
.hunger-fill-bar { background: var(--warning); box-shadow: 0 0 8px var(--warning); transition: width 0.3s ease-out, background 0.3s, box-shadow 0.3s; }
.thirst-fill-bar { background: var(--primary); box-shadow: 0 0 8px var(--primary); transition: width 0.3s ease-out, background 0.3s, box-shadow 0.3s; }
.energy-fill-bar { background: var(--primary); box-shadow: 0 0 8px var(--primary); transition: width 0.3s ease-out, background 0.3s, box-shadow 0.3s; }

/* Critical stat pulsation */
.stat-critical .bar-mini-fill {
    animation: statCriticalPulse 1s ease-in-out infinite;
}
.stat-critical .bar-mini {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8), 0 0 8px rgba(220, 38, 38, 0.4);
}
.hp-stat.stat-critical { animation: statIconShake 0.5s ease-in-out infinite; }

@keyframes statCriticalPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--danger); }
    50% { opacity: 0.5; box-shadow: 0 0 16px var(--danger); }
}
@keyframes statIconShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* Language Picker */
.lang-picker {
    display: flex;
    gap: 5px;
    align-items: center;
}
.lang-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #8892b0;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    outline: none;
}
.lang-btn:hover {
    background: rgba(0, 255, 68, 0.12);
    color: #fff;
    border-color: rgba(0, 255, 68, 0.3);
    transform: translateY(-1px);
}
.lang-btn.active {
    background: rgba(0, 255, 68, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 255, 68, 0.15);
}

/* EXP Bar */
.exp-bar-container { height: 18px; background: rgba(25, 25, 25, 0.8); position: relative; border-bottom: 1px solid rgba(255,255,255,0.05); }
.exp-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, rgba(136, 136, 136, 0.2), var(--accent));
    transition: width 0.5s cubic-bezier(0.2,0.8,0.2,1);
    box-shadow: 0 0 12px rgba(136, 136, 136, 0.15);
    position: relative; overflow: hidden;
}
.exp-bar-fill::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: expBarShine 2.5s ease-in-out infinite;
}
@keyframes expBarShine {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}
.exp-bar-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; font-weight: 700; font-family: var(--font-heading); letter-spacing: 1px; color: #fff; text-shadow: 0 0 6px rgba(0,0,0,0.8); }

/* Overview stats bar */
.overview-stats-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.overview-stat-chip {
    display: flex; align-items: center; gap: 5px;
    background: rgba(25, 25, 25, 0.85); border: 1px solid rgba(0, 255, 68, 0.12);
    border-radius: 10px; padding: 8px 14px; font-size: 0.85rem;
    font-family: var(--font-heading);
}
.overview-stat-label { font-size: 0.9rem; opacity: 0.7; }
.overview-stat-val { font-weight: 700; font-size: 1rem; }
.overview-stat-sep { opacity: 0.3; margin: 0 2px; }
.overview-stat-extra { font-size: 0.75rem; opacity: 0.6; }

/* Flea market sub-tabs */
.flea-tabs .flea-tab {
    padding: 8px 16px; font-size: 0.8rem; border-radius: 12px;
    background: rgba(30, 30, 30, 0.8); border: 1px solid var(--border-glass);
    color: var(--text-muted); transition: all 0.2s; cursor: pointer;
}
.flea-tabs .flea-tab:hover { border-color: var(--primary); color: #fff; }
.flea-tabs .flea-tab.active {
    background: rgba(0, 255, 68, 0.1); border-color: var(--primary);
    color: #fff; box-shadow: 0 0 10px rgba(0, 255, 68, 0.15);
}

.avatar-select { display: flex; justify-content: center; gap: 10px; margin: 10px 0 15px; }
.avatar-select label { font-size: 1.5rem; cursor: pointer; padding: 5px; border-radius: 5px; transition: 0.2s; border: 2px solid transparent; }
.avatar-select label:hover { background: rgba(255,255,255,0.1); }
.avatar-select input { display: none; }
.avatar-select input:checked + label, .avatar-select label:has(input:checked) { border-color: var(--primary); background: rgba(0, 255, 68, 0.2); }

/* Layout */
.app-container {
    flex: 1;
    display: flex;
    overflow: hidden; /* For scrolling in children */
}
.sidebar {
    width: 260px;
    background: #1a1a1a;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
}
.profile-pic { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.06); position: relative; }
.avatar {
    font-size: 45px;
    background: rgba(25, 25, 25, 0.9);
    border-radius: 50%; width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    border: 3px solid rgba(136, 136, 136, 0.4);
    box-shadow: 0 0 20px rgba(136, 136, 136, 0.08);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.avatar:hover {
    box-shadow: 0 0 25px rgba(0, 255, 68, 0.2);
}
/* Avatar rarity rings */
.avatar.avatar-uncommon { border-color: rgba(34, 197, 94, 0.6); box-shadow: 0 0 15px rgba(34, 197, 94, 0.15); }
.avatar.avatar-rare { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }
.avatar.avatar-epic { border-color: rgba(168, 85, 247, 0.6); box-shadow: 0 0 18px rgba(168, 85, 247, 0.2); animation: avatarEpicGlow 2s ease-in-out infinite; }
.avatar.avatar-legendary { border-color: rgba(234, 179, 8, 0.7); box-shadow: 0 0 22px rgba(234, 179, 8, 0.25); animation: avatarLegendaryGlow 1.5s ease-in-out infinite; }
.avatar.avatar-mythic { border-color: rgba(220, 38, 38, 0.7); box-shadow: 0 0 25px rgba(220, 38, 38, 0.3); animation: avatarMythicGlow 1.2s ease-in-out infinite; }

@keyframes avatarEpicGlow {
    0%, 100% { box-shadow: 0 0 18px rgba(168, 85, 247, 0.2); }
    50% { box-shadow: 0 0 28px rgba(168, 85, 247, 0.35); }
}
@keyframes avatarLegendaryGlow {
    0%, 100% { box-shadow: 0 0 22px rgba(234, 179, 8, 0.25); }
    50% { box-shadow: 0 0 35px rgba(234, 179, 8, 0.4); }
}
@keyframes avatarMythicGlow {
    0%, 100% { box-shadow: 0 0 25px rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 0 40px rgba(220, 38, 38, 0.5); }
}
.username { font-family: var(--font-heading); font-weight: 700; font-size: 16px; letter-spacing: 1px; color: #fff; }
.logout-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.2rem; transition: transform 0.2s; }
.logout-btn:hover { transform: scale(1.2); text-shadow: none; }

.nav-links { list-style: none; padding: 10px 0; }
.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-left: 3px solid transparent;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
    position: relative;
    overflow: hidden;
    margin: 2px 8px;
    border-radius: 10px;
    border-left: none;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}
.nav-item:hover::before {
    transform: scaleY(1);
}
.nav-item.active {
    color: var(--primary);
    background: rgba(0, 255, 68, 0.06);
}
.nav-item.active::before {
    transform: scaleY(1);
    box-shadow: 0 0 12px rgba(0, 255, 68, 0.4);
}

.nav-item-logout:hover { background: rgba(220, 38, 38, 0.06); color: #ff3366 !important; }
.nav-item-logout:hover::before { background: var(--danger); }
.nav-item-logout.active::before { background: var(--danger); }

.event-log-section { flex: 1; overflow: hidden; padding: 10px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; background: rgba(0,0,0,0.2); }
.event-log-section h4 { font-size: 0.8rem; margin-bottom: 10px; color: var(--primary); opacity: 0.8; }
.event-log { flex: 1; overflow-y: auto; font-size: 0.8rem; font-family: var(--font-body); }
.log-entry { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,0.02); line-height: 1.4; border-radius: 4px; transition: background 0.2s; }
.log-entry:hover { background: rgba(255,255,255,0.02); }
.log-time { color: #555; font-size: 0.7rem; margin-right: 5px; }

/* Main Content */
.content-area {
    flex: 1; padding: 30px; overflow-y: auto;
    background: var(--bg-base);
    position: relative;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Rate Chart (Stock) */
.rate-chart { width: 100%; height: 120px; border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; margin-top: 10px; background: rgba(25, 25, 25, 0.5); }
.exchange-rate-box { font-family: var(--font-heading); font-size: 1.4rem; background: rgba(30,30,30,0.8); display: inline-block; padding: 10px 20px; border-radius: 10px; border-left: 4px solid var(--primary); box-shadow: 0 4px 15px rgba(0,0,0,0.5); }

/* Progress Bars (Bottle Fill pattern) */
.timer-display { margin-top: 15px; }
.progress-container {
    width: 100%; background: rgba(25, 25, 25, 0.8); height: 34px; border-radius: 12px; position: relative;
    border: 1px solid rgba(255,255,255,0.06); overflow: hidden; box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}
.progress-fill {
    height: 100%; width: 0%;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 8px,
            rgba(255,255,255,0.08) 8px,
            rgba(255,255,255,0.08) 16px
        );
    background-color: var(--primary);
    background-size: 32px 32px;
    transition: width 0.5s linear;
    animation: progressStripes 1s linear infinite;
    box-shadow: 0 0 15px rgba(0, 255, 68, 0.2);
    border-radius: 12px;
    position: relative;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 30px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
    border-radius: 0 8px 8px 0;
    animation: progressShine 1.5s ease-in-out infinite;
}
.fight-fill { background-color: var(--danger); box-shadow: 0 0 15px var(--danger); }
.gym-fill { background-color: var(--accent); box-shadow: 0 0 15px var(--accent); }
.dumpster-fill { background-color: var(--success); box-shadow: 0 0 15px var(--success); }
.progress-fill.almost-done {
    animation: progressStripes 1s linear infinite, progressPulse 0.8s ease-in-out infinite;
}
@keyframes progressStripes { 0% { background-position: 0 0; } 100% { background-position: 32px 0; } }
@keyframes progressShine {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
@keyframes progressPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 68, 0.2); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 68, 0.5), 0 0 40px rgba(0, 255, 68, 0.2); }
}

.progress-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-weight: 700; color: #fff; text-shadow: none; font-size: 1rem;
    font-family: var(--font-heading); letter-spacing: 1px;
}

/* Clock Timer Animation */
.clock-timer {
    width: 40px; height: 40px; border: 3px solid var(--text-muted); border-radius: 50%;
    position: relative; margin-right: 15px; display: inline-block; vertical-align: middle;
}
.clock-timer::before {
    content: ''; position: absolute; top: 5px; left: 16px; width: 3px; height: 12px;
    background: var(--text-main); border-radius: 2px; transform-origin: bottom center;
    animation: spinClock 2s linear infinite;
}
@keyframes spinClock { 100% { transform: rotate(360deg); } }
/* UI Cards - Overhauled with dot overlay, corner brackets, scan-line, glassmorphism */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 15px;
    align-items: stretch;
}
.game-card {
    --card-accent: #00ff44;
    background: #232323;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 520px;
    transition: box-shadow 0.3s;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}
/* Expanding clip-path circle — clips the card image reveal area */
.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--card-accent);
    clip-path: circle(90px at 80% 20%);
    transition: 0.5s ease-in-out;
    z-index: 1;
    pointer-events: none;
}
.game-card:hover::before {
    clip-path: circle(350px at 80% -20%);
}
/* Watermark text */
.game-card::after {
    content: attr(data-card-type);
    position: absolute;
    top: 25%;
    left: -5%;
    font-size: 6em;
    font-weight: 800;
    font-style: italic;
    color: rgba(255, 255, 255, 0.04);
    z-index: 2;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.game-card:hover {
    transform: none !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 0, 0, 0.3);
}
.game-card.locked { pointer-events: none; opacity: 0.6; }
.game-card.locked .card-img-container img { filter: grayscale(1) brightness(0.3) !important; }
/* Corner brackets — removed by request */

.card-img-container {
    width: 100%;
    height: 180px;
    background: transparent;
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 0;
    z-index: 10;
    transition: 0.5s ease-in-out;
}
.card-img-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transition: 0.5s ease-in-out;
    position: relative;
    z-index: 5;
}
/* Image always visible — no clip-path on container */
.card-level-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--warning);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    border: 1px solid var(--warning);
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    overflow: visible;
    z-index: 12;
}
.card-content {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 10;
    text-align: center;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    line-height: 1.35;
    padding: 2px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    overflow: visible;
}
.card-desc {
    font-size: 0.78rem;
    color: rgba(200, 210, 230, 0.6);
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: 0.4s ease;
}
.game-card:hover .card-desc {
    max-height: 4em;
    min-height: 1em;
    opacity: 1;
}
.card-stats {
    font-size: 1rem;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    margin-top: 10px;
}
.card-stat-block {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-bottom: none;
    /* Hidden by default — appear on hover */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s ease;
}
.card-stat-block:last-child {
    border-bottom: none;
}
.game-card:hover .card-stat-block {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.game-card:hover .card-stat-block:nth-child(1) { transition-delay: 0.1s; }
.game-card:hover .card-stat-block:nth-child(2) { transition-delay: 0.15s; }
.game-card:hover .card-stat-block:nth-child(3) { transition-delay: 0.2s; }
.card-stat-block .stat-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    order: 2;
}
.card-stat-block .stat-label {
    color: #bbb;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0;
    font-weight: 400;
    order: 1;
}
.card-btn {
    width: auto;
    margin-top: 15px;
    padding: 12px 25px;
    font-size: 0.8rem;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    overflow: visible;
    position: relative;
    z-index: 10;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #fff;
    color: #111;
    border: none;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: 0.3s ease;
}
.game-card:hover .card-btn {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.25s;
}
.game-card .card-btn:hover:not(:disabled) {
    background: var(--card-accent, #00ff44) !important;
    color: #111 !important;
    box-shadow: 0 0 15px var(--card-accent, #00ff44) !important;
    transform: translateY(0) !important;
}
.card-locked {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 15;
    border-radius: 20px;
    color: var(--danger);
    font-weight: bold;
    font-size: 1.05rem;
    line-height: 1.35;
    padding: 10px;
    text-align: center;
    backdrop-filter: blur(3px);
    overflow: visible;
}
.card-locked span { font-size: 2rem; margin-bottom: 5px; line-height: 1; display: inline-block; }

/* ── SHIMMER EFFECT (Замена Матрицы) ───────────────────────────────── */
.shimmer-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(0, 255, 68, 0.15) 35%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(136, 136, 136, 0.15) 65%,
        transparent 80%
    );
    background-size: 200% auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    mix-blend-mode: overlay;
    z-index: 2;
}

/* Активируем перелив при наведении */
.game-card:hover > .shimmer-bg,
.modal:hover > .shimmer-bg,
.beg-minigame-box:hover > .shimmer-bg,
.mg-box:hover > .shimmer-bg {
    opacity: 1;
    animation: shimmerFlow 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Затемняем перелив на заблокированных карточках */
.game-card.locked > .shimmer-bg {
    opacity: 0.3;
    animation: shimmerFlow 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes shimmerFlow {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ── CARD RARITY SYSTEM ────────────────────────────────────────────── */
/* Tier colors */
:root {
    --rarity-common: rgba(180, 190, 200, 0.5);
    --rarity-uncommon: #22c55e;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;
}

/* ── Rarity badge ── */
.card-rarity-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 20;
    line-height: 1.4;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.game-card.rarity-common .card-rarity-badge {
    background: rgba(100, 116, 139, 0.85);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.4);
}
.game-card.rarity-uncommon .card-rarity-badge {
    background: rgba(34, 197, 94, 0.3);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.5);
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
.game-card.rarity-rare .card-rarity-badge {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}
.game-card.rarity-epic .card-rarity-badge {
    background: rgba(168, 85, 247, 0.3);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.5);
    text-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
}
.game-card.rarity-legendary .card-rarity-badge {
    background: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.6);
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: legendaryBadgePulse 2s ease-in-out infinite;
}
@keyframes legendaryBadgePulse {
    0%, 100% { text-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
    50% { text-shadow: 0 0 14px rgba(245, 158, 11, 1), 0 0 25px rgba(245, 158, 11, 0.4); }
}

/* ── Rarity sets --card-accent for expanding circle ── */
.game-card.rarity-common { --card-accent: rgba(100, 116, 139, 0.6); }
.game-card.rarity-uncommon { --card-accent: #22c55e; }
.game-card.rarity-rare { --card-accent: #3b82f6; }
.game-card.rarity-epic { --card-accent: #a855f7; }
.game-card.rarity-legendary { --card-accent: #f59e0b; }

/* Rarity hover glow (via box-shadow) */
.game-card.rarity-uncommon:hover { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 20px rgba(34, 197, 94, 0.2); }
.game-card.rarity-rare:hover { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 25px rgba(59, 130, 246, 0.25); }
.game-card.rarity-epic:hover { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 30px rgba(168, 85, 247, 0.3); }
.game-card.rarity-legendary:hover { box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 35px rgba(245, 158, 11, 0.35); }

/* ── Rarity hover card-title glow ── */
.game-card.rarity-uncommon:hover .card-title { text-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
.game-card.rarity-rare:hover .card-title { text-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.game-card.rarity-epic:hover .card-title { text-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
.game-card.rarity-legendary:hover .card-title { text-shadow: 0 0 12px rgba(245, 158, 11, 0.6), 0 0 25px rgba(245, 158, 11, 0.2); }

/* Shimmer hidden — replaced by expanding circle */
.shimmer-bg { display: none !important; }


/* ── Mythic: world bosses ── */
.game-card.rarity-mythic {
    --card-accent: #dc2626;
}
.game-card.rarity-mythic .card-rarity-badge {
    background: rgba(220, 38, 38, 0.4);
    color: #ff6666;
    border: 1px solid rgba(220, 38, 38, 0.7);
    text-shadow: 0 0 10px rgba(255, 50, 50, 0.8), 0 0 20px rgba(255, 100, 0, 0.4);
    animation: mythicBadgePulse 1.5s ease-in-out infinite;
}
@keyframes mythicBadgePulse {
    0%, 100% { text-shadow: 0 0 10px rgba(255,50,50,0.8), 0 0 20px rgba(255,100,0,0.4); }
    50% { text-shadow: 0 0 16px rgba(255,50,50,1), 0 0 35px rgba(255,100,0,0.7), 0 0 50px rgba(255,0,0,0.3); }
}
.game-card.rarity-mythic:hover .card-title {
    text-shadow: 0 0 14px rgba(220, 38, 38, 0.7), 0 0 30px rgba(249, 115, 22, 0.3);
}
.game-card.rarity-mythic:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 40px rgba(220, 38, 38, 0.35), 0 0 60px rgba(249, 115, 22, 0.2);
}

/* ── Mobile: show all card content + disable heavy animations ── */
@media (hover: none) and (pointer: coarse) {
    /* On touch devices: show stats and button always (no hover) */
    .card-stat-block {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    .card-btn {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }
    .card-desc {
        max-height: 4em !important;
        opacity: 1 !important;
    }
    /* Expanding circle stays static on mobile */
    .game-card::before {
        clip-path: circle(80px at 80% 15%) !important;
        animation: none !important;
    }
    .game-card { height: auto; min-height: 300px; }

    /* Badge pulses */
    .card-rarity-badge,
    .game-card.rarity-mythic .card-rarity-badge {
        animation: none !important;
    }

    /* Avatar glow */
    .avatar.avatar-epic,
    .avatar.avatar-legendary,
    .avatar.avatar-mythic {
        animation: none !important;
    }

    /* Stat critical pulse */
    .stat-critical .bar-mini-fill {
        animation: none !important;
        background: #dc2626 !important;
    }
    .hp-stat.stat-critical {
        animation: none !important;
    }

    /* EXP bar shine */
    .exp-bar-fill::after {
        animation: none !important;
        display: none !important;
    }

    /* Progress bar stripes & shine */
    .bar-fill-inner::after,
    .bar-fill-inner::before {
        animation: none !important;
    }
    .bar-fill-inner.bar-danger::after {
        animation: none !important;
    }

    /* Active card glow */
    .card-active-overlay {
        animation: none !important;
        border-color: rgba(0, 255, 68, 0.4) !important;
    }

    /* Card timer stripes */
    .card-timer-fill,
    .card-timer-fill.card-timer-danger {
        animation: none !important;
    }

    /* Boss pulse & hit */
    .boss-under-attack {
        animation: none !important;
    }
    .boss-under-attack .card-img-container img {
        animation: none !important;
    }

    /* Boss particles — reduce count via shorter lifetime */
    .boss-particle {
        animation-duration: 0.4s !important;
    }
    .boss-damage-number {
        animation-duration: 0.5s !important;
    }

    /* Spinning modal decoration */
    .modal-deco {
        animation: none !important;
        display: none !important;
    }

    /* Begging hand sway */
    .beg-hand-img {
        animation: none !important;
    }
}

/* Respect reduced motion OS setting */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── ACTIVE CARD = always looks like hover (circle expanded, content visible) ── */
.game-card:has(.card-active-overlay)::before,
.game-card.card-is-active::before {
    clip-path: circle(350px at 80% -20%);
}
.game-card:has(.card-active-overlay) .card-desc,
.game-card.card-is-active .card-desc {
    max-height: 4em;
    min-height: 1em;
    opacity: 1;
}
.game-card:has(.card-active-overlay) .card-stat-block,
.game-card.card-is-active .card-stat-block {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.game-card:has(.card-active-overlay) .card-btn,
.game-card.card-is-active .card-btn {
    display: none; /* hide action button, overlay has cancel */
}

/* EMBEDDED CARD ACTIVE TIMER STYLES */
.card-active-overlay {
    margin-top: 4px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 20;
    width: 100%;
}

/* activeCardGlow removed — no border on overlay */

.card-timer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: bold;
    color: var(--primary);
}

.card-timer-bar {
    width: 100%;
    height: 10px;
    background: rgba(25, 25, 25, 0.7);
    border-radius: 10px;
    border: none;
    overflow: hidden;
    position: relative;
}

.card-timer-fill {
    height: 100%;
    width: 0%;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent, transparent 4px,
            rgba(255,255,255,0.1) 4px, rgba(255,255,255,0.1) 8px
        ),
        linear-gradient(90deg, var(--primary), var(--warning));
    background-size: 16px 16px, 100% 100%;
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.4s linear;
    animation: cardTimerStripes 0.8s linear infinite;
    border-radius: 10px;
    position: relative;
}
.card-timer-fill.almost-done {
    animation: cardTimerStripes 0.8s linear infinite, cardTimerPulse 0.6s ease-in-out infinite;
    background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(255,255,255,0.15) 4px, rgba(255,255,255,0.15) 8px), linear-gradient(90deg, var(--success), #4ade80);
    background-size: 16px 16px, 100% 100%;
    box-shadow: 0 0 15px var(--success);
}
@keyframes cardTimerStripes { 0% { background-position: 0 0, 0 0; } 100% { background-position: 16px 0, 0 0; } }
@keyframes cardTimerPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(101, 163, 13, 0.3); }
    50% { box-shadow: 0 0 20px rgba(101, 163, 13, 0.6), 0 0 35px rgba(101, 163, 13, 0.2); }
}

.card-timer-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.card-timer-actions .btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 10px;
    min-height: 38px;
}

/* Active Task Overlay / Dashboard */
.active-task-dash {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: none; /* JS will toggle */
    align-items: center;
    gap: 15px;
}
.task-icon { font-size: 2rem; }
.task-info { flex: 1; }
.task-name { font-weight: bold; color: var(--warning); margin-bottom: 5px; font-size: 1.1rem; }
.task-progress-wrap { height: 10px; background: rgba(0,0,0,0.5); border-radius: 5px; overflow: hidden; margin-bottom: 5px; }
.task-progress-fill { height: 100%; background: var(--warning); width: 0%; transition: 1s linear; }
.task-time { font-size: 0.85rem; color: #ccc; }
.task-actions { display: flex; gap: 10px; }

.active-timer-card { display: flex; align-items: center; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 12px; margin-bottom: 10px; border-left: 3px solid var(--primary); }

/* Bots & Shops Grid */
.bots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-top: 15px; }
.bot-card { background: rgba(35, 35, 35, 0.8); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 15px; position: relative; overflow: hidden; transition: border-color 0.3s; }
.bot-card:hover { border-color: rgba(0, 255, 68, 0.15); }

/* GLOBAL CHAT */
.chat-sidebar {
    width: 360px;
    background: #1a1a1a;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.chat-header {
    padding: 15px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}
.chat-msg {
    background: rgba(255,255,255,0.025);
    padding: 10px 12px;
    border-radius: 10px;
    word-break: break-word;
    border: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}
.chat-msg:hover { background: rgba(255,255,255,0.04); }
.chat-msg.sys {
    background: rgba(255, 204, 0, 0.06);
    color: var(--warning);
    border-left: 2px solid var(--warning);
    border-color: rgba(255, 204, 0, 0.15);
}
/* Only animate NEW messages, not all on every refresh */
.chat-msg.chat-new {
    animation: chatMsgSlideIn 0.3s ease-out;
}
.chat-msg.chat-new.sys {
    animation: chatSysPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes chatMsgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes chatSysPop {
    0% { opacity: 0; transform: scale(0.95) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.chat-meta { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.75rem; color: #888; }
.chat-author { color: var(--primary); font-weight: bold; cursor: pointer; }
.chat-author:hover { text-decoration: underline; }

/* Chat auto-translation */
.chat-translating { color: #666; font-style: italic; font-size: 0.8rem; }
.chat-original-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.chat-show-original {
    font-size: 0.65rem; color: #6b9fff; cursor: pointer; opacity: 0.6;
    transition: opacity 0.2s; user-select: none;
}
.chat-show-original:hover { opacity: 1; text-decoration: underline; }
.chat-show-original.active { color: #aaa; }

/* Territory gang overlay on location cards */
.territory-gang-overlay {
    position: absolute; top: 6px; right: 6px; z-index: 5;
    display: flex; align-items: center; gap: 4px;
    background: rgba(0,0,0,0.75); border: 1px solid var(--warning);
    border-radius: 6px; padding: 3px 8px 3px 4px;
    pointer-events: none;
}
.chat-original-text {
    margin-top: 4px; padding: 4px 8px; border-radius: 6px;
    background: rgba(255,255,255,0.04); border-left: 2px solid rgba(255,255,255,0.1);
    font-size: 0.82rem; color: #999; font-style: italic;
}
.chat-input-area {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-input-area input {
    flex: 1;
    min-width: 0;
    background: rgba(25, 25, 25, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    outline: none;
    font-family: var(--font-body);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.chat-input-area input:focus { border-color: rgba(0, 255, 68, 0.35); box-shadow: 0 0 12px rgba(0, 255, 68, 0.08); }
.chat-input-area button {
    white-space: nowrap;
    padding: 8px 14px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Avatar preview styling */
.avatar-preview-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 8px transparent;
}
.avatar-img-render {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.chat-inline-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    object-fit: contain;
    margin: 0 3px;
    display: inline-block;
}
.ui-icon-inline {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    object-fit: contain;
    margin: 0 2px;
    display: inline-block;
}

/* Shop Category Headers & PvP Header */
.shop-category-header, .pvp-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 25px 0 15px;
}
.shop-category-header h3 {
    margin: 0;
    white-space: nowrap;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    
}
.shop-category-divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 255, 68, 0.3) 0%, transparent 100%);
}

/* Custom Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}
.modal {
    background: var(--bg-card);
    border: none;
    border-radius: 20px;
    padding: 25px;

    width: 90%;
}

.location-grid {
    position: relative;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.15);
    background-image: 
        linear-gradient(rgba(0, 255, 68, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 68, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}
.location-grid::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--text-muted) 0, var(--text-muted) 10px, transparent 10px, transparent 20px);
    z-index: 0;
    opacity: 0.5;
}

.card-item {
    background: var(--bg-card); border: none;
    border-radius: 20px; padding: 15px; text-align: center;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.card-item:hover { transform: translateY(-4px); border-color: rgba(0, 255, 68, 0.25); box-shadow: 0 10px 30px rgba(0, 255, 68, 0.1); }
.card-item.owned { border-color: rgba(101, 163, 13, 0.25); background: rgba(101, 163, 13, 0.04); }
.card-icon { font-size: 40px; margin-bottom: 10px; text-shadow: none; }
.card-title { font-family: var(--font-heading); font-size: 1.1rem; color: #fff; margin-bottom: 5px; }
.card-stats { color: var(--text-muted); font-size: 1rem; margin-bottom: 10px; }

/* Fight Log */
.fight-log { border-left: 3px solid rgba(0, 255, 68, 0.4); font-size: 0.9rem; background: rgba(25, 25, 25, 0.5); border-radius: 0 10px 10px 0; }
.fight-log-title { font-family: var(--font-heading); font-size: 1.2rem; color: #fff; margin-bottom: 10px; }
.fight-round { padding: 3px 0; color: var(--text-muted); font-family: var(--font-body); }
.fight-result { margin-top: 10px; padding: 10px; border-radius: 10px; font-weight: 700; font-family: var(--font-heading); letter-spacing: 1px; }
.fight-result.win { background: rgba(101, 163, 13, 0.08); color: var(--success); border: 1px solid rgba(101, 163, 13,0.2); border-radius: 10px; box-shadow: 0 0 20px rgba(101, 163, 13, 0.05); }
.fight-result.loss { background: rgba(220, 38, 38, 0.08); color: var(--danger); border: 1px solid rgba(220, 38, 38,0.2); border-radius: 10px; box-shadow: 0 0 20px rgba(220, 38, 38, 0.05); }

/* Referral Box */
.ref-box { background: rgba(25, 25, 25, 0.5); border: 1px dashed rgba(0, 255, 68, 0.25); padding: 15px; border-radius: 12px; margin-top: 15px; text-align: center; }
.ref-link { font-family: var(--font-body); color: var(--primary); font-size: 1.1rem; user-select: all; padding: 10px 16px; background: rgba(0, 255, 68,0.06); border-radius: 12px; display: inline-block; margin: 10px 0; word-break: break-all; border: 1px solid rgba(0, 255, 68, 0.1); }

/* Modal Auth / Offline */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal {
    background: var(--bg-card);
    border: none;
    border-radius: 20px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
}
/* Shimmer bg on modals & minigame boxes */
.modal > .shimmer-bg,
.beg-minigame-box > .shimmer-bg,
.mg-box > .shimmer-bg,
.random-event-box > .shimmer-bg {
    border-radius: 18px;
}
/* Spinning border accent */
.modal::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(transparent, rgba(0, 255, 68,0.15), transparent 30%);
    animation: spinModal 6s linear infinite;
    z-index: -1;
    opacity: 0.5;
}
@keyframes spinModal { 100% { transform: rotate(360deg); } }
.modal h2 { text-align: center; font-size: 2rem; margin-bottom: 25px; position: relative; z-index: 1; }

/* Auth Form */
.auth-tabs { display: flex; gap: 15px; margin-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 15px; position: relative; z-index: 1; }
.auth-tab { background: none; border: none; color: var(--text-muted); cursor: pointer; font-family: var(--font-heading); font-size: 1.1rem; text-transform: uppercase; flex: 1; padding: 10px; transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1); letter-spacing: 1px; position: relative; z-index: 1; }
.auth-tab:hover { color: #ccc; }
.auth-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); text-shadow: 0 0 20px rgba(0, 255, 68, 0.3); }
.auth-form { display: none; flex-direction: column; gap: 15px; }
.auth-form.active { display: flex; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.auth-input { background: rgba(25, 25, 25, 0.7); border: 1px solid rgba(255,255,255,0.08); color: #fff; padding: 15px; border-radius: 10px; font-family: var(--font-body); font-size: 1.1rem; width: 100%; transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1); position: relative; z-index: 1; }
.auth-input:focus { outline: none; border-color: rgba(0, 255, 68, 0.4); box-shadow: 0 0 15px rgba(0, 255, 68, 0.08); }

/* Notifications */
#notification-area { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    padding: 15px 20px; border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.7); color: #fff;
    max-width: 350px; font-size: 0.95rem;
    animation: toastBounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4) forwards, fadeOut 0.5s forwards 4.5s;
    font-family: var(--font-body);
    border: none; border-left: 4px solid var(--primary);
    display: flex; align-items: center; gap: 10px;
}
.toast::before {
    content: 'ℹ️'; font-size: 1.1rem; flex-shrink: 0;
}
.toast-danger { border-left-color: var(--danger); box-shadow: 0 10px 30px rgba(220, 38, 38,0.3); }
.toast-danger::before { content: '⚠️'; }
.toast-success { border-left-color: var(--success); box-shadow: 0 10px 30px rgba(101, 163, 13,0.3); }
.toast-success::before { content: '✅'; }
.toast-warning { border-left-color: var(--warning); box-shadow: 0 10px 30px rgba(245, 158, 11,0.3); }
.toast-warning::before { content: '⚡'; }
@keyframes toastBounceIn {
    0% { transform: translateX(120%) scale(0.8); opacity: 0; }
    60% { transform: translateX(-8px) scale(1.02); opacity: 1; }
    80% { transform: translateX(4px) scale(0.99); }
    100% { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes fadeOut { to { opacity: 0; transform: translateX(50px) scale(0.9); pointer-events: none; } }

/* ═══ MOBILE RESPONSIVE ═══ */

/* === MOBILE BURGER + SLIDE-OUT MENU (hidden on desktop) === */
.mobile-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid rgba(0, 255, 68, 0.2);
    border-radius: 12px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    transition: border-color 0.2s;
    flex-shrink: 0;
}
.mobile-burger:hover { border-color: var(--primary); }
.mobile-burger span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--primary);
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}
.mobile-burger.open span:nth-child(1) { transform: rotate(45deg) translate(3px, 3px); }
.mobile-burger.open span:nth-child(2) { opacity: 0; }
.mobile-burger.open span:nth-child(3) { transform: rotate(-45deg) translate(3px, -3px); }

.mobile-topbar-right { display: none; }
.mobile-topbar-avatar {
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(25, 25, 25, 0.9);
    border: 1.5px solid rgba(0, 255, 68, 0.4);
    overflow: hidden;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.mobile-topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 990;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-menu-overlay.open { display: block; opacity: 1; }

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    max-width: 75vw;
    height: 100%;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 255, 68, 0.1);
    z-index: 991;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
}
.mobile-menu-panel.open { transform: translateX(0); }

.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-menu-header .menu-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(25, 25, 25, 0.9);
    border: 2px solid rgba(0, 255, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
    flex-shrink: 0;
}
.mobile-menu-header .menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.mobile-menu-header .menu-user-info {
    flex: 1;
    min-width: 0;
}
.mobile-menu-header .menu-username {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-menu-header .menu-level {
    font-size: 11px;
    color: var(--primary);
    margin-top: 2px;
}
.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
.mobile-menu-close:hover { color: var(--danger); }

.mobile-menu-actions {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mobile-menu-actions .btn {
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    padding: 10px;
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 12px;
}

.mobile-menu-logout {
    padding: 12px;
    margin-top: auto;
}
.mobile-menu-logout .btn {
    width: 100%;
    text-align: center;
}

/* ===== BEG MINI-GAME ===== */
#beg-minigame-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.88); backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center; z-index: 10000;
}
.beg-minigame-box {
    background: rgba(35, 35, 35, 0.97);
    border: 1px solid rgba(0, 255, 68, 0.2);
    border-radius: 20px; padding: 0; max-width: 440px; width: 94%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 50px rgba(0, 255, 68, 0.08);
    animation: begBoxIn 0.4s ease;
    overflow: hidden;
}
@keyframes begBoxIn {
    from { transform: translateY(40px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Scene: person left, hand right */
.beg-scene {
    display: flex; align-items: flex-end; justify-content: space-between;
    height: 200px; padding: 0 20px;
    background-color: rgba(0,0,0,0.3);
    background-size: cover; background-position: center bottom;
    background-repeat: no-repeat;
    position: relative; overflow: hidden;
    border-radius: 20px 20px 0 0;
}
.beg-scene::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
    background: linear-gradient(transparent, rgba(25,25,25,0.97));
    pointer-events: none;
}
.beg-person-side {
    flex: 0 0 45%; display: flex; align-items: flex-end; justify-content: center;
    animation: begPersonFadeIn 1s ease forwards;
    opacity: 0;
}
@keyframes begPersonFadeIn {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}
.beg-person-img {
    max-height: 170px; max-width: 100%; object-fit: contain;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
}
.beg-hand-side {
    flex: 0 0 40%; display: flex; align-items: flex-end; justify-content: center;
    animation: begHandSway 2.5s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes begHandSway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}
.beg-hand-img {
    max-height: 150px; max-width: 100%; object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* Name bar */
.beg-person-name-bar {
    padding: 14px 22px 8px; display: flex; align-items: baseline; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.beg-person-name { font-size: 1.15rem; font-weight: 800; color: var(--accent-primary); }
.beg-person-subtitle { font-size: 0.82rem; color: var(--text-muted); }

/* Hint */
.beg-hint {
    background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.25);
    border-radius: 10px; padding: 10px 14px; margin: 10px 22px;
    font-size: 0.85rem; color: var(--warning);
}
.beg-hint em { color: #fde68a; font-style: normal; font-weight: 600; }

/* Dialog area (fades in after person) */
.beg-dialog-area { padding: 0 22px 20px; }
.beg-fade-in { animation: begFadeUp 0.4s ease forwards; }
@keyframes begFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.beg-choose-label {
    font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
    margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;
}
.beg-phrase-list { display: flex; flex-direction: column; gap: 7px; }
.btn-beg-phrase {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
    text-align: left; color: #e2e8f0; position: relative;
}
.btn-beg-phrase:hover {
    background: rgba(0, 255, 68, 0.08); border-color: rgba(0, 255, 68, 0.3);
    transform: translateX(4px);
}
.beg-phrase-emoji { font-size: 1.5rem; flex-shrink: 0; }
.beg-phrase-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.beg-phrase-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.beg-phrase-info strong { font-size: 0.9rem; color: #f8fafc; }
.beg-phrase-text { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.beg-stars {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 0.7rem; opacity: 0.7;
}
.beg-skip-btn { width: 100%; margin-top: 10px; }

/* Result screen */
.beg-result-screen {
    text-align: center; padding: 40px 24px;
    animation: begResultPop 0.4s ease;
}
@keyframes begResultPop {
    0% { transform: scale(0.7); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.beg-result-emoji { font-size: 4rem; margin-bottom: 12px; }
.beg-result-img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 0 15px rgba(250,204,21,0.4)); }
.beg-star-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.beg-result-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.beg-result-desc { font-size: 0.95rem; color: var(--text-secondary); }
.beg-result-great .beg-result-title { color: var(--success); }
.beg-result-great .beg-result-emoji, .beg-result-great .beg-result-img { filter: drop-shadow(0 0 20px rgba(101, 163, 13,0.5)); }
.beg-result-good .beg-result-title { color: var(--primary); }
.beg-result-neutral .beg-result-title { color: #94a3b8; }
.beg-result-bad .beg-result-title { color: #f59e0b; }
.beg-result-fail .beg-result-title { color: var(--danger); }
.beg-result-fail .beg-result-emoji, .beg-result-fail .beg-result-img { filter: drop-shadow(0 0 20px rgba(0, 255, 68, 0.5)); }

/* ===== UNIVERSAL MINI-GAME MODALS ===== */
#collect-minigame-modal,
#dumpster-minigame-modal,
#fight-minigame-modal,
#pharmacy-minigame-modal,
#market-minigame-modal {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.85); justify-content: center; align-items: center;
    animation: begFadeIn 0.3s ease;
}
.mg-box {
    background: rgba(35, 35, 35, 0.97);
    border: 2px solid rgba(0, 255, 68, 0.25);
    border-radius: 18px; max-width: 400px; width: 92%;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 255, 68, 0.08);
    animation: begSlideIn 0.4s ease;
}
.mg-scene {
    height: 140px; background-size: cover; background-position: center;
    display: flex; justify-content: center; align-items: center;
    position: relative;
    background-color: rgba(0, 255, 68,0.05);
}
.mg-scene::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(25,25,25,0.95));
}
.mg-scene-icon {
    width: 64px; height: 64px; position: relative; z-index: 2;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 255, 68,0.5));
}
.mg-scene-fight { background: linear-gradient(135deg, rgba(220, 38, 38,0.15), rgba(25,25,25,0.95)); }
.mg-enemy-img {
    height: 120px; max-width: 90%; position: relative; z-index: 2;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(220, 38, 38,0.4));
}
.mg-title-bar {
    padding: 14px 18px 6px; text-align: center;
}
.mg-title {
    display: block; font-family: var(--font-heading); font-size: 1.2rem;
    color: #fff; font-weight: 800;
}
.mg-subtitle {
    display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px;
}
.mg-hint {
    margin: 6px 16px 8px; padding: 8px 12px;
    background: rgba(0, 255, 68,0.08); border: 1px solid rgba(0, 255, 68,0.2);
    border-radius: 10px; font-size: 0.82rem; color: #67e8f9;
    display: flex; align-items: center; gap: 8px;
}
.mg-hint-icon { width: 22px; height: 22px; flex-shrink: 0; }
.mg-options {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px 16px 12px;
}
.mg-option-btn {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 10px 14px;
    color: #fff; cursor: pointer; text-align: left;
    transition: all 0.2s ease; width: 100%;
}
.mg-option-btn:hover {
    background: rgba(0, 255, 68,0.1); border-color: rgba(0, 255, 68,0.3);
    transform: translateX(4px);
}
.mg-option-btn:active { transform: scale(0.97); }
.mg-opt-img { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; object-fit: contain; }
.mg-opt-info { display: flex; flex-direction: column; gap: 2px; }
.mg-opt-info strong { font-size: 0.9rem; }
.mg-opt-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.3; }
.mg-note { font-size: 0.72rem; color: #f59e0b; font-style: italic; }
.mg-btn-disabled { opacity: 0.4; pointer-events: none; }
.mg-skip-btn {
    display: block; width: calc(100% - 32px); margin: 4px 16px 14px;
    font-size: 0.82rem; padding: 8px; border-radius: 10px;
}
.mg-bins {
    display: flex; gap: 10px; padding: 10px 16px 14px; justify-content: center;
}
.mg-bin-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; padding: 14px 16px; color: #fff;
    cursor: pointer; transition: all 0.2s ease; flex: 1;
}
.mg-bin-btn:hover {
    background: rgba(0, 255, 68,0.12); border-color: rgba(0, 255, 68,0.35);
    transform: translateY(-4px);
}
.mg-bin-btn:active { transform: scale(0.93); }
.mg-bin-img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(0, 255, 68,0.3)); }
.mg-bin-btn span { font-size: 0.8rem; color: var(--text-muted); }

.mg-result-screen {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 40px 20px; text-align: center;
    min-height: 180px;
}
.mg-result-icon {
    width: 64px; height: 64px; margin-bottom: 14px;
    object-fit: contain;
    animation: mgPop 0.4s ease;
}
.mg-result-title { font-size: 1.15rem; font-weight: 700; }
.mg-result-good .mg-result-title { color: var(--success); }
.mg-result-good .mg-result-icon { filter: drop-shadow(0 0 20px rgba(101, 163, 13,0.5)); }
.mg-result-bad .mg-result-title { color: var(--danger); }
.mg-result-bad .mg-result-icon { filter: drop-shadow(0 0 20px rgba(0, 255, 68, 0.5)); }
.mg-result-neutral .mg-result-title { color: #94a3b8; }

.mg-rumor-text { font-style: italic; color: #fbbf24 !important; font-size: 0.9rem !important; }
.mg-rumor-actions { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 16px; }
.mg-rumor-btn { border-color: rgba(251,191,36,0.2) !important; }
.mg-rumor-btn:hover { border-color: rgba(251,191,36,0.4) !important; background: rgba(251,191,36,0.08) !important; }

.mg-bounce { animation: mgBounce 1.5s ease infinite; }
@keyframes mgBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes mgPop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ===== RANDOM EVENT POPUP ===== */
.random-event-box {
    background: rgba(35, 35, 35, 0.97);
    border: 2px solid rgba(250, 204, 21, 0.3);
    border-radius: 18px; padding: 28px; max-width: 380px; width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(250, 204, 21, 0.1);
    animation: begSlideIn 0.3s ease;
}
.random-event-emoji { font-size: 3.5rem; margin-bottom: 10px; filter: drop-shadow(0 0 15px rgba(250,204,21,0.4)); }
.random-event-img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 0 15px rgba(250,204,21,0.4)); }
.re-opt-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.random-event-title { font-size: 1.3rem; font-weight: 800; color: var(--warning); margin-bottom: 6px; }
.random-event-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.5; }
.random-event-options { display: flex; flex-direction: column; gap: 8px; }
.btn-random-event-opt {
    padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: #e2e8f0;
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s ease;
}
.btn-random-event-opt:hover {
    background: rgba(250, 204, 21, 0.1); border-color: rgba(250, 204, 21, 0.3);
    transform: scale(1.02);
}
.random-event-result { font-size: 1.05rem; font-weight: 700; line-height: 1.5; padding: 10px 0; }

/* --- Tablet & small desktop (≤900px) --- */
/* === MOBILE CHAT TOGGLE BUTTON (hidden on desktop) === */
.mobile-chat-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 24px;
    border: none;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 255, 68, 0.4), 0 0 30px rgba(136, 136, 136, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-chat-toggle:active { transform: scale(0.9); }

.chat-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    text-align: center;
    padding: 0 5px;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
    font-family: var(--font-body);
    pointer-events: none;
    animation: badge-pulse 1.5s ease-in-out infinite;
}
.chat-badge.active { display: block; }
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.mobile-chat-toggle.chat-active { background: var(--danger); box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4); }

.mobile-chat-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: color 0.2s;
}
.mobile-chat-close:hover { color: var(--danger); }

@media (max-width: 900px) {
    body { font-size: 14px; }

    /* Topbar → logo+burger on first row, stats on second row */
    .topbar {
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 6px 10px;
        gap: 4px;
        align-items: center;
        justify-content: space-between;
    }
    .topbar-logo { font-size: 16px; flex-shrink: 0; }
    .topbar-logo .lang-picker { display: none; }

    /* Stats: compact strip below topbar logo row */
    .topbar-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        width: 100%;
        order: 10;
    }
    .stat-item { padding: 3px 8px; font-size: 0.75rem; }
    .stat-vital { order: -1; }
    /* Hide progress bars on mobile — icon + number only */
    .stat-vital .bar-mini { display: none; }
    .bar-mini { width: 40px; height: 6px; }
    .exp-bar-container { height: 14px; }
    .exp-bar-text { font-size: 8px; }

    /* Burger menu button */
    .mobile-burger { display: flex; }

    /* Mobile top-right area */
    .mobile-topbar-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .mobile-topbar-avatar {
        display: flex;
    }

    /* Slide-out menu panel */
    .mobile-menu-panel.open { transform: translateX(0); }

    /* Layout → column */
    .app-container { flex-direction: column; overflow-y: auto; }

    /* Sidebar: hide profile section, keep nav as horizontal icon strip */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        max-height: none;
        overflow: visible;
        flex-shrink: 0;
    }
    .profile-pic { display: none; }
    .nav-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 2px;
        padding: 6px 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-item {
        padding: 6px 8px;
        font-size: 0.75rem;
        flex: 0 0 auto;
        min-width: auto;
        text-align: center;
        border-left: none;
        border-bottom: 2px solid transparent;
        justify-content: center;
        white-space: nowrap;
        margin: 0 2px;
        border-radius: 8px;
    }
    .nav-item:hover { transform: none; }
    .nav-item::before { display: none; }
    .nav-item span { display: none; }
    .nav-item .ui-icon { width: 24px; height: 24px; }
    .nav-item.active { border-left: none; border-bottom: 2px solid var(--primary); background: transparent; }
    .nav-item-logout { display: none !important; }
    .event-log-section { display: none; }

    /* Content */
    .content-area { padding: 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* Chat → fullscreen overlay on mobile */
    .mobile-chat-toggle { display: flex; align-items: center; justify-content: center; }
    .mobile-chat-close { display: block; }
    .chat-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .chat-sidebar {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100% !important;
        height: 100% !important;
        z-index: 998;
        border: none;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }
    .chat-sidebar.chat-open {
        transform: translateY(0);
    }

    /* Cards */
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .game-card { min-width: unset; overflow: hidden; }

    /* Panels / Grid */
    .panel { padding: 12px; margin-bottom: 12px; }
    .grid-2 { grid-template-columns: 1fr; gap: 12px; }

    /* Typography */
    h2 { font-size: 1.1rem; margin-bottom: 10px; }
    h3 { font-size: 1rem; }

    /* Buttons */
    .btn { padding: 8px 14px; font-size: 12px; }

    /* Task bar */
    .active-task-dash { flex-direction: column; padding: 10px; gap: 8px; }
    .task-actions { flex-direction: row; gap: 5px; }

    /* Referral */
    .ref-box { padding: 8px; }
    .ref-link { font-size: 0.75rem; padding: 6px; }

    /* Modal */
    .modal { padding: 20px; max-width: 95%; }
    .auth-input { padding: 12px; font-size: 1rem; }

    /* Diorama */
    .player-stage { aspect-ratio: 16 / 9; }

    /* Toast notifications */
    #notification-area { bottom: 10px; right: 10px; left: 10px; }
    .toast { max-width: 100%; font-size: 0.85rem; padding: 12px 14px; }

    /* Fight log */
    .fight-log { font-size: 0.8rem; }

    /* Shop headers */
    .shop-category-header { margin: 15px 0 10px; gap: 10px; }
    .shop-category-header h3 { font-size: 1.1rem; }
}

/* --- Phone (≤580px) --- */
@media (max-width: 580px) {
    /* Topbar stats: even more compact */
    .topbar-stats { gap: 3px; }
    .stat-item {
        padding: 3px 6px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Content */
    .content-area { padding: 8px; }

    /* Cards → 1 column */
    .card-grid { grid-template-columns: 1fr; gap: 8px; }
    .card-img-container { height: 120px; }

    /* Welcome panel compact */
    .welcome-panel { padding: 10px; }
    .welcome-panel h2 { font-size: 1rem; }
    .welcome-panel p { font-size: 0.85rem; }

    /* Diorama smaller aspect */
    .player-stage { aspect-ratio: 3 / 2; }
    .stage-bomj { background-size: auto 70%; }
    .likes-badge { font-size: 0.8rem; top: 4px; right: 4px; gap: 0; }
    .like-effect-frame { width: 42px; height: 42px; margin-right: -2px; }
    .likes-count { font-size: 0.85rem; }

    /* Chat — system messages visible but compact on mobile */
    .chat-msg.sys { font-size: 0.8rem; padding: 4px 8px; }
    .chat-header { padding: 12px 16px; font-size: 0.9rem; }
    .chat-messages { font-size: 0.85rem; padding: 10px; }
    .chat-input-area { padding: 8px; gap: 6px; }
    .chat-input-area input { padding: 10px 12px; font-size: 0.9rem; }
    .chat-input-area button { padding: 8px 14px; font-size: 0.8rem; }

    /* Panels */
    .panel { padding: 10px; border-radius: 10px; }

    /* Buttons in panel */
    .btn { padding: 7px 12px; font-size: 11px; letter-spacing: 0.5px; }

    /* Modal */
    .modal { padding: 16px; border-radius: 14px; }
    .modal h2 { font-size: 1.5rem; margin-bottom: 16px; }
    .auth-tab { font-size: 0.9rem; padding: 8px; }
    .auth-input { padding: 10px; font-size: 0.95rem; }

    /* Death panel */
    .death-panel { padding: 20px; max-width: 95%; }

    /* Lang picker */
    .lang-btn { padding: 3px 7px; font-size: 0.7rem; }

    /* Location grid */
    .location-grid { padding: 10px; }

    /* Topbar task bar — single row */
    #topbar-active-task-bar {
        font-size: 0.75rem !important;
        padding: 5px 8px !important;
        gap: 5px !important;
    }

    /* Chat toggle button */
    .mobile-chat-toggle { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 22px; }
}

/* --- Very small phones (≤380px) --- */
@media (max-width: 380px) {
    .topbar { padding: 5px 6px; }
    .topbar-logo { gap: 6px; }
    .game-logo-img { height: 26px; max-width: 100px; }
    .lang-picker { gap: 3px; }
    .lang-btn { padding: 2px 5px; font-size: 0.65rem; }
    .stat-item { padding: 2px 4px; font-size: 0.65rem; }
    .bar-mini { width: 24px; height: 4px; }
    .ui-icon { width: 16px; height: 16px; }
    .ui-icon-sm { width: 13px; height: 13px; }
    .content-area { padding: 6px; }
    .panel { padding: 8px; }
    .btn { padding: 6px 10px; font-size: 10px; }
    .card-img-container { height: 100px; width: 90%; }
    .modal { padding: 12px; }
    .modal h2 { font-size: 1.3rem; }
    .player-stage { aspect-ratio: 4 / 3; }

    /* Disable 3D tilt on tiny screens */
    .game-card { transform: none !important; }
}

/* --- Touch device optimizations --- */
@media (hover: none) and (pointer: coarse) {
    /* Disable 3D tilt on touch (no mousemove) */
    .game-card { transform: none !important; transition: box-shadow 0.3s, border-color 0.3s; }
    .game-card:active {
        border-color: rgba(0, 255, 68, 0.4);
        box-shadow: 0 0 20px rgba(0, 255, 68, 0.15);
    }

    /* Bigger tap targets */
    .nav-item { min-height: 44px; }
    .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .lang-btn { min-height: 36px; }
    .chat-input-area input { min-height: 44px; }
    .chat-input-area button { min-height: 44px; }
    .likes-badge { min-height: 36px; min-width: 36px; gap: 0; }
    .like-effect-frame { width: 44px; height: 44px; margin-right: -2px; }

    /* No hover effects on touch */
    .panel:hover { border-color: rgba(255,255,255,0.06); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
    .stat-item:hover { border-color: rgba(255,255,255,0.06); }
    .card-item:hover { transform: none; }

    /* Scrollbar hide on touch */
    .topbar-stats::-webkit-scrollbar { display: none; }
    .topbar-stats { scrollbar-width: none; }
}

.death-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 5000; }
.death-panel {
    background: rgba(35, 10, 10, 0.95);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 20px;
    padding: 35px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.1), 0 20px 50px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
}
.death-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(220, 38, 38, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}
.death-panel h2 { color: var(--danger); position: relative; z-index: 1; text-shadow: 0 0 30px rgba(220, 38, 38, 0.3); }
.death-skill-btn { display: block; width: 100%; margin-top: 8px; }

/* GAME LOGO IMAGE STYLES */
.game-logo-img {
    height: 42px;
    max-width: 180px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 255, 68, 0.5));
    transition: transform 0.2s ease;
}
.game-logo-img:hover {
    transform: scale(1.04);
}


@media (max-width: 600px) {
    .game-logo-img { height: 28px; max-width: 120px; }
}



/* Timer in topbar uses heading font for consistency */
#topbar-task-timer { font-family: var(--font-heading); }

/* Google Translate Widget Stealth Styling */
.goog-te-banner-frame, 
iframe.goog-te-banner-frame, 
.skiptranslate, 
.goog-te-gadget, 
.VIpgJd-Z44fyf-aK20e, 
.VIpgJd-Z44fyf-aK20e-OWXEXe-bN9bce,
.goog-te-spinner-pos,
#goog-gt-tt, 
.goog-te-balloon-frame, 
.goog-tooltip, 
.goog-tooltip:hover {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body {
    top: 0px !important;
    position: static !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

font[style*="background-color"] {
    background-color: transparent !important;
}







/* --- DIORAMA / PLAYER STAGE --- */
.player-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #050505;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.stage-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Dust particles in diorama */
.dust-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    animation: dustFloat var(--dust-dur, 8s) linear forwards;
}

@keyframes dustFloat {
    0%   { opacity: 0; transform: translate(0, 0); }
    10%  { opacity: var(--dust-opa, 0.4); }
    90%  { opacity: var(--dust-opa, 0.4); }
    100% { opacity: 0; transform: translate(var(--dust-dx, 40px), var(--dust-dy, -30px)); }
}

/* Фон */
.stage-bg {
    z-index: 1;
}

/* Персонаж */
.stage-bomj {
    z-index: 3;
    background-size: auto 75%;
    background-position: center bottom;
}





.stage-stats-overlay {
    position: relative;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#player-action-modal .modal {
    max-width: 500px;
    width: 95%;
    padding: 25px;
}

.likes-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    color: #fff;
    font-weight: bold;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: none;
}
.likes-badge:hover {
    background: transparent;
}
.like-effect-frame {
    width: 52px;
    height: 52px;
    border: none;
    background: transparent;
    pointer-events: none;
    display: block;
    margin-right: -4px;
}
.likes-count {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 8px rgba(136, 136, 136,0.6), 0 0 3px rgba(0,0,0,0.9);
    min-width: 20px;
}
/* PvP cards mini like */
.pvp-likes-mini {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.pvp-likes-mini .like-effect-frame {
    width: 44px;
    height: 44px;
    margin-right: -2px;
}
.pvp-likes-mini .likes-count {
    font-size: 0.85rem;
}

/* Бутылки — слева от персонажа */
.stage-bottles {
    position: absolute !important;
    z-index: 2;
    width: 15% !important;
    height: 35% !important;
    bottom: 3% !important;
    top: auto !important;
    left: 18% !important;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
}

/* Деньги — справа от персонажа */
.stage-cash {
    position: absolute !important;
    z-index: 2;
    width: 15% !important;
    height: 35% !important;
    bottom: 3% !important;
    top: auto !important;
    right: 18% !important;
    left: auto !important;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
}

/* Оружие — справа рядом с персонажем */
.stage-weapon {
    position: absolute !important;
    z-index: 4;
    right: 30% !important;
    left: auto !important;
    bottom: 22% !important;
    top: auto !important;
    width: 10%;
    height: 30%;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    filter: drop-shadow(0 0 8px var(--danger));
}

/* Питомец — слева рядом с персонажем */
.stage-pet {
    position: absolute !important;
    z-index: 4;
    left: 25% !important;
    bottom: 3% !important;
    top: auto !important;
    width: 16%;
    height: 38%;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    filter: drop-shadow(0 0 8px var(--primary));
}

/* ═══════════════════════════════════════════════════
   WEATHER SYSTEM — Overlay, Particles, Badge
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   WEATHER — СУРОВЫЙ УЛИЧНЫЙ РЕАЛИЗМ
   ═══════════════════════════════════════════════════ */

/* Базовый полноэкранный слой погоды */
#weather-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 900;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}
#weather-overlay.active {
    opacity: 1;
}

/* Частицы — внутри диорамы */
.weather-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

/* Weather topbar indicator */
.weather-topbar-item {
    padding: 2px 6px;
    border-radius: 12px;
    transition: background 0.5s ease, color 0.5s ease;
}
.weather-topbar-item.weather-clear { color: #fbbf24; }
.weather-topbar-item.weather-rain { color: #93c5fd; }
.weather-topbar-item.weather-heat { color: #fb923c; }
.weather-topbar-item.weather-frost { color: #e0f2fe; }

/* ── ГРЯЗНЫЙ ДОЖДЬ — настоящие капли ── */
.weather-dirty-rain {
    background-color: rgba(15, 20, 30, 0.3);
    overflow: hidden;
}

.rain-drop {
    width: 3px;
    height: 6px;
    background: #8db0b4;
    position: absolute;
    top: 5px;
    left: 0;
    border-radius: 3px;
    animation: rainFall 4s ease-in infinite;
    pointer-events: none;
}

@keyframes rainFall {
    from {}
    to { top: 200vh; }
}

/* ── МЕТЕЛЬ — canvas снег, CSS только фон ── */
.weather-blizzard {
    background-color: rgba(140, 160, 190, 0.15);
}

#snow-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 901;
    pointer-events: none;
    background: transparent;
}

/* ── ЛЕТНЯЯ ЖАРА — душно, воздух дрожит ── */
.weather-heatwave {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 160, 0, 0.12), transparent 60%),
        linear-gradient(to top, rgba(200, 80, 0, 0.08) 0%, transparent 40%);
    backdrop-filter: contrast(108%) saturate(120%);
    -webkit-backdrop-filter: contrast(108%) saturate(120%);
    box-shadow: inset 0 0 200px rgba(200, 100, 0, 0.12);
    animation: heatWobble 4s ease-in-out infinite alternate;
}

@keyframes heatWobble {
    0% { backdrop-filter: contrast(108%) saturate(120%); -webkit-backdrop-filter: contrast(108%) saturate(120%); }
    50% { backdrop-filter: contrast(112%) saturate(125%); -webkit-backdrop-filter: contrast(112%) saturate(125%); }
    100% { backdrop-filter: contrast(108%) saturate(120%); -webkit-backdrop-filter: contrast(108%) saturate(120%); }
}

/* ── ГОРОДСКОЙ СМОГ — грязный туман ── */
.weather-smog {
    background:
        linear-gradient(to top, rgba(80, 70, 50, 0.45) 0%, rgba(60, 60, 50, 0.15) 50%, transparent 80%),
        linear-gradient(to right, rgba(70, 70, 50, 0.25) 0%, transparent 40%, rgba(70, 70, 50, 0.25) 100%);
    backdrop-filter: blur(1.5px) sepia(30%) brightness(90%);
    -webkit-backdrop-filter: blur(1.5px) sepia(30%) brightness(90%);
    animation: smogDrift 12s ease-in-out infinite alternate;
}

@keyframes smogDrift {
    0% { background-position: 0% 0%, 0% 0%; opacity: 0.8; }
    100% { background-position: 5% 0%, -5% 0%; opacity: 1; }
}

/* ── НОЧНАЯ ГРОЗА — темнота + молнии + дождь ── */
.weather-dark-thunder {
    background-color: rgba(8, 8, 12, 0.7);
    background-image:
        repeating-linear-gradient(
            100deg,
            transparent,
            transparent 4px,
            rgba(150, 170, 200, 0.12) 4px,
            rgba(150, 170, 200, 0.12) 5px
        );
    background-size: 100% 100%;
    animation: dirtyRainFall 0.4s linear infinite, streetLightning 8s infinite;
}

@keyframes streetLightning {
    0%, 92%, 96%, 100% { box-shadow: none; }
    93% { box-shadow: inset 0 0 200px rgba(200, 210, 255, 0.25); }
    94% { box-shadow: none; }
    95% { box-shadow: inset 0 0 300px rgba(220, 230, 255, 0.5); }
}

/* ── CARD WEATHER EFFECTS ── */

/* Rain — мокрый серый glow */
body.weather-rain .game-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(60, 80, 100, 0.25), inset 0 -20px 25px rgba(50, 70, 90, 0.08);
}
body.weather-rain .game-card::before {
    filter: saturate(0.6) brightness(0.85);
}

/* Frost — синюшный ледяной тон */
body.weather-frost .game-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(150, 200, 255, 0.2), inset 0 0 25px rgba(150, 200, 255, 0.1);
    outline: 1px solid rgba(180, 220, 255, 0.15);
    outline-offset: -1px;
}
body.weather-frost .game-card::before {
    filter: saturate(0.5) brightness(0.8) hue-rotate(20deg);
}

/* Heat — душный тёплый тон */
body.weather-heat .game-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px rgba(200, 100, 0, 0.15);
}
body.weather-heat .game-card::before {
    filter: saturate(1.3) brightness(1.05) sepia(0.15);
}

/* ── DIORAMA WEATHER TINTS ── */

/* Rain — dark gloomy diorama */
body.weather-rain #main-diorama {
    filter: brightness(0.8) saturate(0.7);
}

/* Frost — cold blue diorama */
body.weather-frost #main-diorama {
    filter: brightness(0.85) saturate(0.6) hue-rotate(10deg);
    box-shadow: inset 0 0 30px rgba(150, 200, 255, 0.2);
}

/* Heat — warm saturated diorama */
body.weather-heat #main-diorama {
    filter: brightness(1.05) saturate(1.2) sepia(0.1);
}

/* ── Character-interactive weather effects (diorama) ── */

.weather-char-effect {
    position: absolute;
    z-index: 8;
    pointer-events: none;
}

/* Rain splash on character */
.wc-rain-splash {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(120, 140, 160, 0.6);
    background: transparent;
    animation: rainSplashBurst 0.5s ease-out forwards;
}
@keyframes rainSplashBurst {
    0% { transform: scale(0.3); opacity: 0.8; }
    50% { transform: scale(2); opacity: 0.5; }
    100% { transform: scale(3); opacity: 0; }
}

/* Drip — water running down character */
.wc-drip {
    width: 2px; height: 6px;
    background: linear-gradient(to bottom, rgba(120, 150, 180, 0.5), rgba(120, 150, 180, 0.1));
    border-radius: 0 0 2px 2px;
    animation: dripDown 1s ease-in forwards;
}
@keyframes dripDown {
    0% { transform: translateY(0); opacity: 0.7; height: 6px; }
    60% { transform: translateY(40px); opacity: 0.5; height: 10px; }
    100% { transform: translateY(80px); opacity: 0; height: 3px; }
}

/* Snow settle on character */
.wc-snow-settle {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 4px rgba(200, 220, 255, 0.6);
    animation: snowSettle 4s ease-out forwards;
}
@keyframes snowSettle {
    0% { transform: translateY(-5px); opacity: 0; }
    10% { transform: translateY(0); opacity: 0.9; }
    70% { transform: translateY(1px); opacity: 0.8; }
    100% { transform: translateY(2px); opacity: 0; }
}

/* Heat wave near character */
.wc-heat-wave {
    width: 4px; height: 30px;
    background: linear-gradient(to top, rgba(200, 100, 0, 0.25), transparent);
    border-radius: 2px;
    animation: heatWaveRise 2s ease-out forwards;
}
@keyframes heatWaveRise {
    0% { transform: translateY(0) scaleX(1); opacity: 0.5; }
    25% { transform: translateY(-10px) scaleX(1.5); opacity: 0.4; }
    50% { transform: translateY(-25px) scaleX(0.8); opacity: 0.3; }
    75% { transform: translateY(-40px) scaleX(1.3); opacity: 0.2; }
    100% { transform: translateY(-60px) scaleX(1); opacity: 0; }
}

/* Sweat drop in heat */
.wc-sweat {
    width: 3px; height: 5px;
    background: rgba(150, 180, 200, 0.7);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: sweatRoll 1.3s ease-in forwards;
}
@keyframes sweatRoll {
    0% { transform: translateY(0) scale(0.8); opacity: 0.8; }
    40% { transform: translateY(20px) scale(1); opacity: 0.7; }
    100% { transform: translateY(60px) scale(0.5); opacity: 0; }
}

/* Mobile & reduced motion */
@media (hover: none) and (pointer: coarse) {
    .wc-rain-splash { width: 6px; height: 6px; }
    .wc-heat-wave { height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .weather-char-effect { display: none !important; }
    #weather-overlay { transition: none; animation: none !important; }
}

/* ═══════════════════════════════════════════════════
   WORLD BOSS — Card Frame, Hit Animation, Particles
   ═══════════════════════════════════════════════════ */

/* Boss NPC card — same as game-card but with danger glow */
#boss-npc-card {
    border: 2px solid var(--danger) !important;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3), inset 0 0 10px rgba(220, 38, 38, 0.05) !important;
    overflow: visible;
}
#boss-npc-card::before {
    clip-path: circle(350px at 80% -20%);
}
/* Boss card: always show stats and button */
#boss-npc-card .card-stat-block,
#boss-npc-card .card-btn {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}
#boss-npc-card .card-desc {
    max-height: 4em !important;
    opacity: 1 !important;
}
#boss-npc-card .card-img-container,
[data-fight-active="1"] .card-img-container {
    overflow: visible;
    position: relative;
    z-index: 1;
}
#boss-npc-card .card-img-container img:not(.boss-particle) {
    filter: drop-shadow(0 4px 12px rgba(0, 255, 68, 0.5));
    transition: none !important;
}
#boss-npc-card .boss-particle,
[data-fight-active="1"] .boss-particle {
    z-index: 50;
    position: absolute;
}
#boss-npc-card .boss-damage-number,
[data-fight-active="1"] .boss-damage-number {
    z-index: 51;
}

/* ── HIT ANIMATION (active during cooldown) ── */
/* Card glow pulses — card itself stays still, no movement */
.boss-under-attack {
    animation: bossPulse 0.8s ease-in-out infinite;
}

/* Boss image — brightness flash only */
.boss-under-attack .card-img-container img:not(.boss-particle) {
    animation: bossImgHit 0.5s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(220, 38, 38, 0.3); }
    50%      { box-shadow: 0 0 30px rgba(255, 60, 0, 0.6), 0 0 60px rgba(220, 38, 38, 0.2); }
}

@keyframes bossImgHit {
    0%   { filter: drop-shadow(0 4px 12px rgba(0, 255, 68, 0.5)) brightness(1); }
    20%  { filter: drop-shadow(0 0 25px rgba(255, 100, 0, 0.9)) brightness(1.5); }
    40%  { filter: drop-shadow(0 4px 12px rgba(0, 255, 68, 0.5)) brightness(0.85); }
    60%  { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)) brightness(1.4); }
    80%  { filter: drop-shadow(0 4px 12px rgba(255, 50, 0, 0.7)) brightness(0.9); }
    100% { filter: drop-shadow(0 4px 12px rgba(0, 255, 68, 0.5)) brightness(1); }
}

/* ── PARTICLES CONTAINER ── */
.boss-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.boss-particle {
    position: absolute;
    opacity: 1;
    pointer-events: none;
    z-index: 50;
    object-fit: contain;
    animation: bossParticleFly 0.8s ease-out forwards;
}

@keyframes bossParticleFly {
    0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    40%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) rotate(var(--pr)) scale(0.4); }
}

/* ── DAMAGE NUMBER FLOATER ── */
.boss-damage-number {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8), 0 2px 4px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 15;
    animation: dmgFloat 1s ease-out forwards;
    white-space: nowrap;
}

.boss-damage-number.crit {
    font-size: 1.4rem;
    color: #ffaa00;
    text-shadow: 0 0 12px rgba(255, 170, 0, 0.9), 0 2px 4px rgba(0,0,0,0.9);
}

@keyframes dmgFloat {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.3); }
    30%  { opacity: 1; transform: translateX(-50%) translateY(-15px) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(0.7); }
}
/* --- CUSTOM PVP CARDS --- */


.pvp-custom-card {
  position: relative;
  transition: .1s all;
  cursor: pointer;
  width: 280px;
  height: 380px;
  margin: 110px auto 20px auto;
}

.pvp-custom-card:hover {
  transform: scale(1.05);
}

.pvp-custom-card:hover .pvp-custom-card__character {
  transform: scale(1.1);
}



.pvp-custom-card__character {
  position: absolute;
  top: calc(-8.5em + 15px);
  margin-left: 2em;
  z-index: 9;
  transition: all .2s;
  filter: drop-shadow(0px 17px 22px rgba(0, 0, 0, 0.10));
}

.pvp-custom-card__character img {
  width: 250px;
  height: 260px;
  object-fit: contain;
}

.pvp-custom-card__shape {
  width: 257.3px;
  height: 131px;
  background-size: cover;
  margin-left: 1.25em;
  transform: skewX(0deg) skewY(-19deg) scale(1.15);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  background-color: rgba(35, 35, 35, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.pvp-custom-card__detail {
  padding: 1.5em;
  width: 248.3px;
  position: absolute;
  top: 81.5px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  background-color: rgba(35, 35, 35, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.pvp-custom-card__detail::before {
  content: '';
  opacity: 0.2;
  width: 30px;
  height: 330px;
  position: absolute;
  top: -7em;
  right: -15px;
  border-radius: 30px;
  background-color: rgba(35, 35, 35, 0.85);
}

.pvp-custom-card__detail__name h1 {
  letter-spacing: 1px;
  margin-top: 2.5em;
  margin-bottom: 0;
  font-family: var(--font-heading);
  color: white;
  font-size: 24px;
}

.pvp-custom-card__detail__rate {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.pvp-custom-card__detail__rate p {
  color: #fff;
  font-size: 14px;
  margin: 0;
  font-weight: bold;
}

.pvp-custom-card__detail__statistics {
  margin-top: 1.5em;
  display: flex;
  align-items: center;
}


.pvp-custom-card__detail__statistics-bag {
  padding: 5px;
  border: 1px solid #ffffff63;
  border-radius: 4px;
  margin-right: 10px;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: 0.2s;
}

.pvp-custom-card__detail__statistics-bag:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pvp-custom-card__detail__statistics-bag span {
  margin-right: 10px;
}

.pvp-custom-card__detail__statistics-bag span label {
  font-size: 10px;
  color: #fff;
}

.pvp-custom-card__detail__statistics-bag span p {
  margin: 0;
  font-size: 13px;
  color: #fff;
}

.pvp-custom-card__detail__statistics-bag img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}




@media (max-width: 900px) { .side-char { display: none !important; } }
.auth-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); text-shadow: 0 0 15px rgba(0, 255, 68, 0.3); }


