@font-face {
    font-family: "jost";
    src: url("../../assets/fonts/jost.ttf") format("truetype");
}

@font-face {
    font-family: "zombie";
    src: url("../../assets/fonts/zombie.otf") format("opentype");
}

@font-face {
    font-family: "orbitron";
    src: url("../../assets/fonts/orbitron.ttf") format("truetype");
}

:root {
    --space: #000033;
    --cyan: #00ffcc;
    --gold: #ffd700;
    --ink: #02021a;
    --panel: rgba(0, 0, 51, 0.78);
    --panel-strong: rgba(0, 0, 28, 0.92);
    --line: rgba(0, 255, 204, 0.24);
    --text: #f5fffc;
    --muted: rgba(245, 255, 252, 0.66);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--space);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0 16px;
    color: var(--text);
    font-family: "jost", system-ui, sans-serif;
    background:
        radial-gradient(circle at 72% 18%, rgba(0, 255, 204, 0.12), transparent 28rem),
        linear-gradient(90deg, rgba(0, 0, 22, 0.96), rgba(0, 0, 51, 0.62)),
        url("../../assets/images/starbg.png") center / auto fixed,
        var(--space);
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

.hall-layout {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.hall-header {
    position: relative;
    width: 100%;
    padding: 0 56px 26px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(0, 0, 22, 0.78), rgba(0, 0, 51, 0.28)),
        rgba(0, 0, 51, 0.24);
}

.control-label,
.hamburger-section-label,
.stat-row span,
.rank-badge,
.timer-strip,
.select-control,
.sort-direction-button,
.segment-button,
.sanctum-button,
.controls-menu-toggle {
    font-family: "orbitron", monospace;
}

h1 {
    margin: 0;
    color: var(--cyan);
    font-family: "zombie", fantasy;
    font-size: 5.65rem;
    line-height: 0.86;
    font-weight: 400;
    letter-spacing: 0;
    text-align: center;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.8);
    text-shadow:
        0 0 14px rgba(0, 255, 204, 0.96),
        0 0 34px rgba(0, 255, 204, 0.74),
        0 0 68px rgba(0, 255, 204, 0.38),
        0 14px 42px rgba(0, 0, 0, 0.9);
}

.subtitle {
    margin: 18px auto 0;
    max-width: 820px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.45;
    text-align: center;
}

.stats-bar {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(0, 255, 204, 0.09), rgba(0, 0, 24, 0.86)),
        rgba(0, 0, 24, 0.82);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow:
        inset 0 0 28px rgba(0, 255, 204, 0.08),
        0 0 24px rgba(0, 255, 204, 0.08);
}

.stats-secondary-row {
    display: flex;
    width: 100%;
    align-items: stretch;
    justify-content: space-evenly;
    border-bottom: 1px solid rgba(0, 255, 204, 0.18);
}

.stat-row {
    position: relative;
    display: flex;
    min-height: 84px;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    text-align: center;
}

.stats-secondary-row .stat-row + .stat-row::before {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 1px;
    content: "";
    background: linear-gradient(180deg, transparent, rgba(0, 255, 204, 0.34), transparent);
}

.stat-row span {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.stat-row strong {
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 1.6rem;
    line-height: 1.08;
    font-weight: 800;
    text-shadow:
        0 0 10px rgba(0, 255, 204, 0.95),
        0 0 26px rgba(0, 255, 204, 0.54),
        0 0 44px rgba(0, 255, 204, 0.22);
}

.hall-age-stat {
    flex: 0 0 auto;
    min-height: 116px;
    padding: 18px 16px;
}

.hall-age-stat strong {
    font-size: clamp(2.3rem, 5vw, 4.3rem);
    line-height: 1;
}

.stat-good {
    color: #2ed573 !important;
    text-shadow:
        0 0 10px rgba(46, 213, 115, 0.9),
        0 0 26px rgba(46, 213, 115, 0.5) !important;
}

.stat-bad {
    color: #ff4757 !important;
    text-shadow:
        0 0 10px rgba(255, 71, 87, 0.9),
        0 0 26px rgba(255, 71, 87, 0.5) !important;
}

.stat-close {
    color: #ffd700 !important;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.9),
        0 0 26px rgba(255, 215, 0, 0.52) !important;
}

.stat-normal {
    color: var(--cyan) !important;
}

.live-stat {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08), transparent);
}

.live-stat strong {
    animation: readoutPulse 1.8s ease-in-out infinite;
}

@keyframes readoutPulse {
    0%,
    100% {
        text-shadow:
            0 0 10px rgba(0, 255, 204, 0.9),
            0 0 26px rgba(0, 255, 204, 0.5),
            0 0 44px rgba(0, 255, 204, 0.22);
    }

    50% {
        text-shadow:
            0 0 14px rgba(0, 255, 204, 1),
            0 0 34px rgba(0, 255, 204, 0.78),
            0 0 58px rgba(255, 215, 0, 0.28);
    }
}

.control-label {
    margin-top: 4px;
    color: var(--gold);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.controls-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(0, 0, 24, 0.72);
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

.controls-row .control-label {
    margin-top: 0;
    white-space: nowrap;
}

.controls-row .select-control {
    width: auto;
    max-width: fit-content;
    min-height: 36px;
    padding: 0 32px 0 12px;
}

.sort-direction-button {
    display: inline-grid;
    flex: 0 0 38px;
    width: 38px;
    min-height: 36px;
    place-items: center;
    padding: 0;
    color: var(--cyan);
    background: rgba(0, 0, 24, 0.86);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.1);
}

.search-input,
.select-control {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(0, 0, 24, 0.86);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 4px;
    outline: none;
}

.search-input:focus,
.select-control:focus,
.sort-direction-button:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.16);
}

.sort-direction-button:hover {
    background: rgba(0, 255, 204, 0.14);
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(0, 255, 204, 0.34);
}

.segment-button,
.sanctum-button,
.controls-menu-toggle {
    min-height: 42px;
    color: var(--cyan);
    background: rgba(0, 0, 24, 0.78);
    border: 0;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.74rem;
}

.segment-button + .segment-button {
    border-left: 1px solid rgba(0, 255, 204, 0.34);
}

.segment-button.active {
    color: #001b22;
    background: var(--cyan);
}

.button-stack {
    display: grid;
    gap: 10px;
}

.sanctum-button {
    border: 1px solid rgba(0, 255, 204, 0.34);
}

.controls-menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 42px;
    min-height: 38px;
    padding: 0;
    color: var(--cyan);
    background: rgba(0, 0, 20, 0.96);
    border: 0;
    border-right: 1px solid rgba(0, 255, 204, 0.34);
    border-bottom: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 0;
    font-size: 1.05rem;
    line-height: 1;
    box-shadow: 0 0 18px rgba(0, 255, 204, 0.16);
}

.controls-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99;
    width: min(280px, 100vw);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 22, 0.98), rgba(0, 0, 51, 0.94)),
        rgba(0, 0, 51, 0.96);
    border-right: 1px solid rgba(0, 255, 204, 0.34);
    border-bottom: 1px solid rgba(0, 255, 204, 0.34);
    box-shadow: 18px 18px 44px rgba(0, 0, 0, 0.56);
    transition: max-height 260ms ease, opacity 180ms ease;
}

.controls-dropdown-inner {
    display: grid;
    gap: 12px;
    padding: 52px 14px 14px;
}

.controls-dropdown.menu-open {
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
}

.trait-filter {
    display: grid;
    gap: 8px;
    padding: 4px 0;
}

.hamburger-section-label {
    color: rgba(0, 255, 204, 0.66);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.select-control.trait-filter-select {
    width: auto;
    max-width: fit-content;
    min-height: 36px;
    padding: 0 32px 0 12px;
}

.select-control.trait-filter-select:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.clear-filter-button {
    width: fit-content;
    min-height: 34px;
    padding: 7px 10px;
    color: #ff8f9d;
    background: rgba(0, 0, 24, 0.78);
    border: 1px solid rgba(255, 143, 157, 0.58);
    border-radius: 4px;
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.clear-filter-button:hover {
    background: rgba(255, 71, 87, 0.14);
}

.clear-filter-button[hidden] {
    display: none;
}

.sanctum-button.danger {
    color: #ff8f9d;
    border-color: rgba(255, 143, 157, 0.48);
}

.hall-wall {
    min-width: 0;
    width: 100%;
    padding: 18px;
}

.gecko-wall.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 16px;
}

.gecko-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #05051c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    isolation: isolate;

    margin-top: 15px;
}

