/* =========================================
   TITAN OS - STYLE (V33.0 - HOLOGRAPHIC SPHERE)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Inter:wght@300;400;600;800&display=swap');

/* --- GLOBAL UI FIXES (NO SELECT / NO TEXT CURSOR) --- */

/* 1. Désactive la sélection de texte et le curseur texte partout */
body, html {
    -webkit-user-select: none; /* Chrome/Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE/Edge */
    user-select: none;         /* Standard */
    cursor: default;           /* Force la flèche partout */
}

/* 2. Réactive la sélection et le curseur texte UNIQUEMENT dans les champs de saisie */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text; /* Remet le trait vertical ici */
}

/* 3. Force la main sur les éléments cliquables (pour être sûr) */
a, button, .btn, .pointer, label {
    cursor: pointer;
}

:root {
    /* --- PALETTE --- */
    --bg-dark: #0f172a;            
    --bg-card: rgba(30, 41, 59, 0.7); 
    --accent: #38bdf8;              
    --primary: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --text-main: #f8fafc;         
    --text-muted: #94a3b8;        
    --success: #10b981;            
    --warning: #facc15;            
    --danger: #ef4444;             
    --gold: #facc15;
    
    --sidebar-width: 280px;
    --nav-height-mobile: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom);
}

/* 1. RESET & ANTI-REBOND */
html {
    color-scheme: dark;
    overscroll-behavior-y: none; 
    scroll-behavior: smooth;
}

body {
    margin: 0; padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 90%);
    background-attachment: fixed;
    
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

/* --- GESTION DES IMAGES & RATIOS --- */
img {
    max-width: 100%;
    height: auto;
    display: block; 
}

/* Ratio exact 2752x1536 pour éviter les déformations */
.game-visual, .boss-image, .zone-img {
    width: 100%;
    aspect-ratio: 2752 / 1536; 
    object-fit: cover; 
    border-radius: 12px;
    background: #000; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* TYPO */
h1, h2, h3, h4, h5, h6, 
.titular, .brand-title, 
label, legend, fieldset, summary, caption {
    font-family: 'Russo One', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* 2. LAYOUT FLUIDE */
.layout { 
    display: flex; 
    width: 100%; 
    min-height: 100vh;
}

.main-content {
    flex: 1; 
    padding: 30px;
    padding-bottom: 120px;
    
    max-width: 1400px; margin: 0 auto; width: 100%;
    position: relative;
}

/* 3. SIDEBAR (PC) */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh; 
    position: sticky; 
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; 
    padding: 30px 20px;
    z-index: 50; 
    overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 15px; margin-bottom: 40px; padding: 0 10px; }
.brand-logo { width: 42px; height: 42px; filter: drop-shadow(0 0 8px var(--accent-glow)); }
.brand-meta { display: flex; flex-direction: column; }
.brand-version { font-size: 0.7rem; color: var(--text-muted); font-family: 'Courier New'; }

.nav-category { font-size: 0.7rem; font-weight: 800; color: #475569; margin: 20px 0 10px 15px; letter-spacing: 1.5px; }

.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    color: var(--text-muted); border-radius: 12px; font-weight: 600; transition: all 0.2s ease; margin-bottom: 5px;
}
.nav-link:hover { background: rgba(255,255,255,0.03); color: #fff; }
.nav-link.active { background: rgba(56, 189, 248, 0.1); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.1); }
.nav-link i { font-size: 1.2rem; }

.profile-widget {
    background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255,255,255,0.05);
    padding: 12px; border-radius: 12px; display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; cursor: pointer; transition: 0.2s;
}
.profile-widget:hover { background: rgba(30, 41, 59, 0.9); border-color: var(--accent); }

/* 4. NAVIGATION MOBILE */
.mobile-nav {
    display: none; 
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-height-mobile);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.1);
    justify-content: space-around;
    align-items: center;
    z-index: 99999;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.mobile-nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #64748b; font-size: 0.65rem; font-family: 'Russo One';
    width: 20%; height: 100%; transition: 0.3s;
}
.mobile-nav-link i { font-size: 1.5rem; margin-bottom: 3px; transition: 0.3s; }
.mobile-nav-link.active { color: var(--accent); }
.mobile-nav-link.active i { transform: translateY(-3px); text-shadow: 0 0 10px var(--accent-glow); }

/* 5. COMPOSANTS UI */
.card, .friend-card, .quest-item, .item-card, .vs-card, .training-options, .legal-card, .info-block {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px; padding: 20px; margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #fff !important;
}

/* --- CORRECTION GRAPHIQUES (CHART.JS MOBILE) --- */
canvas {
    max-width: 100% !important; 
    width: 100% !important;     
    height: auto !important;    
    display: block;
}
.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px; 
    overflow: hidden; 
}

