/* =========================================
   Dalton Ranking — Far West Theme
   ========================================= */

:root {
    --bg: #261c12;
    --bg-card: #2c2116;
    --bg-header: #281e13;
    --sand: #d4a84b;
    --sand-dim: #a07830;
    --sand-glow: rgba(212, 168, 75, 0.15);
    --terracotta: #c45a3c;
    --leather: #7a4425;
    --wood: #3d2b1a;
    --parchment: #f0dab0;
    --gold: #ffd700;
    --silver: #b8c0cc;
    --bronze: #cd7f32;
    --text: #e8dcc8;
    --text-dim: #8a7b68;
    --border: #3a2a18;
    --row-hover: rgba(212, 168, 75, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    background-image:
        /* plank seams — dark gap with catch-light edges */
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 144px,
            rgba(130,75,35,0.12) 144px,
            rgba(8,4,2,0.5) 146px,
            rgba(8,4,2,0.35) 148px,
            rgba(130,75,35,0.08) 150px,
            transparent 152px
        ),
        /* per-plank warm/cool color shifts */
        linear-gradient(90deg,
            rgba(55,38,20,0.0) 0%,
            rgba(65,42,22,0.25) 10%,
            rgba(55,38,20,0.0) 22%,
            rgba(50,34,18,0.18) 34%,
            rgba(55,38,20,0.0) 44%,
            rgba(70,45,24,0.22) 56%,
            rgba(55,38,20,0.0) 68%,
            rgba(48,32,16,0.18) 80%,
            rgba(55,38,20,0.0) 90%,
            rgba(60,40,20,0.20) 100%
        ),
        /* edge vignette */
        radial-gradient(ellipse 75% 60% at 50% 45%, rgba(55,38,20,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 70% 55% at 50% 50%, transparent 40%, rgba(0,0,0,0.35) 100%);
    color: var(--text);
    min-height: 100vh;
}

/* Wood grain via SVG turbulence — organic, non-repeating pattern */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        /* Fine grain: low X freq = consistent across plank, high Y freq = horizontal lines */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012,0.25' numOctaves='6' seed='5' stitchTiles='stitch' result='grain'/%3E%3CfeColorMatrix type='matrix' values='0.22 0.12 0.04 0 0.08 0.14 0.08 0.02 0 0.05 0.07 0.04 0.01 0 0.02 0 0 0 0.22 0' in='grain'/%3E%3C/filter%3E%3Crect width='800' height='800' filter='url(%23g)'/%3E%3C/svg%3E"),
        /* Larger-scale color undulation between grain bands */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800'%3E%3Cfilter id='w' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.008,0.05' numOctaves='3' seed='12' stitchTiles='stitch' result='wave'/%3E%3CfeColorMatrix type='matrix' values='0.18 0.10 0.03 0 0.06 0.12 0.07 0.02 0 0.04 0.06 0.03 0.01 0 0.02 0 0 0 0.15 0' in='wave'/%3E%3C/filter%3E%3Crect width='800' height='800' filter='url(%23w)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ---------- HERO ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 1rem 2rem;
    text-align: center;
    background:
        /* dark overlay so text reads well */
        linear-gradient(180deg,
            rgba(20,14,8,0.55) 0%,
            rgba(20,14,8,0.4) 40%,
            rgba(20,14,8,0.6) 70%,
            var(--bg) 100%
        ),
        /* warm glow behind the wanted poster */
        radial-gradient(ellipse 60% 70% at 50% 45%, rgba(212,168,75,0.12) 0%, transparent 70%),
        /* the photo */
        url("hero-bg.jpg");
    background-size: cover, cover, cover;
    background-position: center, center, center 60%;
}

.hero-content {
    display: inline-block;
    position: relative;
}

.hero-weapon {
    position: absolute;
    width: 120px;
    opacity: 0.12;
    top: 50%;
    transform: translateY(-50%);
    filter: sepia(0.5) brightness(0.8);
}

.hero-weapon-left {
    left: 5%;
    transform: translateY(-50%) rotate(-25deg);
}

.hero-weapon-right {
    right: 5%;
    transform: translateY(-50%) rotate(25deg) scaleX(-1);
}

/* Wanted poster frame */

.wanted-frame {
    display: inline-block;
    padding: 1.8rem 3rem 1.5rem;
    border: 3px solid var(--sand-dim);
    border-radius: 4px;
    background: rgba(30, 21, 13, 0.75);
    box-shadow:
        inset 0 0 50px rgba(0,0,0,0.3),
        0 0 30px rgba(212,168,75,0.08),
        0 0 0 1px rgba(0,0,0,0.4),
        0 0 0 5px rgba(61,43,26,0.35),
        0 0 0 6px rgba(107,58,31,0.25),
        0 4px 20px rgba(0,0,0,0.4);
    position: relative;
}

.wanted-frame::before,
.wanted-frame::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sand-dim) 15%, var(--sand-dim) 85%, transparent);
    opacity: 0.5;
}

.wanted-frame::before { top: 10px; }
.wanted-frame::after { bottom: 10px; }

.wanted-label {
    font-family: "Rye", serif;
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--terracotta);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.hero h1 {
    font-family: "Rye", serif;
    font-size: 2.6rem;
    font-weight: 400;
    color: var(--sand);
    text-shadow: 0 2px 12px rgba(212,168,75,0.25), 0 0 40px rgba(212,168,75,0.08);
    margin-bottom: 0.8rem;
}

/* Dalton lineup */

.dalton-lineup {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
    margin: 0.8rem 0 1.2rem;
}

.dalton-mugshot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

/* Leek + hat composite */

.leek-with-hat {
    position: relative;
    width: 84px;
    height: 96px;
}

