/* ===== COMPLETE PROJECT CSS ===== */
:root {
    --bg-dark: #07070a;
    --card-bg: rgba(20, 19, 24, 0.62);
    --card-bg-solid: #121218;
    --box-bg: rgba(0, 0, 0, 0.65);
    --wine: #8b0000;
    --wine-light: #c2172f;
    --gold: #cda86a;
    --gold-light: #f3d99a;
    --gold-deep: #9c7b3f;
    --text-main: #f4e9da;
    --text-muted: #a0a0a8;
    --glass-border: rgba(255, 255, 255, 0.06);
    --glow-gold: rgba(205, 168, 106, 0.35);
    --glow-wine: rgba(139, 0, 0, 0.4);
}
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100vh; }
body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 12% 20%, rgba(139, 0, 0, 0.18), transparent 45%),
        radial-gradient(circle at 88% 12%, rgba(205, 168, 106, 0.08), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 0, 0, 0.1), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(205, 168, 106, 0.06), transparent 40%);
    background-attachment: fixed;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}
.menu-btn {
    position: fixed; top: 25px; right: 25px; z-index: 1000;
    background: linear-gradient(145deg, rgba(28, 27, 34, 0.8), rgba(15, 15, 19, 0.8));
    backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(205, 168, 106, 0.28); padding: 12px; border-radius: 15px;
    cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 12px rgba(205,168,106,0.05); transition: all 0.3s ease;
}
.menu-btn:hover { border-color: rgba(205, 168, 106, 0.5); box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 18px var(--glow-gold); }
.menu-btn span { display: block; width: 22px; height: 2px; background-color: var(--gold-light); margin: 5px 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; transform: scale(0); }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-overlay {
    position: fixed; top: 0; right: -300px; width: 280px; height: 100vh;
    background: linear-gradient(180deg, rgba(10, 9, 12, 0.97), rgba(7, 7, 10, 0.98));
    backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-left: 1px solid rgba(205, 168, 106, 0.18); z-index: 999;
    display: flex; flex-direction: column; padding-top: 100px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: -10px 0 40px rgba(0,0,0,0.8), inset 1px 0 0 rgba(255,255,255,0.03);
}
.menu-overlay.open { right: 0; }
.menu-item {
    color: var(--text-main); text-decoration: none; font-size: 1.1rem; font-weight: 500;
    padding: 15px 30px; border-right: 3px solid transparent; transition: all 0.3s ease; cursor: pointer;
}
.menu-item:hover, .menu-item.active {
    border-right-color: var(--gold); color: var(--gold-light);
    background: linear-gradient(90deg, transparent, rgba(205, 168, 106, 0.05));
    padding-right: 38px;
}
.menu-item.hidden { display: none; }
.header-glow { text-align: center; padding: 60px 20px 25px; position: relative; z-index: 2; }
.header-title {
    font-family: 'Cinzel', serif; font-size: clamp(2.6rem, 8.5vw, 4rem); font-weight: 700; margin: 0; direction: ltr;
    background: linear-gradient(180deg, #ffffff, var(--gold)); -webkit-background-clip: text; color: transparent;
    text-shadow: 0 10px 30px rgba(205, 168, 106, 0.25); letter-spacing: 2px;
}
.header-sub { color: var(--text-muted); font-size: 1.1rem; margin-top: 8px; font-weight: 600; }
.container { max-width: 600px; margin: 0 auto; padding: 0 20px 100px; position: relative; z-index: 1; }
.view-page { display: none; animation: fadeIn 0.4s ease forwards; }
.view-page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.card {
    position: relative;
    background:
        linear-gradient(155deg, rgba(255,255,255,0.035), transparent 40%),
        linear-gradient(180deg, rgba(24, 23, 29, 0.68), rgba(10, 10, 13, 0.72));
    border-radius: 26px; border: 1px solid var(--glass-border);
    padding: 30px 20px; margin-bottom: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(28px) saturate(130%); -webkit-backdrop-filter: blur(28px) saturate(130%);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.card::before {
    content: ''; position: absolute; inset: 0; border-radius: 26px; padding: 1px;
    background: linear-gradient(155deg, rgba(205,168,106,0.18), transparent 30%, transparent 70%, rgba(139,0,0,0.14));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
.card-title {
    text-align: center; font-size: 1.4rem; font-weight: 800; margin: 0 0 25px 0;
    position: relative; display: inline-block; width: 100%; color: var(--gold-light);
    text-shadow: 0 0 20px rgba(205,168,106,0.15);
}
.card-title::after {
    content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
    width: 50px; height: 3px; border-radius: 5px;
    background: linear-gradient(90deg, transparent, var(--wine-light), transparent);
    box-shadow: 0 0 14px var(--wine);
}
.chart-btn {
    background: var(--box-bg); border: 1px solid rgba(205,168,106,0.2); color: var(--text-muted);
    padding: 8px 20px; border-radius: 999px; cursor: pointer; font-family: 'Vazirmatn', sans-serif;
    font-weight: 700; font-size: 0.85rem; transition: all 0.3s ease;
}
.chart-btn.active {
    background: rgba(0, 230, 118, 0.15); border-color: #00e676; color: #00e676;
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.2);
}
.chart-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.live-indicator { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.live-dot {
    width: 10px; height: 10px; background-color: #10b981; border-radius: 50%;
    box-shadow: 0 0 10px #10b981, 0 0 20px #10b981; animation: pulse-green 1.8s infinite;
}
.live-text { font-size: 0.85rem; color: #10b981; font-weight: 800; letter-spacing: 0.5px; }
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.stat-item {
    background: linear-gradient(160deg, rgba(255,255,255,0.03), transparent 50%), var(--box-bg);
    border-radius: 22px; padding: 22px 10px; text-align: center;
    border: 1px solid rgba(205,168,106,0.16); box-shadow: inset 0 0 25px rgba(0,0,0,0.6), 0 0 30px rgba(205,168,106,0.06);
}
.stat-val { font-size: 3rem; font-weight: 800; color: #ffffff; display: block; margin-bottom: 5px; text-shadow: 0 0 20px rgba(255,255,255,0.2); }
.stat-lbl { font-size: 1rem; color: var(--gold-light); font-weight: 700; }
.top-active-scroll {
    display: flex; gap: 15px; overflow-x: auto; padding: 10px 5px 20px;
    width: 100%; box-sizing: border-box; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none;
}
.top-active-scroll::-webkit-scrollbar { display: none; }
.active-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100px; text-align: center; }
.active-placeholder p { color: var(--gold-light); font-size: 0.9rem; margin: 0; }
.active-card {
    flex: 0 0 auto; width: 105px; background: rgba(0,0,0,0.5); border-radius: 20px; padding: 15px 10px;
    display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none;
    border: 1px solid rgba(255,255,255,0.05); scroll-snap-align: start;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4); transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.active-card:hover { transform: translateY(-5px); background: rgba(205,168,106,0.05); border-color: rgba(205,168,106,0.3); }
.rank-circle {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(139, 92, 246, 0.1); border: 2px solid #8b5cf6;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800; color: var(--gold-light);
    margin-bottom: 12px; box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}
.active-name { font-size: 0.85rem; font-weight: 700; color: #fff; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.active-msgs { font-size: 0.7rem; color: #10b981; font-weight: 800; }

/* ===== 3D ORBIT COMMAND CENTER ===== */
.org-chart {
    width: 100%;
    height: 400px;
    position: relative;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    overflow: visible;
    cursor: grab;
}
.org-chart:active {
    cursor: grabbing;
}
.orbit-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(var(--rotX, 0deg)) rotateY(var(--rotY, 0deg));
    transition: transform 0.1s ease-out;
    will-change: transform;
    pointer-events: none;
}
.orbit-wrapper > * {
    pointer-events: auto;
}
.center-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(40px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none;
}
.center-core .core-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(205,168,106,0.25), transparent 70%);
    padding: 6px;
    box-shadow: 0 0 40px rgba(205,168,106,0.15);
    animation: coreBreath 4s ease-in-out infinite alternate;
}
@keyframes coreBreath {
    0% { box-shadow: 0 0 40px rgba(205,168,106,0.15), 0 0 80px rgba(205,168,106,0.05); }
    100% { box-shadow: 0 0 60px rgba(205,168,106,0.35), 0 0 120px rgba(205,168,106,0.15); }
}
.center-core .core-avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gold-light), var(--wine-light), var(--gold-deep), var(--wine-light), var(--gold-light));
    opacity: 0.25;
    filter: blur(6px);
    animation: coreSpin 8s linear infinite;
}
@keyframes coreSpin {
    to { transform: rotate(360deg); }
}
.center-core .core-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(205,168,106,0.3);
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    background: #1a1a24;
    display: block;
    position: relative;
    z-index: 1;
}
.center-core .core-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 20px rgba(205,168,106,0.3);
    margin-top: 6px;
    letter-spacing: 1px;
}
.center-core .core-role {
    font-size: 0.7rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
}
.manager-node {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 90px;
    margin-left: -35px;
    margin-top: -45px;
    transform: rotateY(var(--angle, 0deg)) translateZ(var(--radius, 150px)) rotateY(calc(-1 * var(--angle, 0deg))) rotateX(calc(-1 * var(--rotX, 0deg))) rotateY(calc(-1 * var(--rotY, 0deg)));
    transform-style: preserve-3d;
    transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    will-change: transform;
    scale: var(--node-scale, 1);
}
.manager-node .node-avatar-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: radial-gradient(circle at 30% 30%, rgba(205,168,106,0.1), transparent 70%);
    padding: 3px;
}
.manager-node .node-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(205,168,106,0.2);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    background: #1a1a24;
}
.manager-node .node-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(0,0,0,0.8);
}
.manager-node .node-role {
    font-size: 0.55rem;
    color: var(--gold-light);
    opacity: 0.7;
}
.orbit-wrapper.is-focused .manager-node:not(.is-focused) {
    opacity: 0.4;
    filter: blur(2px) grayscale(0.6);
    transition: opacity 0.3s, filter 0.3s;
}
.manager-node.is-focused {
    transform: rotateY(var(--angle, 0deg)) translateZ(var(--radius, 150px)) rotateY(calc(-1 * var(--angle, 0deg))) rotateX(calc(-1 * var(--rotX, 0deg))) rotateY(calc(-1 * var(--rotY, 0deg))) scale(1.2);
    z-index: 20;
    filter: brightness(1.2);
}
.manager-node.is-focused .node-avatar {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(205,168,106,0.6);
}
.orbit-wrapper.is-focused .center-core .core-avatar-wrap {
    box-shadow: 0 0 60px rgba(205,168,106,0.6), 0 0 120px rgba(205,168,106,0.3);
    animation: none;
}
@media (max-width: 600px) {
    .org-chart { height: 320px; }
    .center-core .core-avatar-wrap { width: 80px; height: 80px; }
    .center-core .core-name { font-size: 1rem; }
    .manager-node { width: 55px; height: 75px; margin-left: -27.5px; margin-top: -37.5px; }
    .manager-node .node-avatar-wrap { width: 50px; height: 50px; }
    .manager-node .node-name { font-size: 0.65rem; }
    .manager-node .node-role { font-size: 0.5rem; }
}
@media (max-width: 400px) {
    .org-chart { height: 260px; }
    .center-core .core-avatar-wrap { width: 65px; height: 65px; }
    .manager-node { width: 45px; height: 65px; margin-left: -22.5px; margin-top: -32.5px; }
    .manager-node .node-avatar-wrap { width: 40px; height: 40px; }
}