/* Boutons */
.btn-primary, .btn-action, .btn-add {
    background: var(--primary); color: #0f172a;
    border: none; padding: 12px 24px; border-radius: 10px;
    font-family: 'Russo One'; font-size: 0.9rem; cursor: pointer; transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 0 15px var(--accent-glow);
    font-weight: 800;
}
.btn-primary:active, .btn-action:active { transform: scale(0.96); }
.btn-primary:hover, .btn-action:hover { filter: brightness(1.1); box-shadow: 0 0 20px var(--accent-glow); }

.nav-tab.active { 
    background: var(--primary) !important; color: #0f172a !important; 
    box-shadow: 0 0 15px var(--accent-glow); font-weight: 800;
}

/* --- SUPPRESSION TOTALE DU CURSEUR QUI CLIGNOTE --- */
input, select, textarea, input[type="text"], input[type="number"] {
    background-color: #1e293b !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    padding: 12px; border-radius: 8px; width: 100%;
    font-family: 'Inter', sans-serif; font-size: 16px;
    outline: none !important;
    -webkit-appearance: none; appearance: none;
    caret-color: transparent !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    background-color: #0f172a !important;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* 6. RESPONSIVE */
@media (max-width: 1024px) {
    .sidebar { display: none !important; }
    .mobile-nav { display: flex !important; }
    .main-content { padding: 20px 15px 120px 15px !important; } 
}

@media (max-width: 768px) {
    .mobile-user-bar {
        display: block !important;
        position: sticky; top: 0; z-index: 100;
        margin: -20px -15px 20px -15px !important; padding: 15px;
        background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .titular { font-size: 1.6rem; }
    .btn-primary, .btn-action, input, select { height: 50px; }
    .stats-grid, .inventory-grid, .avatar-grid { grid-template-columns: 1fr !important; }
    .chart-container { min-height: 200px; padding: 0; }
}

/* 7. ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.view-section.active { animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes boss-shake { 0% { transform: translateX(0); } 25% { transform: translateX(-5px) rotate(-2deg); } 50% { transform: translateX(5px) rotate(2deg); } 75% { transform: translateX(-5px); } 100% { transform: translateX(0); } }
.boss-shake { animation: boss-shake 0.4s ease-in-out; }
.damage-number { position: absolute; color: #fff; font-weight: 900; font-size: 1.5rem; text-shadow: 0 0 5px #ff0000; pointer-events: none; animation: floatUp 0.8s ease-out forwards; z-index: 999; }
.dmg-crit { color: #facc15; font-size: 2rem; text-shadow: 0 0 10px #facc15; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-40px) scale(1.2); } }

/* --- ADBLOCK WALL --- */
#adblock-lockout {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.98);
    z-index: 999999; 
    display: none; 
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
    backdrop-filter: blur(10px);
}
.lockout-icon { font-size: 4rem; color: var(--danger); margin-bottom: 20px; animation: heartbeat 1.5s infinite; }
.lockout-title { font-family: 'Russo One'; font-size: 1.5rem; color: #fff; margin-bottom: 10px; text-transform: uppercase; }
.lockout-msg { color: #94a3b8; max-width: 400px; margin-bottom: 30px; line-height: 1.5; }
.lockout-btn {
    background: var(--accent); color: #000; padding: 15px 30px;
    font-family: 'Russo One'; border-radius: 50px; text-decoration: none;
    font-size: 1rem; transition: 0.3s; box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    border: none; cursor: pointer;
}
.lockout-btn:hover { transform: scale(1.05); }
.lockout-link { color: #64748b; font-size: 0.8rem; margin-top: 20px; cursor: pointer; text-decoration: underline; }
@keyframes heartbeat { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* --- SYSTÈME DE NOTIFICATION TITAN --- */
#titan-notify-area {
    position: fixed; top: 20px; right: 20px; width: 320px; z-index: 100000;
    display: flex; flex-direction: column; gap: 15px; pointer-events: none;
}
.titan-toast {
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-left: 4px solid var(--toast-color, #38bdf8);
    padding: 16px; border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--toast-color-glow, rgba(0,0,0,0));
    display: flex; align-items: flex-start; gap: 15px; color: #fff; pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: right center; overflow: hidden; position: relative;
}
.titan-toast.closing { animation: toastFadeOut 0.3s ease forwards; }
.t-icon-box {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.05);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--toast-color); flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1);
}
.t-content { flex: 1; }
.t-title { font-family: 'Russo One', sans-serif; font-size: 0.85rem; text-transform: uppercase; margin-bottom: 4px; color: var(--toast-color); letter-spacing: 1px; text-shadow: 0 0 10px var(--toast-color-glow); }
.t-msg { font-size: 0.8rem; color: #cbd5e1; font-family: 'Outfit', sans-serif; line-height: 1.4; }
@keyframes toastSlideIn { from { transform: translateX(100%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes toastFadeOut { to { opacity: 0; transform: translateX(20px) scale(0.95); } }

/* --- SYSTÈME DE MODAL (NEWS & PATCHS) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.news-panel {
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
    border-radius: 16px;
    max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
    position: relative;
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column;
}
.modal-overlay.active .news-panel { transform: scale(1); }

.news-header { background: rgba(6, 182, 212, 0.1); padding: 1rem; border-bottom: 1px solid rgba(56, 189, 248, 0.2); }
.news-body { padding: 1.5rem; flex: 1; overflow-y: auto; }
.news-footer { padding: 1rem; background: rgba(15, 23, 42, 0.5); }

/* --- DISCORD WIDGET --- */
.discord-box {
    background: rgba(88, 101, 242, 0.1); border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px; padding: 15px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 15px; cursor: pointer; transition: all 0.3s ease; text-decoration: none;
}
.discord-box:hover {
    background: rgba(88, 101, 242, 0.25); box-shadow: 0 0 20px rgba(88, 101, 242, 0.2);
    transform: translateY(-2px); border-color: #5865F2;
}
.d-icon {
    width: 40px; height: 40px; background: #5865F2; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; box-shadow: 0 0 10px rgba(88, 101, 242, 0.5);
}
.d-info { flex: 1; }
.d-title { font-family: 'Russo One'; font-size: 0.9rem; color: #fff; margin-bottom: 2px; text-transform: uppercase; }
.d-sub { font-size: 0.75rem; color: #a5b4fc; font-family: 'Inter'; }

/* =======================================================
   ADVENTURE / COCKPIT MODE (INTEGRATION OPTIMISÉE V2)
   ======================================================= */

/* 1. Amélioration du Viewport (Effet Écran Tactique) */
.viewport {
    position: relative;
    height: 45vh; width: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: #050505;
    border-bottom: 2px solid var(--accent);
    perspective: 1000px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
}

/* Le sol en grille 3D (inchangé) */
.viewport::before {
    content: "";
    position: absolute; bottom: -50%; left: -50%; width: 200%; height: 100%;
    background: 
        linear-gradient(rgba(56, 189, 248, 0.3) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(56, 189, 248, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotateX(60deg); opacity: 0.3;
    animation: grid-scroll 10s linear infinite;
    z-index: 1; pointer-events: none;
    -webkit-mask-image: linear-gradient(to top, black 20%, transparent 80%);
    mask-image: linear-gradient(to top, black 20%, transparent 80%);
}

@keyframes grid-scroll { 0% { background-position: 0 0; } 100% { background-position: 0 40px; } }

/* Effet scanlines (inchangé) */
.viewport::after {
    content: " "; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 20; background-size: 100% 2px, 3px 100%; pointer-events: none;
}

/* 2. Intégration Visuelle de l'Ennemi (Hologramme Sphérique) */
.enemy-visual {
    max-width: 95%; max-height: 95%; height: auto; width: auto;
    object-fit: contain; object-position: center center;
    z-index: 10;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8)) drop-shadow(0 0 15px rgba(56, 189, 248, 0.3));
    animation: breathe 4s ease-in-out infinite;
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
    mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
}

@keyframes breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.03); }
}

/* Mode Boss Actif (Rouge) */
body.boss-active .viewport { border-bottom-color: var(--danger); }
body.boss-active .viewport::before {
    background: 
        linear-gradient(rgba(239, 68, 68, 0.3) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(239, 68, 68, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
}
body.boss-active .enemy-visual {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.9)) drop-shadow(0 0 20px rgba(239, 68, 68, 0.4));
}

/* 3. Animation d'Impact (Hit) */
.hit-anim {
    animation: impact-shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
    filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(5) !important;
    -webkit-mask-image: none !important; mask-image: none !important;
}

@keyframes impact-shake {
    10%, 90% { transform: translate3d(-3px, 0, 0) scale(1.05); }
    20%, 80% { transform: translate3d(6px, 0, 0) scale(1.05); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0) scale(1.05); }
    40%, 60% { transform: translate3d(8px, 0, 0) scale(1.05); }
}

/* 4. Responsive Spécial Cockpit */
@media (max-width: 480px) {
    .viewport { height: 40vh; }
    .enemy-visual { max-width: 100%; max-height: 100%; }
}

/* TITAN OS v39 - lisibilite operationnelle */
.brand-version {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-widget {
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.profile-widget:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
    transform: translateY(-1px);
}

.nav-link, .mobile-nav-link, .grid-item, .history-card, .log-card, .hist-card {
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.grid-item:hover, .history-card:hover, .log-card:hover, .hist-card:hover {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.input-tech:focus, .input-field:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.titan-system-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.08);
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

/* TITAN OS v40 - visual polish global */
:root {
    --bg-dark: #070a0f;
    --bg-card: rgba(17, 24, 39, 0.72);
    --surface-strong: rgba(10, 14, 22, 0.88);
    --surface-soft: rgba(255, 255, 255, 0.045);
    --line-soft: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(148, 163, 184, 0.22);
    --accent: #3dd6c6;
    --primary: #3dd6c6;
    --accent-glow: rgba(61, 214, 198, 0.24);
    --gold: #f4c95d;
    --warning: #f4c95d;
    --danger: #ff5c6c;
    --success: #45d483;
    --text-main: #f6f7fb;
    --text-muted: #9aa7ba;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(61, 214, 198, 0.10), transparent 28rem),
        radial-gradient(circle at 88% 18%, rgba(244, 201, 93, 0.08), transparent 30rem),
        linear-gradient(145deg, #06070b 0%, #0b1018 48%, #10131c 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.main-content {
    max-width: min(1720px, calc(100vw - 32px));
}

.sidebar {
    background: rgba(7, 10, 15, 0.84);
    border-right: 1px solid var(--line-soft);
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.22);
}

.brand {
    margin-bottom: 26px;
}

.brand-logo {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
}

.profile-widget,
.card,
.friend-card,
.quest-item,
.item-card,
.vs-card,
.training-options,
.legal-card,
.info-block,
.kpi-card,
.selection-area,
.wallet-section,
.premium-chart-container,
.tactical-dashboard,
.weapon-card,
.history-card,
.log-card,
.hist-card {
    border-radius: 8px !important;
    border-color: var(--line-soft) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
        var(--surface-strong) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.nav-category {
    color: #657286;
    margin-top: 18px;
}

.nav-link {
    border-radius: 8px;
    border: 1px solid transparent;
    min-height: 42px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--line-soft);
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(61, 214, 198, 0.18), rgba(244, 201, 93, 0.06));
    border-color: rgba(61, 214, 198, 0.32);
    color: #e8fffb;
}

.elite-mini {
    margin-left: 8px;
    color: var(--gold) !important;
}

.btn-primary,
.btn-action,
.btn-add,
.btn-shop,
.save-btn,
.data-btn,
.danger-btn,
.btn-fire {
    border-radius: 8px !important;
}

.mobile-agent-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(7, 10, 15, 0.78);
    border: 1px solid var(--line-soft);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.mobile-nav {
    height: calc(74px + var(--safe-area-bottom));
    background: rgba(7, 10, 15, 0.92);
    border-top: 1px solid var(--line-soft);
    overflow-x: auto;
    justify-content: flex-start;
    padding: 6px 8px var(--safe-area-bottom);
    gap: 4px;
}

.mobile-nav-link {
    flex: 0 0 14.2%;
    min-width: 54px;
    border-radius: 8px;
    height: 58px;
}

.mobile-nav-link.active {
    background: rgba(61, 214, 198, 0.13);
}

.mobile-nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1500px) {
    .main-content {
        padding-left: 44px;
        padding-right: 44px;
    }
    .stats-grid,
    .shop-grid,
    .kpi-grid,
    .inventory-grid {
        gap: 22px !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        max-width: 100%;
    }
    .mobile-user-bar {
        margin: -20px -15px 18px -15px !important;
    }
    .shop-grid,
    .kpi-grid,
    .elite-grid,
    .premium-controls {
        grid-template-columns: 1fr !important;
    }
    h1.titular,
    .titular {
        font-size: 1.45rem !important;
        line-height: 1.08;
    }
}

/* TITAN OS premium cosmetics - visual only */
.titan-elite-mark {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: 4px;
    padding: 3px 7px;
    border: 1px solid rgba(244, 201, 93, 0.46);
    border-radius: 999px;
    color: var(--gold) !important;
    background: rgba(244, 201, 93, 0.1);
    font-family: 'Russo One', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    box-shadow: 0 0 18px rgba(244, 201, 93, 0.12);
}

.titan-premium-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    border-radius: 50%;
    color: #0b1120;
    background: linear-gradient(135deg, #facc15, #38bdf8);
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.3);
    vertical-align: -2px;
}

.titan-avatar-frame {
    position: relative;
    isolation: isolate;
}

.titan-avatar-frame::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.titan-avatar-frame.frame-aegis,
.current-avatar-box.frame-aegis {
    border-color: #facc15 !important;
    box-shadow: 0 0 22px rgba(250, 204, 21, 0.24), inset 0 0 12px rgba(250, 204, 21, 0.08) !important;
}

.titan-avatar-frame.frame-aegis::after,
.current-avatar-box.frame-aegis::after {
    border-color: rgba(250, 204, 21, 0.45);
    opacity: 1;
}

.titan-avatar-frame.frame-neon,
.current-avatar-box.frame-neon {
    border-color: #22d3ee !important;
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.24), inset 0 0 12px rgba(34, 211, 238, 0.08) !important;
}

.titan-avatar-frame.frame-neon::after,
.current-avatar-box.frame-neon::after {
    border-color: rgba(56, 189, 248, 0.5);
    opacity: 1;
}

.titan-avatar-frame.frame-frost,
.current-avatar-box.frame-frost {
    border-color: #7dd3fc !important;
    box-shadow: 0 0 22px rgba(125, 211, 252, 0.22), inset 0 0 12px rgba(125, 211, 252, 0.08) !important;
}

.titan-avatar-frame.frame-crimson,
.current-avatar-box.frame-crimson {
    border-color: #ef4444 !important;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.22), inset 0 0 12px rgba(239, 68, 68, 0.08) !important;
}

.titan-elite-avatar-effect::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from 90deg, transparent, rgba(250, 204, 21, 0.34), rgba(56, 189, 248, 0.22), transparent 64%);
    filter: blur(7px);
    opacity: 0.6;
    z-index: -1;
    animation: titanElitePulse 3.2s ease-in-out infinite;
}

