:root {
    --primary: #2c3e50;
    --secondary: #c0392b;
    --accent: #f39c12;
    --light: #ecf0f1;
    --dark: #1a2530;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #34495e;
    color: var(--light);
    line-height: 1.6;
}

/* Kriminelle Handlinger page (scoped to body.krim-page) */
body.krim-page {
    background-color: #34495e;
    color: var(--light);
    line-height: 1.6;
    padding: 20px;
}

.krim-page .container {
    max-width: 1000px;
    margin: 0 auto;
}

.krim-page .card {
    background-color: var(--dark);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.krim-page .card-header {
    border-bottom: 1px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.krim-page .krim-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.krim-page .krim-type {
    margin-bottom: 20px;
}

.krim-page .krim-handling {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.krim-page .krim-handling.executing {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: #f39c12;
}

.krim-page .handling-navn {
    font-weight: bold;
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.krim-page .handling-beskrivelse {
    color: #bdc3c7;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.krim-page .handling-detalj {
    margin-bottom: 8px;
}

.krim-page .detalj-label {
    font-weight: bold;
    color: #bdc3c7;
    display: block;
    font-size: 0.9rem;
}

.krim-page .sjanse-visning {
    width: 100%;
    height: 8px;
    background-color: #34495e;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.krim-page .sjanse-fyll {
    height: 100%;
    background-color: #2ecc71;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.krim-page .equipment-bonus {
    font-size: 0.8rem;
    color: #f39c12;
    margin: 10px 0;
    text-align: center;
}

.krim-page .krim-btn {
    background-color: var(--secondary);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 100%;
    position: relative;
}

.krim-page .krim-btn:hover:not(:disabled) {
    background-color: #a23526;
}

.krim-page .krim-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.krim-page .krim-btn.cooldown {
    background-color: #7f8c8d !important;
}

.krim-page .krim-btn.executing {
    background-color: #f39c12 !important;
    transform: scale(0.95);
}

.krim-page .cooldown-timer {
    font-weight: bold;
    margin-left: 5px;
}

.krim-page #krim-resultat {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.krim-page #krim-resultat.success,
.krim-page #krim-resultat.action-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.krim-page #krim-resultat.error,
.krim-page #krim-resultat.action-failure {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

.krim-page .loading-indicator {
    display: none;
    text-align: center;
    margin-top: 5px;
}

.krim-page .loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.krim-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.krim-page .stat-item {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.krim-page .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.krim-page .cooldown-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
}

.krim-page .cooldown-active {
    color: #ff6b6b;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.krim-page .fade-in { animation: fadeIn 0.5s; }

@media (max-width: 768px) {
    .krim-page .krim-container { grid-template-columns: 1fr; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(18, 26, 34, 0.65);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.6rem; font-weight: 800; color: var(--accent); letter-spacing: .4px; }

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a { color: var(--light); text-decoration: none; padding: 8px 12px; border-radius: 8px; transition: background-color .25s ease, transform .08s ease; }
.nav-links a:hover { background-color: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }

.admin-link {
    background-color: var(--accent);
    color: var(--dark) !important;
    font-weight: bold;
}

.admin-link:hover {
    background-color: #e67e22 !important;
}

/* Mobile menu toggle (hamburger) */
.mobile-menu-toggle { display:none; background: transparent; border:none; cursor:pointer; padding:8px; margin-left:auto; }
.mobile-menu-toggle .bar { display:block; width:26px; height:3px; background:#e5e7eb; margin:5px 0; border-radius:2px; transition: transform .2s ease, opacity .2s ease; }

/* Full-screen mobile nav overlay */
.mobile-nav-overlay { position: fixed; inset: 0; background: rgba(15,23,32,0.96); display:none; z-index: 1000; }
.mobile-nav-overlay.open { display:flex; align-items:center; justify-content:center; }
.mobile-nav-content { width: 88%; max-width: 420px; display:flex; flex-direction:column; gap:12px; }
.mobile-nav-link { display:block; padding: 14px 16px; font-size: 1.1rem; color:#e5e7eb; background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.06); border-radius: 10px; text-decoration:none; text-align:center; transition: background .2s ease, transform .08s ease; }
.mobile-nav-link:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.mobile-nav-link.admin { background: linear-gradient(135deg, var(--accent), #e67e22); color:#0f1720; font-weight:700; }
.mobile-nav-close { align-self:flex-end; background: transparent; border:1px solid rgba(255,255,255,0.2); color:#e5e7eb; border-radius: 50%; width:36px; height:36px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size: 22px; margin-bottom:8px; }

/* Prevent body scroll when menu is open */
body.menu-open { overflow: hidden; }

.main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.card { background-color: rgba(18, 26, 34, 0.72); border-radius: 12px; padding: 16px; margin-bottom: 20px; box-shadow: 0 10px 26px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.04); backdrop-filter: blur(6px); }
.card.reveal-on-scroll { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.card.reveal-on-scroll.revealed { opacity: 1; transform: translateY(0); }
/* Generic reveal helper for other elements */
.reveal-on-scroll { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.reveal-on-scroll.revealed { opacity: 1; transform: none; }

.card-header {
    border-bottom: 1px solid var(--accent);
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.view-all:hover {
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.stat-item {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
}

.mission-list {
    list-style: none;
}

.mission-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
}

.mission-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mission-name {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.mission-desc {
    margin-bottom: 8px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.mission-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.status-not_started {
    background-color: var(--info);
    color: white;
}

.status-in_progress {
    background-color: var(--warning);
    color: var(--dark);
}

.status-completed {
    background-color: var(--success);
    color: white;
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 8px; border: none; cursor: pointer; font-weight: 700; letter-spacing: .2px; transition: transform .12s ease, box-shadow .2s ease, background .3s ease; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--secondary), #a23526); box-shadow: 0 8px 18px rgba(192,57,43,0.18); font-size: 0.9rem; }
.btn:hover { box-shadow: 0 10px 22px rgba(192,57,43,0.26); transform: translateY(-1px); }

.btn-disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

.btn-disabled:hover {
    background-color: #7f8c8d;
}

.btn-completed {
    background-color: var(--success);
}

.btn-completed:hover {
    background-color: #229954;
}

/* Button variants */
.btn-warning { background: linear-gradient(135deg, #e67e22, #cf711f); color: #fff; box-shadow: 0 8px 18px rgba(230,126,34,0.25); }
.btn-warning:hover { box-shadow: 0 10px 22px rgba(230,126,34,0.32); }
.btn-danger { background: linear-gradient(135deg, #c0392b, #a23526); color: #fff; box-shadow: 0 8px 18px rgba(192,57,43,0.22); }
.btn-danger:hover { box-shadow: 0 10px 22px rgba(192,57,43,0.3); }
.btn-success { background: linear-gradient(135deg, #27ae60, #229954); color:#fff; box-shadow: 0 8px 18px rgba(39,174,96,0.22); }
.btn-success:hover { box-shadow: 0 10px 22px rgba(39,174,96,0.3); }

.admin-badge {
    background-color: var(--accent);
    color: var(--dark);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 5px;
}

.progress-bar {
    height: 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    margin: 6px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--accent);
    border-radius: 3px;
    width: 0%;
}

.mission-meta {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

.krim-container {
    margin-top: 10px;
}

.krim-type {
    margin-bottom: 15px;
}

.krim-handling {
       background-color: rgba(0, 0, 0, 0.18);
       padding: 8px;
       border-radius: 6px;
    margin-bottom: 14px; /* a bit more space between krim cards */
    border-left: 3px solid var(--accent);
}
.krim-handling:last-child { margin-bottom: 0; }

.krim-handling.tung {
    border-left-color: var(--secondary);
}

/* Make krim cards clearly clickable and show a subtle translucent selection highlight */
.selectable-handling {
    cursor: pointer;
    position: relative;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.selectable-handling:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.selectable-handling.selected {
    background-color: rgba(243,156,18,0.06); /* translucent accent */
    border-left-color: rgba(243,156,18,0.9);
    box-shadow: 0 8px 22px rgba(243,156,18,0.08);
    outline: 2px solid rgba(243,156,18,0.12);
}
.selectable-handling .handling-navn {
    /* keep text legible when overlay used */
    text-shadow: 0 0 0 rgba(0,0,0,0);
}


.handling-navn {
       font-weight: bold;
       color: var(--accent);
       margin-bottom: 4px;
    font-size: 0.9rem;
}

.handling-beskrivelse {
       margin-bottom: 6px;
       opacity: 0.92;
       font-size: 0.78rem;
}

.handling-detaljer {
       display: grid;
       grid-template-columns: 1fr;
       gap: 6px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.handling-detalj {
    display: flex;
    flex-direction: column;
}

.detalj-label {
    font-weight: bold;
    color: var(--accent);
    font-size: 0.75rem;
}

.sjanse-visning {
       height: 6px;
       background-color: rgba(0, 0, 0, 0.15);
       border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
}

.sjanse-fyll {
    height: 100%;
    background-color: var(--success);
    border-radius: 4px;
}

.krim-btn {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.8rem;
}

.krim-btn:hover {
    background-color: #a23526;
}

.krim-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

.equipment-bonus {
       font-size: 0.72rem;
       opacity: 0.78;
       margin-top: 4px;
}

.item-list {
    list-style: none;
    font-size: 0.85rem;
}

.item-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-list li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    .mobile-menu-toggle { display:block; }
    
    .handling-detaljer {
        grid-template-columns: 1fr;
    }
}

/* Legg til disse nye stilene i stilark.css */

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.item-card {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--accent);
    position: relative;
}

.item-name {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.item-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.item-price {
    color: var(--success);
    font-weight: bold;
}

.buy-btn {
    width: 100%;
    background-color: var(--success);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.85rem;
}

.buy-btn:hover {
    background-color: #229954;
}

/* Locked/greyed-out items (e.g., cars above level) */
.item-card.locked {
    filter: grayscale(1);
    opacity: 0.68;
}
.item-card .locked-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #7f8c8d, #5f6a6a);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Map helpers */
/* Static SVG world map container (dark) */
.world-map-container {
        position: relative;
        height: 520px;
        border-radius: 10px;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.08);
        /* Stack: noir overlay -> uniform tint -> accent glows -> user map -> dark gradient fallback */
        background:
            linear-gradient(0deg, rgba(15,23,32,0.58), rgba(15,23,32,0.58)),
            linear-gradient(0deg, rgba(34,49,63,0.65), rgba(34,49,63,0.65)),
            radial-gradient(120% 80% at 70% 30%, rgba(243,156,18,0.08), transparent 60%),
            radial-gradient(120% 80% at 20% 80%, rgba(192,57,43,0.06), transparent 60%),
            url('assets/world.svg') center/cover no-repeat,
            linear-gradient(180deg, #0f1720, #1a2530);
        background-blend-mode: overlay, multiply, multiply, multiply, normal, normal;
}
.world-map-svg { width: 100%; height: 100%; display:block; }
.world-map-svg .map-label { fill: #cfd6db; text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.world-map-svg .map-marker.current circle:first-child { filter: drop-shadow(0 0 6px rgba(39,174,96,0.3)); }
.world-map-svg .map-marker:hover circle:first-child { transform: scale(1.05); transition: transform .12s ease; }

/* Responsive design for mobile */
@media (max-width: 768px) {
    .item-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Cooldown timer styling */
.krim-btn:disabled {
    background-color: #7f8c8d !important;
    cursor: not-allowed;
}

.cooldown-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

#krim-resultat-spill.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

/* New, less ambiguous class name for action success to avoid mixing with request-level 'success' */
#krim-resultat-spill.action-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

#krim-resultat-spill.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* Visual for action failures (keeps same red look as .error but separate classname)
   so we can distinguish between request errors and expected failed attempts. */
#krim-resultat-spill.action-failure {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

/* Våpenbutikk additions */
.user-info { background: var(--dark); padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; }
.weapon-list { margin-top: 30px; }
.weapon-item { display:flex; justify-content: space-between; align-items:center; padding:10px; background: rgba(0,0,0,0.2); margin-bottom:8px; border-radius:6px; }
.weapon-item.equipped { background: rgba(39,174,96,0.2); border-left: 3px solid var(--success); }
.weapon-info { flex-grow: 1; }
.weapon-name { font-weight: bold; color: var(--accent); }
.weapon-equipped { color: var(--success); font-size:0.8rem; margin-left:10px; }


/* Auth pages (login/register) scoped styles */
body.auth-page {
    /* Noir gradient base with subtle depth */
    background:
        radial-gradient(1200px 800px at 20% 10%, rgba(243,156,18,0.06), transparent 60%),
        linear-gradient(135deg, #0b1016 0%, #0f1720 50%, var(--dark) 100%);
    color: var(--light);
    min-height: 100vh;
    /* Use dynamic viewport to avoid browser UI offset issues on some devices */
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body.auth-page .container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
}

body.auth-page .logo { text-align: center; margin-bottom: 30px; }
body.auth-page .logo h1 {
    font-size: 2.6rem;
    color: var(--accent);
    letter-spacing: 1px;
    text-shadow:
      0 0 6px rgba(243,156,18,0.6),
      0 0 16px rgba(243,156,18,0.35),
      0 2px 24px rgba(0,0,0,0.35);
    animation: neon-flicker 6s infinite steps(100, end);
}
body.auth-page .logo p { color: var(--light); font-size: 1.1rem; margin-top: 10px; }

body.auth-page .card {
    background-color: rgba(18, 26, 34, 0.7);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.04);
    backdrop-filter: blur(10px) saturate(110%);
    -webkit-backdrop-filter: blur(10px) saturate(110%);
    position: relative;
}

/* Glossy edge for the auth card */
body.auth-page .card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(243,156,18,0.35), rgba(255,255,255,0.05) 30%, rgba(231,76,60,0.25));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

body.auth-page .card-header { text-align: center; margin-bottom: 25px; }
body.auth-page .card-header h2 { color: var(--accent); font-size: 1.8rem; }
body.auth-page .form-group { margin-bottom: 20px; }
body.auth-page .form-group label { display:block; margin-bottom: 8px; color: var(--light); font-weight:500; }
body.auth-page .form-group input {
    width:100%; padding:12px 15px; border-radius:8px;
    border:1px solid #2a3a48; background:#1f2a35; color:#fff;
    font-size:1rem; transition: box-shadow .25s, border-color .25s, transform .08s;
}
body.auth-page .form-group input:hover { border-color:#344e62; }
body.auth-page .form-group input:focus {
    outline:none; border-color: var(--accent);
    box-shadow:
      0 0 0 2px rgba(243,156,18,0.18),
      0 6px 18px rgba(243,156,18,0.08),
      inset 0 1px 0 rgba(255,255,255,0.05);
}
body.auth-page .form-group input:active { transform: translateY(0.5px); }

/* Mafia vibe CTA */
body.auth-page .btn {
    width:100%;
    background: linear-gradient(135deg, var(--secondary), #b33a2a);
    color:#fff; border:none; padding:12px 14px; border-radius:8px; cursor:pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .3s ease;
    font-size:1.05rem; font-weight:700; margin-top:10px; letter-spacing: .2px;
    box-shadow: 0 8px 22px rgba(179,58,42,0.22), 0 1px 0 rgba(255,255,255,0.04) inset;
    position: relative; overflow: hidden;
}
body.auth-page .btn::after {
    content: ""; position:absolute; inset: -40% -20% auto -20%; height: 180%;
    background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.15) 40%, transparent 60%);
    transform: translateX(-120%) rotate(8deg);
    transition: transform .6s ease;
}
body.auth-page .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(179,58,42,0.28), 0 1px 0 rgba(255,255,255,0.06) inset;
}
body.auth-page .btn:hover::after { transform: translateX(60%) rotate(8deg); }
body.auth-page .btn:active { transform: translateY(0); }

body.auth-page .switch-form { text-align:center; margin-top:25px; color: var(--light); }
body.auth-page .switch-form a { color: var(--accent); text-decoration:none; font-weight:600; transition: color .3s; }
body.auth-page .switch-form a:hover { color:#e67e22; text-decoration: underline; }
body.auth-page .message { padding:12px; border-radius:6px; margin-bottom:20px; text-align:center; }
body.auth-page .error { background: rgba(192,57,43,0.2); border:1px solid var(--secondary); color:#ff8f8f; }
body.auth-page .success { background: rgba(46,204,113,0.2); border:1px solid #2ecc71; color:#85e0ac; }
body.auth-page .password-toggle { position: relative; }
body.auth-page .toggle-password { position:absolute; right:15px; top:38px; cursor:pointer; color:#9aa8b3; transition: color .2s; }
body.auth-page .toggle-password:hover { color:#c3ced6; }
body.auth-page .requirements { font-size:0.85rem; color:#7b8c9d; margin-top:5px; }

/* Make auth layout fit without needing page scroll on shorter screens */
@media (max-height: 800px) {
    body.auth-page { padding: 16px; }
    body.auth-page .logo { margin-bottom: 18px; }
    body.auth-page .logo h1 { font-size: 2rem; }
    body.auth-page .card { padding: 22px; }
    body.auth-page .form-group { margin-bottom: 14px; }
    body.auth-page .btn { padding: 10px 12px; font-size: 1rem; }
}

@media (max-height: 700px) {
    body.auth-page { padding: 12px; }
    body.auth-page .container { max-width: 420px; transform: scale(0.94); transform-origin: center center; }
    body.auth-page .logo { margin-bottom: 14px; }
    body.auth-page .logo h1 { font-size: 1.8rem; }
    /* Always show subtitle on small heights; reduce size instead of hiding */
    body.auth-page .logo p { display: block; font-size: 0.95rem; opacity: 0.95; }
    body.auth-page .card { padding: 18px; max-height: none; overflow: visible; }
    body.auth-page .switch-form { margin-top: 16px; }
}

@media (max-height: 620px) {
    body.auth-page .container { transform: scale(0.9); }
    body.auth-page .logo h1 { font-size: 1.6rem; }
    body.auth-page .card-header h2 { font-size: 1.4rem; }
    body.auth-page .btn { padding: 9px 10px; font-size: 0.98rem; }
}

@media (max-height: 560px) {
    body.auth-page { padding: 8px; }
    body.auth-page .container { transform: scale(0.86); }
    body.auth-page .logo { margin-bottom: 10px; }
    body.auth-page .card { padding: 16px; }
}

/* Ambient background layers: glow blobs + vignette + subtle scanlines */
body.auth-page::before,
body.auth-page::after {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
}
body.auth-page::before {
    background:
      radial-gradient(520px 420px at 15% 15%, rgba(243,156,18,0.11), transparent 60%),
      radial-gradient(520px 420px at 85% 25%, rgba(231,76,60,0.08), transparent 60%),
      radial-gradient(640px 520px at 50% 90%, rgba(46,204,113,0.08), transparent 65%);
    filter: blur(0.5px) saturate(120%);
    animation: auth-ambient 16s linear infinite;
}
body.auth-page::after {
    background:
      radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%),
      repeating-linear-gradient(0deg, rgba(255,255,255,0.025), rgba(255,255,255,0.025) 1px, transparent 3px, transparent 6px);
    mix-blend-mode: overlay;
}

@keyframes auth-ambient {
  0% { transform: translate3d(0,0,0); }
  33% { transform: translate3d(2%, -1%, 0); }
  66% { transform: translate3d(-1%, 1%, 0); }
  100% { transform: translate3d(0,0,0); }
}

@keyframes neon-flicker {
  0%, 100% { opacity: 1; text-shadow: 0 0 6px rgba(243,156,18,0.6), 0 0 16px rgba(243,156,18,0.35), 0 2px 24px rgba(0,0,0,0.35); }
  48% { opacity: 1; }
  49% { opacity: 0.94; }
  50% { opacity: 1; }
  70% { opacity: 0.98; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  body.auth-page::before { animation: none; }
  body.auth-page .logo h1 { animation: none; }
  body.auth-page .btn::after { transition: none; }
}

/* Generic message helpers (non-auth pages) */
.message { padding: 12px; border-radius: 6px; margin-bottom: 20px; text-align: center; }
.message-success { background-color: rgba(39, 174, 96, 0.2); border: 1px solid var(--success); color: #a9dfbf; }
.message-error { background-color: rgba(231, 76, 60, 0.2); border: 1px solid var(--secondary); color: #f5b7b1; }

/* Admin page extras */
.admin-header { text-align:center; margin-bottom:30px; padding:20px; background: var(--dark); border-radius: 8px; }
.admin-header h1 { color: var(--accent); margin-bottom: 10px; }
.admin-section { background: var(--dark); padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.section-header { color: var(--accent); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.tabs { display:flex; margin-bottom:20px; border-bottom:1px solid rgba(255,255,255,0.1); }
.tab { padding:10px 20px; cursor:pointer; background: rgba(0,0,0,0.1); margin-right:5px; border-radius: 4px 4px 0 0; }
.tab.active { background: var(--dark); border:1px solid rgba(255,255,255,0.1); border-bottom:none; }
.tab-content { display:none; }
.tab-content.active { display:block; opacity: 1; }
/* Smoother tab fade */
.tab-content { opacity: 0; transition: opacity .25s ease; }
.stat-card { background: var(--dark); padding: 15px; border-radius: 8px; text-align: center; }
.stat-card h3 { margin-bottom: 8px; font-weight: 600; }

/* Admin tables */
table { width: 100%; border-collapse: collapse; background: rgba(0,0,0,0.1); }
thead th { text-align: left; color: var(--light); padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.15); }
tbody td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.07); }
tbody tr:hover { background: rgba(255,255,255,0.03); }

/* Buttons */
.btn-danger { background-color: var(--secondary); color: #fff; }
.btn-danger:hover { background-color: #a23526; }
.btn-success { background-color: var(--success); color:#fff; }
.btn-success:hover { background-color: #229954; }

/* Admin forms */
.form-group { margin-bottom: 14px; }
.form-group label { display:block; margin-bottom:6px; color: var(--light); font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea { width:100%; padding:10px 12px; border-radius:6px; border:1px solid #3a506b; background:#2c3e50; color:#fff; font-size:0.95rem; transition: all .2s; }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline:none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(243,156,18,0.15); }
.form-group small,
.form-help { color:#bdc3c7; display:block; margin-top:6px; font-size:0.85rem; }
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.7); z-index:1000; justify-content:center; align-items:center; }
.modal-content { background: var(--dark); padding:30px; border-radius:8px; width:90%; max-width:600px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.close { float:right; font-size:1.5rem; font-weight:bold; cursor:pointer; color: var(--accent); }
.action-buttons { display:flex; gap:5px; }
.code-block { background:#2c3e50; border:1px solid #3a506b; border-radius:4px; padding:10px; font-family:monospace; font-size:0.9rem; margin:10px 0; white-space: pre-wrap; }
.event-log-entry { background: rgba(0,0,0,0.1); border-left:3px solid var(--accent); padding:10px; margin:5px 0; font-size:0.9rem; }
/* Compact event log rows for better density */
#event-log .event-log-entry { padding:4px 6px; margin:3px 0; font-size:0.8rem; line-height:1.2; }
#event-log .event-log-entry strong { font-weight:600; }
#event-log .code-block { font-size:0.75rem; padding:4px 6px; margin:4px 0; line-height:1.25; }

/* Krim layout tweaks (spill.php inline -> moved here) */
.krim-card { max-width: 900px; margin: 0 auto; padding: 14px; }
.krim-card .krim-container { display:grid; grid-template-columns: 1fr 1fr; gap:14px; align-items:start; }
.krim-column { display:flex; flex-direction:column; gap:12px; }
.krim-column h3 { margin:0 0 6px 0; font-size:1rem; }
.krim-card .krim-handling { padding:10px; border:1px solid rgba(0,0,0,0.06); border-radius:6px; background: var(--card-bg, #2b3b4c); }
.krim-card .handling-navn { font-size:1rem; font-weight:600; margin-bottom:6px; }
.sjanse-visning { height:8px; background:#eee; border-radius:4px; overflow:hidden; margin-top:6px; }
.sjanse-fyll { height:100%; background: linear-gradient(90deg,#2ecc71,#27ae60); }
.equipment-bonus { font-size:0.85rem; color:#cfd6db; margin-top:8px; }
@media (max-width: 720px) {
    .krim-card .krim-container { grid-template-columns: 1fr; }
}

/* Våpenlager page styles */
/* Biler page two-column layout */
.shop-layout { display:grid; grid-template-columns: 2fr 1fr; gap:16px; align-items:start; }
.cars-sidebar .weapon-list { max-height: 60vh; overflow:auto; }
@media (max-width: 920px){ 
    .shop-layout { grid-template-columns: 1fr; }
    .cars-sidebar .weapon-list { max-height: none; }
}
/* Chat page */
body.chat-page .chat-layout { display:grid; grid-template-columns: 260px 1fr; gap:16px; }
.chat-sidebar { max-height: 70vh; overflow:auto; }
.chat-user-list { list-style:none; padding:0; margin:0; }
.chat-user { padding:10px; border-radius:8px; cursor:pointer; transition: background .2s; }
.chat-user:hover { background: rgba(255,255,255,0.06); }
.chat-user.active { background: rgba(243,156,18,0.15); }
.chat-window { display:flex; flex-direction:column; height: 70vh; }
.chat-header { padding-bottom:8px; border-bottom:1px solid rgba(255,255,255,0.1); margin-bottom:8px; }
.messages { flex:1; overflow:auto; display:flex; flex-direction:column; gap:8px; padding-right:4px; }
.msg { background: rgba(0,0,0,0.1); border-radius:8px; padding:8px 10px; }
.msg.mine { background: rgba(46,204,113,0.12); border-left: 3px solid var(--success); }
.msg .meta { font-size: 0.75rem; color:#cfd6db; margin-bottom:4px; }
.send-box { display:flex; gap:8px; margin-top:8px; }
.send-box input[type="text"] { flex:1; padding:10px 12px; border-radius:8px; border:1px solid #2a3a48; background:#1f2a35; color:#fff; }

/* Floating chat bubble + popup */
.chat-fab { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg, var(--info), #2980b9); color:#fff; box-shadow: 0 10px 24px rgba(0,0,0,0.25); cursor: pointer; z-index: 1000; font-size: 22px; user-select: none; }
.chat-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0,0,0,0.3); }
.chat-popup { position: fixed; right: 18px; bottom: 86px; width: 320px; max-height: 60vh; display:none; flex-direction: column; background: rgba(18,26,34,0.92); border:1px solid rgba(255,255,255,0.06); border-radius: 10px; box-shadow: 0 18px 40px rgba(0,0,0,0.35); z-index: 1000; backdrop-filter: blur(8px); }
.chat-popup[aria-hidden="false"] { display:flex; }
.chat-popup-header { display:flex; justify-content: space-between; align-items:center; padding:10px 12px; border-bottom:1px solid rgba(255,255,255,0.08); }
.chat-popup-close { background: transparent; border:none; color:#fff; font-size: 20px; cursor:pointer; }
.chat-popup-messages { padding:10px; overflow:auto; display:flex; flex-direction:column; gap:6px; min-height: 140px; max-height: 40vh; }
.chat-popup-send { display:flex; gap:8px; padding:10px; border-top:1px solid rgba(255,255,255,0.08); }
.chat-popup-send input { flex:1; padding:10px 12px; border-radius:8px; border:1px solid #2a3a48; background:#1f2a35; color:#fff; }
.chat-popup .msg { background: rgba(0,0,0,0.1); border-radius:8px; padding:6px 8px; }
.chat-popup .msg.mine { background: rgba(46,204,113,0.12); border-left: 3px solid var(--success); }

/* Chat widget friend selector */
.chat-target-select { margin-left: auto; background: rgba(0,0,0,0.2); color:#e5e7eb; border:1px solid rgba(255,255,255,0.1); border-radius:6px; padding:4px 6px; }

/* Toasts */
.toast-container { position: fixed; top: 16px; right: 16px; display:flex; flex-direction:column; gap:10px; z-index: 9999; }
.toast { background: rgba(18,26,34,0.9); color:#fff; padding:10px 14px; border-radius:8px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); border:1px solid rgba(255,255,255,0.06); opacity:0; transform: translateY(-6px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity:1; transform: translateY(0); }
.storage-info { background: var(--dark); padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; }
.weapon-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap:15px; margin-top:20px; }
.weapon-card { background: var(--dark); border-radius: 8px; padding: 15px; border-left: 4px solid var(--accent); box-shadow: 0 4px 6px rgba(0,0,0,0.1); position: relative; }
.weapon-card.equipped { border-left-color: var(--success); background: rgba(39,174,96,0.1); }
.weapon-name { font-size: 1.1rem; font-weight: bold; color: var(--accent); margin-bottom: 8px; }
.weapon-equipped { color: var(--success); font-weight: bold; font-size: 0.8rem; margin-bottom: 8px; }
.weapon-stats { margin-bottom: 10px; }
.weapon-stat { display:flex; justify-content: space-between; margin-bottom:4px; font-size:0.85rem; }
.action-buttons { display:flex; gap:8px; align-items:center; }
.action-buttons form { display:flex; }
.weapon-card .action-buttons { margin-top: 8px; }
.action-buttons { display:flex; gap:8px; margin-top:10px; }
.action-btn { flex:1; border:none; padding:8px; border-radius:4px; cursor:pointer; font-size:0.8rem; transition: background-color .3s; }
.equip-btn { background-color: var(--accent); color: var(--dark); }
.equip-btn:hover { background-color:#e67e22; }
.equip-btn.equipped { background-color: var(--success); color:#fff; }
.sell-btn { background-color: var(--secondary); color:#fff; }
.sell-btn:hover { background-color:#a23526; }
.send-btn { background-color: var(--info); color:#fff; }
.send-btn:hover { background-color:#2980b9; }
.send-form { display:none; margin-top:10px; padding:10px; background: rgba(0,0,0,0.2); border-radius:4px; }
.send-input { width:100%; padding:6px; margin-bottom:8px; border:1px solid rgba(255,255,255,0.2); border-radius:4px; background: var(--dark); color:#fff; }
.upgrade-section { background: var(--dark); padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; }
.upgrade-cost { color: var(--accent); font-weight: bold; margin: 10px 0; }
.upgrade-btn { background-color: var(--success); color:#fff; border:none; padding:10px 20px; border-radius:4px; cursor:pointer; font-size:0.9rem; }
.upgrade-btn:hover { background-color:#229954; }
.upgrade-btn:disabled { background-color:#7f8c8d; cursor:not-allowed; }

/* Profile page */
.profile-card{ position:relative; overflow:hidden; }
.profile-bg{ position:relative; height:320px; background-size:cover; background-position:center; border-bottom:1px solid rgba(255,255,255,0.06); }
.profile-bg-overlay{ position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.55)); color:#e5e7eb; padding:16px; font-size:14px; }
.profile-header{ display:flex; gap:16px; align-items:flex-end; padding:16px; }
.profile-avatar{ position:relative; z-index:2; width:120px; height:120px; border-radius:12px; background:#111827; color:#fff; display:flex; align-items:center; justify-content:center; font-size:44px; border:2px solid rgba(255,255,255,0.12); background-size:cover; background-position:center; transform: translateY(-72px); box-shadow: 0 10px 24px rgba(0,0,0,0.35); }
.online-dot{ position:absolute; right:-4px; bottom:-4px; width:14px; height:14px; border-radius:50%; border:2px solid #0f172a; background:#6b7280; }
.online-dot.online{ background:#22c55e; }
.online-dot.offline{ background:#6b7280; }
.profile-info{ transform: translateY(-40px); }
.profile-name{ margin:0; }
.profile-meta{ color:#9ca3af; margin-top:4px; }
.profile-actions{ display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.profile-edit .form-row{ display:flex; gap:16px; flex-wrap:wrap; }
.friends-page .online-dot{ display:inline-block; vertical-align:middle; }