.leek-with-hat .leek-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 84px;
    height: 84px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6));
}

.leek-with-hat .leek-hat {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    object-fit: contain;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
    z-index: 1;
}

/* Hat sits on the leek head — scaled for 84px body */
.hat-panama   { width: 58px; top: 6px; }
.hat-fedora   { width: 58px; top: 7px; }
.hat-sombrero { width: 64px; top: 3px; }

.dalton-mugshot:hover .leek-with-hat .leek-body,
.dalton-mugshot:hover .leek-with-hat .leek-hat {
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.6)) brightness(1.08);
}

/* Section header mugshot — WANTED overlay + easter egg */

.section-mugshot {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.section-wanted-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Rye", serif;
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--terracotta);
    text-transform: uppercase;
    opacity: 1;
    white-space: nowrap;
    z-index: 5;
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.6);
    text-shadow:
        0 0 10px rgba(0,0,0,0.9),
        0 0 20px rgba(0,0,0,0.6),
        0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

.section-mugshot:hover .section-wanted-label {
    opacity: 1;
}

.section-mugshot:hover .leek-body,
.section-mugshot:hover .leek-hat {
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6)) brightness(1.1);
}

/* Section header leek — same size as hero */

.section-leek-wrap {
    position: relative;
    width: 84px;
    height: 96px;
    flex-shrink: 0;
}

.section-leek-wrap .leek-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 84px;
    height: 84px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6));
}

.section-leek-wrap .leek-hat {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    object-fit: contain;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
    z-index: 1;
}

.section-leek-wrap .hat-panama  { width: 58px; top: 6px; }
.section-leek-wrap .hat-fedora  { width: 58px; top: 7px; }
.section-leek-wrap .hat-sombrero { width: 64px; top: 3px; }

/* Farmer avatar */

.farmer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid var(--leather);
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(212,168,75,0.1),
        0 2px 4px rgba(0,0,0,0.3);
}

.dalton-mugshot span {
    font-family: "Rye", serif;
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.06em;
}

/* Most Wanted in hero */

.most-wanted {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-shrink: 0;
    margin-left: 2.5rem;
    margin-right: 0.5rem;
}

.most-wanted-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.most-wanted-label {
    font-family: "Rye", serif;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    color: var(--terracotta);
    text-transform: uppercase;
}

.most-wanted-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    height: 96px;
}

.most-wanted-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 3px;
}

/* Inner gold frame */
.most-wanted-avatar-wrap::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 4px;
    border: 6px solid;
    border-image: linear-gradient(
        145deg,
        #ffe082 0%,
        #ffd700 12%,
        #c89b3c 28%,
        #a07828 45%,
        #c89b3c 55%,
        #ffd700 72%,
        #ffe082 88%,
        #c89b3c 100%
    ) 1;
    box-shadow:
        inset 2px 2px 4px rgba(255,230,150,0.35),
        inset -2px -2px 4px rgba(0,0,0,0.3),
        3px 3px 8px rgba(0,0,0,0.5),
        0 0 20px rgba(255,215,0,0.15);
    pointer-events: none;
}

/* Outer ornate border */
.most-wanted-avatar-wrap::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 5px;
    border: 2px solid;
    border-image: linear-gradient(
        135deg,
        #c89b3c 0%,
        #ffe082 25%,
        #ffd700 50%,
        #ffe082 75%,
        #c89b3c 100%
    ) 1;
    box-shadow:
        inset 0 0 0 1px rgba(255,215,0,0.15),
        0 0 16px rgba(255,215,0,0.1);
    pointer-events: none;
}

/* Corner studs */
.most-wanted-avatar-wrap .corner-stud {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff8dc, #ffe082 30%, #c89b3c 60%, #8b6914);
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.5),
        0 1px 3px rgba(0,0,0,0.6),
        0 0 6px rgba(255,215,0,0.2);
    z-index: 3;
    pointer-events: none;
}

.corner-stud.tl { top: -13px; left: -13px; }
.corner-stud.tr { top: -13px; right: -13px; }
.corner-stud.bl { bottom: -13px; left: -13px; }
.corner-stud.br { bottom: -13px; right: -13px; }

/* Laurel wreaths */
.laurel {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 110px;
    transform: translateY(-50%);
    z-index: -1;
    pointer-events: none;
}