.gecko-card:hover {
    transform: translateY(-2px);
}

.gecko-image-frame {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1;
    min-height: 0;
    background: #05051c;
}

.gecko-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    padding: 5px 8px;
    color: var(--gold);
    background: rgba(0, 0, 20, 0.76);
    border: 1px solid rgba(255, 215, 0, 0.42);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.32);
}

.gecko-info-bar {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 12px 10px;
    background: rgba(0, 0, 20, 0.94);
    border-top: 1px solid var(--wallet-glow-color, rgba(0, 255, 204, 0.28));
}

.timer-strip {
    min-width: 0;
    display: block;
    width: 100%;
    color: var(--cyan);
    font-size: clamp(8px, 1.8vw, 11px);
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gecko-wall.list-view {
    display: grid;
    gap: 16px;
}

.owner-section {
    position: relative;
    background: rgba(0, 0, 28, 0.62);
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 6px;
    overflow: hidden;
}

.owner-section-header,
.owner-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(0, 0, 20, 0.78);
}

.owner-section-header h2,
.owner-header h2 {
    margin: 0;
    font-family: "orbitron", monospace;
    color: var(--cyan);
    font-size: 0.98rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.owner-section-header h2.copyable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(0, 255, 204, 0.34);
    text-underline-offset: 4px;
}

.owner-section-header h2.copyable.copied {
    color: var(--gold);
}

.owner-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.owner-count {
    color: var(--gold);
    font-family: "orbitron", monospace;
    white-space: nowrap;
}

.indicator-column {
    display: flex;
    flex-direction: column;
    max-width: min(760px, 72%);
    gap: 6px;
}

.indicator-item {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-family: "orbitron", monospace;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    background: rgba(0, 0, 24, 0.84);
    box-shadow: 0 0 14px rgba(0, 255, 204, 0.18);
}

.indicator-item.general {
    color: #ffd700;
    background: rgba(70, 54, 0, 0.42);
}

.indicator-item.lieutenant {
    color: #cfd8dc;
    background: rgba(84, 96, 103, 0.34);
}

.indicator-item.order {
    color: #00e5ff;
    background: rgba(0, 72, 82, 0.34);
}

.indicator-item.faction-set {
    color: #c58cff;
    background: rgba(78, 30, 128, 0.34);
}

.owner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 12px;
    padding: 14px;
}

.owner-geckos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 14px;
}

.owner-gecko-item {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #05051c;
    border: 1px solid rgba(0, 255, 204, 0.24);
    border-radius: 6px;
    cursor: pointer;
}

.owner-gecko-item:hover {
    transform: translateY(-2px);
}

.owner-gecko-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #05051c;
}

.owner-gecko-info {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 6px;
    background: rgba(0, 0, 20, 0.94);
    border-top: 1px solid rgba(0, 255, 204, 0.18);
}

.owner-gecko-id {
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    font-weight: 900;
}

.rank-badge.list-view-badge {
    top: 6px;
    left: 6px;
    padding: 4px 7px;
    font-size: 0.66rem;
}

.empty-state,
.loading-state {
    padding: 70px 20px;
    color: var(--muted);
    text-align: center;
    font-family: "orbitron", monospace;
}

.modal {
    /* Positioning context for the close/link/export controls: they anchor here
       rather than to the scrolling panel, so they stay put as content scrolls. */
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(0, 0, 16, 0.82);
    backdrop-filter: blur(8px);
}

.modal[hidden] {
    display: none;
}

.modal-panel {
    position: relative;
    width: min(980px, 100%);
    max-height: min(960px, 96vh);
    overflow-y: auto;
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(0, 0, 51, 0.96), rgba(0, 0, 24, 0.98)),
        url("../../assets/images/starbg.png") center / auto fixed;
    border: 1px solid rgba(0, 255, 204, 0.42);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 255, 204, 0.16);
}

.detail-panel {
    width: min(920px, 100%);
    /* min() rather than a flat 560px: a hard minimum forced the panel wider
       than a narrow viewport, which pushes the whole page sideways and makes
       the browser zoom out so mobile media queries never match. */
    min-width: min(560px, 100%);
    overflow-y: auto;
}

.leaderboard-panel {
    width: min(1127px, 100%);
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    color: var(--cyan);
    background: rgba(0, 0, 20, 0.86);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 4px;
    cursor: pointer;
}

.detail-top {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: start;
}

.detail-image-col {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    display: block;
    object-fit: contain;
    background: #05051c;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 204, 0.32);
}

.gecko-composite {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    flex-shrink: 0;
}

.gecko-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.modal h2 {
    margin: 0 46px 16px 0;
    color: var(--cyan);
    font-family: "orbitron", monospace;
}

.detail-meta,
.leaderboard-list {
    display: grid;
    gap: 10px;
}

.detail-meta {
    gap: 4px;
}

.detail-meta .meta-line {
    padding: 4px 0;
}

.meta-line,
.leaderboard-row {
    display: flex;
    justify-content: space-between;
    /* Baseline rather than stretch: an I8 badge makes some labels taller, and
       without this the value on the right floats away from its own text. */
    align-items: baseline;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0, 255, 204, 0.14);
}

.leaderboard-row.rank-1 {
    color: #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.14), transparent);
    border-bottom-color: rgba(255, 215, 0, 0.42);
}

.leaderboard-row.rank-2 {
    color: #cfd8dc;
    background: linear-gradient(90deg, rgba(207, 216, 220, 0.12), transparent);
    border-bottom-color: rgba(207, 216, 220, 0.36);
}

.leaderboard-row.rank-3 {
    color: #cd7f32;
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.13), transparent);
    border-bottom-color: rgba(205, 127, 50, 0.38);
}

.meta-line span,
.leaderboard-row span {
    color: var(--muted);
    /* The wallet label is the flexible half: let it shrink and ellipsize so the
       value on the right keeps its own line. */
    min-width: 0;
    overflow-wrap: anywhere;
}

.meta-line strong,
.leaderboard-row strong {
    color: var(--text);
    text-align: right;
    /* break-word, not anywhere: "anywhere" split dates like 2/23/2025 mid-number
       and unit labels like "8 faction sets" mid-phrase. This still rescues a
       genuinely unbreakable string but leaves normal values intact. */
    overflow-wrap: break-word;
    flex: 0 0 auto;
}

.copyable-wallet-address {
    cursor: pointer;
    transition: color 120ms ease, text-shadow 120ms ease;
}

.copyable-wallet-address.copied {
    color: #2ed573;
    text-shadow: 0 0 10px rgba(46, 213, 115, 0.9);
}

/* Sits beside .modal-close so the two read as one control cluster. */
.modal-link-button {
    position: absolute;
    top: 12px;
    right: 56px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    color: var(--cyan);
    background: rgba(0, 0, 20, 0.86);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-link-button:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.35);
}

.modal-link-button.copied {
    border-color: #2ed573;
    box-shadow: 0 0 12px rgba(46, 213, 115, 0.55);
}