.current-avatar-box.titan-elite-avatar-effect {
    overflow: visible !important;
}

.current-avatar-box.titan-elite-avatar-effect #current-avatar-display {
    overflow: hidden;
    border-radius: 50%;
}

.premium-toast {
    border-color: rgba(244, 201, 93, 0.24) !important;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.52), 0 0 26px rgba(244, 201, 93, 0.18) !important;
}

.premium-toast::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 0 35%, rgba(250, 204, 21, 0.12), transparent 62% 100%);
    transform: translateX(-100%);
    animation: titanPremiumSweep 2.2s ease-out forwards;
}

.cosmetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.cosmetic-chip {
    min-height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    text-align: left;
}

.cosmetic-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(61, 214, 198, 0.42);
    background: rgba(61, 214, 198, 0.08);
}

.cosmetic-chip.active {
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(250, 204, 21, 0.09);
    color: #fff;
}

.cosmetic-chip.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.cosmetic-chip i {
    color: var(--accent);
    font-size: 1.2rem;
}

.cosmetic-chip strong {
    display: block;
    font-family: 'Russo One', sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
}

.cosmetic-chip span {
    display: block;
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.grenade-skin-plasma {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(15, 23, 42, 0.86)) !important;
    box-shadow: 0 0 18px rgba(167, 139, 250, 0.22);
}