.laurel-left {
    left: -40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 110'%3E%3Cdefs%3E%3ClinearGradient id='lf' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%234a7a2e'/%3E%3Cstop offset='50%25' stop-color='%23386622'/%3E%3Cstop offset='100%25' stop-color='%232d5518'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M34 6 Q36 55 34 104' stroke='%234a3520' stroke-width='2' fill='none'/%3E%3Cg fill='url(%23lf)' stroke='%232d5518' stroke-width='0.5'%3E%3Cellipse cx='26' cy='8' rx='12' ry='5' transform='rotate(40 26 8)'/%3E%3Cellipse cx='22' cy='18' rx='12' ry='5' transform='rotate(32 22 18)'/%3E%3Cellipse cx='19' cy='28' rx='11' ry='5' transform='rotate(22 19 28)'/%3E%3Cellipse cx='17' cy='38' rx='11' ry='5' transform='rotate(12 17 38)'/%3E%3Cellipse cx='16' cy='48' rx='10' ry='5' transform='rotate(3 16 48)'/%3E%3Cellipse cx='16' cy='58' rx='10' ry='5' transform='rotate(-3 16 58)'/%3E%3Cellipse cx='17' cy='68' rx='11' ry='5' transform='rotate(-12 17 68)'/%3E%3Cellipse cx='19' cy='78' rx='11' ry='5' transform='rotate(-22 19 78)'/%3E%3Cellipse cx='22' cy='88' rx='12' ry='5' transform='rotate(-32 22 88)'/%3E%3Cellipse cx='26' cy='98' rx='12' ry='5' transform='rotate(-40 26 98)'/%3E%3C/g%3E%3Cg fill='%235a9a38' opacity='0.5'%3E%3Cellipse cx='24' cy='13' rx='8' ry='3' transform='rotate(36 24 13)'/%3E%3Cellipse cx='20' cy='23' rx='8' ry='3' transform='rotate(27 20 23)'/%3E%3Cellipse cx='18' cy='43' rx='7' ry='3' transform='rotate(8 18 43)'/%3E%3Cellipse cx='18' cy='63' rx='7' ry='3' transform='rotate(-8 18 63)'/%3E%3Cellipse cx='20' cy='83' rx='8' ry='3' transform='rotate(-27 20 83)'/%3E%3Cellipse cx='24' cy='93' rx='8' ry='3' transform='rotate(-36 24 93)'/%3E%3C/g%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.laurel-right {
    right: -40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 110'%3E%3Cdefs%3E%3ClinearGradient id='lf' x1='1' y1='0' x2='0' y2='1'%3E%3Cstop offset='0%25' stop-color='%234a7a2e'/%3E%3Cstop offset='50%25' stop-color='%23386622'/%3E%3Cstop offset='100%25' stop-color='%232d5518'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M10 6 Q8 55 10 104' stroke='%234a3520' stroke-width='2' fill='none'/%3E%3Cg fill='url(%23lf)' stroke='%232d5518' stroke-width='0.5'%3E%3Cellipse cx='18' cy='8' rx='12' ry='5' transform='rotate(-40 18 8)'/%3E%3Cellipse cx='22' cy='18' rx='12' ry='5' transform='rotate(-32 22 18)'/%3E%3Cellipse cx='25' cy='28' rx='11' ry='5' transform='rotate(-22 25 28)'/%3E%3Cellipse cx='27' cy='38' rx='11' ry='5' transform='rotate(-12 27 38)'/%3E%3Cellipse cx='28' cy='48' rx='10' ry='5' transform='rotate(-3 28 48)'/%3E%3Cellipse cx='28' cy='58' rx='10' ry='5' transform='rotate(3 28 58)'/%3E%3Cellipse cx='27' cy='68' rx='11' ry='5' transform='rotate(12 27 68)'/%3E%3Cellipse cx='25' cy='78' rx='11' ry='5' transform='rotate(22 25 78)'/%3E%3Cellipse cx='22' cy='88' rx='12' ry='5' transform='rotate(32 22 88)'/%3E%3Cellipse cx='18' cy='98' rx='12' ry='5' transform='rotate(40 18 98)'/%3E%3C/g%3E%3Cg fill='%235a9a38' opacity='0.5'%3E%3Cellipse cx='20' cy='13' rx='8' ry='3' transform='rotate(-36 20 13)'/%3E%3Cellipse cx='24' cy='23' rx='8' ry='3' transform='rotate(-27 24 23)'/%3E%3Cellipse cx='26' cy='43' rx='7' ry='3' transform='rotate(-8 26 43)'/%3E%3Cellipse cx='26' cy='63' rx='7' ry='3' transform='rotate(8 26 63)'/%3E%3Cellipse cx='24' cy='83' rx='8' ry='3' transform='rotate(27 24 83)'/%3E%3Cellipse cx='20' cy='93' rx='8' ry='3' transform='rotate(36 20 93)'/%3E%3C/g%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.most-wanted-name {
    font-family: "Rye", serif;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    color: var(--gold);
}

.sheriff-badge {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 0.4rem;
    filter: drop-shadow(0 1px 4px rgba(255,215,0,0.4));
}

.most-wanted-name a {
    color: inherit;
    text-decoration: none;
}

.most-wanted-name a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.most-wanted-stats {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.reward {
    font-family: "Rye", serif;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ---------- NAV ---------- */

.section-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background:
        linear-gradient(180deg, rgba(30,21,13,0.95) 0%, var(--bg-header) 100%);
    border-bottom: 2px solid var(--leather);
    border-top: 2px solid var(--leather);
    box-shadow:
        inset 0 1px 0 rgba(212,168,75,0.06),
        inset 0 -1px 0 rgba(212,168,75,0.06),
        0 2px 6px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}

.section-nav:empty { display: none; }

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-dim);
    background: rgba(61,43,26,0.3);
    border: 1px solid var(--leather);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.04);
}

.nav-btn:hover, .nav-btn.active {
    color: var(--sand);
    border-color: var(--sand-dim);
    background: var(--sand-glow);
    box-shadow:
        inset 0 1px 0 rgba(212,168,75,0.1),
        0 0 8px rgba(212,168,75,0.08);
}

.nav-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ---------- SEARCH ---------- */

.search-bar {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.7rem 1rem 0;
}

.search-bar input {
    width: 100%;
    max-width: 280px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--leather);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
}

.search-bar input::placeholder {
    color: var(--text-dim);
}

.search-bar input:focus {
    border-color: var(--sand-dim);
    box-shadow: 0 0 6px rgba(212,168,75,0.1);
}

#my-farmer {
    border-style: dashed;
}

/* ---------- MAIN ---------- */

main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    position: relative;
}

/* Decorative vertical side rails */
@media (min-width: 1060px) {
    main::before,
    main::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(180deg, transparent, rgba(107,58,31,0.15) 10%, rgba(107,58,31,0.15) 90%, transparent);
    }
    main::before { left: -20px; }
    main::after { right: -20px; }
}

.loading {
    text-align: center;
    color: var(--text-dim);
    padding: 4rem 1rem;
}

/* ---------- SECTION CARDS ---------- */