/* Third control in the cluster, left of the link button. */
.modal-export-button {
    position: absolute;
    top: 12px;
    right: 100px;
    z-index: 5;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    color: var(--gold);
    background: rgba(0, 0, 20, 0.86);
    border: 1px solid rgba(255, 215, 0, 0.34);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.modal-export-button:hover:not(:disabled) {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.modal-export-button:disabled {
    cursor: progress;
    opacity: 0.75;
}

/* The finished export, shown so the user can save it with their own gesture.
   A synthetic click is unreliable on mobile: browsers allow about one
   programmatic download per page load and drop the rest without an error. */
.export-result {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    background: rgba(0, 0, 12, 0.94);
    /* hidden, not auto: the image is already capped to the viewport, and a
       scrollable overlay let a tall export push its own controls off-screen. */
    overflow: hidden;
}

.export-result-image {
    /* width:auto with a height cap keeps a very tall export (the dossier is
       roughly 1:2.5) scaled to fit rather than filling the overlay width and
       leaving the picture letterboxed inside an oversized box. */
    width: auto;
    height: auto;
    max-width: min(100%, 520px);
    max-height: 70vh;
    object-fit: contain;
    flex: 0 1 auto;
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
}

.export-result-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

/* Rendered as a <button> when Web Share is available, an <a> otherwise. */
.export-result-save {
    padding: 12px 26px;
    cursor: pointer;
    border: 1px solid rgba(46, 213, 115, 0.7);
    border-radius: 8px;
    background: rgba(0, 30, 14, 0.9);
    color: #2ed573;
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
}

.export-result-share {
    padding: 12px 22px;
    border: 1px solid rgba(160, 80, 255, 0.6);
    border-radius: 8px;
    background: rgba(18, 0, 32, 0.9);
    color: #a050ff;
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}

.export-result-close {
    padding: 12px 22px;
    border: 1px solid rgba(0, 255, 204, 0.4);
    border-radius: 8px;
    background: rgba(0, 0, 24, 0.9);
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}

.export-result-hint {
    width: 100%;
    color: var(--muted);
    font-size: 0.72rem;
}

/* Export failures are otherwise invisible on mobile, where there is no console
   to read and a blocked download looks the same as nothing happening. */
.export-error-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px;
    border: 1px solid rgba(255, 95, 126, 0.7);
    border-radius: 8px;
    background: rgba(30, 0, 10, 0.96);
    color: #ff5f7e;
    font-family: "orbitron", monospace;
    font-size: 0.66rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Confirm the copy in place: the icon alone gives no feedback. */
.modal-link-button.copied::after {
    content: "Copied";
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    transform: translateY(-50%);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 20, 0.92);
    border: 1px solid rgba(46, 213, 115, 0.5);
    color: #2ed573;
    font-family: "orbitron", monospace;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.leaderboard-row.rank-1 span,
.leaderboard-row.rank-1 strong {
    color: #ffd700;
}

.leaderboard-row.rank-2 span,
.leaderboard-row.rank-2 strong {
    color: #cfd8dc;
}

.leaderboard-row.rank-3 span,
.leaderboard-row.rank-3 strong {
    color: #cd7f32;
}

.leaderboard-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.leaderboard-tabs-bar {
    display: flex;
    border-bottom: 1px solid rgba(0, 255, 204, 0.15);
    margin-bottom: 18px;
}

.leaderboard-tab-btn {
    padding: 10px 20px;
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: rgba(0, 255, 204, 0.4);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    text-transform: uppercase;
    transition: color 0.2s;
}

.leaderboard-tab-btn.active {
    color: #00FFCC;
    border-bottom-color: #00FFCC;
}

.leaderboard-tab-btn:hover:not(.active) {
    color: rgba(0, 255, 204, 0.7);
}

.leaderboard-tab-pane {
    display: none;
}

.leaderboard-tab-pane-overview.active {
    display: grid;
    /* 300px minimum: at 250 the six cards fell 4 + 2, leaving a ragged second
       row. A wider track lands them 3 + 3 on a typical modal width and gives
       each row's labels room to sit on one line. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

.leaderboard-tab-pane-i8.active {
    display: grid;
    gap: 14px;
}

/* Each pane needs its own .active rule — the base .leaderboard-tab-pane is
   display:none, so without this the growth tab rendered nothing. */
.leaderboard-tab-pane-growth.active {
    display: block;
}

.leaderboard-stats-summary {
    display: grid;
    grid-column: 1 / -1;
    /* auto-fit rather than a hard 3: there are four stats, and the fixed count
       stranded the fourth alone on a second row. */
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.leaderboard-stat-item {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 24, 0.72);
    border: 1px solid rgba(0, 255, 204, 0.22);
    border-radius: 6px;
}

.leaderboard-stat-item span {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.68rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.leaderboard-stat-item strong {
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 1.35rem;
    line-height: 1.1;
}

.leaderboard-card {
    padding: 16px;
    background: rgba(0, 0, 24, 0.72);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 6px;
}

.leaderboard-card h3 {
    margin: 0 0 12px;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 0.9rem;
}

.trait-list {
    display: contents;
}

.detail-traits-col {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    padding-top: 16px;
    margin-top: 18px;
    border-top: 1px solid rgba(0, 255, 204, 0.18);
}

.trait-section-title {
    grid-column: 1 / -1;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.trait-gecko-popup-content {
    display: grid;
    gap: 18px;
}

.trait-gecko-header h2 {
    margin: 0 46px 6px 0;
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 1.35rem;
    line-height: 1.2;
}

.trait-gecko-header .subtitle {
    margin: 0 46px 0 0;
    max-width: none;
    text-align: left;
}

.composite-exists-badge {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.composite-exists-badge.exists-true {
    color: var(--cyan);
}

.composite-exists-badge.exists-true a {
    color: var(--cyan);
    text-decoration: underline;
}

.composite-exists-badge.exists-false {
    color: #ff4757;
}

.trait-gecko-main {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    padding-top: 4px;
}

.trait-gecko-composite-traits {
    display: grid;
    align-content: center;
    gap: 2px;
    min-width: 0;
}

.trait-gecko-composite-traits .meta-line {
    align-items: start;
    padding: 6px 0;
}

.trait-gecko-composite-traits .meta-line span {
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.trait-gecko-composite-traits .meta-line strong {
    color: var(--cyan);
    font-size: 1rem;
}

.trait-composite-value {
    min-width: 0;
    text-align: right;
}

.trait-composite-value strong,
.trait-composite-value small {
    display: block;
}

.trait-composite-value small {
    margin-top: 2px;
    color: rgba(245, 255, 252, 0.52);
    font-size: 0.78rem;
    line-height: 1.25;
}

.none-trait-toggle {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.none-trait-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--cyan);
}

.mortal-trait-gecko-panel {
    border-color: rgba(255, 67, 101, 0.48);
    box-shadow: 0 0 60px rgba(255, 67, 101, 0.14);
}

.mortal-gecko-popup-content .trait-gecko-header h2,
.mortal-gecko-popup-content .trait-gecko-composite-traits .meta-line strong {
    color: #ff4757;
}

.mortal-gecko-popup-content .none-trait-toggle input {
    accent-color: #ff4757;
}

.trait-pill {
    padding: 10px;
    background: rgba(0, 0, 24, 0.72);
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 4px;
}

.trait-pill span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.trait-pill strong {
    color: var(--cyan);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    padding: 12px 0;
}

.detail-action-button {
    width: 150px;
    min-height: 38px;
    padding: 8px 12px;
    color: var(--cyan);
    background: rgba(0, 0, 24, 0.78);
    border: 1px solid rgba(0, 255, 204, 0.34);
    border-radius: 4px;
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.detail-action-button:hover {
    background: rgba(0, 255, 204, 0.14);
}

.detail-action-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

/* ============================================================
   Wallet popup (redesigned) — sizing, header, sectioned layout
   ============================================================ */
.wallet-panel {
    width: 85vw;
    max-width: 85vw;
    height: fit-content;
    max-height: 75vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#walletTitle {
    margin: 0 46px 4px 0;
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 1.6rem;
    text-shadow: 0 0 12px rgba(0, 255, 204, 0.4);
    word-break: break-word;
}

.wallet-subtitle {
    margin: 0 46px 14px 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.wallet-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

.wallet-status-pill {
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.08);
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.66rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wallet-status-pill.i8 {
    border-color: rgba(185, 242, 255, 0.8);
    background: rgba(185, 242, 255, 0.12);
    color: #b9f2ff;
}

.wallet-status-pill.general {
    border-color: rgba(255, 215, 0, 0.7);
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
}

.wallet-status-pill.lieutenant {
    border-color: rgba(192, 192, 192, 0.7);
    background: rgba(192, 192, 192, 0.1);
    color: #dcdcdc;
}

/* --- Generic section shell --- */
.wallet-sec {
    margin-bottom: 28px;
}

.wallet-sec-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 210, 0, 0.2);
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.wallet-sec-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.wallet-sec-count {
    color: rgba(255, 210, 0, 0.55);
    letter-spacing: 2px;
}

.wallet-sec-action {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--cyan);
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.wallet-sec-action:hover {
    text-shadow: 0 0 8px currentColor;
}

/* --- Section 1: Earned Titles (horizontal scroll pills) --- */
/* Wraps rather than scrolls: the pills are wide enough that a single row hid
   titles off-screen even in the collapsed preview, and a sideways drag is easy
   to miss. Wrapping keeps every visible title reachable, matches the export,
   and grows to as many rows as the wallet needs. */
.wallet-titles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    padding-bottom: 8px;
}

.wallet-title-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    max-width: 280px;
    min-height: 64px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 215, 0, 0.55);
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.06);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
}

.wallet-title-star {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 0.9rem;
}

.wallet-title-text {
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    color: var(--text);
    white-space: normal;
}

.wallet-title-role {
    margin-right: 6px;
    color: var(--gold);
    font-size: 0.62rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wallet-title-x {
    color: var(--cyan);
}

.wallet-more-chip {
    flex: 0 0 auto;
    align-self: center;
    padding: 8px 14px;
    border: 1px dashed rgba(255, 215, 0, 0.5);
    border-radius: 999px;
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.66rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.wallet-more-chip:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* --- Section 2: Immortal Faction Sets (2-column rows) --- */
.wallet-set-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wallet-set-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 204, 0.16);
    border-radius: 6px;
    background: rgba(0, 0, 24, 0.5);
}

.wallet-set-icon {
    flex: 0 0 auto;
    color: var(--gold);
    font-size: 1rem;
}

.wallet-set-name {
    flex: 1 1 auto;
    overflow: hidden;
    font-family: "orbitron", monospace;
    font-size: 0.76rem;
    color: var(--text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.wallet-set-index {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.7rem;
}

.wallet-set-chevron {
    flex: 0 0 auto;
    color: var(--cyan);
    font-size: 1.1rem;
}

/* --- Section 3: Immortals (4-column grid on mobile, wider on desktop) --- */
.wallet-gecko-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important; /* 4 cols all screens */
    gap: 10px;
}

.wallet-gecko-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 6px;
    background: #05051c;
    display: block;
}

.wallet-gecko-item {
    position: relative;
    overflow: hidden;
    padding: 8px;
    background: rgba(0, 0, 24, 0.66);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.wallet-gecko-item:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.wallet-gecko-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: rgba(0, 0, 20, 0.6);
    border-radius: 6px;
}

.wallet-gecko-id,
.wallet-gecko-rank {
    margin-top: 6px;
    font-family: "orbitron", monospace;
    font-size: 0.7rem;
}

.wallet-gecko-rank {
    color: var(--muted);
}

.wallet-sec-foot {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.wallet-viewall-btn {
    padding: 9px 22px;
    border: 1px solid rgba(0, 255, 204, 0.4);
    border-radius: 6px;
    background: rgba(0, 255, 204, 0.06);
    color: var(--cyan);
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wallet-viewall-btn:hover {
    background: rgba(0, 255, 204, 0.14);
}

/* --- Section 4: Badges (5-column grid, tiered borders) --- */
.wallet-badge-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.wallet-badge-card {
    padding: 12px;
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.wallet-badge-card.bronze {
    border-color: rgba(205, 127, 50, 0.7);
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.3);
}

.wallet-badge-card.silver {
    border-color: rgba(192, 192, 192, 0.75);
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.3);
}

.wallet-badge-card.gold {
    border-color: rgba(255, 215, 0, 0.78);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
}

.wallet-badge-card.platinum {
    border-color: rgba(229, 228, 226, 0.9);
    box-shadow: 0 0 16px rgba(229, 228, 226, 0.4);
}

.wallet-badge-card.diamond {
    border-color: rgba(0, 255, 204, 0.82);
    box-shadow: 0 0 20px rgba(185, 242, 255, 0.5);
}

.wallet-badge-icon {
    margin-bottom: 8px;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.wallet-badge-name {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}

.wallet-badge-desc {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.badge-category-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: "orbitron", monospace;
    font-size: 10px;
    letter-spacing: 1px;
}

.badge-cat-progress {
    margin-left: auto;
    color: rgba(0, 255, 204, 0.6);
    font-size: 9px;
}

.badge-cat-chevron {
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.2s;
}

.badge-category-row.open .badge-cat-chevron {
    transform: rotate(90deg);
}

.badge-tier-ladder {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge-tier-ladder.hidden {
    display: none;
}

.badge-tier {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.badge-tier.earned {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.badge-tier.earned.bronze {
    border-color: rgba(205, 127, 50, 0.4);
}

.badge-tier.earned.silver {
    border-color: rgba(192, 192, 192, 0.4);
}

.badge-tier.earned.gold {
    border-color: rgba(255, 215, 0, 0.4);
}

.badge-tier.earned.platinum {
    border-color: rgba(229, 228, 226, 0.4);
}

.badge-tier.earned.diamond {
    border-color: rgba(185, 242, 255, 0.4);
}

.badge-tier.unearned {
    opacity: 0.35;
}

.badge-tier-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.badge-tier-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge-tier-name {
    font-family: "orbitron", monospace;
    font-size: 9px;
    letter-spacing: 1px;
    color: #fff;
}

.badge-tier-desc {
    font-size: 10px;
    color: rgba(200, 230, 220, 0.5);
    margin-top: 2px;
}

.badge-tier-check {
    margin-left: auto;
    color: #00ffcc;
    font-size: 14px;
}

.badge-tier-lock {
    margin-left: auto;
    opacity: 0.4;
}

/* --- Expand / collapse --- */
.wallet-sec:not(.expanded) .overflow-item {
    display: none;
}

.wallet-sec.expanded .wallet-more-chip {
    display: none;
}

@media (max-width: 720px) {
    .wallet-panel {
        width: 92vw;
        max-width: 92vw;
        height: 82vh;
        max-height: 82vh;
    }

    #walletTitle {
        font-size: 1.25rem;
    }

    .wallet-badge-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wallet-set-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 720px) {
    /* Desktop: halve each gecko item by doubling the column count */
    .wallet-gecko-grid {
        grid-template-columns: repeat(8, 1fr) !important;
        gap: 12px;
    }

    .wallet-gecko-item {
        padding: 4px;
    }

    .wallet-gecko-id,
    .wallet-gecko-rank {
        margin-top: 3px;
        font-size: 0.6rem;
    }

    /* Earned Titles pills — cap width so long names stay reasonable */
    .wallet-title-pill {
        max-width: 200px;
    }
}

.badges-section {
    margin-top: 14px;
}

.badge-category-title {
    margin: 0 0 8px;
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    text-shadow: 0 0 8px currentColor;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.badge-item {
    padding: 12px 10px;
    background: rgba(0, 0, 24, 0.76);
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 6px;
    text-align: center;
}

.badge-item.bronze {
    border-color: rgba(205, 127, 50, 0.7);
    border-width: 2px;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.4);
}

.badge-item.silver {
    border-color: rgba(192, 192, 192, 0.74);
    border-width: 2px;
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.4);
}

.badge-item.gold {
    border-color: rgba(255, 215, 0, 0.76);
    border-width: 2px;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

.badge-item.platinum {
    border-color: rgba(229, 228, 226, 0.9);
    border-width: 2px;
    box-shadow: 0 0 18px rgba(229, 228, 226, 0.5);
}

.badge-item.diamond {
    border-color: rgba(0, 255, 204, 0.82);
    border-width: 2px;
    box-shadow: 0 0 22px rgba(185, 242, 255, 0.6);
}

.badge-icon {
    margin-bottom: 8px;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 2rem;
    font-weight: 900;
}

.badge-name {
    margin-top: 6px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.badge-description {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.wallet-empty {
    padding: 22px;
    color: var(--muted);
    text-align: center;
    border: 1px solid rgba(0, 255, 204, 0.14);
    border-radius: 6px;
}

@media (min-width: 1200px) {
    .gecko-wall.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
        padding: 20px;
    }
}

@media (min-width: 881px) {
    body {
        padding: 0 32px;
    }
}

@media (max-width: 880px) {
    .hall-header {
        padding: 0 42px 20px;
    }

    h1 {
        font-size: 4.4rem;
        line-height: 0.84;
    }

    .subtitle {
        margin-top: 10px;
        font-size: 0.88rem;
    }

    .segment-button,
    .sanctum-button,
    .controls-menu-toggle,
    .search-input,
    .select-control,
    .sort-direction-button {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 0.68rem;
    }

    .controls-menu-toggle {
        width: 42px;
        min-height: 38px;
        padding: 0;
        font-size: 1.05rem;
    }

    .button-stack {
        gap: 7px;
    }

    .stat-row {
        min-height: 78px;
        padding: 10px 8px;
    }

    .hall-age-stat {
        min-height: 104px;
    }

    .stat-row span {
        font-size: 0.62rem;
    }

    .hall-wall {
        padding: 12px;
    }

    .gecko-wall.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .owner-geckos {
        grid-template-columns: repeat(3, 1fr);
    }

    .trait-gecko-main {
        grid-template-columns: 320px minmax(240px, 1fr);
        gap: 16px;
    }
}

@media (max-width: 520px) {
    .modal {
        padding: 10px;
        align-items: start;
    }

    .detail-panel {
        width: 100%;
        min-width: 0;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .detail-top {
        flex-direction: row;
    }

    .monument-top {
        flex-direction: column;
    }

    .detail-image-col {
        width: 120px;
    }

    .monument-image-col {
        width: 100%;
    }

    .gecko-composite {
        width: min(300px, 100%);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .trait-gecko-main {
        grid-template-columns: 1fr;
    }

    .trait-gecko-header h2,
    .trait-gecko-header .subtitle {
        margin-right: 38px;
    }

    .trait-gecko-main {
        gap: 14px;
    }

    .detail-image {
        height: 120px;
    }

    .hall-header {
        padding: 0 12px 18px;
    }

    h1 {
        font-size: 3.35rem;
    }

    .subtitle {
        font-size: 0.82rem;
    }

    .stats-bar {
        overflow: hidden;
    }

    .stats-secondary-row {
        display: flex;
    }

    .stat-row {
        min-width: 0;
        min-height: 76px;
        padding: 9px 4px;
    }

    .stat-row strong {
        font-size: 1.6rem;
        overflow-wrap: anywhere;
    }

    .stat-row span {
        font-size: 0.56rem;
        overflow-wrap: anywhere;
    }

    .hall-age-stat strong {
        font-size: 2.1rem;
    }

    .controls-row {
        justify-content: flex-start;
        padding: 9px 10px;
    }

    .sort-direction-button {
        flex-basis: 36px;
        width: 36px;
        padding: 0;
        font-size: 0.9rem;
    }

    .gecko-wall.grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .wallet-gecko-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px;
    }

    .wallet-gecko-num,
    .wallet-gecko-immortal-num {
        font-size: 8px;
        letter-spacing: 0;
    }

    .wallet-gecko-card {
        padding: 4px;
    }

    .timer-strip {
        font-size: clamp(8px, 1.8vw, 11px);
    }

    .owner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .owner-geckos {
        grid-template-columns: repeat(2, 1fr);
    }

    .leaderboard-stats-summary {
        grid-template-columns: 1fr;
    }
}

.unclaimed-orders-panel {
    width: min(860px, 100%);
    overflow-y: auto;
}

.orders-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,255,204,0.15);
    margin-bottom: 16px;
}

.orders-tab {
    padding: 10px 20px;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(0,255,204,0.4);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    background: none;
    border: none;
}

.orders-tab.active {
    color: #00FFCC;
    border-bottom-color: #00FFCC;
}

.orders-tab:hover:not(.active) {
    color: rgba(0,255,204,0.7);
}

.unclaimed-orders-subtitle {
    margin: 0 0 14px;
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.orders-description {
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: rgba(0, 255, 204, 0.5);
    line-height: 1.7;
    margin: 0 0 18px;
    padding: 12px 16px;
    border-left: 2px solid rgba(0, 255, 204, 0.2);
    background: rgba(0, 255, 204, 0.03);
    border-radius: 0 4px 4px 0;
}

.orders-description-leader {
    color: #FFD700;
    font-weight: 600;
}

.unclaimed-orders-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.unclaimed-orders-controls .control-label {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.unclaimed-orders-content {
    display: grid;
    gap: 12px;
}

.unclaimed-orders-content[hidden] {
    display: none;
}

.unclaimed-order-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 6px;
}

.order-card-close {
    border-color: rgba(255,210,0,0.6);
    background: rgba(255,210,0,0.06);
}

.order-card-mid {
    border-color: rgba(255,80,80,0.5);
    background: rgba(255,80,80,0.04);
}

.order-card-far {
    border-color: rgba(255,80,80,0.2);
    background: rgba(255,80,80,0.02);
}

.unclaimed-order-name {
    color: #FF4757;
    font-family: "orbitron", monospace;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.order-card-close .unclaimed-order-name { color: #FFD700; }
.order-card-mid .unclaimed-order-name { color: #FF5050; }
.order-card-far .unclaimed-order-name { color: rgba(255,80,80,0.6); }

.unclaimed-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.unclaimed-pill {
    padding: 2px 8px;
    color: var(--cyan);
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.32);
    border-radius: 999px;
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.unclaimed-meta-text {
    color: var(--muted);
    font-size: 0.78rem;
}

.unclaimed-progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(0, 255, 204, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.unclaimed-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 255, 204, 0.6), var(--cyan));
    transition: width 200ms ease;
}


.unclaimed-closest {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    padding-top: 4px;
}

.unclaimed-closest-label {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.unclaimed-closest-wallet {
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.82rem;
}

.unclaimed-closest-stats {
    color: var(--muted);
    font-size: 0.76rem;
}

.faction-pips {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}
.faction-pip {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    transition: opacity 0.2s;
}
.faction-pip-active {
    opacity: 1;
    border-color: rgba(0,255,204,0.4);
    box-shadow: 0 0 6px rgba(0,255,204,0.2);
}
.faction-pip-missing {
    opacity: 0.2;
    filter: grayscale(100%);
    border-color: rgba(255,255,255,0.1);
}

.claimed-orders-section {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 215, 0, 0.25);
}

.claimed-orders-heading {
    margin: 0 0 6px;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.claimed-orders-subtitle {
    margin: 0 0 14px;
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.claimed-orders-content {
    display: grid;
    gap: 12px;
}

.claimed-orders-content[hidden] {
    display: none;
}

.claimed-order-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    background: rgba(0, 255, 204, 0.06);
    border: 1px solid rgba(0, 255, 204, 0.6);
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.15);
}

.claimed-order-name {
    color: #00FFCC;
    font-family: "orbitron", monospace;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.claimed-pill {
    padding: 2px 8px;
    color: var(--gold);
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 999px;
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.claimed-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.6), var(--gold));
    transition: width 200ms ease;
}

.claimed-leader {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    padding-top: 4px;
}

.claimed-leader-label {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.claimed-leader-wallet {
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 0.82rem;
}

.claimed-members {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.claimed-order-date {
    color: rgba(46, 213, 115, 0.72);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.orders-filter-select {
    width: auto;
    max-width: fit-content;
    min-height: 36px;
    padding: 0 32px 0 12px;
}

/* Custom scrollbars - site-wide */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 20, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.4);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 204, 0.7);
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 204, 0.4) rgba(0, 0, 20, 0.8);
}

.modal-panel::-webkit-scrollbar,
.unclaimed-orders-panel::-webkit-scrollbar,
.wallet-panel::-webkit-scrollbar,
.badge-discovery-panel::-webkit-scrollbar,
.unclaimed-orders-content::-webkit-scrollbar,
.claimed-orders-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.modal-panel::-webkit-scrollbar-track,
.unclaimed-orders-panel::-webkit-scrollbar-track,
.wallet-panel::-webkit-scrollbar-track,
.badge-discovery-panel::-webkit-scrollbar-track,
.unclaimed-orders-content::-webkit-scrollbar-track,
.claimed-orders-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 20, 0.8);
}
.modal-panel::-webkit-scrollbar-thumb,
.unclaimed-orders-panel::-webkit-scrollbar-thumb,
.wallet-panel::-webkit-scrollbar-thumb,
.badge-discovery-panel::-webkit-scrollbar-thumb,
.unclaimed-orders-content::-webkit-scrollbar-thumb,
.claimed-orders-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.4);
    border-radius: 3px;
}
.modal-panel::-webkit-scrollbar-thumb:hover,
.unclaimed-orders-panel::-webkit-scrollbar-thumb:hover,
.wallet-panel::-webkit-scrollbar-thumb:hover,
.badge-discovery-panel::-webkit-scrollbar-thumb:hover,
.unclaimed-orders-content::-webkit-scrollbar-thumb:hover,
.claimed-orders-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 204, 0.7);
}

/* ── Dossier button ───────────────────────────────────── */
.dossier-btn {
    width: 150px;
    min-height: 38px;
    padding: 8px 12px;
    color: #9b70ff;
    background: rgba(0, 0, 24, 0.78);
    border: 1px solid rgba(140, 80, 255, 0.34);
    border-radius: 4px;
    cursor: pointer;
    font-family: "orbitron", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.dossier-btn:hover {
    background: rgba(140, 80, 255, 0.14);
}

/* ── Dossier modal ────────────────────────────────────── */
.dossier-modal {
    z-index: 1400;
}

/* ── Gecko detail modal — above wallet (1100) and faction set detail (1200) ── */
#detailModal {
    z-index: 1300;
}

.dossier-panel {
    width: min(860px, 100%);
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
}

/* Header band */
.dossier-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    /* Right padding clears the three controls pinned in the panel's corner:
       close (12px), link (56px) and export (100px), each 36px wide. */
    padding: 14px 148px 14px 24px;
    background: rgba(0, 0, 20, 0.96);
    border-bottom: 1px solid rgba(255, 50, 50, 0.28);
}

