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

:root {
    /* Palette inspired by the logo: shield blue, gold, fire orange, flag red */
    --bg-dark: #0b0d1a;
    --bg-dark-2: #0f1225;
    --bg-card: #151938;
    --bg-card-border: #252a5a;
    --bg-input: #0e1130;
    --bg-input-border: #2a2f62;
    --bg-input-focus: #3b6dff;

    --gold: #ffcc00;
    --gold-dark: #cc8800;
    --gold-glow: rgba(255, 204, 0, 0.35);
    --blue: #3b8bff;
    --blue-dark: #1a4fa0;
    --blue-light: #5ebaff;
    --blue-glow: rgba(59, 139, 255, 0.3);
    --red: #ff3d3d;
    --red-dark: #b02020;
    --red-glow: rgba(255, 61, 61, 0.3);
    --green: #3ddc84;
    --green-dark: #22a55e;
    --orange: #ff8c1a;
    --orange-glow: rgba(255, 140, 26, 0.4);

    --text: #f0f0f5;
    --text-muted: #8088b0;
    --text-gold: #ffe066;

    --radius: 14px;
    --radius-lg: 20px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

/* ============================================================
   ANIMATED BACKGROUND (auth pages)
   ============================================================ */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #151d45 0%, #0b0d1a 70%);
}

.auth-bg::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 140, 26, 0.12) 0%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite;
}

.auth-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(to top, #0b0d1a 0%, transparent 100%);
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* Floating particles */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-up 6s ease-in infinite;
}

.particle:nth-child(1)  { left: 10%; animation-delay: 0s;    animation-duration: 5s; }
.particle:nth-child(2)  { left: 20%; animation-delay: 1.2s;  animation-duration: 7s; }
.particle:nth-child(3)  { left: 35%; animation-delay: 0.5s;  animation-duration: 6s; }
.particle:nth-child(4)  { left: 50%; animation-delay: 2s;    animation-duration: 5.5s; }
.particle:nth-child(5)  { left: 65%; animation-delay: 0.8s;  animation-duration: 6.5s; }
.particle:nth-child(6)  { left: 78%; animation-delay: 1.5s;  animation-duration: 5s; }
.particle:nth-child(7)  { left: 88%; animation-delay: 3s;    animation-duration: 7s; }
.particle:nth-child(8)  { left: 45%; animation-delay: 2.5s;  animation-duration: 6s; }
.particle:nth-child(9)  { left: 5%;  animation-delay: 3.5s;  animation-duration: 5.5s; }
.particle:nth-child(10) { left: 92%; animation-delay: 0.3s;  animation-duration: 6.8s; }

@keyframes float-up {
    0%   { bottom: -10px; opacity: 0; transform: scale(0.5); }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.2; }
    100% { bottom: 100%; opacity: 0; transform: scale(1.2); }
}