.dalton-section {
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--leather);
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        inset 0 0 0 1px rgba(212,168,75,0.08),
        0 2px 8px rgba(0,0,0,0.3),
        0 0 0 1px rgba(0,0,0,0.2);
    position: relative;
}

.dalton-section::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(212,168,75,0.15);
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background:
        linear-gradient(135deg, rgba(212,168,75,0.06) 0%, transparent 60%),
        repeating-linear-gradient(90deg, transparent, transparent 120px, rgba(107,58,31,0.04) 120px, rgba(107,58,31,0.04) 121px);
    border-bottom: 2px solid var(--leather);
    box-shadow: inset 0 -1px 0 rgba(212,168,75,0.06);
}

.section-leek {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    flex-shrink: 0;
}

.section-info h2 {
    font-family: "Rye", serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--sand);
}

.section-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.section-link:hover {
    color: var(--parchment);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.section-info .badge {
    display: inline-block;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.12rem 0.45rem;
    border-radius: 3px;
    margin-top: 0.15rem;
}

.badge-solo {
    color: #8cb4d4;
    background: rgba(140,180,212,0.08);
    border: 1px solid rgba(140,180,212,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-farmer {
    color: var(--terracotta);
    background: rgba(196,90,60,0.08);
    border: 1px solid rgba(196,90,60,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-team {
    color: #8cd4a0;
    background: rgba(140,212,160,0.08);
    border: 1px solid rgba(140,212,160,0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.section-stats {
    margin-left: auto;
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-dim);
}

.section-stats .count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sand);
    display: block;
    line-height: 1;
}

/* Western star divider between sections */
.dalton-section + .dalton-section {
    margin-top: 2rem;
    position: relative;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.section-divider::before,
.section-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    max-width: 140px;
    background: linear-gradient(90deg, transparent, var(--sand-dim));
}

.section-divider::after {
    background: linear-gradient(90deg, var(--sand-dim), transparent);
}

.section-divider span {
    color: var(--sand-dim);
    font-size: 1.1rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(212,168,75,0.2);
}

/* ---------- TABLE ---------- */

.table-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th {
    background:
        linear-gradient(180deg, rgba(61,43,26,0.4) 0%, var(--bg-header) 100%);
    color: var(--text-dim);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--leather);
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.04);
}

.ranking-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(107,58,31,0.12);
    font-size: 0.85rem;
    transition: background 0.1s;
}

.ranking-table tbody tr:hover td {
    background: var(--row-hover);
}

.ranking-table tbody tr:last-child td {
    border-bottom: none;
}

/* Champion section — gold ornate border */

.champion-section {
    border: 3px solid var(--gold);
    box-shadow:
        inset 0 0 0 1px rgba(255,215,0,0.15),
        0 0 0 2px rgba(0,0,0,0.3),
        0 0 0 4px rgba(255,215,0,0.2),
        0 0 0 5px rgba(0,0,0,0.15),
        0 0 30px rgba(255,215,0,0.08),
        0 4px 16px rgba(0,0,0,0.4);
}

.champion-section::before {
    inset: 4px;
    border: 1px solid rgba(255,215,0,0.25);
}

.champion-section::after {
    content: "★ GRAND CHAMPION ★";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Rye", serif;
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    background: var(--bg-card);
    padding: 0 0.8rem;
    z-index: 2;
}

.champion-header .section-info h2 {
    font-size: 1.5rem;
}

.champion-header .badge {
    font-size: 0.7rem;
}

.champion-header {
    padding: 1.1rem 1.25rem;
    background:
        linear-gradient(135deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0.02) 40%, transparent 70%),
        linear-gradient(180deg, rgba(255,215,0,0.04) 0%, transparent 100%),
        repeating-linear-gradient(90deg, transparent, transparent 120px, rgba(107,58,31,0.04) 120px, rgba(107,58,31,0.04) 121px);
}

/* Farmer section — terracotta wanted poster */

#farmer {
    border-color: var(--terracotta);
    box-shadow:
        inset 0 0 0 1px rgba(196,90,60,0.1),
        0 0 0 1px rgba(0,0,0,0.25),
        0 0 0 3px rgba(196,90,60,0.15),
        0 0 0 4px rgba(0,0,0,0.1),
        0 3px 12px rgba(0,0,0,0.35);
}

#farmer::before {
    border-color: rgba(196,90,60,0.2);
}

/* Team section — green accented */

#team {
    border-color: #4a7a56;
    box-shadow:
        inset 0 0 0 1px rgba(140,212,160,0.08),
        0 0 0 1px rgba(0,0,0,0.25),
        0 0 0 3px rgba(140,212,160,0.12),
        0 0 0 4px rgba(0,0,0,0.1),
        0 3px 12px rgba(0,0,0,0.35);
}

#team::before {
    border-color: rgba(140,212,160,0.15);
}

/* Solo leek sections — wanted poster style */

[id^="leek-"] {
    border-color: var(--sand-dim);
    box-shadow:
        inset 0 0 0 1px rgba(212,168,75,0.1),
        0 0 0 1px rgba(0,0,0,0.3),
        0 0 0 3px rgba(61,43,26,0.4),
        0 0 0 4px rgba(107,58,31,0.25),
        0 3px 12px rgba(0,0,0,0.35);
}

[id^="leek-"]::before {
    border-color: rgba(212,168,75,0.2);
}

[id^="leek-"]::after {
    content: "WANTED";
    position: absolute;
    top: -8px;
    right: 1.2rem;
    font-family: "Rye", serif;
    font-size: 0.45rem;
    letter-spacing: 0.15em;
    color: var(--terracotta);
    background: var(--bg-card);
    padding: 0 0.5rem;
    z-index: 2;
    opacity: 0.7;
}