.dossier-classified {
    padding: 4px 10px;
    color: #ff3232;
    border: 1px solid #ff3232;
    font-family: "orbitron", monospace;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.dossier-title {
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
}

.dossier-file-ref {
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-align: right;
    white-space: nowrap;
}

/* Identity section */
.dossier-identity {
    display: grid;
    grid-template-columns: 240px 1fr;
    border-bottom: 1px solid rgba(0, 255, 204, 0.18);
}

.dossier-image-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    background: rgba(0, 0, 20, 0.9);
    border-right: 1px solid rgba(0, 255, 204, 0.18);
    overflow: hidden;
    flex-shrink: 0;
}

.dossier-gecko-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dossier-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    z-index: 2;
}

.dossier-corner.tl { top: 8px; left: 8px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.dossier-corner.tr { top: 8px; right: 8px; border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.dossier-corner.bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.dossier-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }

.dossier-scanlines {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 20, 0.07) 2px,
        rgba(0, 0, 20, 0.07) 4px
    );
    pointer-events: none;
}

.dossier-identity-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
}

.dossier-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dossier-faction-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.dossier-faction-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #0d1f36;
    border: 2px solid rgba(140, 190, 255, 0.35);
}
.dossier-faction-name {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #FF9620;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.dossier-gecko-name {
    margin: 0;
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 1.05rem;
    line-height: 1.25;
}

