/* =============================================================
   MyCoinage — Dark Theme CSS Framework
   Spec §6.1 colour system · Desktop-first · Mobile-responsive
   ============================================================= */

/* ── Custom Properties ───────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-deep:        #0D1B2A;
    --bg-card:        #1A2C42;
    --bg-input:       #243850;

    /* Blues */
    --blue-primary:   #1A56A8;
    --blue-electric:  #2E86DE;

    /* Accent */
    --gold:           #C9963A;

    /* Text */
    --text-primary:   #FFFFFF;
    --text-secondary: #A8B8CC;
    --text-muted:     #5E7A94;

    /* Semantic */
    --success:        #27AE60;
    --danger:         #E74C3C;

    /* Borders */
    --border:         #2A3D56;

    /* Spacing */
    --radius:         8px;
    --radius-lg:      12px;

    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--blue-electric); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.25;
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

small, .text-sm { font-size: .875rem; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary   { color: var(--text-primary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-gold      { color: var(--gold); }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.container-md {
    max-width: 900px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* ── Navigation ──────────────────────────────────────────────── */
.nav {
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1rem;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.02em;
    white-space: nowrap;
}
.nav-logo span { color: var(--gold); }
.nav-logo:hover { text-decoration: none; }

.nav-links {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    padding: .4rem .75rem;
    border-radius: var(--radius);
    font-size: .9rem;
    transition: color .15s, background .15s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-card);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.nav-actions-secondary { display: flex; align-items: center; gap: .5rem; }

/* Spot price ticker in nav */
.spot-ticker {
    display: flex;
    gap: 1rem;
    font-size: .8rem;
    color: var(--text-muted);
    padding: 0 .75rem;
    border-left: 1px solid var(--border);
}
.spot-ticker span { color: var(--gold); font-weight: 600; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.card-sm  { padding: 1rem; }
.card-lg  { padding: 2rem; }

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .4rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card .stat-sub {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .4rem;
}

/* ── Coin Cards ──────────────────────────────────────────────── */
.coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.coin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    transition: border-color .15s, transform .15s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.coin-card:hover {
    border-color: var(--blue-electric);
    transform: translateY(-2px);
    text-decoration: none;
}

.coin-card-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    align-self: center;
    background: var(--bg-input);
}

.coin-card-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: .95rem;
    line-height: 1.3;
}

.coin-card-sub   { font-size: .72rem; color: var(--text-muted); font-style: italic; margin-top: .1rem; line-height: 1.2; }
.coin-card-year  { font-size: .8rem; color: var(--text-muted); }

.coin-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: auto;
}

.coin-card-trend {
    font-size: .8rem;
    font-weight: 600;
}
.coin-card-trend.up   { color: var(--success); }
.coin-card-trend.down { color: var(--danger); }
.coin-card-trend.flat { color: var(--text-muted); }

/* Key date badge */
.badge-key-date {
    display: inline-block;
    background: var(--gold);
    color: #000;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Pro badge */
.badge-pro {
    display: inline-block;
    background: var(--gold);
    color: #000;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, opacity .15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--blue-primary);
    color: #fff;
    border-color: var(--blue-primary);
}
.btn-primary:hover { background: var(--blue-electric); border-color: var(--blue-electric); }

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--blue-electric);
}

.btn-gold {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}
.btn-gold:hover { opacity: .9; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { opacity: .85; }

.btn-sm   { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg   { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled, .btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1.1rem;
}

.form-group:last-of-type { margin-bottom: 0; }

label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-optional { color: var(--text-muted); font-weight: 400; }
.label-link     { color: var(--blue-electric); font-weight: 400; font-size: .8rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .9rem;
    padding: .6rem .85rem;
    width: 100%;
    transition: border-color .15s;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue-electric);
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235E7A94' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

textarea { resize: vertical; min-height: 80px; }

.form-hint {
    font-size: .78rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-error   { background: rgba(231,76,60,.12);  border-color: rgba(231,76,60,.3);  color: #f1948a; }
.alert-success { background: rgba(39,174,96,.12);  border-color: rgba(39,174,96,.3);  color: #6fcf97; }
.alert-info    { background: rgba(46,134,222,.12); border-color: rgba(46,134,222,.3); color: #7eb9f5; }
.alert-warning { background: rgba(201,150,58,.12); border-color: rgba(201,150,58,.3); color: var(--gold); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table, .table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

thead th {
    text-align: left;
    padding: .7rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-input); }

tbody td {
    padding: .8rem 1rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

/* ── Pro Gate / Blur Overlay ─────────────────────────────────── */
.pro-gate {
    position: relative;
    overflow: hidden;
}

.pro-gate-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(13,27,42,.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.pro-gate-overlay p {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

/* ── Leaderboard Podium ──────────────────────────────────────── */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    text-align: center;
    min-width: 140px;
}

.podium-card.rank-1 { border-color: var(--gold); min-height: 180px; }
.podium-card.rank-2 { min-height: 155px; border-color: #aaa; }
.podium-card.rank-3 { min-height: 135px; border-color: #cd7f32; }

.podium-crown { font-size: 1.5rem; margin-bottom: .5rem; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-bar-wrap {
    background: var(--bg-input);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 99px;
    background: var(--blue-primary);
    transition: width .4s ease;
}

.progress-bar.complete { background: var(--success); }

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
    padding: 5rem 0 3.5rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin-inline: auto;
    margin-bottom: 2rem;
}

.hero-search {
    display: flex;
    max-width: 560px;
    margin-inline: auto;
    gap: .5rem;
}

.hero-search input {
    flex: 1;
    font-size: 1rem;
    padding: .75rem 1rem;
}

.hero-search .btn { padding: .75rem 1.5rem; font-size: 1rem; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    display: block;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.02em;
    margin-bottom: 1.75rem;
    text-decoration: none;
}

.auth-heading {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: .35rem;
}

.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}

.auth-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin-bottom: 1.25rem;
}

.auth-form .btn-full { margin-top: .75rem; }

.auth-footer {
    text-align: center;
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: .6rem;
}

.auth-legal {
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Pricing Feature List ────────────────────────────────────── */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}

.price-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: .5rem 0;
}

.price-display span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ── Filter Sidebar ──────────────────────────────────────────── */
.page-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.filter-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
}

.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-section h4 {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: .875rem;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
}

.pagination a:hover {
    background: var(--bg-input);
    border-color: var(--blue-electric);
    color: var(--text-primary);
    text-decoration: none;
}

.pagination span.current {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
    color: #fff;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.page-header h1 { margin-bottom: .35rem; }

/* ── Utilities ───────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm  { gap: .5rem; }
.flex-gap     { gap: 1rem; }
.flex-gap-lg  { gap: 1.5rem; }
.flex-wrap    { flex-wrap: wrap; }

.text-link { color: var(--blue-electric); }
.text-link:hover { text-decoration: underline; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }

.mt-0  { margin-top: 0; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mb-4  { margin-bottom: 2rem; }

.p-0  { padding: 0; }

.w-full  { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
    .filter-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    body { overflow-x: hidden; }

    .nav { overflow: hidden; }
    .nav-links { display: none; }
    /* On mobile, collapse to logo + essential actions only */
    .nav-actions-secondary { display: none; }
    .nav-actions { gap: .35rem; }
    .nav-actions .btn-sm { padding: .3rem .6rem; font-size: .8rem; }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .coin-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .form-row { grid-template-columns: 1fr; }

    .hero { padding: 3rem 0 2rem; }

    .spot-ticker { display: none; }

    .podium {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .auth-form { padding: 1.25rem; }
    .container { padding-inline: 1rem; }
}

/* ── Role Badges ─────────────────────────────────────────────── */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .15rem .45rem;
    border-radius: 4px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}
.role-badge--admin   { background: rgba(255,215,0,.18); color: #FFD700; border: 1px solid rgba(255,215,0,.4); box-shadow: 0 0 8px rgba(255,215,0,.3); }
.role-badge--mod     { background: rgba(74,144,217,.18); color: #4A90D9; border: 1px solid rgba(74,144,217,.4); }
.role-badge--pro     { background: rgba(0,188,212,.15); color: #00BCD4; border: 1px solid rgba(0,188,212,.35); }
.role-badge--blogger { background: rgba(156,39,176,.18); color: #CE93D8; border: 1px solid rgba(156,39,176,.4); }

/* ── Rarity Badges ───────────────────────────────────────────── */
.rarity-badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: .2rem .55rem;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
}

.rarity--common      { background: rgba(158,158,158,.15); color: #9E9E9E; border: 1px solid rgba(158,158,158,.3); }
.rarity--uncommon    { background: rgba(76,175,80,.15);   color: #4CAF50; border: 1px solid rgba(76,175,80,.3); }
.rarity--scarce      { background: rgba(0,150,136,.15);   color: #4DB6AC; border: 1px solid rgba(0,150,136,.3); }
.rarity--rare        { background: rgba(33,150,243,.15);  color: #64B5F6; border: 1px solid rgba(33,150,243,.3); }
.rarity--veryrare    { background: rgba(156,39,176,.18);  color: #CE93D8; border: 1px solid rgba(156,39,176,.35); animation: rarity-pulse 2.5s ease-in-out infinite; }
.rarity--elite       { background: rgba(255,152,0,.18);   color: #FFB74D; border: 1px solid rgba(255,152,0,.35); animation: rarity-pulse 2s ease-in-out infinite; }
.rarity--exceptional { background: rgba(244,67,54,.18);   color: #EF9A9A; border: 1px solid rgba(244,67,54,.35); animation: rarity-glow 2s ease-in-out infinite; box-shadow: 0 0 8px rgba(244,67,54,.35); }
.rarity--legendary   { background: linear-gradient(135deg, rgba(255,215,0,.15), rgba(255,140,0,.15)); color: #FFD700; border: 1px solid rgba(255,215,0,.4); animation: rarity-shimmer 3s linear infinite; }
.rarity--mythic      { background: linear-gradient(135deg, rgba(255,0,255,.12), rgba(100,0,255,.12)); color: #E040FB; border: 1px solid rgba(224,64,251,.4); animation: rarity-rainbow 4s linear infinite; }
.rarity--sovereign   { background: linear-gradient(135deg, rgba(255,215,0,.2), rgba(255,140,0,.2), rgba(255,215,0,.2)); color: #FFD700; border: 1px solid #FFD700; box-shadow: 0 0 16px rgba(255,215,0,.5), 0 0 32px rgba(255,140,0,.2); animation: rarity-sovereign 2s ease-in-out infinite; }

@keyframes rarity-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}
@keyframes rarity-glow {
    0%, 100% { box-shadow: 0 0 6px rgba(244,67,54,.3); }
    50%       { box-shadow: 0 0 14px rgba(244,67,54,.7); }
}
@keyframes rarity-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes rarity-rainbow {
    0%   { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}
@keyframes rarity-sovereign {
    0%, 100% { box-shadow: 0 0 16px rgba(255,215,0,.5), 0 0 32px rgba(255,140,0,.2); transform: scale(1); }
    50%       { box-shadow: 0 0 24px rgba(255,215,0,.8), 0 0 48px rgba(255,140,0,.4); transform: scale(1.03); }
}

/* ── Mobile Bottom Navigation Bar ────────────────────────────── */
.bottom-nav {
    display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
    /* Push page content above fixed bottom bar */
    body.has-bottom-nav { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }

    /* Hide top nav links on mobile — keep logo only */
    .nav-links { display: none !important; }
    .nav-actions { display: none !important; }
    .spot-ticker { display: none !important; }
    .nav-inner { justify-content: center; }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 60px;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
        align-items: stretch;
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        letter-spacing: .02em;
        min-width: 44px;
        min-height: 44px;
        transition: color .15s;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item .bnav-icon {
        font-size: 20px;
        line-height: 1;
    }

    .bottom-nav-item.active,
    .bottom-nav-item:hover {
        color: var(--blue-electric);
        text-decoration: none;
    }

    .bottom-nav-item.active .bnav-icon {
        filter: drop-shadow(0 0 4px rgba(46,134,222,.5));
    }

    /* Tables on mobile: horizontal scroll wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Modal dialogs full-screen on mobile */
    .modal-inner {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 60vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
    }

    /* Ensure form inputs don't trigger iOS zoom */
    input[type=text], input[type=email], input[type=password],
    input[type=number], input[type=search], input[type=tel],
    textarea, select {
        font-size: 16px !important;
    }

    /* Coin images */
    .coin-img { max-width: 100% !important; }
}

/* ── PWA Theme ───────────────────────────────────────────────── */
@media (display-mode: standalone) {
    .nav { padding-top: env(safe-area-inset-top); }
}