.champion-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: sepia(0.3) brightness(0.9) drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    flex-shrink: 0;
}

.badge-champion {
    color: var(--gold);
    background: rgba(255,215,0,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.nav-btn-champion {
    color: var(--gold) !important;
    border-color: rgba(255,215,0,0.3) !important;
}

/* Stat line in section header */

.stat-line {
    display: block;
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
    letter-spacing: 0.02em;
}

.stat-line strong {
    color: var(--sand);
    font-weight: 700;
}

/* NEW badge */

.new-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.08rem 0.35rem;
    margin-left: 0.45rem;
    border-radius: 3px;
    color: #ffe082;
    background: rgba(255,183,0,0.15);
    border: 1px solid rgba(255,183,0,0.3);
    vertical-align: middle;
    animation: new-pulse 2s ease-in-out infinite;
}

@keyframes new-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.row-new td {
    background: rgba(255,183,0,0.03);
}

/* Expandable rows */

tr.expandable {
    cursor: pointer;
}

tr.expandable .wins-badge::after {
    content: " \25BE";
    font-size: 0.5rem;
}

tr.expanded .wins-badge::after {
    content: " \25B4";
}

.history-row td {
    padding: 0 !important;
    border-bottom: 1px solid rgba(107,58,31,0.12);
}

.history-cell {
    background: rgba(0,0,0,0.15);
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
}

.history-label {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.history-list a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    border: 1px solid rgba(107,58,31,0.15);
    transition: all 0.15s;
}

.history-list a:hover {
    color: var(--sand);
    border-color: var(--sand-dim);
    background: var(--sand-glow);
}

.history-list a.history-best {
    color: var(--sand);
    border-color: rgba(212,168,75,0.25);
}

.history-list a small {
    color: var(--text-dim);
    opacity: 0.7;
}

.wins-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 600;
    padding: 0.06rem 0.3rem;
    margin-left: 0.35rem;
    border-radius: 3px;
    color: var(--text-dim);
    background: rgba(138,123,104,0.12);
    border: 1px solid rgba(138,123,104,0.2);
    vertical-align: middle;
}

/* Sortable headers */

.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.sortable::after {
    content: " \25B8";
    font-size: 0.55rem;
    opacity: 0.3;
}

.sortable:hover {
    color: var(--sand);
}

.sortable.sort-active::after {
    opacity: 0.8;
}

.sortable.sort-asc::after {
    content: " \25B4";
}

.sortable.sort-desc::after {
    content: " \25BE";
}

/* Rank column */

.rank-cell {
    text-align: center;
    width: 3.2rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-medal {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

/* Top 3 */

.rank-1 td { background: rgba(255, 215, 0, 0.05); }
.rank-2 td { background: rgba(184, 192, 204, 0.03); }
.rank-3 td { background: rgba(205, 127, 50, 0.04); }

.rank-1 .rank-cell { color: var(--gold); }
.rank-2 .rank-cell { color: var(--silver); }
.rank-3 .rank-cell { color: var(--bronze); }

.rank-1 td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.rank-2 td:first-child { box-shadow: inset 3px 0 0 var(--silver); }
.rank-3 td:first-child { box-shadow: inset 3px 0 0 var(--bronze); }

.rank-1:hover td { background: rgba(255, 215, 0, 0.09) !important; }
.rank-2:hover td { background: rgba(184, 192, 204, 0.06) !important; }
.rank-3:hover td { background: rgba(205, 127, 50, 0.07) !important; }

/* Data cells */

.farmer-cell { font-weight: 600; }

.farmer-mini-avatar {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.4rem;
    border: 1px solid var(--leather);
    opacity: 0.85;
}

.farmer-cell a {
    color: var(--text);
    text-decoration: none;
}

.farmer-cell a:hover {
    color: var(--sand);
}

.leek-cell { color: #a89880; }

.level-cell {
    text-align: center;
    font-weight: 700;
    color: var(--sand);
}

.turns-cell {
    text-align: center;
    color: var(--text-dim);
}

.date-cell {
    color: var(--text-dim);
    font-size: 0.78rem;
}

.fight-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.fight-link:hover {
    color: var(--sand);
    border-color: var(--sand-dim);
    background: var(--sand-glow);
    box-shadow: 0 0 6px rgba(212,168,75,0.1);
}

.fight-link img {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.action-cell {
    white-space: nowrap;
}

.share-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 3px;
    margin-left: 0.2rem;
    transition: all 0.15s;
    vertical-align: middle;
}

.share-btn:hover {
    color: var(--sand);
    border-color: var(--sand-dim);
    background: var(--sand-glow);
}

/* Empty state — compact */

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    color: var(--text-dim);
}

.empty-state img {
    width: 24px;
    height: 24px;
    opacity: 0.25;
    filter: sepia(1) brightness(0.7);
    flex-shrink: 0;
}

.empty-state p {
    font-size: 0.8rem;
    font-style: italic;
}

/* ---------- FOOTER ---------- */

footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 2px solid var(--leather);
    color: var(--text-dim);
    font-size: 0.78rem;
    background:
        linear-gradient(180deg, transparent 0%, rgba(30,21,13,0.5) 100%);
    box-shadow: inset 0 1px 0 rgba(212,168,75,0.05);
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 2rem;
    right: 2rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(107,58,31,0.3) 20%, rgba(107,58,31,0.3) 80%, transparent);
}

.footer-logo {
    height: 28px;
    opacity: 0.3;
    margin-bottom: 0.6rem;
    filter: sepia(0.4);
}

footer p { margin-bottom: 0.25rem; }

.last-updated {
    font-size: 0.68rem;
    color: #443a2c;
}