.dossier-id-fields {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dossier-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
}

.dossier-field span {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dossier-field strong {
    color: var(--text);
    font-size: 0.84rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.dossier-status-immortal { color: #2ed573; }
.dossier-status-mortal { color: #ff4757; }
.dossier-status-zombie { color: #a29bfe; }
.dossier-status-normal { color: var(--muted); }

/* Immortal band */
.dossier-immortal-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(0, 80, 40, 0.18);
    border-top: 1px solid rgba(46, 213, 115, 0.22);
    border-bottom: 1px solid rgba(46, 213, 115, 0.22);
}

.dossier-band-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px;
    text-align: center;
}

.dossier-band-cell + .dossier-band-cell {
    border-left: 1px solid rgba(46, 213, 115, 0.18);
}

.dossier-band-cell span {
    color: rgba(46, 213, 115, 0.66);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dossier-band-cell strong {
    color: #2ed573;
    font-family: "orbitron", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Section blocks */
.dossier-section {
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
}

.dossier-section-header {
    padding: 10px 18px;
    font-family: "orbitron", monospace;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: rgba(0, 0, 20, 0.52);
}

.dossier-section-traits {
    color: var(--cyan);
    border-left: 3px solid var(--cyan);
}

.dossier-section-transactions {
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

/* Trait cards */
.dossier-traits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px 18px;
}

.dossier-trait-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 24, 0.72);
    border: 1px solid rgba(0, 255, 204, 0.14);
    border-radius: 4px;
}

.dossier-trait-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.dossier-trait-img-wrap {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #545454;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dossier-trait-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dossier-trait-legendary { border-color: rgba(155, 89, 182, 0.5); }
.dossier-trait-epic { border-color: rgba(255, 215, 0, 0.46); }
.dossier-trait-rare { border-color: rgba(0, 255, 204, 0.42); }
.dossier-trait-common { border-color: rgba(245, 255, 252, 0.12); }

.dossier-trait-category {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.dossier-trait-name {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.dossier-trait-rarity {
    font-family: "orbitron", monospace;
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 5px;
}

.dossier-rarity-bar-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 4px;
}

.dossier-rarity-bar {
    height: 100%;
    border-radius: 2px;
}

/* Sales table */
/* The transaction list can run to dozens of rows, which pushed the dossier far
   past its own height. Scrolling it here keeps the rest of the record visible. */
.dossier-sales-scroll {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dossier-sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

/* Keep the column headers in view while the rows scroll under them. */
.dossier-sales-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(0, 0, 20, 0.96);
}

.dossier-sales-table th {
    padding: 8px 18px;
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    text-align: left;
    letter-spacing: 1px;
    background: rgba(0, 0, 20, 0.38);
    border-bottom: 1px solid rgba(0, 255, 204, 0.14);
}

.dossier-sales-table td {
    padding: 8px 18px;
    color: var(--text);
    border-bottom: 1px solid rgba(0, 255, 204, 0.07);
    font-size: 0.82rem;
}

.dossier-sale-amount {
    color: var(--gold) !important;
    font-family: "orbitron", monospace;
}

.dossier-tx-link,
.dossier-link {
    color: var(--cyan);
    text-decoration: none;
    font-family: "orbitron", monospace;
    font-size: 0.66rem;
    letter-spacing: 1px;
}

.dossier-tx-link:hover,
.dossier-link:hover {
    text-decoration: underline;
}

/* Loading / error / empty */
.dossier-loading-body {
    padding: 48px 24px;
    text-align: center;
    font-family: "orbitron", monospace;
    font-size: 0.84rem;
    color: var(--muted);
    letter-spacing: 2px;
    animation: readoutPulse 1.8s ease-in-out infinite;
}

.dossier-error {
    padding: 32px 24px;
    text-align: center;
    font-family: "orbitron", monospace;
    font-size: 0.82rem;
    color: #ff4757;
    line-height: 1.6;
}

.dossier-empty {
    padding: 16px 18px;
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    text-align: center;
}

/* ── Dossier commendations section ───────────────────── */
.dossier-section-commendations {
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.dossier-medals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
}

.dossier-medal {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 210, 0, 0.06);
    border: 1px solid rgba(255, 210, 0, 0.2);
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 180px;
}

.dossier-medal-icon {
    font-size: 22px;
}

.dossier-medal-name {
    font-family: "orbitron", monospace;
    font-size: 9px;
    letter-spacing: 1px;
    color: #FFD700;
}

.dossier-medal-desc {
    font-size: 10px;
    color: rgba(200, 230, 220, 0.5);
    margin-top: 2px;
}

/* ── Dossier journey record section ──────────────────── */
.dossier-section-journey {
    color: #9b59b6;
    border-left: 3px solid #9b59b6;
}

.dossier-journey-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.12);
}

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

/* The CURRENT badge used to be the only marker for the active journey. Tint the
   row instead: it survives export, costs no layout width, and cannot push the
   dates column out of alignment the way an inline badge did. */
.dossier-journey-current .dossier-journey-type {
    color: #b07cd6;
}

.dossier-journey-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "orbitron", monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    /* Fixed basis rather than a minimum: an auto-width column let a longer
       label push that row's dates out of line with the rows below it. */
    flex: 0 0 160px;
}

.dossier-journey-dates {
    color: var(--muted);
    font-size: 0.82rem;
    flex: 1;
}

.dossier-journey-completion {
    width: 100%;
    color: rgba(46, 213, 115, 0.7);
    font-size: 0.76rem;
}

/* Responsive */
@media (max-width: 600px) {
    .dossier-identity {
        grid-template-columns: 1fr;
    }

    .dossier-image-wrap {
        width: 100%;
        height: 220px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 255, 204, 0.18);
    }

    .dossier-traits-grid {
        grid-template-columns: 1fr;
    }

    .dossier-immortal-band {
        grid-template-columns: 1fr;
    }

    .dossier-band-cell + .dossier-band-cell {
        border-left: none;
        border-top: 1px solid rgba(46, 213, 115, 0.18);
    }

    .dossier-header {
        grid-template-columns: 1fr;
        padding: 14px 18px;
        gap: 6px;
        text-align: center;
    }

    .dossier-file-ref {
        text-align: center;
    }
}

