/* ═══════════════════════════════════════════════════════
   KillerGame - Mobile Web App Styles
   Dark theme + Orange accents
   ═══════════════════════════════════════════════════════ */

:root {
    --bg-primary: #000000;
    --bg-card: #0a0a0a;
    --bg-card-alt: #141414;
    --bg-input: #1a1a1a;
    --bg-nav: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #f59e0b;
    --accent-hover: #f97316;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;
    --border: #1f1f1f;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 50%;
    --nav-height: 64px;
    --header-height: 56px;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ─── Typography ───────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #000;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Form Inputs ──────────────────────────────────────── */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder { color: var(--text-muted); }

/* ─── Splash / Auth Screen ─────────────────────────────── */
.splash-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: radial-gradient(ellipse at 50% 30%, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
}

.splash-logo {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.splash-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.splash-title .accent { color: var(--accent); }

.splash-tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 100%;
    max-width: 320px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-tab.active {
    color: #000;
    background: var(--accent);
}

.auth-form {
    width: 100%;
    max-width: 320px;
}

.auth-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 8px;
    text-align: center;
}

/* ─── App Shell ────────────────────────────────────────── */
.app-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-title .accent { color: var(--accent); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}
.header-btn:hover { color: var(--accent); }

/* ─── Status Badge ─────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-alive { background: rgba(34,197,94,0.15); color: var(--success); }
.status-dead { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-duel { background: rgba(245,158,11,0.15); color: var(--accent); }
.status-inactive { background: rgba(100,100,100,0.15); color: var(--text-muted); }

/* ─── Main Content Area ────────────────────────────────── */
.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.view {
    display: none;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 24px);
    min-height: 100%;
}
.view.active { display: block; }

/* ─── Player Card (Dashboard) ──────────────────────────── */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.player-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #000;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.dash-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.player-details { flex: 1; }
.player-name { font-weight: 700; font-size: 1.1rem; }
.player-level { color: var(--text-secondary); font-size: 0.8rem; }

/* XP Bar */
.xp-bar-container {
    margin-bottom: 16px;
}
.xp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.xp-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Daily Counters */
.daily-counters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.counter-box {
    background: var(--bg-card-alt);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.counter-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.counter-value .max { color: var(--text-muted); font-size: 1rem; }
.counter-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }
.counter-kills .counter-value { color: var(--danger); }
.counter-deaths .counter-value { color: var(--accent); }

/* ─── Radar Visualization ──────────────────────────────── */
.radar-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 320px;
    margin: 20px auto;
}

.radar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.radar-ring {
    position: absolute;
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-full);
}

.radar-ring-1 { width: 75%; height: 75%; top: 12.5%; left: 12.5%; }
.radar-ring-2 { width: 50%; height: 50%; top: 25%; left: 25%; }
.radar-ring-3 { width: 25%; height: 25%; top: 37.5%; left: 37.5%; }

.radar-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px var(--accent-glow);
    z-index: 2;
}

.radar-sweep {
    position: absolute;
    top: 0; left: 50%;
    width: 50%; height: 50%;
    transform-origin: bottom left;
    background: linear-gradient(to top, transparent, var(--accent-glow));
    animation: sweep 4s linear infinite;
    z-index: 1;
}