footer a {
    color: var(--sand-dim);
    text-decoration: none;
}

footer a:hover {
    color: var(--sand);
    text-decoration: underline;
}

/* My farmer highlight */

.my-row td {
    background: rgba(212,168,75,0.1) !important;
    box-shadow: inset 0 0 0 1px rgba(212,168,75,0.15);
}

.my-row td:first-child {
    box-shadow: inset 3px 0 0 var(--sand) !important;
}

/* ---------- BACK TO TOP ---------- */

.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--sand-dim);
    background: var(--bg-card);
    border: 2px solid var(--leather);
    border-radius: 6px;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, color 0.15s, border-color 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 20;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    color: var(--sand);
    border-color: var(--sand-dim);
}

/* ---------- EASTER EGGS ---------- */

.dalton-mugshot[data-egg] {
    cursor: pointer;
}

/* Joe's pistol — hidden by default */
.joe-pistol {
    position: absolute;
    width: 32px;
    right: -8px;
    top: 60%;
    transform: rotate(-25deg);
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
    z-index: 2;
    transition: none;
}

@keyframes pistol-shoot {
    0%   { opacity: 0; transform: rotate(-25deg) translateX(10px); }
    15%  { opacity: 1; transform: rotate(-15deg) translateX(0); }
    25%  { transform: rotate(-20deg) translateX(-3px); }
    35%  { transform: rotate(-15deg) translateX(0); }
    75%  { opacity: 1; transform: rotate(-15deg); }
    100% { opacity: 0; transform: rotate(-15deg) translateX(10px); }
}

@keyframes shoot-recoil {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    20%      { transform: translateX(-50%) rotate(-3deg) translateX(-2px); }
    40%      { transform: translateX(-50%) rotate(0); }
}

.egg-shoot .joe-pistol {
    animation: pistol-shoot 0.7s ease;
}

.egg-shoot .leek-body {
    animation: shoot-recoil 0.4s ease;
}

@keyframes hat-jump {
    0%   { transform: translateX(-50%) translateY(0); }
    20%  { transform: translateX(-50%) translateY(-6px) rotate(-5deg); }
    50%  { transform: translateX(-50%) translateY(-3px) rotate(-2deg); }
    100% { transform: translateX(-50%) translateY(0) rotate(0); }
}

.egg-shoot .leek-hat {
    animation: hat-jump 0.4s ease;
    animation-delay: 0.1s;
}

/* Jack's bulbs — hidden by default */
.jack-bulb {
    position: absolute;
    width: 22px;
    height: 22px;
    object-fit: contain;
    bottom: 2px;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    z-index: 2;
}

.bulb-1 { left: 12px; transform: rotate(-15deg); }
.bulb-2 { left: 50%; transform: translateX(-50%); }
.bulb-3 { right: 12px; transform: rotate(15deg); }

@keyframes bulb-pop-left {
    0%   { opacity: 0; transform: rotate(-15deg) scale(0) translateY(8px); }
    30%  { opacity: 1; transform: rotate(-15deg) scale(1.2) translateY(-4px); }
    50%  { transform: rotate(-15deg) scale(1) translateY(0); }
    80%  { opacity: 1; transform: rotate(-15deg) scale(1) translateY(0); }
    100% { opacity: 0; transform: rotate(-15deg) scale(0.8) translateY(4px); }
}

@keyframes bulb-pop-center {
    0%   { opacity: 0; transform: translateX(-50%) scale(0) translateY(8px); }
    30%  { opacity: 1; transform: translateX(-50%) scale(1.2) translateY(-4px); }
    50%  { transform: translateX(-50%) scale(1) translateY(0); }
    80%  { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.8) translateY(4px); }
}

@keyframes bulb-pop-right {
    0%   { opacity: 0; transform: rotate(15deg) scale(0) translateY(8px); }
    30%  { opacity: 1; transform: rotate(15deg) scale(1.2) translateY(-4px); }
    50%  { transform: rotate(15deg) scale(1) translateY(0); }
    80%  { opacity: 1; transform: rotate(15deg) scale(1) translateY(0); }
    100% { opacity: 0; transform: rotate(15deg) scale(0.8) translateY(4px); }
}

.egg-summon .bulb-1 {
    animation: bulb-pop-left 0.7s ease both;
    animation-delay: 0s;
}

.egg-summon .bulb-2 {
    animation: bulb-pop-center 0.7s ease both;
    animation-delay: 0.12s;
}

.egg-summon .bulb-3 {
    animation: bulb-pop-right 0.7s ease both;
    animation-delay: 0.24s;
}

/* Jack also tips his hat */
@keyframes tip-hat {
    0%   { transform: translateX(-50%) translateY(0) rotate(0); }
    30%  { transform: translateX(-50%) translateY(-14px) rotate(-15deg); }
    60%  { transform: translateX(-50%) translateY(-10px) rotate(-12deg); }
    100% { transform: translateX(-50%) translateY(0) rotate(0); }
}

.egg-summon .leek-hat {
    animation: tip-hat 0.6s ease;
}



/* William's covid chip */
.william-covid {
    position: absolute;
    width: 52px;
    height: 52px;
    object-fit: contain;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}