.grenade-skin-gold {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(15, 23, 42, 0.86)) !important;
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.22);
}

.grenade-skin-glitch {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(239, 68, 68, 0.08), rgba(15, 23, 42, 0.86)) !important;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
}

.grenade-skin-frost {
    background: linear-gradient(135deg, rgba(125, 211, 252, 0.2), rgba(15, 23, 42, 0.86)) !important;
    box-shadow: 0 0 18px rgba(125, 211, 252, 0.2);
}

.log-card.elite-trace,
.history-card.elite-trace {
    border-color: rgba(250, 204, 21, 0.3) !important;
    background:
        linear-gradient(120deg, rgba(250, 204, 21, 0.09), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
        var(--surface-strong) !important;
}

.log-card.elite-trace .log-meta::after {
    content: "ELITE TRACE";
    margin-left: 8px;
    color: var(--gold);
    font-family: 'Russo One', sans-serif;
    font-size: 0.6rem;
}

.titan-victory-fx {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 42%);
    animation: titanFxFade 1.8s ease forwards;
}

.victory-fx-ring {
    width: min(58vw, 420px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(250, 204, 21, 0.52);
    box-shadow: 0 0 38px rgba(250, 204, 21, 0.24), inset 0 0 40px rgba(56, 189, 248, 0.12);
    animation: titanFxRing 1.4s ease-out forwards;
}

.titan-victory-fx.orbital .victory-fx-ring {
    border-color: rgba(56, 189, 248, 0.62);
    box-shadow: 0 0 42px rgba(56, 189, 248, 0.3), inset 0 0 40px rgba(250, 204, 21, 0.08);
}

.victory-fx-label {
    position: absolute;
    color: #fff;
    font-family: 'Russo One', sans-serif;
    letter-spacing: 0.12em;
    font-size: clamp(0.85rem, 2.2vw, 1.2rem);
    background: rgba(7, 10, 15, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.36);
}

@keyframes titanElitePulse {
    0%, 100% { opacity: 0.35; transform: scale(0.98); }
    50% { opacity: 0.72; transform: scale(1.04); }
}

@keyframes titanPremiumSweep {
    to { transform: translateX(120%); }
}

@keyframes titanFxFade {
    0% { opacity: 0; }
    12%, 72% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes titanFxRing {
    from { transform: scale(0.4) rotate(0deg); opacity: 0; }
    30% { opacity: 1; }
    to { transform: scale(1.18) rotate(36deg); opacity: 0; }
}

/* TITAN OS v41 - navigation immersive complete */
:root {
    --sidebar-width: 304px;
    --nav-height-mobile: 82px;
}

.sidebar {
    padding: 0;
    overflow: hidden;
    isolation: isolate;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(61, 214, 198, 0.12), transparent 32%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: auto, 42px 42px;
    opacity: 0.7;
    z-index: -1;
}

.sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 16px 18px;
    min-height: 0;
}

.brand {
    padding: 10px 10px 18px;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--line-soft);
}