/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
.auth-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-logo-img {
    width: 260px;
    max-width: 70vw;
    height: auto;
    margin-bottom: 6px;
    filter: drop-shadow(0 8px 30px rgba(255, 140, 26, 0.3));
    animation: logo-entrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes logo-entrance {
    from { opacity: 0; transform: translateY(-30px) scale(0.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 0.3px;
    animation: fade-in 1s ease 0.3s both;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Auth form card */
.auth-form {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(165deg, rgba(21, 25, 56, 0.9), rgba(15, 18, 37, 0.95));
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow:
        0 2px 0 0 rgba(37, 42, 90, 0.6),
        0 8px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: card-entrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes card-entrance {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input groups */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-group input {
    background: var(--bg-input);
    border: 2px solid var(--bg-input-border);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.input-group input::placeholder {
    color: #484e78;
}

.input-group input:focus {
    border-color: var(--blue);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 0 3px var(--blue-glow);
}


/* ============================================================
   BUTTONS — Game Style (3D push effect)
   ============================================================ */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.btn:active {
    transform: translateY(2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary: Gold gradient like the logo text */
.btn-primary {
    background: linear-gradient(180deg, #ffcc00 0%, #e6a000 50%, #cc8800 100%);
    color: #1a1200;
    text-shadow: 0 1px 0 rgba(255, 255, 200, 0.4);
    box-shadow:
        0 4px 0 0 #996600,
        0 6px 20px rgba(255, 170, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffdd33 0%, #f0b000 50%, #dd9900 100%);
    box-shadow:
        0 4px 0 0 #aa7700,
        0 8px 28px rgba(255, 170, 0, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    box-shadow:
        0 1px 0 0 #996600,
        0 2px 10px rgba(255, 170, 0, 0.2);
    transform: translateY(2px);
}

/* Danger: Red like the flags */
.btn-danger {
    background: linear-gradient(180deg, #ff5050 0%, #e03030 50%, #c02020 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow:
        0 4px 0 0 #801515,
        0 6px 20px var(--red-glow);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #ff6666 0%, #f04040 50%, #d03030 100%);
    transform: translateY(-1px);
}

.btn-danger:active {
    box-shadow: 0 1px 0 0 #801515;
    transform: translateY(2px);
}

/* Ghost: outlined, blue tint */
.btn-ghost {
    background: rgba(59, 139, 255, 0.08);
    color: var(--blue-light);
    border: 2px solid rgba(59, 139, 255, 0.3);
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(59, 139, 255, 0.15);
    border-color: rgba(59, 139, 255, 0.5);
}

.btn-small {
    padding: 10px 18px;
    font-size: 0.8rem;
    border-radius: 10px;
}

.btn-small.btn-primary {
    box-shadow:
        0 3px 0 0 #996600,
        0 4px 14px rgba(255, 170, 0, 0.2);
}


/* ============================================================
   AUTH LINK
   ============================================================ */
.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    animation: fade-in 1s ease 0.6s both;
}

.auth-link a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: #ffe066;
    text-decoration: underline;
}


/* ============================================================
   ERROR MSG
   ============================================================ */
.error-msg {
    background: rgba(255, 61, 61, 0.1);
    border: 1px solid rgba(255, 61, 61, 0.25);
    color: #ff6b6b;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: none;
}

.error-msg.visible {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}


/* ============================================================
   MAP PAGE
   ============================================================ */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Top bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: max(env(safe-area-inset-top), 12px);
    background: linear-gradient(to bottom, rgba(11, 13, 26, 0.95) 0%, rgba(11, 13, 26, 0.6) 70%, transparent 100%);
    pointer-events: none;
}

.top-bar > * {
    pointer-events: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    padding: 8px 16px;
    border-radius: 24px;
    border: 2px solid var(--bg-card-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #6d3dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(59, 139, 255, 0.3);
}

.zone-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.zone-count strong {
    color: var(--gold);
    font-size: 1rem;
}

.top-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.icon-btn:hover {
    border-color: var(--blue);
    box-shadow: 0 2px 14px var(--blue-glow);
}

.icon-btn.has-badge {
    position: relative;
}

.icon-btn.has-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--bg-dark);
}

/* Plant flag button (FAB) */
.fab {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(180deg, #ffcc00 0%, #e6a000 50%, #cc8800 100%);
    border: none;
    border-radius: 28px;
    color: #1a1200;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow:
        0 5px 0 0 #996600,
        0 8px 30px rgba(255, 170, 0, 0.35);
    transition: all 0.15s ease;
}

.fab:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow:
        0 7px 0 0 #996600,
        0 12px 40px rgba(255, 170, 0, 0.45);
}

.fab:active {
    transform: translateX(-50%) translateY(3px);
    box-shadow:
        0 1px 0 0 #996600,
        0 3px 12px rgba(255, 170, 0, 0.2);
}

.fab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: translateX(-50%);
}

/* ============================================================
   VIRTUAL D-PAD
   ============================================================ */
.dpad-toggle {
    position: fixed;
    z-index: 1001;
    display: none; /* shown via JS for admin users */
    /* Same size & style as Leaflet zoom buttons */
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid #252a5a;
    background: linear-gradient(165deg, #151938, #111433);
    color: #f0f0f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    /* Align with Leaflet zoom controls */
    right: 10px;
    /* Positioned above zoom controls: bottom-nav(60) + leaflet-push(80) + margin(10) + zoom-buttons(36+4+36) + gap(10) */
    bottom: 176px;
}
.dpad-toggle:hover {
    border-color: #3b8bff;
}
.dpad-toggle.active {
    border-color: #ff6b35;
    color: #ff6b35;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.25);
}
.dpad-toggle:active {
    transform: scale(0.92);
}

.dpad-container {
    position: fixed;
    bottom: 220px;
    right: 6px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dpad-status {
    font-size: 0.6rem;
    font-weight: 800;
    color: #ff6b35;
    background: rgba(11, 13, 26, 0.85);
    padding: 2px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.dpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(3, 38px);
    gap: 3px;
}

.dpad-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(165deg, #1a1f50, #111433);
    color: #ccc;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
.dpad-btn:active {
    background: rgba(59, 139, 255, 0.2);
    border-color: var(--blue);
    transform: scale(0.9);
    color: #fff;
}

.dpad-center {
    background: linear-gradient(165deg, #1a2850, #111833);
    border-color: rgba(59, 139, 255, 0.2);
    font-size: 0.9rem;
}
.dpad-center:active {
    background: rgba(59, 139, 255, 0.3);
}

.dpad-spacer {
    width: 38px;
    height: 38px;
}


/* ============================================================
   BOTTOM SHEET
   ============================================================ */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: linear-gradient(165deg, #181d45, #111433);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 2px solid var(--bg-card-border);
    padding: 20px;
    padding-bottom: max(env(safe-area-inset-bottom), 24px);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.bottom-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 42px;
    height: 4px;
    background: var(--bg-card-border);
    border-radius: 2px;
    margin: 0 auto 18px;
}

.zone-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.zone-detail-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-gold);
}

.zone-detail-owner {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2px;
}

.zone-detail-stats {
    display: flex;
    gap: 24px;
    margin: 16px 0;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.zone-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.zone-actions .btn {
    flex: 1;
}


/* ============================================================
   MODAL (plant flag)
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: linear-gradient(165deg, #1a1f50, #111433);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    border: 2px solid var(--bg-card-border);
    box-shadow:
        0 4px 0 0 rgba(37, 42, 90, 0.5),
        0 16px 60px rgba(0, 0, 0, 0.6);
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h2 {
    margin-bottom: 18px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal .input-group {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
}


/* ============================================================
   FRIENDS PAGE
   ============================================================ */
.page {
    min-height: 100vh;
    padding: 20px;
    padding-top: max(env(safe-area-inset-top), 20px);
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-dark);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--blue);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.friend-card {
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.friend-card:hover {
    border-color: #3a3f7a;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.friend-name {
    font-weight: 700;
    font-size: 1rem;
}

.friend-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.friend-actions {
    display: flex;
    gap: 8px;
}

.section-title {
    font-size: 0.75rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--bg-card-border), transparent);
}

.add-friend-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.add-friend-form input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid var(--bg-input-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.25s;
}

.add-friend-form input::placeholder {
    color: #484e78;
}

.add-friend-form input:focus {
    border-color: var(--blue);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.3),
        0 0 0 3px var(--blue-glow);
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    z-index: 3000;
    background: linear-gradient(165deg, #1a1f50, #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 14px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90%;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(61, 220, 132, 0.4);
    color: var(--green);
}

.toast.error {
    border-color: rgba(255, 61, 61, 0.4);
    color: #ff6b6b;
}


/* ============================================================
   ZONE MARKERS
   ============================================================ */
.zone-marker {
    position: relative;
}

.zone-marker-own {
    filter: hue-rotate(120deg) brightness(1.3);
}

.zone-marker-secured {
    filter: hue-rotate(45deg) brightness(1.5) saturate(1.5);
}


/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--bg-card-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ============================================================
   SCROLLBAR (subtle)
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-border);
    border-radius: 3px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 420px) {
    .auth-logo-img {
        width: 200px;
    }
    .auth-form {
        padding: 22px 18px;
    }
    .fab {
        padding: 14px 24px;
        font-size: 0.9rem;
    }
    .zone-detail-stats {
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .auth-logo-img {
        width: 320px;
    }
    .auth-form {
        max-width: 440px;
        padding: 36px 32px;
    }
}


/* ============================================================
   BOTTOM NAVIGATION BAR
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    display: flex;
    background: linear-gradient(165deg, #151938, #0e1130);
    border-top: 2px solid var(--bg-card-border);
    padding: 6px 0;
    padding-bottom: max(env(safe-area-inset-bottom), 6px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--text);
}

.nav-item.active {
    color: var(--gold);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 6px var(--gold-glow));
}

/* Adjust FAB position when bottom nav is present */
body:has(.bottom-nav) .fab {
    bottom: 90px;
}

body:has(.bottom-nav) .bottom-sheet {
    padding-bottom: 80px;
}

/* Push Leaflet zoom controls above bottom nav */
.leaflet-bottom.leaflet-right {
    bottom: 80px;
}


/* ============================================================
   XP BAR (mini, in top bar)
   ============================================================ */
.xp-bar-mini {
    width: 80px;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.xp-label {
    font-size: 0.65rem;
    color: var(--blue-light);
    font-weight: 700;
    margin-top: 1px;
}

.user-avatar.premium {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Make user-info clickable */
.user-info {
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.user-info:active {
    transform: scale(0.96);
}

/* ============================================================
   EXPANDED USER CARD
   ============================================================ */
.user-card-expanded {
    position: relative;
    width: 92%;
    max-width: 360px;
    background: linear-gradient(165deg, #151938 0%, #111433 50%, #0e1028 100%);
    border: 2px solid var(--bg-card-border);
    border-radius: 20px;
    padding: 24px 20px 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(59, 139, 255, 0.08);
    animation: cardExpand 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardExpand {
    0% { transform: scale(0.7) translateY(-30px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.user-card-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.user-card-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.user-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #6d3dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(59, 139, 255, 0.35);
    flex-shrink: 0;
}

.user-card-avatar.premium {
    border-color: var(--gold);
    box-shadow: 0 4px 16px var(--gold-glow);
}

.user-card-identity {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-clan {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.user-card-clan .clan-tag {
    color: var(--blue-light);
    font-weight: 700;
}

.user-card-level-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.user-card-level {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-light);
}

.user-card-class {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
}

.user-card-xp-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.user-card-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.user-card-xp-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 16px;
}

.user-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.user-card-stat-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 10px 4px;
    text-align: center;
}

.user-card-stat-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.user-card-stat-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.user-card-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-card-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.user-card-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
}

.user-card-action-btn:hover,
.user-card-action-btn:active {
    background: rgba(59, 139, 255, 0.1);
    border-color: rgba(59, 139, 255, 0.3);
    color: #fff;
}

.user-card-action-btn.premium-btn {
    background: rgba(255, 195, 0, 0.08);
    border-color: rgba(255, 195, 0, 0.15);
    color: var(--gold);
}
.user-card-action-btn.premium-btn:hover {
    background: rgba(255, 195, 0, 0.15);
    border-color: rgba(255, 195, 0, 0.3);
}

.user-card-action-btn.premium-active {
    background: rgba(255, 195, 0, 0.12);
    border-color: var(--gold);
    color: var(--gold);
}

.user-card-action-btn.admin-btn {
    grid-column: 1 / -1;
    background: rgba(255, 60, 60, 0.1);
    border-color: rgba(255, 60, 60, 0.25);
    color: #ff6b6b;
}
.user-card-action-btn.admin-btn:hover,
.user-card-action-btn.admin-btn:active {
    background: rgba(255, 60, 60, 0.2);
    border-color: rgba(255, 60, 60, 0.5);
    color: #ff4444;
}


/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.admin-tab {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-tab.active {
    background: rgba(255, 60, 60, 0.12);
    border-color: rgba(255, 60, 60, 0.4);
    color: #ff6b6b;
}

/* Search bar */
.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.admin-search-bar .input-field {
    flex: 1;
}
.admin-user-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* User list */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    transition: background 0.15s;
}
.admin-user-row:hover {
    background: rgba(255,255,255,0.06);
}
.admin-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), #6d3dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}
.admin-user-avatar.premium {
    background: linear-gradient(135deg, var(--gold), #ff8c1a);
}
.admin-user-info {
    flex: 1;
    min-width: 0;
}
.admin-user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-user-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.admin-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 60, 60, 0.2);
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.premium-badge {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 195, 0, 0.15);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pagination */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Edit modal */
.admin-edit-card {
    position: relative;
    width: 92%;
    max-width: 400px;
    background: linear-gradient(165deg, #151938 0%, #111433 50%, #0e1028 100%);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 24px 20px 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: cardExpand 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 80vh;
    overflow-y: auto;
}
.admin-edit-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}
.admin-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.admin-edit-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-edit-row label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.admin-edit-input-group {
    display: flex;
    gap: 6px;
}
.admin-edit-input-group .input-field {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.85rem;
}
.admin-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Settings */
.admin-settings-category {
    margin-bottom: 20px;
}
.admin-settings-cat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 60, 60, 0.15);
}
.admin-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.admin-setting-info {
    flex: 1;
    min-width: 0;
}
.admin-setting-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 600;
}
.admin-setting-key {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: monospace;
}
.admin-setting-input-group {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.admin-setting-input-group .input-field {
    width: 80px;
    padding: 6px 8px;
    font-size: 0.85rem;
    text-align: right;
}

/* Stats panel */
.admin-stats-period {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.admin-stats-quick-btns {
    display: flex;
    gap: 6px;
}
.admin-stats-quick-btns .stats-period-btn.active {
    background: rgba(255, 60, 60, 0.15);
    border-color: rgba(255, 60, 60, 0.4);
    color: #ff6b6b;
}
.admin-stats-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-stats-date-range .input-field {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.8rem;
}
.admin-stats-date-range span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Stats grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 520px) {
    .admin-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 700px) {
    .admin-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.admin-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    transition: background 0.15s;
}
.admin-stat-card:hover {
    background: rgba(255,255,255,0.06);
}
.admin-stat-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
}
.admin-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.admin-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================================
   LOOT GRID (chest rewards)
   ============================================================ */
.chest-modal h2 {
    text-align: center;
}

.chest-anim {
    font-size: 4rem;
    text-align: center;
    animation: chest-shake 0.5s ease infinite;
}

@keyframes chest-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.loot-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    animation: loot-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.loot-item:nth-child(1) { animation-delay: 0s; }
.loot-item:nth-child(2) { animation-delay: 0.1s; }
.loot-item:nth-child(3) { animation-delay: 0.2s; }
.loot-item:nth-child(4) { animation-delay: 0.3s; }

@keyframes loot-pop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.loot-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.loot-name {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.loot-qty {
    font-size: 0.7rem;
    color: var(--text-muted);
}


/* ============================================================
   TABS COMPONENT
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tab.active {
    background: linear-gradient(165deg, var(--bg-card), #1a1f55);
    color: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab:hover:not(.active) {
    color: var(--text);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* ============================================================
   GENERIC CARD (reusable)
   ============================================================ */
.card {
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #3a3f7a;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.card-row:last-child {
    border-bottom: none;
}


/* ============================================================
   CLAN PAGE
   ============================================================ */
.clan-header {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.clan-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.clan-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-gold);
    margin-bottom: 4px;
}

.clan-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.clan-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.clan-stat {
    text-align: center;
}

.clan-stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
}

.clan-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.member-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.member-role {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
}

.clan-search-list {
    max-height: 400px;
    overflow-y: auto;
}

.create-clan-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-row input[type="color"] {
    width: 44px;
    height: 44px;
    border: 2px solid var(--bg-card-border);
    border-radius: 10px;
    background: var(--bg-input);
    cursor: pointer;
    padding: 2px;
}


/* ============================================================
   INVENTORY PAGE
   ============================================================ */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.inv-item {
    position: relative;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.inv-item:hover {
    border-color: #3a3f7a;
    transform: translateY(-2px);
}

.inv-item-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.inv-item-name {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.inv-item-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.inv-item-rarity {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
}

.rarity-common { color: #8088b0; border: 1px solid rgba(128,136,176,0.3); }
.rarity-rare { color: #3b8bff; border: 1px solid rgba(59,139,255,0.3); }
.rarity-epic { color: #c026d3; border: 1px solid rgba(192,38,211,0.3); }
.rarity-legendary { color: #ffcc00; border: 1px solid rgba(255,204,0,0.3); }

.active-effects {
    margin-bottom: 20px;
}

.effect-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(59, 139, 255, 0.08);
    border: 1px solid rgba(59, 139, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 8px;
}

.effect-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.effect-icon {
    font-size: 1.5rem;
}

.effect-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.effect-timer {
    font-size: 0.8rem;
    color: var(--blue-light);
    font-weight: 600;
}


/* ============================================================
   CHAT PAGE
   ============================================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.convo-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.convo-card:hover {
    border-color: #3a3f7a;
}

.convo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.convo-avatar.clan {
    background: linear-gradient(135deg, var(--blue), #6d3dff);
}

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

.convo-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.convo-last-msg {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.convo-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Chat view toggle */
.chat-view-hidden {
    display: none !important;
    flex: 1;
    flex-direction: column;
}
.chat-view-visible {
    display: flex !important;
    flex: 1;
    flex-direction: column;
}

/* Chat messages view */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.msg-own {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-other {
    align-self: flex-start;
    background: linear-gradient(165deg, var(--bg-card), #1a1f55);
    border: 1px solid var(--bg-card-border);
    border-bottom-left-radius: 4px;
}

.msg-sender {
    font-size: 0.7rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 3px;
}

.msg-time {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-align: right;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--bg-card-border);
}

.chat-input-bar input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid var(--bg-input-border);
    border-radius: 24px;
    padding: 12px 18px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-bar input:focus {
    border-color: var(--blue);
}

.chat-input-bar input::placeholder {
    color: #484e78;
}

.chat-send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffcc00 0%, #cc8800 100%);
    border: none;
    color: #1a1200;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 0 #996600;
    transition: all 0.15s;
}

.chat-send-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 #996600;
}


/* ============================================================
   LEADERBOARD PAGE
   ============================================================ */
.rank-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.rank-card.top-1 {
    border-color: rgba(255, 204, 0, 0.4);
    background: linear-gradient(165deg, rgba(255, 204, 0, 0.08), #111433);
}

.rank-card.top-2 {
    border-color: rgba(192, 192, 192, 0.3);
}

.rank-card.top-3 {
    border-color: rgba(205, 127, 50, 0.3);
}

.rank-card.is-me {
    border-color: rgba(59, 139, 255, 0.4);
    background: linear-gradient(165deg, rgba(59, 139, 255, 0.08), #111433);
}

.rank-position {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rank-position.gold { color: var(--gold); }
.rank-position.silver { color: #c0c0c0; }
.rank-position.bronze { color: #cd7f32; }

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

.rank-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.rank-clan-tag {
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 4px;
}

.rank-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.rank-score {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gold);
    flex-shrink: 0;
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.period-selector select {
    background: var(--bg-input);
    border: 2px solid var(--bg-input-border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.period-selector select:focus {
    border-color: var(--blue);
}


/* ============================================================
   PREMIUM PAGE
   ============================================================ */
.premium-hero {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 24px;
}

.premium-crown {
    font-size: 4rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 20px var(--gold-glow));
}

.premium-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-gold);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.premium-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.premium-benefits {
    margin-bottom: 24px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.benefit-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.benefit-text {
    flex: 1;
}

.benefit-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.benefit-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.premium-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.plan-card {
    background: linear-gradient(165deg, var(--bg-card), #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.plan-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.plan-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

.plan-card.popular::before {
    content: 'POPULAIRE';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    color: #1a1200;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.plan-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-gold);
    margin-bottom: 4px;
}

.plan-period {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.plan-savings {
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 600;
    margin-top: 8px;
}

.premium-active-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(165deg, rgba(255, 204, 0, 0.1), rgba(255, 204, 0, 0.02));
    border: 2px solid rgba(255, 204, 0, 0.3);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.premium-active-badge .badge-icon {
    font-size: 1.8rem;
}

.premium-active-badge .badge-text {
    font-weight: 700;
    color: var(--text-gold);
}

.premium-active-badge .badge-until {
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 60px;
    padding: 20px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text);
}

.empty-state-desc {
    font-size: 0.9rem;
}


/* ============================================================
   PAGE WITH PADDING BOTTOM (for bottom nav)
   ============================================================ */
.page-padded {
    padding-bottom: 80px;
}

/* ============================================================
   NOTIFICATION PANEL & BADGE
   ============================================================ */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notif-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 300px;
    max-height: 400px;
    background: var(--bg-card);
    border: 2px solid var(--bg-card-border);
    border-radius: var(--radius);
    z-index: 2001;
    overflow-y: auto;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.notif-panel.open {
    display: block;
}

.notif-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-card-border);
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: rgba(59,139,255,0.05);
}

.notif-item.unread {
    border-left: 3px solid var(--blue);
    background: rgba(59,139,255,0.08);
}

.notif-title {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.notif-body {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ============================================================
   COMBAT MODAL & ARENA
   ============================================================ */
.combat-modal {
    max-width: 420px;
    width: 95%;
}

.combat-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.combat-stat-card {
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.combat-stat-card.attack {
    border-color: var(--blue);
    background: rgba(59,139,255,0.08);
}

.combat-stat-card.defense {
    border-color: var(--red);
    background: rgba(255,61,61,0.08);
}

.combat-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.combat-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 2px;
}

.combat-items-list {
    max-height: 150px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.combat-item-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: border-color 0.2s;
}

.combat-item-check:hover {
    border-color: var(--blue);
}

.combat-item-check input[type="checkbox"] {
    accent-color: var(--blue);
}

.combat-item-icon {
    font-size: 1.2rem;
}

.combat-item-name {
    flex: 1;
    font-weight: 600;
}

.combat-item-qty {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Combat Arena */
.combat-header {
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.combat-arena {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 0;
}

.combat-side {
    flex: 1;
    text-align: center;
    position: relative;
}

.combat-avatar {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.combat-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.combat-vs {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--red);
    text-shadow: 0 0 10px rgba(255,61,61,0.5);
}

.hp-bar-container {
    width: 100%;
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--bg-card-border);
}

.hp-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease, background 0.3s;
}

.hp-text {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 3px;
    color: var(--text-muted);
}

.combat-log {
    max-height: 120px;
    overflow-y: auto;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    padding: 8px;
    margin: 8px 0;
    font-size: 0.75rem;
    line-height: 1.5;
}

.combat-log-entry {
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.combat-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 8px;
}

/* Damage numbers */
.damage-number {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--red);
    pointer-events: none;
    animation: damage-float 1.2s ease-out forwards;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.damage-number.crit {
    color: var(--gold);
    font-size: 1.8rem;
}

@keyframes damage-float {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
}

/* Hit shake */
.hit-shake {
    animation: hit-shake 0.4s ease-out;
}

@keyframes hit-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Victory / Defeat */
.combat-victory, .combat-defeat {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.victory-icon, .defeat-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.combat-victory h2 {
    color: var(--gold);
    font-size: 1.8rem;
    text-shadow: 0 0 20px rgba(255,204,0,0.5);
}

.combat-defeat h2 {
    color: var(--red);
    font-size: 1.8rem;
}

.combat-victory p, .combat-defeat p {
    color: var(--text-muted);
    margin: 10px 0 20px;
}

/* Confetti */
.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: confetti-fall linear forwards;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% { top: -10px; opacity: 1; transform: rotate(0deg); }
    100% { top: 100%; opacity: 0; transform: rotate(720deg); }
}

/* ============================================================
   INPUT FIELD (select styling)
   ============================================================ */
.input-field, select.input-field {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 2px solid var(--bg-input-border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    appearance: auto;
}

.input-field:focus, select.input-field:focus {
    outline: none;
    border-color: var(--bg-input-focus);
}

select.input-field option {
    background: var(--bg-card);
    color: var(--text);
}

/* ── Language selector ── */
.lang-selector {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    border: 2px solid var(--bg-input-border);
    border-radius: 12px;
    padding: 6px;
    z-index: 2000;
    min-width: 90px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-option {
    background: none;
    border: none;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    transition: background 0.15s;
}

.lang-option:hover {
    background: var(--bg-input);
}

.lang-option.active {
    background: var(--blue);
    color: #fff;
}

/* ── Inventory category badge ── */
.inv-item-category {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════ */
/*  ADMIN — Cards Management                   */
/* ═══════════════════════════════════════════ */

.admin-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: linear-gradient(165deg, #151938, #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.admin-card-item:hover {
    border-color: #3b8bff;
}

.admin-card-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.admin-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--bg-card-border);
    font-size: 1.5rem;
}

.admin-card-info {
    flex: 1;
    min-width: 0;
}
.admin-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.admin-card-owners {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-rarity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.card-category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
}

.admin-card-image-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-card-preview {
    width: 120px;
    border-radius: 10px;
    overflow: visible;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-card-preview .tcg-card {
    animation: none;
}
.admin-card-preview .tcg-card:hover {
    transform: none;
}
.admin-card-no-image {
    font-size: 2rem;
    opacity: 0.3;
}

/* ═══════════════════════════════════════════ */
/*  COLLECTION PAGE                            */
/* ═══════════════════════════════════════════ */

.collection-stats {
    background: linear-gradient(165deg, #151938, #111433);
    border: 2px solid var(--bg-card-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.collection-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}
.collection-percent {
    color: #3ddc84;
    font-size: 0.85rem;
}

.collection-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.collection-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b8bff, #3ddc84);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.collection-rarity-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.collection-rarity-stat {
    font-size: 0.75rem;
    font-weight: 700;
}

.collection-filters {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.collection-filter.active {
    background: rgba(59, 139, 255, 0.2);
    border-color: #3b8bff;
    color: #3b8bff !important;
}

/* Cards grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 80px;
}
@media (min-width: 500px) {
    .collection-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 768px) {
    .collection-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ═══════════════════════════════════════════ */
/*  COLLECTION TABS & TRADES                   */
/* ═══════════════════════════════════════════ */

.collection-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--bg-card-border);
}
.collection-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.collection-tab.active {
    background: var(--accent);
    color: #fff;
}
.trade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

/* Trade section titles */
.trade-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 16px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bg-card-border);
}
.trade-section-title:first-child {
    margin-top: 0;
}

/* Trade card row */
.trade-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.trade-card:hover {
    border-color: var(--accent);
}

/* Mini TCG card in trade row */
.tcg-card-mini {
    width: 60px !important;
    min-width: 60px;
    flex-shrink: 0;
    font-size: 0.5rem;
}
.tcg-card-mini .tcg-card-header {
    font-size: 0.4rem;
    padding: 2px 3px;
}
.tcg-card-mini .tcg-card-footer {
    padding: 2px 3px;
}
.tcg-card-mini .tcg-card-stars {
    font-size: 0.4rem;
}
.tcg-card-mini .tcg-card-art {
    height: 50px;
}

/* Trade info */
.trade-info {
    flex: 1;
    min-width: 0;
}
.trade-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trade-person {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.trade-message {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trade-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 3px;
}

/* Trade actions */
.trade-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.trade-actions .btn {
    font-size: 0.75rem;
    padding: 6px 12px;
    white-space: nowrap;
}

/* Status badges */
.trade-status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 6px;
}
.trade-status-accepted {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.trade-status-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.trade-status-cancelled {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

/* Send card modal */
#sendCardModal .modal {
    max-width: 360px;
}
#sendCardModal h2 {
    text-align: center;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════ */
/*  TCG CARD — Composant reutilisable          */
/* ═══════════════════════════════════════════ */

.tcg-card {
    position: relative;
    border-radius: 10px;
    padding: 5px;
    background: linear-gradient(145deg, #4a4e6a, #2a2d42, #4a4e6a);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    animation: tcg-appear 0.3s ease both;
}
.tcg-card:hover { transform: scale(1.05); }
.tcg-card:active { transform: scale(0.97); }

@keyframes tcg-appear {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tcg-card-inner {
    border-radius: 6px;
    overflow: hidden;
    background: #0d0f1e;
}

.tcg-card-header {
    padding: 5px 6px 4px;
    background: linear-gradient(to bottom, rgba(20,24,50,0.95), rgba(13,15,30,0.95));
    text-align: center;
    font-weight: 800;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0.3px;
}

.tcg-card-art {
    position: relative;
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.tcg-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tcg-card-art-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(165deg, #0d0f1e, #151833);
    color: rgba(255,255,255,0.15);
}

.tcg-card-footer {
    padding: 4px 6px 5px;
    background: linear-gradient(to bottom, rgba(13,15,30,0.95), rgba(8,10,24,0.95));
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.tcg-card-stars {
    font-size: 0.55rem;
    letter-spacing: 2px;
}
.tcg-card-desc {
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tcg-card-stars-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tcg-card-rarity-label {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Quantity badge ── */
.tcg-card-qty {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
}

/* ── Lock overlay ── */
.tcg-card-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    opacity: 0.8;
    z-index: 2;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
}

/* ── Locked state ── */
.tcg-card-locked {
    opacity: 0.4;
}
.tcg-card-locked .tcg-card-art img,
.tcg-card-locked .tcg-card-art-placeholder {
    filter: grayscale(1) brightness(0.4);
}

/* ═══════════════════════════════════════════ */
/*  TCG CARD — Rarity Variants                 */
/* ═══════════════════════════════════════════ */

/* Common — steel grey */
.tcg-card[data-rarity="common"] {
    background: linear-gradient(145deg, #4a4e6a, #2a2d42, #3a3e58);
}
.tcg-card[data-rarity="common"] .tcg-card-header,
.tcg-card[data-rarity="common"] .tcg-card-stars,
.tcg-card[data-rarity="common"] .tcg-card-rarity-label { color: #8088b0; }

/* Rare — blue metallic */
.tcg-card[data-rarity="rare"] {
    background: linear-gradient(145deg, #1a4a8a, #2563eb, #1a4a8a);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.35), 0 2px 8px rgba(0,0,0,0.5);
}
.tcg-card[data-rarity="rare"] .tcg-card-header { color: #7cb3ff; }
.tcg-card[data-rarity="rare"] .tcg-card-stars,
.tcg-card[data-rarity="rare"] .tcg-card-rarity-label { color: #3b8bff; }

/* Epic — purple metallic */
.tcg-card[data-rarity="epic"] {
    background: linear-gradient(145deg, #5a1a80, #9333ea, #5a1a80);
    box-shadow: 0 0 12px rgba(147, 51, 234, 0.4), 0 2px 8px rgba(0,0,0,0.5);
}
.tcg-card[data-rarity="epic"] .tcg-card-header { color: #d4a0ff; }
.tcg-card[data-rarity="epic"] .tcg-card-stars,
.tcg-card[data-rarity="epic"] .tcg-card-rarity-label { color: #c026d3; }

/* Legendary — gold metallic + animated glow */
.tcg-card[data-rarity="legendary"] {
    background: linear-gradient(145deg, #8a6510, #eab308, #c49a0c, #eab308, #8a6510);
    box-shadow: 0 0 18px rgba(234, 179, 8, 0.45), 0 2px 8px rgba(0,0,0,0.5);
    animation: tcg-appear 0.3s ease both, tcg-legendary-glow 3s ease-in-out infinite 0.3s;
}
.tcg-card[data-rarity="legendary"] .tcg-card-header { color: #ffe082; }
.tcg-card[data-rarity="legendary"] .tcg-card-stars,
.tcg-card[data-rarity="legendary"] .tcg-card-rarity-label { color: #ffcc00; }

@keyframes tcg-legendary-glow {
    0%, 100% { box-shadow: 0 0 18px rgba(234, 179, 8, 0.45), 0 2px 8px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 28px rgba(234, 179, 8, 0.7), 0 0 50px rgba(234, 179, 8, 0.15), 0 2px 8px rgba(0,0,0,0.5); }
}

/* Holographic shine — legendary only */
.tcg-card[data-rarity="legendary"]::after {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.03) 40%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.03) 60%,
        transparent 70%
    );
    animation: tcg-shine 4s linear infinite;
    pointer-events: none;
    z-index: 3;
}
@keyframes tcg-shine {
    0% { transform: translateX(-30%) translateY(-30%) rotate(25deg); }
    100% { transform: translateX(30%) translateY(30%) rotate(25deg); }
}

/* ═══════════════════════════════════════════ */
/*  TCG CARD — Detail (modal)                  */
/* ═══════════════════════════════════════════ */

.tcg-card-detail {
    width: 220px;
    margin: 0 auto 16px;
    cursor: default;
    animation: none;
}
.tcg-card-detail:hover { transform: none; }
.tcg-card-detail:active { transform: none; }
.tcg-card-detail .tcg-card-header {
    font-size: 0.85rem;
    padding: 8px 10px 6px;
}
.tcg-card-detail .tcg-card-footer {
    padding: 8px 10px 10px;
}
.tcg-card-detail .tcg-card-desc {
    font-size: 0.72rem;
    -webkit-line-clamp: 4;
    margin-bottom: 6px;
}
.tcg-card-detail .tcg-card-stars {
    font-size: 0.7rem;
}
.tcg-card-detail .tcg-card-rarity-label {
    font-size: 0.65rem;
}

.card-detail-modal {
    text-align: center;
    max-width: 340px;
}
.card-detail-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.card-detail-meta div {
    margin-bottom: 4px;
}

/* ═══════════════════════════════════════════ */
/*  TCG CARD — Loot drop (chest results)       */
/* ═══════════════════════════════════════════ */

.tcg-card-loot {
    width: 140px;
    margin: 0 auto;
    cursor: default;
}
.tcg-card-loot:hover { transform: none; }
.tcg-card-loot:active { transform: none; }

.loot-card-drop {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(165deg, #1a1e3a, #151833);
    border: 2px solid var(--bg-card-border);
    border-radius: 14px;
    text-align: center;
    animation: card-drop-pop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.4s;
}

@keyframes card-drop-pop {
    from { opacity: 0; transform: scale(0.3) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(2deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.loot-card-badge {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #ffcc00;
}