/* ===== INFO BOXES, BUTTONS, MODALS ===== */
.info-box {
    background: var(--box-bg); border-radius: 20px; padding: 20px; margin-bottom: 16px;
    border-right: 4px solid var(--accent); display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-box:hover { transform: translateX(-5px); box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.info-content { flex: 1; text-align: right; padding-left: 15px; }
.info-content h3 { color: #ffffff; margin: 0 0 6px 0; font-size: 1.15rem; font-weight: 800; }
.info-content p { color: var(--text-muted); margin: 0; font-size: 0.9rem; line-height: 1.7; }
.info-icon { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,0.03); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: inset 0 0 10px rgba(255,255,255,0.05); }
.color-green { --accent: #00e676; }
.color-red { --accent: #ef4444; }
.color-purple { --accent: #8b5cf6; }
.color-gold { --accent: #cda86a; }
.btn-primary {
    display: block; width: 100%; padding: 16px; border-radius: 16px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 45%, var(--gold-deep));
    color: #0a0a0c; text-align: center; text-decoration: none; font-weight: 800; font-size: 1.1rem; margin-top: 15px;
    box-shadow: 0 10px 25px rgba(205, 168, 106, 0.3), inset 0 1px 0 rgba(255,255,255,0.5);
    transition: all 0.3s ease; cursor: pointer; border: none; letter-spacing: 0.3px;
}
.btn-primary:hover { background: linear-gradient(135deg, #fff0cf, var(--gold-light), var(--gold)); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(205,168,106,0.4), inset 0 1px 0 rgba(255,255,255,0.6); }
.owner-shrine {
    position: relative; overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(139,0,0,0.22), transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(205,168,106,0.08), transparent 60%),
        linear-gradient(180deg, rgba(24, 23, 29, 0.7), rgba(8, 8, 11, 0.78));
    border: 1px solid rgba(205,168,106,0.16);
    box-shadow: 0 25px 60px rgba(0,0,0,0.7), inset 0 0 60px rgba(139,0,0,0.08);
}
.owner-shrine::before {
    content: ''; position: absolute; inset: 7px; border-radius: 20px; pointer-events: none;
    border: 1px solid rgba(205,168,106,0.12);
}
.owner-shrine::after {
    content: ''; position: absolute; top: -40%; left: 50%; width: 260px; height: 260px; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(139,0,0,0.35), transparent 65%);
    filter: blur(10px); pointer-events: none; animation: shrinePulse 6s ease-in-out infinite;
}
@keyframes shrinePulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
.owner-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0; position: relative; z-index: 1; }
.owner-avatar-wrap { position: relative; width: 110px; height: 110px; margin-bottom: 18px; }
.owner-avatar-wrap::before {
    content: ''; position: absolute; inset: -8px; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--gold-light), var(--wine-light), #4a0000, var(--gold-deep), var(--gold-light));
    filter: blur(7px); opacity: 0.8; animation: ownerRing 7s linear infinite;
}
.owner-avatar-wrap::after {
    content: ''; position: absolute; inset: -2px; border-radius: 50%;
    border: 1px solid rgba(243, 217, 154, 0.5);
}
.owner-img {
    width: 105px; height: 105px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1;
    border: 3px solid #0a0a0d; box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 25px rgba(139,0,0,0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.owner-card:hover .owner-img { transform: scale(1.03); box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 35px rgba(205,168,106,0.35); }
.owner-name {
    font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 700; margin: 5px 0 12px; letter-spacing: 3px;
    text-transform: uppercase; color: #ffffff; text-shadow: 0 0 20px rgba(205,168,106,0.4);
}
.owner-desc { font-size: 1.05rem; color: var(--gold-light); line-height: 1.9; max-width: 85%; margin-bottom: 25px; font-style: italic; }
.btn-owner {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 35px; border-radius: 999px;
    border: 1px solid rgba(205, 168, 106, 0.35); color: var(--gold-light); text-decoration: none;
    font-size: 0.95rem; font-weight: 700; background: rgba(205, 168, 106, 0.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    transition: all 0.3s ease; cursor: pointer;
}
.btn-owner:hover { background: rgba(205, 168, 106, 0.12); border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(205,168,106,0.2); }
.about-text { color: var(--text-main); font-size: 1rem; line-height: 2; text-align: justify; margin-bottom: 20px; }
.about-text strong { color: var(--gold-light); }
.floating-btns {
    position: fixed; bottom: 25px; left: 20px; right: 20px;
    display: flex; justify-content: space-between; z-index: 998; pointer-events: none;
}
.float-btn {
    pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 50px; backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
    background: rgba(10, 10, 15, 0.75); border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 25px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03) inset;
    font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.95rem; text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; color: var(--text-main);
}
.float-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.7); }
.float-btn.realm { border-color: rgba(205, 168, 106, 0.3); color: var(--gold-light); background: rgba(205, 168, 106, 0.08); }
.float-btn.realm:hover { background: rgba(205, 168, 106, 0.15); border-color: var(--gold); box-shadow: 0 14px 30px rgba(205,168,106,0.25); }
.float-btn.power { border-color: rgba(139, 0, 0, 0.35); color: #fecaca; background: rgba(139, 0, 0, 0.1); }
.float-btn.power:hover { background: rgba(139, 0, 0, 0.2); border-color: var(--wine); box-shadow: 0 14px 30px rgba(139,0,0,0.3); }
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 1001; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-card {
    position: relative;
    background:
        linear-gradient(160deg, rgba(255,255,255,0.04), transparent 40%),
        linear-gradient(180deg, rgba(22, 21, 27, 0.96), rgba(9, 9, 12, 0.97));
    backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%);
    border-radius: 28px; border: 1px solid rgba(205,168,106,0.14); padding: 32px 26px;
    width: 90%; max-width: 360px; text-align: center; box-shadow: 0 30px 70px rgba(0,0,0,0.85), inset 0 1px 0 rgba(255,255,255,0.05);
    transform: translateY(20px) scale(0.97); transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 28px; padding: 1px; pointer-events: none;
    background: linear-gradient(155deg, rgba(205,168,106,0.3), transparent 35%, transparent 65%, rgba(139,0,0,0.25));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.modal-overlay.active .modal-card { transform: translateY(0) scale(1); }
.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 15px; color: var(--gold-light); text-shadow: 0 0 16px rgba(205,168,106,0.25); }
.modal-text { color: var(--text-muted); font-size: 0.95rem; line-height: 1.9; margin-bottom: 25px; }
.modal-text strong { color: #fecaca; }
.modal-btn {
    display: inline-block; padding: 12px 30px; border-radius: 999px;
    background: linear-gradient(135deg, var(--wine), var(--wine-light)); color: white; font-weight: 800;
    font-size: 1rem; text-decoration: none; border: none; cursor: pointer;
    box-shadow: 0 8px 20px rgba(139,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15); transition: all 0.3s ease; margin: 5px;
}
.modal-btn:hover { background: linear-gradient(135deg, #a00000, #d13333); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(139,0,0,0.45); }
.modal-close { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: var(--text-muted); margin-top: 10px; box-shadow: none; }
.live-clock {
    font-size: 0.8rem; color: var(--gold-light); text-align: center; margin-top: 8px;
    font-weight: 600; letter-spacing: 0.5px;
}
.chart-glow { position: relative; }
.chart-glow canvas { filter: drop-shadow(0 0 8px rgba(0, 230, 118, 0.4)); }
.game-header-btn {
    position: fixed; top: 25px; left: 25px; z-index: 1001;
    background: rgba(25, 25, 35, 0.75); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(205, 168, 106, 0.25); padding: 10px 16px; border-radius: 15px;
    cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.6); transition: all 0.3s ease;
    color: var(--gold-light); font-family: 'Vazirmatn', sans-serif; font-weight: 700; font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
}
.game-header-btn:hover { border-color: var(--gold); box-shadow: 0 0 20px rgba(205, 168, 106, 0.3); transform: scale(1.05); }
.game-header-btn .glow-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444; box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
    animation: pulse-red 1.5s infinite; flex-shrink: 0;
}
.game-header-btn .desktop-text { display: inline-block; }
.game-header-btn .mobile-text { display: none; }
.game-header-btn.hidden-btn { display: none !important; }
@keyframes pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@media (max-width: 600px) {
    .game-header-btn .desktop-text { display: none; }
    .game-header-btn .mobile-text { display: inline-block; font-size: 1.2rem; }
    .game-header-btn { padding: 8px 12px; gap: 6px; }
}
#game-section {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 900;
    background-color: #07070a;
    background-image: radial-gradient(circle at 50% 50%, rgba(139,0,0,0.15) 0%, transparent 60%);
    display: none; overflow: hidden; font-family: 'Vazirmatn', sans-serif; transition: box-shadow 0.3s ease;
}
#game-section.active { display: block; }
#game-section.critical { animation: criticalPulse 0.6s ease-in-out infinite; }
@keyframes criticalPulse {
    0%, 100% { box-shadow: inset 0 0 0 rgba(239,68,68,0); }
    50% { box-shadow: inset 0 0 140px rgba(239,68,68,0.35); }
}
#game-section #gameCanvas { display: block; width: 100%; height: 100%; cursor: none; }
#game-section #ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 20px;
}
#game-section .top-bar { display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 900; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
#game-section .score-box { color: #cda86a; display: flex; flex-direction: column; }
#game-section .combo-text { font-size: 1rem; color: #f59e0b; transition: transform 0.1s; }
#game-section .combo-text.active { transform: scale(1.2); color: #ef4444; }
#game-section .time-box { color: #ef4444; transition: transform 0.15s ease; }
#game-section .time-box.critical { animation: timeShake 0.5s ease-in-out infinite; color: #fca5a5; }
@keyframes timeShake { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
#game-section .overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(7, 7, 10, 0.92); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    pointer-events: auto; z-index: 10; transition: opacity 0.3s;
}
#game-section .hidden { opacity: 0; pointer-events: none !important; }
#game-section h1 {
    font-size: 2.5rem; color: #cda86a; margin-bottom: 10px;
    text-shadow: 0 5px 20px rgba(205,168,106,0.3); text-align: center;
    animation: titleGlow 2.4s ease-in-out infinite;
}
@keyframes titleGlow {
    0%, 100% { text-shadow: 0 5px 20px rgba(205,168,106,0.3); }
    50% { text-shadow: 0 5px 32px rgba(205,168,106,0.6), 0 0 40px rgba(139,0,0,0.3); }
}
#game-section p {
    color: #a0a0a8; margin-bottom: 20px; font-size: 1.1rem; text-align: center; max-width: 90%; line-height: 1.6;
}
#game-section .input-group { margin-bottom: 25px; width: 80%; max-width: 300px; }
#game-section input[type="text"] {
    width: 100%; padding: 15px; border-radius: 15px; border: 2px solid rgba(205,168,106,0.3);
    background: rgba(0,0,0,0.5); color: #fff; font-family: 'Vazirmatn', sans-serif;
    font-size: 1.2rem; text-align: center; outline: none; transition: border-color 0.3s;
}
#game-section input[type="text"]:focus { border-color: #cda86a; }
#game-section button {
    background: linear-gradient(135deg, #cda86a, #8b0000); border: none;
    padding: 15px 40px; border-radius: 30px; color: #fff; font-family: 'Vazirmatn', sans-serif;
    font-size: 1.3rem; font-weight: 900; cursor: pointer;
    box-shadow: 0 10px 30px rgba(139,0,0,0.4); transition: transform 0.2s, box-shadow 0.2s; margin-bottom: 20px;
}
#game-section button:hover { transform: scale(1.05); box-shadow: 0 15px 40px rgba(139,0,0,0.6); }
#game-section button:active { transform: scale(0.95); }
#game-section .flash {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: white; opacity: 0; pointer-events: none; z-index: 5;
}
#game-section .leaderboard-box {
    background: rgba(18, 18, 24, 0.8); border: 1px solid rgba(205,168,106,0.2);
    border-radius: 20px; padding: 15px 25px; width: 90%; max-width: 350px; margin-top: 10px;
}
#game-section .leaderboard-box h3 {
    color: #cda86a; font-size: 1.1rem; text-align: center; margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px;
}
#game-section .lb-list { list-style: none; }
#game-section .lb-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 0.95rem;
}
#game-section .lb-item:last-child { border-bottom: none; }
#game-section .lb-rank { font-weight: 900; color: #ef4444; width: 25px; }
#game-section .lb-name { flex-grow: 1; color: #e2e8f0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
#game-section .lb-score { color: #cda86a; font-weight: 900; }
.rank-badge {
    width: 90px; height: 90px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 2.6rem; font-weight: 900; font-family: 'Cinzel', serif; color: #0a0a0c; margin-bottom: 12px;
    background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 55%, var(--gold-deep));
    box-shadow: 0 0 0 3px #0a0a0d, 0 0 35px rgba(205,168,106,0.55), 0 15px 30px rgba(0,0,0,0.6);
    animation: rankPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.rank-badge.rank-c { background: radial-gradient(circle at 35% 30%, #cbd5e1, #94a3b8 55%, #64748b); box-shadow: 0 0 0 3px #0a0a0d, 0 0 25px rgba(148,163,184,0.4), 0 15px 30px rgba(0,0,0,0.6); }
.rank-badge.rank-b { background: radial-gradient(circle at 35% 30%, #86efac, #22c55e 55%, #15803d); box-shadow: 0 0 0 3px #0a0a0d, 0 0 25px rgba(34,197,94,0.45), 0 15px 30px rgba(0,0,0,0.6); }
.rank-badge.rank-a { background: radial-gradient(circle at 35% 30%, #93c5fd, #3b82f6 55%, #1d4ed8); box-shadow: 0 0 0 3px #0a0a0d, 0 0 25px rgba(59,130,246,0.45), 0 15px 30px rgba(0,0,0,0.6); }
@keyframes rankPop { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.run-stats { display: flex; gap: 30px; margin-bottom: 18px; }
.run-stat { display: flex; flex-direction: column; align-items: center; }
.run-stat span { font-size: 1.4rem; font-weight: 800; color: var(--gold-light); }
.run-stat small { color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }
#game-section.frenzy { animation: frenzyPulse 0.5s ease-in-out infinite; }
@keyframes frenzyPulse {
    0%, 100% { box-shadow: inset 0 0 0 rgba(245,158,11,0); }
    50% { box-shadow: inset 0 0 160px rgba(245,158,11,0.3); }
}
#game-section .combo-text.frenzy-text { color: #fcd34d; text-shadow: 0 0 12px rgba(252,211,77,0.7); }
.menu-btn, .game-header-btn { z-index: 1001; }
.menu-overlay { z-index: 1000; }
.telegram-login-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #2fb4ff, #1d9bf0 55%, #0d6fb8); color: white;
    padding: 13px 34px; border-radius: 30px; font-weight: 800; text-decoration: none;
    box-shadow: 0 10px 26px rgba(29, 155, 240, 0.4), inset 0 1px 0 rgba(255,255,255,0.35);
    transition: all 0.3s ease;
}
.telegram-login-btn:hover { background: linear-gradient(135deg, #4fc3ff, #1d9bf0); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(29,155,240,0.5), inset 0 1px 0 rgba(255,255,255,0.4); }
.login-modal-card { padding-top: 40px; overflow: visible; }
.login-badge {
    position: relative; width: 72px; height: 72px; margin: -68px auto 18px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    background: linear-gradient(150deg, #35baff, #1d9bf0 60%, #0a5fa1);
    box-shadow: 0 12px 30px rgba(29,155,240,0.45), 0 0 0 6px rgba(7,7,10,0.9), 0 0 0 7px rgba(205,168,106,0.25);
}
.login-badge::before {
    content: ''; position: absolute; inset: -10px; border-radius: 50%;
    border: 1px solid rgba(29,155,240,0.35); animation: loginPulse 2.4s ease-out infinite;
}
@keyframes loginPulse {
    0% { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}
.login-badge-icon { font-size: 2rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); transform: rotate(-8deg); }
.loader {
    border: 4px solid rgba(255,255,255,0.1); border-radius: 50%; border-top-color: #cda86a;
    width: 30px; height: 30px; animation: spin 0.8s linear infinite; margin: 15px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-box {
    background: var(--box-bg);
    border: 2px dashed rgba(205,168,106,0.3);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    transition: border-color 0.3s;
    cursor: pointer;
    user-select: none;
}
.upload-box.dragover { border-color: #cda86a; background: rgba(205,168,106,0.05); }
#profileAvatar {
    width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--gold); box-shadow: 0 0 15px rgba(205,168,106,0.3);
}
.menu-btn, .game-header-btn {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7) !important;
}
.float-btn {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.02) !important;
}
.float-btn.realm:hover {
    box-shadow: 0 12px 30px rgba(205, 168, 106, 0.15) !important;
}
.float-btn.power:hover {
    box-shadow: 0 12px 30px rgba(139, 0, 0, 0.2) !important;
}
.btn-primary, .telegram-login-btn {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6) !important;
}