@keyframes covid-fade {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20%  { opacity: 0.9; transform: translate(-50%, -50%) scale(1.1); }
    40%  { opacity: 0.8; transform: translate(-50%, -50%) scale(1) rotate(10deg); }
    60%  { opacity: 0.7; transform: translate(-50%, -50%) scale(1) rotate(-5deg); }
    80%  { opacity: 0.4; transform: translate(-50%, -50%) scale(0.95); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

.egg-wobble .william-covid {
    animation: covid-fade 0.6s ease both;
}

/* Wobble: the whole leek shakes angrily */
@keyframes wobble {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    15%      { transform: translateX(-50%) rotate(-8deg); }
    30%      { transform: translateX(-50%) rotate(7deg); }
    45%      { transform: translateX(-50%) rotate(-6deg); }
    60%      { transform: translateX(-50%) rotate(4deg); }
    75%      { transform: translateX(-50%) rotate(-2deg); }
}

.egg-wobble .leek-body {
    animation: wobble 0.5s ease;
}

/* Bounce: happy Averell bounces */
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    20%      { transform: translateX(-50%) translateY(-16px); }
    40%      { transform: translateX(-50%) translateY(0); }
    55%      { transform: translateX(-50%) translateY(-8px); }
    70%      { transform: translateX(-50%) translateY(0); }
    80%      { transform: translateX(-50%) translateY(-3px); }
}

@keyframes bounce-hat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    20%      { transform: translateX(-50%) translateY(-18px) rotate(5deg); }
    40%      { transform: translateX(-50%) translateY(0); }
    55%      { transform: translateX(-50%) translateY(-10px) rotate(-3deg); }
    70%      { transform: translateX(-50%) translateY(0); }
    80%      { transform: translateX(-50%) translateY(-4px); }
}

.egg-bounce .leek-body {
    animation: bounce 0.7s ease 0.1s both;
}

.egg-bounce .leek-hat {
    animation: bounce-hat 0.7s ease 0.1s both;
}

/* ---------- ANIMATIONS ---------- */

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

.dalton-section {
    animation: fade-up 0.4s ease both;
}

.dalton-section:nth-child(1) { animation-delay: 0s; }
.dalton-section:nth-child(2) { animation-delay: 0.08s; }
.dalton-section:nth-child(3) { animation-delay: 0.16s; }
.dalton-section:nth-child(4) { animation-delay: 0.24s; }
.dalton-section:nth-child(5) { animation-delay: 0.32s; }
.dalton-section:nth-child(6) { animation-delay: 0.4s; }
.dalton-section:nth-child(7) { animation-delay: 0.48s; }

.section-divider {
    animation: fade-up 0.3s ease both;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 640px) {
    .hero h1 { font-size: 1.8rem; }
    .wanted-frame { padding: 1rem 1.2rem 0.8rem; }
    .wanted-label { font-size: 0.8rem; }
    .dalton-lineup { gap: 0.8rem; }
    .leek-with-hat { width: 60px; height: 70px; }
    .leek-with-hat .leek-body { width: 60px; height: 60px; }
    .hat-panama, .hat-fedora { width: 42px; top: 5px; }
    .hat-sombrero { width: 46px; top: 3px; }
    .hero-weapon { display: none; }

    .section-header { padding: 0.7rem; gap: 0.6rem; }
    .dalton-section::before { inset: 2px; }
    .section-leek-wrap { width: 36px; height: 44px; }
    .section-leek-wrap .leek-body { width: 36px; height: 36px; }
    .section-leek-wrap .hat-panama,
    .section-leek-wrap .hat-fedora { width: 26px; top: 3px; }
    .section-leek-wrap .hat-sombrero { width: 28px; top: 1px; }
    .farmer-avatar { width: 36px; height: 36px; }
    .section-info h2 { font-size: 1rem; }
    .section-stats { display: none; }

    .ranking-table th,
    .ranking-table td {
        padding: 0.4rem 0.45rem;
        font-size: 0.76rem;
    }

    .date-cell { display: none; }
    .ranking-table th:nth-child(6) { display: none; }

    .table-scroll { max-height: 300px; }

    .nav-btn { padding: 0.3rem 0.55rem; font-size: 0.68rem; }
    .nav-btn img { width: 16px; height: 16px; }
    .rich-tooltip { max-width: 90vw; }
    .stat-grid { gap: 0.1rem 0.3rem; }
    .stat-icon { width: 11px; height: 11px; }
}

/* ---------- RICH TOOLTIP ---------- */

.rich-tooltip {
    position: fixed;
    z-index: 100;
    max-width: 560px;
    background: var(--bg-card);
    border: 2px solid var(--leather);
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 1px rgba(212,168,75,0.1),
        0 4px 20px rgba(0,0,0,0.5),
        0 0 0 1px rgba(0,0,0,0.3);
    padding: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    overflow: hidden;
}

.rich-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
}

.rich-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background:
        linear-gradient(135deg, rgba(212,168,75,0.06) 0%, transparent 60%);
    border-bottom: 1px solid rgba(107,58,31,0.2);
}

.rich-tooltip-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--leather);
    flex-shrink: 0;
}

.rich-tooltip-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--sand);
}

.rich-tooltip-name a {
    color: inherit;
    text-decoration: none;
}

.rich-tooltip-name a:hover {
    text-decoration: underline;
}

.rich-tooltip-sub {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

.rich-tooltip-leeks {
    padding: 0.25rem 0;
}

.rich-tooltip-leek {
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid rgba(107,58,31,0.1);
}

.rich-tooltip-leek:last-child {
    border-bottom: none;
}

.rich-tooltip-leek-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.rich-tooltip-leek-name {
    color: var(--text);
    font-weight: 600;
    font-size: 0.78rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rich-tooltip-leek-name a {
    color: inherit;
    text-decoration: none;
}

.rich-tooltip-leek-name a:hover {
    color: var(--sand);
}

.rich-tooltip-leek-level {
    color: var(--sand);
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.rich-tooltip-leek-talent {
    font-size: 0.68rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* Stat line with icons — single row */
.stat-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    font-size: 0.65rem;
    padding: 0.1rem 0;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    color: var(--text-dim);
    font-weight: 600;
    white-space: nowrap;
}

.stat-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    opacity: 0.85;
}

/* Equipment section */
.equip-section {
    padding: 0.3rem 0.75rem;
    border-top: 1px solid rgba(107,58,31,0.12);
}

.equip-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: calc(10 * (22px + 3px));
}

.equip-sep {
    width: 6px;
    flex-shrink: 0;
}

.equip-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 3px;
    border: 1px solid rgba(107,58,31,0.15);
    background: rgba(0,0,0,0.15);
    padding: 1px;
    transition: border-color 0.15s;
}