.brand-title {
    letter-spacing: 0.12em;
}

.profile-widget {
    flex-shrink: 0;
    margin: 0 0 14px;
}

.profile-avatar-shell {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(61, 214, 198, 0.55);
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 0 24px rgba(61, 214, 198, 0.16);
    flex-shrink: 0;
}

.profile-info {
    min-width: 0;
}

.profile-name {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 4px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(61, 214, 198, 0.32) transparent;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 12px 4px 0;
    border-top: 1px solid var(--line-soft);
}

.nav-sector {
    margin-bottom: 12px;
}

.nav-category {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 8px 8px;
    color: #7d8da4;
    font-size: 0.62rem;
}

.nav-category::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.45;
}

.nav-link {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 10px 12px;
    margin-bottom: 6px;
    overflow: hidden;
}

.nav-link i {
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.045);
    color: var(--accent);
}

.nav-link strong,
.drawer-link strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.nav-link span,
.drawer-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    inset: 8px auto 8px 0;
    width: 3px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}

.nav-link-utility {
    min-height: 46px;
    opacity: 0.9;
}

.mobile-user-bar {
    display: none;
}

.mobile-agent-card {
    gap: 10px;
    min-height: 64px;
}

.mobile-menu-toggle,
.drawer-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(61, 214, 198, 0.26);
    border-radius: 8px;
    background: rgba(61, 214, 198, 0.1);
    color: #e8fffb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.mobile-agent-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.mobile-avatar {
    width: 40px;
    height: 40px;
    background: #111827;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 1px solid rgba(61, 214, 198, 0.55);
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-agent-name {
    font-weight: 800;
    color: #fff;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-agent-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mobile-wallet {
    text-align: right;
    min-width: 54px;
    flex-shrink: 0;
}