/* ── I8 Designation ──────────────────────────────────── */
.indicator-item.i8-leader {
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.15), rgba(140, 80, 255, 0.15));
    border: 1px solid rgba(0, 255, 204, 0.5);
    color: #00FFCC;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.indicator-item.i8-member {
    background: rgba(140, 80, 255, 0.1);
    border: 1px solid rgba(140, 80, 255, 0.4);
    color: #8C50FF;
}

.i8-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: "orbitron", monospace;
    font-size: 0.6rem;
    font-weight: 700;
    vertical-align: middle;
}

.i8-leader-badge {
    background: rgba(0, 255, 204, 0.12);
    border: 1px solid rgba(0, 255, 204, 0.45);
    color: #00FFCC;
}

.i8-member-badge {
    background: rgba(140, 80, 255, 0.1);
    border: 1px solid rgba(140, 80, 255, 0.4);
    color: #8C50FF;
}

.i8-row-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.i8-leaderboard-card .i8-leaderboard-desc {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ── iOS Safari glow reduction ────────────────────────── */
/* WebKit amplifies text-shadow spread; tone down on iOS only */
@supports (-webkit-touch-callout: none) {
    h1,
    .stat-row strong,
    .stat-value,
    .stat-good,
    .stat-bad,
    .stat-close,
    .hall-age-stat strong {
        text-shadow: none !important;
    }
    .hall-age-stat strong {
        font-size: clamp(28px, 7vw, 52px) !important;
    }
    @keyframes readoutPulse {
        0%, 100% { text-shadow: none; }
        50%       { text-shadow: none; }
    }

    /* Wallet color glow is applied via inline box-shadow by JS (wallet grouping) —
       !important here overrides those inline styles for the base card glow classes */
    .gecko-card,
    .image-item,
    .immortal-card {
        box-shadow: none !important;
        filter: none !important;
    }

    .gecko-card:hover,
    .image-item:hover {
        box-shadow: none !important;
    }
}

/* ── Faction set rows: clickable ─────────────────────── */
.wallet-set-row {
    cursor: pointer;
}

.wallet-set-row:hover {
    border-color: rgba(0, 255, 204, 0.4);
    background: rgba(0, 0, 32, 0.7);
}

/* ── Faction set detail popup ────────────────────────── */
.faction-set-detail {
    position: fixed;
    z-index: 1200;
    background: rgba(8, 10, 28, 0.97);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 380px;
    width: 90vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.1);
}