.equip-icon:hover {
    border-color: var(--sand-dim);
}

.rich-tooltip-loading {
    padding: 0.8rem 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-style: italic;
}

.rich-tooltip-error {
    padding: 0.6rem 0.75rem;
    color: var(--terracotta);
    font-size: 0.72rem;
    text-align: center;
}

.rich-tooltip-talent-badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    color: var(--sand);
    background: rgba(212,168,75,0.1);
    border: 1px solid rgba(212,168,75,0.2);
    margin-left: 0.3rem;
    vertical-align: middle;
}

.rich-tooltip-team {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.rich-tooltip-team img {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 0.2rem;
    border-radius: 2px;
}

/* Hoverable leek names */
[data-leek-id],
[data-comp] {
    cursor: help;
    border-bottom: 1px dotted rgba(168,152,128,0.3);
}

/* Composition tooltip — farmer groups */
.comp-farmer-group {
    border-bottom: 1px solid rgba(107,58,31,0.15);
}

.comp-farmer-group:last-child {
    border-bottom: none;
}

.comp-farmer-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem 0.1rem;
}

.comp-farmer-avatar {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--leather);
}

.comp-farmer-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.comp-farmer-name:hover {
    color: var(--sand);
}

/* =========================================
   Lucky Clover — Secret Trigger
   ========================================= */

.lucky-clover {
    position: absolute;
    right: -52px;
    bottom: 1.5rem;
    cursor: pointer;
}

.lucky-clover img {
    width: 44px;
    height: 44px;
    opacity: 0.08;
    filter: grayscale(0.5) brightness(0.8);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.3s ease;
}

.lucky-clover:hover img {
    opacity: 0.5;
    filter: grayscale(0) brightness(1);
    transform: scale(1.2);
}

/* =========================================
   Haunted Section — Abandoned Saloon Theme
   ========================================= */

.haunted-section {
    margin-top: 2rem;
}

.haunted-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.haunted-divider::before,
.haunted-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    max-width: 140px;
}

.haunted-divider::before {
    background: linear-gradient(90deg, transparent, #4a5568);
}

.haunted-divider::after {
    background: linear-gradient(90deg, #4a5568, transparent);
}

.haunted-divider span {
    font-size: 1.3rem;
    line-height: 1;
    filter: grayscale(0.3);
    text-shadow: 0 0 10px rgba(130, 200, 160, 0.3);
}

/* Condemned section card */
.condemned-section {
    border-color: #3a4a3a !important;
    background: #1a1e1a !important;
    box-shadow:
        inset 0 0 0 1px rgba(130, 200, 160, 0.06),
        0 0 0 1px rgba(0,0,0,0.4),
        0 0 0 3px rgba(60, 80, 60, 0.2),
        0 0 0 4px rgba(0,0,0,0.15),
        0 0 30px rgba(130, 200, 160, 0.04),
        0 4px 16px rgba(0,0,0,0.5) !important;
}

.condemned-section::before {
    border-color: rgba(130, 200, 160, 0.1) !important;
}

.condemned-section::after {
    content: "\2620  CONDEMNED \2620" !important;
    color: #6b8a6b !important;
    background: #1a1e1a !important;
    font-family: "Rye", serif;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    letter-spacing: 0.2em;
    padding: 0 0.8rem;
    z-index: 2;
}

.condemned-header {
    background:
        linear-gradient(135deg, rgba(130, 200, 160, 0.04) 0%, transparent 60%),
        repeating-linear-gradient(90deg, transparent, transparent 120px, rgba(60,80,60,0.04) 120px, rgba(60,80,60,0.04) 121px) !important;
    border-bottom-color: #3a4a3a !important;
}

.condemned-avatar {
    border-color: #3a4a3a !important;
    filter: brightness(0.85) saturate(0.7);
    box-shadow:
        0 0 8px rgba(130, 200, 160, 0.1),
        0 0 0 1px rgba(130, 200, 160, 0.08) !important;
}

.condemned-title {
    color: #6b8a6b !important;
}

.condemned-title a {
    color: inherit !important;
}

.condemned-title a:hover {
    color: #8ab88a !important;
}

.condemned-stats .count {
    color: #6b8a6b !important;
}

.badge-condemned {
    color: #8ab88a;
    background: rgba(130, 200, 160, 0.06);
    border: 1px solid rgba(130, 200, 160, 0.15);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Condemned table overrides */
.condemned-table th {
    background:
        linear-gradient(180deg, rgba(40,50,40,0.5) 0%, #1a1e1a 100%) !important;
    border-bottom-color: #3a4a3a !important;
}

.condemned-table td {
    border-bottom-color: rgba(60,80,60,0.12) !important;
}

.condemned-table tbody tr:hover td {
    background: rgba(130, 200, 160, 0.04) !important;
}

/* Cobweb decorations on condemned section */
.condemned-section .section-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(180,180,180,0.06) 0%, transparent 70%),
        linear-gradient(135deg, rgba(180,180,180,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 2;
}

.condemned-section .section-header::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(180,180,180,0.06) 0%, transparent 70%),
        linear-gradient(225deg, rgba(180,180,180,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 2;
}