.mobile-wallet div {
    font-weight: 800;
    color: var(--gold);
    font-size: 0.92rem;
}

.mobile-wallet span {
    display: block;
    color: #75839a;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.mobile-nav {
    overscroll-behavior-x: contain;
}

.mobile-nav-link {
    min-width: 64px;
    max-width: 96px;
    flex: 1 0 72px;
    gap: 2px;
}

.mobile-nav-link i {
    margin-bottom: 0;
}

.mobile-nav-link span {
    font-size: 0.57rem;
    letter-spacing: 0;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(5px);
    z-index: 99990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(430px, 92vw);
    padding: max(18px, env(safe-area-inset-top)) 14px calc(96px + var(--safe-area-bottom));
    background:
        radial-gradient(circle at 18% 4%, rgba(61, 214, 198, 0.16), transparent 18rem),
        linear-gradient(180deg, rgba(10, 14, 22, 0.98), rgba(5, 8, 13, 0.98));
    border-right: 1px solid rgba(61, 214, 198, 0.18);
    box-shadow: 26px 0 70px rgba(0, 0, 0, 0.45);
    z-index: 99991;
    transform: translateX(-104%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
}

.mobile-menu-open {
    overflow: hidden;
}

.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.drawer-head strong {
    display: block;
    font-family: 'Russo One', sans-serif;
    font-size: 1.18rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.drawer-kicker {
    display: block;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.drawer-nav {
    padding-top: 8px;
}

.drawer-link {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    min-height: 58px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.drawer-link i {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: rgba(61, 214, 198, 0.1);
    font-size: 1.25rem;
}

.drawer-link.active {
    border-color: rgba(61, 214, 198, 0.42);
    background: linear-gradient(90deg, rgba(61, 214, 198, 0.16), rgba(244, 201, 93, 0.055));
}

.drawer-utilities {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

@media (max-width: 1180px) and (min-width: 1025px) {
    :root {
        --sidebar-width: 278px;
    }

    .sidebar-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        min-height: 48px;
    }
}

@media (max-width: 1024px) {
    .layout {
        display: block;
    }

    .mobile-user-bar {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 9000;
        margin: -20px -15px 18px -15px !important;
        padding: 12px 12px 0;
        background: linear-gradient(180deg, rgba(7, 10, 15, 0.96), rgba(7, 10, 15, 0.72));
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .main-content {
        padding-bottom: calc(112px + var(--safe-area-bottom)) !important;
    }
}

@media (max-width: 560px) {
    .mobile-agent-card {
        padding: 9px;
    }

    .mobile-agent-sub {
        display: none;
    }

    .mobile-agent-name {
        max-width: 28vw;
        font-size: 0.9rem;
    }

    .mobile-wallet {
        min-width: 48px;
    }

    .mobile-wallet div {
        font-size: 0.82rem;
    }

    .mobile-menu-toggle,
    .drawer-close {
        width: 38px;
        height: 38px;
    }

    .mobile-nav {
        height: calc(78px + var(--safe-area-bottom));
        padding-left: 6px;
        padding-right: 6px;
        gap: 2px;
        overflow-x: hidden;
    }

    .mobile-nav-link {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        height: 56px;
    }

    .mobile-nav-link i {
        font-size: 1.32rem;
    }

    .mobile-nav-link span {
        font-size: 0.5rem;
    }
}

/* TITAN OS v47 - immersive polish, boot mask, responsive framing */
:root {
    --panel-radius: 8px;
    --panel-pad: clamp(14px, 1.6vw, 22px);
    --page-gutter: clamp(14px, 2.2vw, 38px);
    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
}

html.titan-booting body {
    overflow: hidden;
}

html.titan-booting .layout {
    opacity: 0;
    transform: translateY(8px);
}

html.titan-ready .layout {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

body.titan-page-leaving .layout {
    opacity: 0.25;
    transform: scale(0.995);
    filter: blur(1px);
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

#titan-boot-screen {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: start stretch;
    padding: 0;
    background: transparent;
    pointer-events: none;
}

#titan-boot-screen.is-done {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.34s ease;
}

.titan-boot-strip {
    width: 100%;
    display: grid;
    gap: 0;
}

.titan-boot-track {
    height: 3px;
    background: rgba(15, 23, 42, 0.72);
    overflow: hidden;
    box-shadow: 0 0 18px rgba(61, 214, 198, 0.24);
}

.titan-boot-track span {
    display: block;
    height: 100%;
    width: 42%;
    background: linear-gradient(90deg, transparent, var(--accent), #facc15, transparent);
    animation: titanBootSweep 0.9s ease-in-out infinite;
}

.titan-boot-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    height: 2px;
}

.titan-boot-bars i {
    border-radius: 999px;
    background: rgba(61, 214, 198, 0.22);
    animation: titanBootBars 0.92s ease-in-out infinite;
}

.titan-boot-bars i:nth-child(2) { animation-delay: 0.08s; }
.titan-boot-bars i:nth-child(3) { animation-delay: 0.16s; }
.titan-boot-bars i:nth-child(4) { animation-delay: 0.24s; }

@keyframes titanBootSweep {
    to { transform: translateX(100%); }
}

@keyframes titanBootBars {
    0%, 100% { opacity: 0.28; transform: scaleX(0.64); }
    45% { opacity: 1; transform: scaleX(1); }
}

body {
    text-rendering: geometricPrecision;
}

.main-content {
    padding: var(--page-gutter) !important;
    padding-bottom: calc(112px + var(--safe-area-bottom)) !important;
    min-width: 0;
}

header,
.card,
.friend-card,
.quest-item,
.item-card,
.vs-card,
.training-options,
.legal-card,
.info-block,
.kpi-card,
.selection-area,
.wallet-section,
.premium-chart-container,
.tactical-dashboard,
.weapon-card,
.history-card,
.log-card,
.hist-card,
.day-card,
.elite-block,
details {
    border-radius: var(--panel-radius) !important;
}

.card,
.friend-card,
.quest-item,
.item-card,
.vs-card,
.training-options,
.legal-card,
.info-block,
.kpi-card,
.selection-area,
.wallet-section,
.premium-chart-container,
.tactical-dashboard,
.weapon-card,
.history-card,
.log-card,
.hist-card,
.day-card,
details {
    padding: var(--panel-pad) !important;
    border: 1px solid rgba(255, 255, 255, 0.085) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.056), rgba(255, 255, 255, 0.026)),
        rgba(8, 12, 20, 0.82) !important;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
}

.card:hover,
.item-card:hover,
.hist-card:hover,
.log-card:hover,
.history-card:hover,
.day-card:hover {
    border-color: rgba(61, 214, 198, 0.22) !important;
}

.stats-grid,
.kpi-grid,
.shop-grid,
.inventory-grid,
.avatar-grid,
.elite-grid,
.planning-grid,
.quick-sport-grid,
.cosmetic-grid {
    min-width: 0;
}

.stats-grid,
.kpi-grid,
.shop-grid,
.inventory-grid {
    gap: clamp(10px, 1.4vw, 18px) !important;
}

input,
select,
textarea,
.input-tech,
.input-field {
    min-height: 46px;
    border-radius: 8px !important;
    caret-color: var(--accent) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

textarea {
    line-height: 1.45;
}

button,
.btn,
.btn-primary,
.btn-action,
.btn-add,
.btn-shop,
.save-btn,
.data-btn,
.danger-btn,
.btn-fire,
.nav-tab,
.intent-chip,
.habit-chip,
.terrain-opt {
    min-width: 0;
    overflow-wrap: anywhere;
}

.btn-primary,
.btn-action,
.btn-add,
.btn-shop,
.save-btn,
.data-btn,
.danger-btn,
.btn-fire {
    min-height: 46px;
    border-radius: 8px !important;
    box-shadow: 0 12px 30px rgba(61, 214, 198, 0.12) !important;
}

.nav-tab {
    min-height: 44px;
    white-space: normal;
}

.sidebar,
.mobile-nav,
.mobile-user-bar,
.mobile-menu-panel,
.modal-overlay,
.session-modal-overlay {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar {
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.34);
}

.nav-link,
.drawer-link,
.mobile-nav-link {
    -webkit-tap-highlight-color: transparent;
}

#titan-notify-area {
    width: min(360px, calc(100vw - 24px)) !important;
    gap: 10px !important;
}

.titan-toast {
    border-radius: 8px !important;
    border-left-width: 3px !important;
    background: rgba(8, 12, 20, 0.92) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
}

.t-icon-box {
    border-radius: 8px !important;
}

.t-content {
    min-width: 0;
}

.t-msg {
    overflow-wrap: anywhere;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap,
.history-list,
#training-history-list,
#sport-selector-list {
    max-width: 100%;
}

.hist-card,
.log-card,
.history-card {
    gap: 12px;
}

.session-modal {
    width: min(560px, calc(100vw - 24px)) !important;
    border-radius: 8px !important;
}

@media (min-width: 1025px) {
    .layout {
        align-items: stretch;
    }

    .main-content {
        max-width: min(1540px, calc(100vw - var(--sidebar-width))) !important;
    }

    .card > .card,
    .card .card {
        box-shadow: none !important;
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 18px 14px calc(112px + var(--safe-area-bottom)) !important;
    }

    .mobile-user-bar {
        margin: -18px -14px 16px -14px !important;
    }
}

@media (max-width: 720px) {
    #titan-notify-area {
        top: auto !important;
        right: 12px !important;
        bottom: calc(92px + var(--safe-area-bottom)) !important;
        left: 12px !important;
        width: auto !important;
    }

    .titan-toast {
        padding: 12px !important;
    }

    .ops-nav,
    .intent-grid,
    .habits-list {
        gap: 6px !important;
    }

    .ops-nav {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .ops-nav::-webkit-scrollbar {
        display: none;
    }

    .ops-nav .nav-tab {
        flex: 0 0 auto;
        min-width: 116px;
        font-size: 0.72rem !important;
        padding: 10px !important;
    }

    .quick-sport-grid,
    .terrain-grid,
    .calendar-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .elite-grid,
    .planning-grid,
    .shop-grid,
    .inventory-grid,
    .stats-grid,
    .kpi-grid,
    .avatar-grid,
    .cosmetic-grid {
        grid-template-columns: 1fr !important;
    }

    .hist-card,
    .log-card,
    .history-card,
    .week-summary,
    .recovery-panel {
        align-items: stretch !important;
        gap: 10px;
    }

    .hist-card,
    .week-summary {
        flex-direction: column;
    }

    h1,
    .titular {
        font-size: clamp(1.24rem, 7vw, 1.72rem) !important;
        line-height: 1.1 !important;
    }
}

@media (max-width: 420px) {
    .main-content {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .mobile-user-bar {
        margin-left: -10px !important;
        margin-right: -10px !important;
    }

    .quick-sport-grid,
    .terrain-grid,
    .calendar-strip {
        grid-template-columns: 1fr !important;
    }

    .mobile-wallet {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
