/* ============================================================
   LAMB UNIVERSE — Design System
   assets/css/main.css
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --red:       #8B0000;
    --red-light: #c0392b;
    --red-glow:  rgba(139,0,0,0.25);
    --gold:      #d4a017;
    --gold-light:#f0c040;
    --dark:      #080808;
    --dark2:     #0f0f0f;
    --dark3:     #161616;
    --dark4:     #1e1e1e;
    --border:    #252525;
    --border2:   #2e2e2e;
    --text:      #e8e8e8;
    --text2:     #b0b0b0;
    --muted:     #6a6a6a;
    --green:     #2ecc71;
    --blue:      #3498db;
    --orange:    #e67e22;
    --yellow:    #f1c40f;
    --sidebar-w: 240px;
    --topbar-h:  60px;
    --radius:    10px;
    --radius-sm: 6px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', system-ui, Arial, sans-serif;
    background: var(--dark); color: var(--text);
    font-size: 14px; line-height: 1.5;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ══════════════════════════════════════════════════════════
   LAYOUT APP (pages authentifiées)
══════════════════════════════════════════════════════════ */

.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w); min-height: 100vh;
    background: var(--dark2);
    border-right: 1px solid var(--border);
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    overflow-y: auto; z-index: 200;
    transition: transform 0.3s;
}
.sidebar-brand {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .logo { font-size: 22px; }
.sidebar-brand .name { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-brand .sub  { font-size: 10px; color: var(--muted); }

.sidebar-user {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--red); display: flex; align-items: center;
    justify-content: center; font-size: 16px; flex-shrink: 0;
}
.sidebar-user .info .pseudo { font-size: 13px; font-weight: 600; }
.sidebar-user .info .role   { font-size: 11px; color: var(--muted); }
.sidebar-user .wallet {
    margin-left: auto; font-size: 11px; color: var(--gold);
    font-weight: 600;
}

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section {
    padding: 10px 16px 4px;
    font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text2); font-size: 13px;
    cursor: pointer; transition: all 0.15s; border-left: 3px solid transparent;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
    background: rgba(139,0,0,0.12);
    color: #fff; border-left-color: var(--red);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto; background: var(--red); color: #fff;
    font-size: 10px; padding: 1px 6px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

/* ── Main ── */
.main-content {
    margin-left: var(--sidebar-w); flex: 1;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--dark2);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-action {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--dark3); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; position: relative;
    transition: background 0.15s;
}
.topbar-action:hover { background: var(--dark4); }
.topbar-action .dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red); border: 2px solid var(--dark2);
}