@keyframes sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-dot {
    position: absolute;
    width: 10px; height: 10px;
    background: var(--danger);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    z-index: 3;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.radar-dot.locked {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    width: 14px; height: 14px;
}

.radar-info {
    text-align: center;
    margin-top: 12px;
}

.radar-count {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.radar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ─── Nearby Player List ───────────────────────────────── */
.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.nearby-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.nearby-item:active { border-color: var(--accent); }

.nearby-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nearby-details { flex: 1; }
.nearby-name { font-weight: 600; font-size: 0.95rem; }
.nearby-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.nearby-distance {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

.nearby-action {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
}
.nearby-action:active { background: var(--accent); color: #000; }

/* ─── Duel Screen ──────────────────────────────────────── */
.duel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.duel-status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 8px;
}

.duel-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.duel-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.duel-player {
    text-align: center;
}

.duel-player-avatar {
    width: 60px; height: 60px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 auto 8px;
}

.duel-player-you .duel-player-avatar {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #000;
}

.duel-player-them .duel-player-avatar {
    background: var(--bg-card-alt);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.duel-player-name { font-weight: 600; font-size: 0.9rem; }
.duel-player-level { font-size: 0.75rem; color: var(--text-secondary); }

.duel-vs-icon {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.duel-timer {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.duel-timer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Code Input */
.code-input-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.code-digit {
    width: 48px; height: 56px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.code-digit:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.duel-code-display {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--accent);
    margin: 16px 0;
    text-shadow: 0 0 20px var(--accent-glow);
}

.duel-code-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ─── No Duel State ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 260px;
    margin: 0 auto;
}

/* ─── Leaderboard ──────────────────────────────────────── */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-top: 16px;
}

.podium-item {
    text-align: center;
    flex: 1;
    max-width: 100px;
}

.podium-avatar {
    width: 48px; height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    margin: 0 auto 6px;
    border: 2px solid;
}

.podium-1 .podium-avatar { border-color: #fbbf24; color: #fbbf24; }
.podium-2 .podium-avatar { border-color: #94a3b8; color: #94a3b8; }
.podium-3 .podium-avatar { border-color: #d97706; color: #d97706; }

.podium-name { font-size: 0.75rem; font-weight: 600; }
.podium-pts { font-size: 0.7rem; color: var(--text-secondary); }

.podium-block {
    height: 60px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    margin-top: 8px;
}

.podium-1 .podium-block { height: 80px; background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.podium-2 .podium-block { height: 60px; background: rgba(148, 163, 184, 0.1); color: #94a3b8; }
.podium-3 .podium-block { height: 45px; background: rgba(217, 119, 6, 0.1); color: #d97706; }

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.rank-item.me {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
}

.rank-pos {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 28px;
    text-align: center;
}

.rank-item.me .rank-pos { color: var(--accent); }

.rank-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.rank-info { flex: 1; }
.rank-name { font-weight: 600; font-size: 0.9rem; }
.rank-level { font-size: 0.7rem; color: var(--text-secondary); }

.rank-pts {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
}

/* ─── Shop ─────────────────────────────────────────────── */
.wallet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.wallet-amount {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

.wallet-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shop-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: border-color 0.2s;
}

.shop-item:active { border-color: var(--accent); }

.shop-item-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.shop-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.shop-item-price {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
}

.shop-item-buy {
    margin-top: 10px;
    padding: 6px 12px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

/* ─── Profile / Settings ───────────────────────────────── */
.profile-header {
    text-align: center;
    padding: 24px 0;
}

.profile-avatar {
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    margin: 0 auto 12px;
    border: 3px solid var(--accent);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    text-align: center;
    padding: 2px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-avatar:hover .profile-avatar-edit,
.profile-avatar:active .profile-avatar-edit {
    opacity: 1;
}

.profile-avatar-edit .material-symbols-outlined {
    font-size: 14px;
    color: #fff;
}

/* Avatar picker */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 4px 0;
}

.avatar-option {
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.avatar-option:hover { border-color: var(--border); }
.avatar-option.selected { border-color: var(--accent); }

.avatar-option-circle {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-option-default {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
}

.avatar-option-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.profile-name { font-size: 1.3rem; font-weight: 700; }
.profile-level { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
}

.settings-section {
    margin-top: 20px;
}

.settings-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-left: 4px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-left .material-symbols-outlined {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.settings-item-label { font-size: 0.9rem; }

/* Language Selector */
.lang-selector {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-option:hover { border-color: var(--text-muted); }

.lang-option.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.lang-flag { font-size: 1.1rem; }

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px; height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.toggle.active {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    background: white;
    border-radius: var(--radius-full);
    top: 2px; left: 2px;
    transition: transform 0.2s;
}

.toggle.active::after {
    transform: translateX(20px);
}

/* ─── Bottom Navigation ────────────────────────────────── */
.bottom-nav {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn .material-symbols-outlined { font-size: 1.4rem; }
.nav-btn span:last-child { font-size: 0.65rem; font-weight: 500; }

.nav-btn.active { color: var(--accent); }

/* Scanner button (center) */
.nav-btn-scan {
    position: relative;
    top: -12px;
    width: 56px; height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-nav);
    box-shadow: 0 4px 20px var(--accent-glow);
    padding: 0;
}

.nav-btn-scan .material-symbols-outlined {
    font-size: 1.6rem;
    color: #000;
}

/* ─── Toast Notifications ──────────────────────────────── */
.toast-container {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--accent); }

.toast-text { font-size: 0.85rem; flex: 1; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Loading Spinner ──────────────────────────────────── */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Geolocation Permission ───────────────────────────── */
.geo-prompt {
    text-align: center;
    padding: 40px 24px;
}

.geo-prompt .material-symbols-outlined {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 16px;
}

/* ─── Scrollbar ────────────────────────────────────────── */
.app-content::-webkit-scrollbar { width: 4px; }
.app-content::-webkit-scrollbar-track { background: transparent; }
.app-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── Modal ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 1000;
    padding: 0 0 env(safe-area-inset-bottom, 0);
}
.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%; max-width: 430px;
    padding: 20px;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-action {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 16px;
    color: var(--text-primary); font-size: 0.95rem;
    cursor: pointer; width: 100%; text-align: left;
}
.modal-action:active { background: var(--bg-card-alt); }

/* ─── Nearby actions ──────────────────────────────────── */
.nearby-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nearby-action-icon {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: var(--radius-sm);
}
.nearby-action-icon:active { background: var(--bg-input); }

/* ─── History ──────────────────────────────────────────── */
.history-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.history-details { flex: 1; min-width: 0; }
.history-title { font-size: 0.9rem; line-height: 1.3; }
.history-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Season Pass ──────────────────────────────────────── */
.pass-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}
.pass-season-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.pass-tier { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }
.pass-xp { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
.pass-rewards { display: flex; flex-direction: column; gap: 8px; }
.pass-reward-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.pass-reward-item.unlocked { border-color: var(--success); }
.pass-reward-item.premium { border-left: 3px solid var(--accent); }
.pass-reward-tier { font-size: 0.8rem; color: var(--text-muted); min-width: 70px; }
.pass-reward-value { flex: 1; font-size: 0.9rem; }
.pass-reward-locked { color: var(--text-muted); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; background: var(--accent); color: #000; border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }

/* ─── Duel Result ──────────────────────────────────────── */
.duel-result { text-align: center; }
.duel-result-icon { margin-bottom: 12px; }
.duel-victory .duel-result-icon { color: var(--accent); }
.duel-defeat .duel-result-icon { color: var(--danger); }
.duel-result-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.duel-victory .duel-result-title { color: var(--accent); }
.duel-defeat .duel-result-title { color: var(--danger); }
.duel-result-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 20px; }
.duel-result-stats { display: flex; justify-content: center; gap: 24px; }
.result-stat {
    display: flex; align-items: center; gap: 6px;
    font-size: 1rem; font-weight: 600;
    color: var(--text-primary);
}
.result-stat .material-symbols-outlined { font-size: 20px; }

/* ─── Killer Party ─────────────────────────────────────── */
.party-join-screen { padding: 20px 0; }

.party-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.party-event-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
}

.party-event-location {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.party-stats-row {
    display: flex;
    justify-content: space-around;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.party-stat { text-align: center; }
.party-stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.party-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

.party-badge-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.party-badge-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.party-badge-number {
    font-size: 3rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.party-target-card {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.05));
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(245,158,11,0.2); }
    50% { box-shadow: 0 0 25px rgba(245,158,11,0.4); }
}

.party-target-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 8px;
}

.party-target-badge {
    font-size: 4.5rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--accent);
    line-height: 1;
}

.party-target-name {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 8px;
}

.party-target-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.party-waiting, .party-eliminated {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.party-feed {
    margin-top: 16px;
}

.party-feed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.party-feed-item .material-symbols-outlined {
    font-size: 18px;
    color: var(--danger);
}

.party-lb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.party-lb-pos {
    font-weight: 800;
    font-size: 1rem;
    width: 28px;
    text-align: center;
    color: var(--text-muted);
}

.party-lb-pos.gold { color: #fbbf24; }
.party-lb-pos.silver { color: #94a3b8; }
.party-lb-pos.bronze { color: #d97706; }

.party-lb-info { flex: 1; }
.party-lb-name { font-weight: 600; font-size: 0.9rem; }
.party-lb-meta { font-size: 0.75rem; color: var(--text-muted); }
.party-lb-kills { font-weight: 800; font-size: 1.1rem; color: var(--accent); }

.party-lb-dead { opacity: 0.5; }

/* QR Scanner */
.qr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.qr-crosshair {
    width: 60%;
    aspect-ratio: 1;
    border: 2px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

/* ─── Kill Flash (when you get killed) ─────────────────── */
.kill-flash {
    position: fixed; inset: 0;
    background: rgba(239, 68, 68, 0.6);
    z-index: 9999;
    pointer-events: none;
    animation: killFlashAnim 1.5s ease-out forwards;
}
@keyframes killFlashAnim {
    0% { opacity: 1; }
    20% { opacity: 0.3; }
    40% { opacity: 0.8; }
    60% { opacity: 0.2; }
    80% { opacity: 0.5; }
    100% { opacity: 0; }
}
.kill-bright {
    position: fixed; inset: 0;
    background: #ffffff;
    z-index: 10000;
    pointer-events: none;
    animation: killBrightAnim 0.8s ease-out forwards;
}
@keyframes killBrightAnim {
    0% { opacity: 0.9; }
    30% { opacity: 0; }
    50% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* ─── Currency Bar (Dashboard) ─────────────────────────── */
.currency-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding: 8px 0;
}
.currency-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.currency-icon { font-size: 18px; }
.coins-icon { color: #fbbf24; }
.gems-icon { color: #a78bfa; }
.currency-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ─── Dashboard Gauges ────────────────────────────────── */
.dash-gauges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.gauge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}
.gauge-cooldown { background: rgba(239,68,68,0.12); color: var(--danger); }
.gauge-protected { background: rgba(59,130,246,0.12); color: var(--info); }
.gauge-season { background: rgba(245,158,11,0.1); color: var(--accent); }

/* ─── Nearby Rewards Tags ─────────────────────────────── */
.nearby-rewards {
    display: flex;
    gap: 6px;
    margin-top: 3px;
}
.reward-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.reward-xp { background: rgba(34,197,94,0.15); color: var(--success); }
.reward-coins { background: rgba(251,191,36,0.15); color: #fbbf24; }
.nearby-bonus {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--success);
    margin-left: 4px;
}

/* ─── Shop Tabs ───────────────────────────────────────── */
.shop-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}
.shop-tab.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ─── Shop dual currency ──────────────────────────────── */
.wallet-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 14px;
}
.wallet-col {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shop-item-rarity {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.shop-item-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.3;
}
.shop-item-prices {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 4px;
}
.shop-price {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
}
.coins-price { color: #fbbf24; }
.gems-price { color: #a78bfa; }
.shop-item.owned { opacity: 0.6; }
.shop-item-owned {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

/* ─── Duel Result enriched ────────────────────────────── */
.result-stat-coins { color: #fbbf24; }
.result-stat-season { color: var(--info); }
.result-stat-bonus { color: var(--success); }

/* ─── Inventory ───────────────────────────────────────── */
.inventory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.inventory-item.equipped { border-color: var(--accent); }
.inventory-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.inventory-item.equipped .inventory-icon { color: var(--accent); }
.inventory-details { flex: 1; min-width: 0; }
.inventory-name { font-weight: 600; font-size: 0.9rem; }
.inventory-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Responsive ───────────────────────────────────────── */
@media (min-width: 480px) {
    .app-shell { max-width: 430px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