.faction-set-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.faction-set-detail-title {
    color: #00FFCC;
    font-family: "orbitron", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.faction-set-detail-subtitle {
    color: rgba(200, 230, 220, 0.55);
    font-size: 0.75rem;
    margin-top: 4px;
}

.faction-set-detail-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 24, 0.78);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 4px;
    color: #00FFCC;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: grid;
    place-items: center;
}

.faction-set-detail-close:hover {
    background: rgba(0, 255, 204, 0.12);
}

.faction-set-gecko-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.faction-set-gecko-card {
    background: rgba(0, 0, 20, 0.6);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.faction-set-gecko-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 6px;
    background: #05051c;
}

.faction-set-gecko-num {
    font-family: "orbitron", monospace;
    font-size: 10px;
    color: #00FFCC;
    margin-top: 6px;
}

.faction-set-gecko-faction {
    font-size: 9px;
    color: rgba(200, 230, 220, 0.5);
    margin-top: 2px;
}

.faction-set-gecko-date {
    font-size: 9px;
    color: rgba(200, 230, 220, 0.4);
    margin-top: 2px;
}

/* ── Rebuilt Gecko Detail Popup ── */
.detail-modal { background:#0a0a1a; border:1px solid rgba(0,255,204,0.2); border-radius:16px; max-width:780px; width:92vw; max-height:90vh; overflow-y:auto; overscroll-behavior:contain; padding:0; }
.detail-top { display:grid; grid-template-columns:220px 1fr; gap:24px; padding:24px; }
@media(max-width:600px){ .detail-top{ grid-template-columns:1fr; } }
.detail-gecko-img { width:100%; aspect-ratio:1; border-radius:12px; object-fit:contain; background:#05051c; }
.detail-gecko-num { font-family:'Orbitron',monospace; font-size:22px; color:#fff; margin-top:10px; text-align:center; }
.detail-immortal-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(255,215,0,0.1); border:1px solid rgba(255,215,0,0.4); border-radius:20px; padding:4px 12px; font-family:'Orbitron',monospace; font-size:10px; color:#FFD700; margin-top:8px; }
.detail-title { font-family:'Orbitron',monospace; font-size:clamp(16px,3vw,26px); color:#00FFCC; font-weight:700; margin-bottom:12px; }
.detail-immortal-pill { display:inline-flex; align-items:center; gap:8px; background:rgba(160,80,255,0.15); border:1px solid rgba(160,80,255,0.5); border-radius:20px; padding:5px 14px; font-family:'Orbitron',monospace; font-size:11px; color:#A050FF; margin-bottom:16px; }
.detail-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.detail-info-cell { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px; padding:12px 14px; }
.detail-info-label { font-family:'Orbitron',monospace; font-size:8px; letter-spacing:2px; color:rgba(200,230,220,0.75); text-transform:uppercase; }
.detail-info-value { font-family:'Orbitron',monospace; font-size:15px; color:#fff; margin-top:4px; }
.detail-info-value.cred,.detail-info-value.price { color:#FFD700; }
.detail-wallet-row { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px; padding:10px 14px; display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.detail-wallet-label { font-family:'Orbitron',monospace; font-size:8px; letter-spacing:2px; color:rgba(200,230,220,0.65); }
.detail-wallet-value { font-size:13px; color:#fff; cursor:pointer; }
.detail-actions { display:flex; gap:10px; flex-wrap:wrap; }
.detail-btn { flex:1; min-width:90px; padding:10px 16px; border-radius:8px; font-family:'Orbitron',monospace; font-size:10px; letter-spacing:1px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:6px; transition:all 0.2s; }
.detail-btn-dossier { background:rgba(160,80,255,0.1); border:1px solid rgba(160,80,255,0.5); color:#A050FF; }
.detail-btn-matrica,.detail-btn-wallet { background:rgba(0,255,204,0.05); border:1px solid rgba(0,255,204,0.3); color:#00FFCC; }
.detail-traits-section { padding:0 24px 24px; border-top:1px solid rgba(255,255,255,0.06); }
.detail-traits-header { font-family:'Orbitron',monospace; font-size:11px; letter-spacing:2px; color:#FFD700; padding:16px 0 12px; display:flex; align-items:center; gap:8px; justify-content:space-between; }
.detail-traits-wallet { font-family:'Jost',sans-serif; font-size:11px; color:rgba(200,230,220,0.5); cursor:pointer; letter-spacing:0; font-weight:400; }
.detail-traits-wallet:hover { color:#00FFCC; }
/* auto-fit + 1fr so tracks share the full width with no dead strip on the right.
   The 110px minimum keeps cards narrow enough that the square image box stays a
   sensible size — a wider track makes every card disproportionately tall. */
.detail-traits-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:10px; }
.detail-trait-card { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.08); border-radius:10px; overflow:visible; transition:border-color 0.2s; cursor:pointer; }
.detail-trait-card:hover { border-color:rgba(0,255,204,0.3); }
/* Square, because autoFitTraitImage() redraws every trait onto a 160x160 canvas.
   Any other ratio leaves the art letterboxed inside the frame and smaller than
   it needs to be, which is what made the traits look warped. */
.detail-trait-img-wrap { background:#545454; padding:0; display:flex; align-items:center; justify-content:center; width:100%; aspect-ratio:1; overflow:hidden; }
.detail-trait-img { width:100%; height:100%; object-fit:contain; object-position:center; }
/* Placed after the base rules above: equal specificity, so the later one wins.
   A fixed column count on a narrow screen rather than letting auto-fit decide —
   three, since square boxes at two columns would be nearly half the viewport
   wide and make the list four screens long. */
@media(max-width:500px){
    .detail-traits-grid{ grid-template-columns:repeat(3,1fr); }
}
.detail-trait-info { padding:8px 10px; }
.detail-trait-category { font-family:'Orbitron',monospace; font-size:7px; letter-spacing:2px; color:rgba(200,230,220,0.65); text-transform:uppercase; }
.detail-trait-name { font-size:12px; color:#00FFCC; font-weight:600; margin-top:2px; }
.detail-trait-rarity-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; margin-top:6px; align-items:start; }
.detail-trait-rarity { font-size:10px; color:rgba(200,230,220,0.4); margin-top:0; text-align:center; line-height:1.2; }
.detail-trait-rarity-value { font-family:'Orbitron',monospace; font-size:10px; font-weight:700; min-height:12px; }

/* ══ Immortalization feed ═══════════════════════════════════════════════ */

.feed-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 14px;
    padding: 10px 14px;
    width: min(1400px, 100%);
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 10px;
    background: rgba(0, 0, 28, 0.55);
    overflow-x: auto;
    scrollbar-width: none;
}

.feed-strip::-webkit-scrollbar { display: none; }

.feed-strip-label {
    flex: 0 0 auto;
    color: var(--gold);
    font-family: "orbitron", monospace;
    font-size: 0.58rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.feed-strip-items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.feed-strip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid rgba(0, 255, 204, 0.22);
    border-radius: 999px;
    background: rgba(0, 255, 204, 0.05);
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.feed-strip-item:hover { border-color: var(--cyan); }

.feed-strip-item.is-milestone {
    border-color: rgba(255, 215, 0, 0.55);
    background: rgba(255, 215, 0, 0.08);
}

.feed-strip-id { color: var(--cyan); }
.feed-strip-age { color: var(--muted); }

.feed-strip-all {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.58rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.feed-panel { width: min(760px, 100%); }

.feed-subtitle {
    margin: 4px 0 16px;
    color: var(--muted);
    font-size: 0.84rem;
}

/* Five columns for five children. The milestone cell is always present (empty
   on ordinary rows) so every row aligns on the same grid — previously milestone
   rows had an extra child and wrapped onto an implicit second row. */
.feed-row {
    display: grid;
    /* Fixed milestone column: an auto-width one collapsed on ordinary rows, so
       the owner column started at a different x on every other line. */
    grid-template-columns: 64px 190px minmax(0, 1fr) minmax(0, 130px) 68px;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.12);
    cursor: pointer;
}

.feed-row:hover { background: rgba(0, 255, 204, 0.05); }

/* Milestones read as significant only against the ordinary rows they
   interrupt, so they are styled inline rather than split into their own list. */
.feed-row.is-milestone {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), transparent);
    border-bottom-color: rgba(255, 215, 0, 0.4);
}

/* An achievement row is marked more lightly than a count milestone: they are
   far more frequent, and tinting every one would flatten the distinction. */
.feed-row.is-achievement {
    background: linear-gradient(90deg, rgba(0, 255, 204, 0.06), transparent);
}

.feed-row-rank {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
}

.feed-row-gecko {
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.76rem;
    /* Fixed column and no wrap: the name is a known length, and letting it wrap
       made those rows taller than their neighbours. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-row-milestone {
    display: flex;
    /* nowrap: a second chip used to wrap and make the row taller than its
       neighbours. Chips shrink instead, and the column is wide enough for two. */
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
    min-width: 0;
    overflow: hidden;
}

/* One chip per achievement — a gecko can complete a set and an order at once,
   so the cell holds a list rather than a single label. */
.feed-badge {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: "orbitron", monospace;
    font-size: 0.52rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.feed-badge-count {
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.12);
    color: var(--gold);
}

.feed-badge-first-wallet {
    border: 1px solid rgba(255, 111, 180, 0.5);
    background: rgba(255, 111, 180, 0.12);
    color: #ff6fb4;
}

.feed-badge-set {
    border: 1px solid rgba(0, 255, 204, 0.45);
    background: rgba(0, 255, 204, 0.1);
    color: var(--cyan);
}

.feed-badge-order {
    border: 1px solid rgba(160, 80, 255, 0.5);
    background: rgba(160, 80, 255, 0.14);
    color: #a050ff;
}

.feed-row-owner {
    color: var(--muted);
    font-size: 0.76rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-row-age {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.6rem;
    white-space: nowrap;
}

/* ══ Growth curve ═══════════════════════════════════════════════════════ */

.growth-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.growth-chart-wrap {
    padding: 12px;
    border: 1px solid rgba(0, 255, 204, 0.18);
    border-radius: 8px;
    background: rgba(0, 0, 24, 0.6);
}

.growth-chart { width: 100%; height: auto; }
.growth-guide { stroke: rgba(0, 255, 204, 0.12); stroke-width: 1; }
.growth-guide-label,
.growth-axis-label {
    fill: rgba(245, 255, 252, 0.5);
    font-family: "orbitron", monospace;
    font-size: 10px;
}
.growth-area { fill: rgba(0, 255, 204, 0.12); stroke: none; }
.growth-line { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linejoin: round; }

/* ══ Wallet comparison ══════════════════════════════════════════════════ */

.compare-launcher { margin-bottom: 14px; }

.compare-toggle {
    padding: 8px 14px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 6px;
    background: rgba(0, 255, 204, 0.05);
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.compare-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.compare-form[hidden] {
    display: none;
}

.compare-select {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid rgba(0, 255, 204, 0.25);
    border-radius: 6px;
    background: rgba(0, 0, 20, 0.6);
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    cursor: pointer;
}

.compare-select option {
    background: var(--ink, #02021a);
    color: var(--text);
}

.compare-toggle.is-open {
    border-color: var(--cyan);
    background: rgba(0, 255, 204, 0.12);
}

.compare-go {
    padding: 9px 18px;
    border: 1px solid rgba(0, 255, 204, 0.5);
    border-radius: 6px;
    background: rgba(0, 255, 204, 0.1);
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    cursor: pointer;
}

.compare-error {
    margin-top: 10px;
    color: var(--danger, #ff5f7e);
    font-size: 0.78rem;
}

.compare-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

.compare-name {
    color: var(--cyan);
    font-family: "orbitron", monospace;
    font-size: 0.72rem;
    text-align: center;
    word-break: break-all;
}

.compare-i8 { color: var(--gold); }

.compare-vs {
    color: var(--muted);
    font-family: "orbitron", monospace;
    font-size: 0.58rem;
    text-transform: uppercase;
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-label {
    color: rgba(200, 230, 220, 0.7);
    font-family: "orbitron", monospace;
    font-size: 0.52rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.compare-value {
    color: var(--text);
    font-family: "orbitron", monospace;
    font-size: 0.94rem;
    text-align: center;
}

/* The stronger figure on each row, so a scan reads as a result not a table. */
.compare-value.is-better {
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

@media (max-width: 600px) {
    .feed-row {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        row-gap: 4px;
    }

    .feed-row-milestone { grid-column: 2 / -1; }
    .feed-row-owner { grid-column: 2 / -1; text-align: left; }

    /* Collapse the empty milestone cell so ordinary rows stay compact. */
    .feed-row-milestone:empty { display: none; }
}