/* ── Page ── */
.page { padding: 24px; flex: 1; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header p  { color: var(--muted); font-size: 13px; margin-top: 4px; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb span { color: var(--text2); }

/* ══════════════════════════════════════════════════════════
   COMPOSANTS
══════════════════════════════════════════════════════════ */

/* ── Cards ── */
.card {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.card-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; }
.card-body   { padding: 20px; }
.card-footer {
    padding: 12px 20px; border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

/* ── Stats grid ── */
.stats-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.stat-card {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card .s-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .s-value { font-size: 28px; font-weight: 800; color: #fff; margin: 4px 0; }
.stat-card .s-sub   { font-size: 12px; color: var(--muted); }
.stat-card .s-icon  { font-size: 28px; float: right; margin-top: -36px; opacity: 0.25; }
.stat-card.accent   { border-color: rgba(139,0,0,0.4); background: rgba(139,0,0,0.05); }
.stat-card.gold     { border-color: rgba(212,160,23,0.4); background: rgba(212,160,23,0.05); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    border: none; cursor: pointer; font-size: 13px;
    font-weight: 500; transition: all 0.15s; text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--red);   color: #fff; }
.btn-primary:hover  { background: var(--red-light); }
.btn-gold     { background: var(--gold);  color: #000; font-weight: 700; }
.btn-gold:hover     { background: var(--gold-light); }
.btn-success  { background: #27ae60; color: #fff; }
.btn-success:hover  { background: #2ecc71; }
.btn-ghost    { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover    { border-color: #444; color: var(--text); }
.btn-danger   { background: transparent; color: #e74c3c; border: 1px solid rgba(231,76,60,0.4); }
.btn-danger:hover   { background: rgba(231,76,60,0.1); }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 12px 28px; font-size: 15px; }
.btn-full{ width: 100%; justify-content: center; }
.btn-icon{ padding: 8px; border-radius: var(--radius-sm); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 12px; color: var(--text2);
    margin-bottom: 6px; font-weight: 500;
}
.form-control {
    width: 100%; background: var(--dark4);
    border: 1px solid var(--border2);
    color: var(--text); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: 13px;
    transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--red); }
.form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row  { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Alerts ── */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13px; display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.3); color: #2ecc71; }
.alert-error   { background: rgba(231,76,60,0.1);  border: 1px solid rgba(231,76,60,0.3);  color: #e74c3c; }
.alert-warning { background: rgba(241,196,15,0.1); border: 1px solid rgba(241,196,15,0.3); color: #f1c40f; }
.alert-info    { background: rgba(52,152,219,0.1); border: 1px solid rgba(52,152,219,0.3); color: #3498db; }

/* ── Badges ── */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
}
.badge-active    { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.badge-pending   { background: rgba(241,196,15,0.15);  color: #f1c40f; }
.badge-suspended { background: rgba(231,76,60,0.15);   color: #e74c3c; }
.badge-espoir    { background: rgba(52,152,219,0.15);  color: #3498db; }
.badge-confirme  { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.badge-vip       { background: rgba(212,160,23,0.15);  color: var(--gold); }
.badge-roi       { background: rgba(139,0,0,0.2);      color: #ff6b6b; }
.badge-simple    { background: rgba(52,152,219,0.15);  color: #74b9ff; }
.badge-frappe    { background: rgba(231,76,60,0.15);   color: #ff7675; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    padding: 10px 16px; text-align: left;
    background: rgba(0,0,0,0.3); color: var(--muted);
    font-weight: 500; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
tbody td { padding: 12px 16px; border-top: 1px solid var(--border); }
tbody tr:hover td { background: rgba(255,255,255,0.015); }

/* ── Progress bars ── */
.progress { background: var(--dark4); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-bar {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--red), var(--red-light));
    transition: width 0.5s ease;
}
.progress-gold .progress-bar, .progress-bar.progress-gold { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.progress-green .progress-bar, .progress-bar.progress-green { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.progress-blue .progress-bar, .progress-bar.progress-blue { background: linear-gradient(90deg, #2980b9, #3498db); }

/* ── Stat bars (pour les stats lutteur) ── */
.stat-bar { margin-bottom: 12px; }
.stat-bar-header {
    display: flex; justify-content: space-between; margin-bottom: 4px;
    font-size: 12px;
}
.stat-bar-header .name { color: var(--text2); }
.stat-bar-header .val  { color: #fff; font-weight: 600; }

/* ── Fighter card ── */
.fighter-card {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all 0.2s; cursor: pointer;
}
.fighter-card:hover { border-color: var(--red); transform: translateY(-2px); }
.fighter-card .fc-img {
    height: 120px; background: linear-gradient(135deg, var(--dark4), var(--dark2));
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
}
.fighter-card .fc-body { padding: 14px; }
.fighter-card .fc-name { font-weight: 700; font-size: 15px; }
.fighter-card .fc-nick { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fighter-card .fc-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.fighter-card .fc-record { font-size: 12px; color: var(--text2); }
.fighter-card .fc-record .w { color: var(--green); }
.fighter-card .fc-record .l { color: #e74c3c; }

/* ── Combat screen ── */
.combat-arena {
    background: radial-gradient(ellipse at center, #1a0505 0%, var(--dark) 70%);
    border: 1px solid rgba(139,0,0,0.3);
    border-radius: var(--radius); padding: 24px;
    text-align: center;
}
.fighters-vs {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 20px; margin-bottom: 24px;
}
.fighter-side .f-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--dark4); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 10px;
}
.fighter-side.left .f-avatar  { border-color: var(--red); }
.fighter-side.right .f-avatar { border-color: var(--blue); }
.fighter-side .f-name { font-weight: 700; font-size: 15px; }
.fighter-side .f-level{ font-size: 11px; color: var(--muted); }
.vs-badge {
    font-size: 28px; font-weight: 900; color: var(--red);
    text-shadow: 0 0 20px rgba(139,0,0,0.5);
}
.endurance-bar { margin-top: 8px; }

/* ── Combat log ── */
.combat-log {
    background: var(--dark); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px;
    max-height: 200px; overflow-y: auto;
    font-family: monospace; font-size: 12px;
}
.log-line { padding: 3px 0; border-bottom: 1px solid var(--border); }
.log-line:last-child { border-bottom: none; }
.log-line.win    { color: var(--green); }
.log-line.hit    { color: #ff9999; }
.log-line.miss   { color: var(--muted); }
.log-line.event  { color: var(--gold); font-weight: 600; }

/* ── Map ── */
.map-container {
    position: relative; background: var(--dark3);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
}
.map-region {
    position: absolute; cursor: pointer;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; text-align: center;
    background: rgba(139,0,0,0.3); border: 2px solid rgba(139,0,0,0.5);
    transform: translate(-50%, -50%);
    transition: all 0.2s; z-index: 2;
}
.map-region:hover {
    background: rgba(139,0,0,0.6); border-color: var(--red);
    transform: translate(-50%,-50%) scale(1.2);
    z-index: 3;
}
.map-tooltip {
    position: absolute; background: var(--dark4);
    border: 1px solid var(--border); padding: 6px 10px;
    border-radius: 4px; font-size: 11px; pointer-events: none;
    white-space: nowrap; z-index: 10;
}

/* ── Mystique ── */
.mystic-object {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; cursor: pointer;
    transition: all 0.2s;
}
.mystic-object:hover { border-color: rgba(212,160,23,0.5); }
.mystic-object .mo-icon { font-size: 32px; margin-bottom: 8px; }
.mystic-object .mo-name { font-weight: 600; font-size: 14px; }
.mystic-object .mo-rarity {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    margin-top: 4px;
}
.rarity-common    { color: var(--muted); }
.rarity-rare      { color: var(--blue); }
.rarity-epic      { color: #9b59b6; }
.rarity-legendary { color: var(--gold); }

/* ── Notifications ── */
.notif-item {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    display: flex; gap: 12px; cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item.unread { background: rgba(139,0,0,0.05); border-left: 3px solid var(--red); }
.notif-icon { font-size: 22px; flex-shrink: 0; }
.notif-body .notif-title { font-size: 13px; font-weight: 600; }
.notif-body .notif-text  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-body .notif-time  { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Chat ── */
.chat-layout { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - var(--topbar-h) - 48px); }
.chat-sidebar { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-conv-item {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    cursor: pointer; display: flex; gap: 10px; align-items: center;
}
.chat-conv-item:hover  { background: rgba(255,255,255,0.03); }
.chat-conv-item.active { background: rgba(139,0,0,0.1); border-left: 3px solid var(--red); }
.chat-main { display: flex; flex-direction: column; }
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.msg-bubble {
    max-width: 70%; padding: 10px 14px; border-radius: 12px;
    font-size: 13px; line-height: 1.5;
}
.msg-bubble.mine { background: rgba(139,0,0,0.25); border: 1px solid rgba(139,0,0,0.3); align-self: flex-end; }
.msg-bubble.theirs{ background: var(--dark4); border: 1px solid var(--border); align-self: flex-start; }
.chat-input-bar {
    padding: 12px 16px; border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}

/* ── Shop ── */
.shop-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shop-item {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; text-align: center;
    transition: all 0.2s;
}
.shop-item:hover { border-color: var(--gold); transform: translateY(-3px); }
.shop-item .si-icon { font-size: 40px; margin-bottom: 12px; }
.shop-item .si-name { font-weight: 700; margin-bottom: 6px; }
.shop-item .si-desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.shop-item .si-price { color: var(--gold); font-weight: 700; font-size: 16px; }
.shop-item .si-cat {
    font-size: 10px; color: var(--muted); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 4px;
}

/* ── Spinner / Loading ── */
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border2);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-page {
    min-height: 300px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    color: var(--muted);
}

/* ── Modals ── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.75); z-index: 500;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: 12px; width: 100%; max-width: 500px;
    max-height: 90vh; overflow-y: auto;
}
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 20px; }
.modal-footer {
    padding: 14px 20px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 18px; font-size: 13px; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: all 0.15s; margin-bottom: -1px;
}
.tab:hover  { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--red); }

/* ── Empty state ── */
.empty-state {
    padding: 48px 20px; text-align: center; color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════════ */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139,0,0,0.1) 0%, transparent 60%),
        var(--dark);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-card {
    background: var(--dark3); border: 1px solid var(--border);
    border-radius: 14px; width: 100%; max-width: 420px;
    overflow: hidden;
}
.auth-card-header {
    background: linear-gradient(135deg, var(--dark2), rgba(139,0,0,0.15));
    padding: 28px 28px 20px; text-align: center;
    border-bottom: 1px solid var(--border);
}
.auth-card-header .logo  { font-size: 40px; margin-bottom: 8px; }
.auth-card-header h1     { font-size: 22px; font-weight: 800; }
.auth-card-header p      { color: var(--muted); font-size: 13px; margin-top: 4px; }
.auth-card-body          { padding: 28px; }
.auth-divider {
    text-align: center; color: var(--muted); font-size: 12px;
    position: relative; margin: 16px 0;
}
.auth-divider::before, .auth-divider::after {
    content: ''; position: absolute; top: 50%; width: calc(50% - 20px);
    height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-link { color: var(--red); font-weight: 500; }
.auth-link:hover { color: var(--red-light); text-decoration: underline; }

/* ── Role cards ── */
.role-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-select-card {
    background: var(--dark4); border: 2px solid var(--border);
    border-radius: 10px; padding: 20px; text-align: center;
    cursor: pointer; transition: all 0.2s;
}
.role-select-card:hover    { border-color: var(--red); }
.role-select-card.selected { border-color: var(--red); background: rgba(139,0,0,0.1); }
.role-select-card .r-icon  { font-size: 32px; margin-bottom: 8px; }
.role-select-card .r-name  { font-weight: 700; font-size: 14px; }
.role-select-card .r-desc  { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .api-grid { grid-template-columns: 1fr; }
}

/* ── Mobile bottom nav (app-like) ── */
.mobile-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--dark2); border-top: 1px solid var(--border);
    z-index: 300; padding: 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-items {
    display: flex; justify-content: space-around; align-items: center;
}
.mobile-nav-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 6px 10px; cursor: pointer;
    color: var(--muted); font-size: 10px; transition: color 0.15s;
    text-decoration: none; position: relative;
}
.mobile-nav-item .icon { font-size: 20px; }
.mobile-nav-item:hover, .mobile-nav-item.active { color: var(--red); }
.mobile-nav-item .nav-badge {
    position: absolute; top: 2px; right: 2px;
    font-size: 9px; padding: 0 4px; min-width: 14px;
}

/* ── Pull to refresh indicator ── */
.ptr-indicator {
    text-align: center; padding: 12px; color: var(--muted);
    font-size: 12px; display: none;
}

/* ── Toast notifications (app-like) ── */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 1000; display: flex; flex-direction: column; gap: 8px;
    max-width: 360px;
}
.toast {
    padding: 12px 16px; border-radius: 8px;
    font-size: 13px; animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3s forwards;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast-success { background: #27ae60; color: #fff; }
.toast-error   { background: #e74c3c; color: #fff; }
.toast-info    { background: var(--dark4); border: 1px solid var(--border); color: var(--text); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; pointer-events: none; }
}

/* ── Transition pages (app-like) ── */
.page-transition {
    animation: fadeInUp 0.25s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton loading (app-like) ── */
.skeleton {
    background: linear-gradient(90deg, var(--dark3) 25%, var(--dark4) 50%, var(--dark3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Swipeable tabs (app-like) ── */
.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; }

/* ── Floating action button ── */
.fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer; z-index: 250;
    box-shadow: 0 4px 16px rgba(139,0,0,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(139,0,0,0.7); }

/* ── Haptic feedback simulation ── */
.btn:active, .nav-item:active, .fighter-card:active, .tab:active {
    transform: scale(0.97);
}
.fighter-card:active { transform: scale(0.98); }

/* ── Better touch targets ── */
.btn { min-height: 40px; }
.nav-item { min-height: 44px; }

/* ── Status bar spacing ── */
.safe-top { padding-top: env(safe-area-inset-top, 0); }

/* ── Improved mobile responsiveness ── */
@media (max-width: 900px) {
    .mobile-nav { display: block; }
    .page { padding: 16px; padding-bottom: 80px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card .s-value { font-size: 22px; }
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .fighters-vs { gap: 12px; }
    .fighter-side .f-avatar { width: 60px; height: 60px; font-size: 28px; }
    .vs-badge { font-size: 22px; }
    .modal { max-width: 95vw; margin: 10px; }
    .fab { bottom: 80px; } /* Above mobile nav */
    .toast-container { top: auto; bottom: 80px; right: 10px; left: 10px; max-width: 100%; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .page-header h2 { font-size: 18px; }
    .role-select-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 12px; }
    .stat-card .s-value { font-size: 20px; }
    .card-body { padding: 14px; }
    .chat-messages { padding: 10px; }
    .msg-bubble { max-width: 85%; }
}

/* ── Utilities ── */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-gold  { color: var(--gold); }
.text-red   { color: var(--red-light); }
.text-green { color: var(--green); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.font-bold  { font-weight: 700; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.w-full     { width: 100%; }
.text-center{ text-align: center; }
