/* ═══════════════════════════════════════════════════════════════
   Caucasian Titans — style.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --bg:          rgba(9,7,4,.2);
    --bg-deep:     rgba(7,5,4,.25);
    --surface:     rgba(18,14,9,.3);
    --surface-2:   rgba(28,22,10,.35);
    --surface-3:   rgba(36,28,15,.4);
    --border:      rgba(46,34,20,.55);
    --border-light:rgba(61,46,24,.6);
    --gold:        #c8a54a;
    --gold-light:  #e8c570;
    --gold-dark:   #8a6520;
    --text:        #fff8ee;
    --text-muted:  #c8b898;
    --text-dim:    #9a8a70;
    --radius:      14px;
    --radius-lg:   20px;
    --shadow:      0 8px 40px rgba(0,0,0,.7);
    --transition:  .25s cubic-bezier(.4,0,.2,1);
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans Georgian', system-ui, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background layer — parallax + roar shake (shared by video and image fallback) */
body::after {
    content: '';
    position: fixed;
    inset: -60px;
    background: url('../bg.webp') center center / cover no-repeat;
    z-index: -1;
    will-change: transform;
    transform: translate(
        calc(var(--bg-x, 0px) + var(--bg-shake-x, 0px)),
        calc(var(--bg-y, 0px) + var(--bg-shake-y, 0px))
    );
}


/* ── Page atmosphere (inner pages) ──────────────────────────── */

/* Floating golden orbs */
body::before {
    content: '';
    position: fixed;
    inset: -200px;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80vw 70vh at 10% 15%,  rgba(200,165,74,.18)  0%, transparent 65%),
        radial-gradient(ellipse 70vw 75vh at 90% 85%,  rgba(200,165,74,.15)  0%, transparent 65%),
        radial-gradient(ellipse 55vw 50vh at 75% 20%,  rgba(239,68,68,.10)   0%, transparent 60%),
        radial-gradient(ellipse 50vw 50vh at 20% 80%,  rgba(34,197,94,.09)   0%, transparent 60%),
        radial-gradient(ellipse 40vw 40vh at 50% 50%,  rgba(200,165,74,.08)  0%, transparent 60%);
    animation: orbDrift 22s ease-in-out infinite alternate;
}

@keyframes orbDrift {
    0%   { transform: translate(0,    0)    scale(1);    opacity: 1;  }
    33%  { transform: translate(80px, 60px) scale(1.06); opacity: .9; }
    66%  { transform: translate(-60px,80px) scale(.96);  opacity: .95;}
    100% { transform: translate(70px,-70px) scale(1.08); opacity: 1;  }
}

/* Make sure all content sits above the fixed bg effects */
.page-topbar,
main,
.container,
.modal-overlay { position: relative; z-index: 1; }
.page-topbar { z-index: 100; }
.modal-overlay { z-index: 1000; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul { list-style: none; }

/* ── Container ──────────────────────────────────────────────── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Page topbar (no-nav pages) ─────────────────────────────── */
.page-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 60px;
    background: rgba(6,5,8,.55);
    backdrop-filter: blur(28px) saturate(1.4);
    border-bottom: 1px solid rgba(200,165,74,.12);
    box-shadow: 0 2px 24px rgba(0,0,0,.4);
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.topbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}
.topbar-brand-name {
    font-family: 'Cinzel', serif;
    font-size: .85rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: .06em;
    white-space: nowrap;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.topbar-page {
    font-family: 'Cinzel', serif;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.topbar-switch {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: color .2s, border-color .2s;
}
.topbar-switch:hover { color: var(--gold); border-color: var(--gold-light); }
/* legacy alias kept for gallery back link */
.topbar-back {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s;
}
.topbar-back:hover { color: var(--gold); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .95rem;
    transition: var(--transition);
    cursor: pointer;
}
.btn-outline {
    border: 1.5px solid var(--gold);
    color: var(--gold);
}
.btn-outline:hover {
    background: var(--gold);
    color: #0a0800;
    box-shadow: 0 0 24px rgba(200,165,74,.4);
}
.btn-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 100px;
    border: 1.5px solid var(--border-light);
    color: var(--text-muted);
    font-size: .9rem;
    transition: var(--transition);
    margin-top: 16px;
}
.btn-switch:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
    background: rgba(7,5,4,.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity var(--transition);
}
.logo:hover { opacity: .85; }
.logo-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-main {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--gold);
    letter-spacing: .05em;
}
.logo-sub {
    font-size: .72rem;
    color: var(--text-dim);
    letter-spacing: .04em;
}

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .9rem;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: width var(--transition);
}
.nav-link:hover,
.nav-link.active { color: var(--text); }
.nav-link:hover::after,
.nav-link.active::after { width: calc(100% - 32px); }
.nav-link.active { color: var(--gold); }

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 32px;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════════
   LANDING (index) — everything in one viewport
   ═══════════════════════════════════════════════════════════════ */
.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 70px;
}
.landing-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 20%, rgba(200,165,74,.07) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 15% 75%, rgba(34,197,94,.04) 0%, transparent 55%),
        radial-gradient(ellipse 55% 45% at 85% 75%, rgba(239,68,68,.04) 0%, transparent 55%),
        linear-gradient(180deg, #0a0804 0%, #070504 60%, #0d0a07 100%);
}
.landing-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.particle {
    position: absolute;
    background: var(--gold);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}
@keyframes particleFloat {
    0%   { transform: translateY(0) scale(1); opacity: inherit; }
    50%  { transform: translateY(-50px) scale(1.2); opacity: .7; }
    100% { transform: translateY(0) scale(1); opacity: inherit; }
}
.landing-inner {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding-top: 32px;
    padding-bottom: 40px;
}

/* Top block */
.landing-top {
    text-align: center;
}
.landing-eyebrow {
    font-size: .8rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
    font-weight: 500;
}
.landing-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 24px;
}
.lt-geo {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: .12em;
}
.lt-eng {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 7vw, 4.5rem);
    font-weight: 900;
    letter-spacing: .06em;
    background: linear-gradient(135deg, #c8a54a, #f0d890, #c8a54a, #8a6520);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.landing-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
    width: fit-content;
    margin: 0 auto;
}
.landing-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
}
.landing-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}
.ls-num {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}
.ls-lbl {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* Choose block */
.landing-choose { width: 100%; }
.landing-choose-label {
    text-align: center;
    font-size: .8rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════ */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 700;
    text-align: center;
    color: var(--gold-light);
    margin-bottom: 12px;
}
.section-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   CATEGORY CARDS (shared between landing + any other usage)
   ═══════════════════════════════════════════════════════════════ */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}
.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    padding: 40px 32px 32px;
    cursor: pointer;
    opacity: 1;
    transform: none;
}
.cat-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-light);
}
.cat-herb:hover  { box-shadow: 0 20px 60px rgba(34,197,94,.25); border-color: #22c55e55; }
.cat-carn:hover  { box-shadow: 0 20px 60px rgba(239,68,68,.25); border-color: #ef444455; }


.cat-card-glow {
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.cat-herb .cat-card-glow { background: radial-gradient(circle, rgba(34,197,94,.15), transparent 70%); }
.cat-carn .cat-card-glow { background: radial-gradient(circle, rgba(239,68,68,.15), transparent 70%); }
.cat-card:hover .cat-card-glow { opacity: 1; }

.cat-card-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}
.cat-card-body h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.cat-herb h3 { color: #22c55e; }
.cat-carn h3 { color: #ef4444; }
.cat-card-body > p {
    font-size: .85rem;
    color: var(--text-dim);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.cat-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}
.cat-card-list li {
    font-size: .9rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
}
.cat-card-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--gold);
}
.cat-card-btn {
    display: inline-flex;
    align-items: center;
    font-size: .9rem;
    font-weight: 600;
    color: var(--gold);
    transition: gap var(--transition);
}
.cat-card:hover .cat-card-btn { gap: 6px; }
.cat-card-deco {
    position: absolute;
    bottom: -10px; right: 16px;
    font-size: 5rem;
    opacity: .07;
    line-height: 1;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}
.cat-card:hover .cat-card-deco { opacity: .12; transform: scale(1.1) rotate(-5deg); }

/* ═══════════════════════════════════════════════════════════════
   TIER SECTION (index)
   ═══════════════════════════════════════════════════════════════ */
.tier-section {
    padding: 80px 0;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,.015), transparent);
}
.tier-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}
.tier-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--tc, #fff);
    border-radius: var(--radius);
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-20px);
}
.tier-item.visible {
    opacity: 1;
    transform: translateX(0);
}
.tier-item:hover {
    background: var(--surface-2);
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.tier-badge {
    font-family: 'Cinzel', serif;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--tc, #fff);
    background: color-mix(in srgb, var(--tc, #fff) 15%, transparent);
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--tc, #fff) 30%, transparent);
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
}
.tier-info { display: flex; flex-direction: column; gap: 2px; }
.tier-info strong { font-size: .95rem; }
.tier-info span { font-size: .8rem; color: var(--text-muted); }
.tier-cta { text-align: center; margin-top: 32px; }

/* ═══════════════════════════════════════════════════════════════
   PAGE HERO (gallery / tierlist)
   ═══════════════════════════════════════════════════════════════ */
.page-hero {
    padding: 120px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .06;
}
.page-hero--herbivore::before {
    background: radial-gradient(ellipse 80% 80% at 50% 0%, #22c55e, transparent);
}
.page-hero--carnivore::before {
    background: radial-gradient(ellipse 80% 80% at 50% 0%, #ef4444, transparent);
}
.page-hero--tier::before {
    background: radial-gradient(ellipse 80% 80% at 50% 0%, #eab308, transparent);
}
.page-hero-content { position: relative; }
.page-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
    animation: bounce 3s ease-in-out infinite;
}
@keyframes bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
.page-hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    color: var(--gold-light);
    margin-bottom: 12px;
}
.page-hero-sub {
    font-size: 1rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   TIER FILTER
   ═══════════════════════════════════════════════════════════════ */
.tier-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 32px 0;
    position: sticky;
    top: 70px;
    z-index: 100;
    background: transparent;
}
.tier-btn {
    padding: 8px 20px;
    border-radius: 100px;
    border: 1.5px solid rgba(200,165,74,.2);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 500;
    transition: var(--transition);
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(10px);
}
.tier-btn:hover {
    border-color: var(--tc, var(--gold));
    color: var(--tc, var(--gold));
}
.tier-btn.active {
    background: var(--tc, var(--gold));
    border-color: var(--tc, var(--gold));
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px color-mix(in srgb, var(--tc, var(--gold)) 40%, transparent);
}
.tier-btn[data-tier="all"].active {
    --tc: #c8a54a;
}

/* ═══════════════════════════════════════════════════════════════
   TIER GROUP
   ═══════════════════════════════════════════════════════════════ */
.tier-group {
    margin-bottom: 60px;
}
.tier-group-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}
.tier-group-badge {
    font-family: 'Cinzel', serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--tc, #fff);
    background: color-mix(in srgb, var(--tc) 15%, transparent);
    padding: 5px 16px;
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent);
    white-space: nowrap;
}
.tier-group-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--tc, #fff);
    white-space: nowrap;
}
.tier-group-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 30%, transparent), transparent);
}

/* ═══════════════════════════════════════════════════════════════
   DINO CARDS
   ═══════════════════════════════════════════════════════════════ */
.dino-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.dino-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    opacity: 0;
    transform: translateY(24px);
}
.dino-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.dino-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0,0,0,.5);
    border-color: var(--border-light);
}
.dino-card:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Card image */
.dino-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dino-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.dino-card:hover .dino-card-image img { transform: scale(1.07); }
.dino-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
}
.dino-emoji  { font-size: 3.5rem; opacity: .25; }
.dino-initial {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255,255,255,.08);
    line-height: 1;
    letter-spacing: -.02em;
}

/* Tier badge on card */
.dino-tier-badge {
    position: absolute;
    top: 12px; left: 12px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tc);
    background: rgba(0,0,0,.65);
    border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent);
    padding: 4px 10px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 12px var(--tg);
}

/* Card body */
.dino-card-body {
    padding: 18px 20px;
}
.dino-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.3;
}
.dino-name-eng {
    font-size: .78rem;
    color: var(--text-dim);
    font-style: italic;
    margin-bottom: 14px;
}
.dino-mini-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.mini-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mini-icon { font-size: .85rem; width: 18px; text-align: center; flex-shrink: 0; }
.mini-bar-wrap { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.mini-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.mini-label {
    font-size: .65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mini-value {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text);
}
.mini-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .6s ease;
}
/* Speed badges on cards */
.dino-speed-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.speed-tag {
    font-size: .68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid;
    white-space: nowrap;
}
.speed-ground { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.3); }
.speed-water  { background: rgba(59,130,246,.12); color: #60a5fa; border-color: rgba(59,130,246,.3); }
.speed-air    { background: rgba(168,85,247,.12); color: #c084fc; border-color: rgba(168,85,247,.3); }

.dino-card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 4px 0 2px;
}
.dino-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 600;
    border: 1px solid;
}
.dino-meta-chip--growth {
    background: rgba(34,197,94,.1);
    color: #4ade80;
    border-color: rgba(34,197,94,.28);
}
.dino-meta-chip--carry {
    background: rgba(239,68,68,.1);
    color: #f87171;
    border-color: rgba(239,68,68,.28);
}

.dino-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.dino-length { font-size: .8rem; color: var(--text-muted); }
.card-view-btn {
    font-size: .78rem;
    color: var(--gold);
    font-weight: 600;
    transition: letter-spacing var(--transition);
}
.dino-card:hover .card-view-btn { letter-spacing: .02em; }

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: #120e09;
    border: 1px solid rgba(46,34,20,.8);
    border-radius: var(--radius-lg);
    max-width: 1300px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    transform: scale(.95) translateY(20px);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 32px 80px rgba(0,0,0,.8);
}
.modal-overlay.open .modal-box {
    transform: scale(1) translateY(0);
}
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 10;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}
.modal-close:hover {
    background: rgba(255,255,255,.1);
    color: var(--text);
}

/* Modal hero */
.modal-hero {
    position: relative;
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(18,14,9,1) 0%, rgba(18,14,9,.3) 50%, transparent 100%);
}
.modal-hero-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px 28px;
    z-index: 2;
}
.modal-tier-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tc);
    background: rgba(0,0,0,.6);
    border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 8px;
    box-shadow: 0 0 20px var(--tg);
}
.modal-dino-name {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 4px;
}
.modal-dino-eng {
    font-size: .9rem;
    color: rgba(255,255,255,.7);
    font-style: italic;
    margin-bottom: 8px;
}
.modal-cat-tag {
    font-size: .8rem;
    color: rgba(255,255,255,.85);
    background: rgba(0,0,0,.35);
    padding: 3px 12px;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,.2);
}

/* Modal body */
.modal-body {
    padding: 20px 28px;
}
.modal-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.modal-section { margin-bottom: 24px; }
.modal-section-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stat bars */
.modal-stats { display: flex; flex-direction: column; gap: 12px; }
.modal-stat {}
.modal-stat-label {
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.modal-stat-val { color: var(--text); font-weight: 600; }
.modal-stat-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.modal-stat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .8s cubic-bezier(.4,0,.2,1);
}

.marks-icon-sm { width: 10px; height: 10px; object-fit: contain; }
.marks-icon    { width: 14px; height: 14px; object-fit: contain; vertical-align: middle; }

.terrain-speeds { display: flex; flex-direction: column; gap: 8px; }
.terrain-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,.04);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.terrain-icon { font-size: 1rem; width: 22px; text-align: center; }
.terrain-label { flex: 1; font-size: .82rem; color: var(--text-dim); }
.terrain-val { font-size: .88rem; font-weight: 700; color: var(--text); }

/* Special tags */
.special-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.special-tag {
    font-size: .78rem;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(200,165,74,.1);
    border: 1px solid rgba(200,165,74,.25);
    color: var(--gold-light);
}

/* Info table */
.info-table { display: flex; flex-direction: column; gap: 1px; }
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: .85rem;
    gap: 16px;
}
.info-row:nth-child(odd) { background: var(--surface-3); }
.info-row span:first-child { color: var(--text-muted); white-space: nowrap; }
.info-row span:last-child  { color: var(--text); text-align: right; }

/* Modal text */
.modal-text {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.75;
}

/* ═══════════════════════════════════════════════════════════════
   TIER LIST PAGE
   ═══════════════════════════════════════════════════════════════ */
.tierlist-main { padding-bottom: 80px; }
.tl-legend {
    padding: 24px 0 32px;
    display: flex;
    justify-content: center;
}
.tl-legend-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 16px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.tl-leg-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--text-muted);
}
.tl-leg-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tl-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0;
    margin-bottom: 4px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s, transform .5s;
}
.tl-row.visible {
    opacity: 1;
    transform: translateY(0);
}
.tl-row-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    background: color-mix(in srgb, var(--tc) 8%, #120e09);
    border-right: 3px solid var(--tc);
    text-align: center;
}
.tl-row-badge {
    font-family: 'Cinzel', serif;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--tc);
    background: color-mix(in srgb, var(--tc) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent);
    padding: 4px 12px;
    border-radius: 100px;
}
.tl-row-geo {
    font-size: .78rem;
    color: var(--text-muted);
}
.tl-row-body {
    padding: 20px 24px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tl-group { display: flex; flex-direction: column; gap: 10px; }
.tl-group-label {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
}
.tl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tl-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.tl-chip:hover {
    border-color: var(--tc);
    background: color-mix(in srgb, var(--tc) 10%, var(--surface-2));
    box-shadow: 0 4px 16px color-mix(in srgb, var(--tc) 20%, transparent);
    transform: translateY(-2px);
}
.tl-chip-emoji { font-size: 1.1rem; }
.tl-chip-names { display: flex; flex-direction: column; line-height: 1.2; }
.tl-chip-eng { font-size: .88rem; font-weight: 600; color: var(--text); }
.tl-chip-geo { font-size: .72rem; color: var(--text-dim); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 48px 0;
    margin-top: 80px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-logo {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
}
.footer-brand p { font-size: .8rem; color: var(--text-dim); }
.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-links a {
    font-size: .85rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--gold); }
.footer-copy p { font-size: .78rem; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════
   GALLERY MAIN
   ═══════════════════════════════════════════════════════════════ */
.gallery-main { padding-bottom: 80px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar ── */
@media (max-width: 600px) {
    .page-topbar { padding: 0 16px; height: 52px; }
    .topbar-brand-name { display: none; }
    .topbar-brand img { width: 28px; height: 28px; }
    .topbar-page { font-size: .7rem; }
    .topbar-switch { font-size: .7rem; padding: 4px 9px; }
}
@media (max-width: 380px) {
    .topbar-page { display: none; }
}

/* ── Tier filter offset matches topbar height ── */
.tier-filter { top: 60px; }
@media (max-width: 600px) { .tier-filter { top: 52px; } }

@media (max-width: 900px) {
    .modal-cols { grid-template-columns: 1fr; }
    .tl-row { grid-template-columns: 120px 1fr; }
}

@media (max-width: 768px) {
    .site-nav {
        position: fixed;
        top: 70px; left: 0; right: 0;
        background: rgba(7,5,4,.97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 4px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform .3s ease, opacity .3s ease;
    }
    .site-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .nav-link { padding: 12px 16px; border-radius: 8px; }
    .nav-link::after { display: none; }
    .nav-link:hover,
    .nav-link.active { background: var(--surface-2); }
    .nav-toggle { display: flex; }

    .landing-stats { border-radius: var(--radius); }
    .landing-stat  { padding: 10px 18px; gap: 6px; }
    .ls-num { font-size: 1.2rem; }
    .ls-lbl { font-size: .72rem; }
    .landing-inner { gap: 28px; }

    .tl-row { grid-template-columns: 1fr; }
    .tl-row-label {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 20px;
        border-right: none;
        border-bottom: 3px solid var(--tc);
    }
    .tl-row-body { padding: 16px; }

    .dino-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .modal-hero { height: 140px; }
    .modal-body { padding: 16px; }
    .modal-dino-name { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════════════════════════════
   RULES PAGE  (wesrebi.php)
   ═══════════════════════════════════════════════════════════════ */

/* Hero accent */
.page-hero--rules::before {
    background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(200,165,74,.18), transparent);
}

/* ── Tab chooser cards ──────────────────────────────────────── */
.rules-chooser {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 40px 0 52px;
    flex-wrap: wrap;
}
.rules-choose-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 36px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-light);
    background: var(--surface);
    font-family: 'Noto Sans Georgian', system-ui, sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
    position: relative;
    overflow: hidden;
    min-width: 290px;
}
.rules-choose-card::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.rules-choose-card--group::after  { background: radial-gradient(ellipse 120% 100% at 0% 60%, rgba(239,68,68,.09), transparent 60%); }
.rules-choose-card--general::after { background: radial-gradient(ellipse 120% 100% at 0% 60%, rgba(200,165,74,.09), transparent 60%); }
.rules-choose-card:hover::after,
.rules-choose-card.active::after  { opacity: 1; }
.rules-choose-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.rules-choose-card--group:hover,
.rules-choose-card--group.active  { border-color: rgba(239,68,68,.5); box-shadow: 0 12px 40px rgba(239,68,68,.18); }
.rules-choose-card--general:hover,
.rules-choose-card--general.active { border-color: rgba(200,165,74,.5); box-shadow: 0 12px 40px rgba(200,165,74,.18); }
.rules-choose-card.active { background: rgba(255,255,255,.035); }

.rcc-icon { font-size: 2.2rem; transition: transform .3s; flex-shrink: 0; }
.rules-choose-card:hover .rcc-icon,
.rules-choose-card.active .rcc-icon { transform: scale(1.15); }

.rcc-text { display: flex; flex-direction: column; gap: 5px; }
.rcc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: color .25s;
}
.rules-choose-card--group.active .rcc-title,
.rules-choose-card--group:hover .rcc-title  { color: #ef4444; }
.rules-choose-card--general.active .rcc-title,
.rules-choose-card--general:hover .rcc-title { color: var(--gold); }
.rcc-sub { font-size: .75rem; color: var(--text-dim); }

.rcc-arrow {
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--text-dim);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity .25s, transform .25s;
    flex-shrink: 0;
}
.rules-choose-card:hover .rcc-arrow,
.rules-choose-card.active .rcc-arrow { opacity: 1; transform: translateX(0); }

/* ── Content sections ───────────────────────────────────────── */
.rules-section         { display: none; padding-bottom: 80px; }
.rules-section.active  { display: block; }

/* ── Legend ─────────────────────────────────────────────────── */
.rules-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 16px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 36px;
}
.rules-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    color: var(--text-muted);
}
.rules-legend-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}
.rules-legend-badge--p   { background: rgba(234,179,8,.15);  color: #eab308; border: 1px solid rgba(234,179,8,.35); }
.rules-legend-badge--mix { background: rgba(200,165,74,.12); color: var(--gold); border: 1px solid rgba(200,165,74,.3); }
.rules-legend-badge--cw  { background: rgba(239,68,68,.1);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }

/* ── Group rules grid ────────────────────────────────────────── */
.group-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
}

/* ── Rule card ───────────────────────────────────────────────── */
.rule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    opacity: 0;
    transform: translateY(22px);
    animation: ruleCardIn .55s ease forwards;
    position: relative;
}
@keyframes ruleCardIn {
    to { opacity: 1; transform: translateY(0); }
}
.rule-card.visible { opacity: 1; transform: translateY(0); }
.rule-card:hover   { transform: translateY(-5px); box-shadow: 0 14px 48px rgba(0,0,0,.55); }
.rule-card--carnivore:hover { border-color: rgba(239,68,68,.35); }
.rule-card--herbivore:hover { border-color: rgba(34,197,94,.35); }

/* Image area */
.rule-card-image {
    position: relative;
    height: 168px;
    overflow: hidden;
}
.rule-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.rule-card:hover .rule-card-image img { transform: scale(1.08); }
.rule-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(18,14,9,.97) 0%, rgba(18,14,9,.15) 55%, transparent 100%);
}
.rule-card-name-block {
    position: absolute;
    bottom: 10px; left: 14px; right: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}
.rule-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,.8);
    min-width: 0;
    overflow: hidden;
}
.rule-cat-badge {
    font-size: .67rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
    background: rgba(0,0,0,.55);
    white-space: nowrap;
    flex-shrink: 0;
}
.rule-cat-badge--carn { color: #f87171; border: 1px solid rgba(239,68,68,.45); }
.rule-cat-badge--herb { color: #4ade80; border: 1px solid rgba(34,197,94,.45); }

/* Card body */
.rule-card-body {
    padding: 16px 18px 70px 18px;
    display: flex;
    flex-direction: column;
}

/* Stat boxes */
.rule-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.rule-stat-box {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rule-stat-label {
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    font-weight: 600;
}
.rule-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.rule-stat-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}
.rule-stat-fill { height: 100%; border-radius: 2px; }
.rule-stat-fill--weight { background: linear-gradient(90deg, #ef4444, #f97316); }
.rule-stat-fill--hp     { background: linear-gradient(90deg, #22c55e, #86efac); }

/* Group rules box */
.rule-group-box {
    background: rgba(255,255,255,.022);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rule-group-divider {
    height: 1px;
    background: var(--border);
    margin: 0 -2px;
}
.rule-group-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.rule-group-icon { font-size: .95rem; flex-shrink: 0; width: 20px; text-align: center; padding-top: 2px; }
.rule-group-content { display: flex; flex-direction: column; gap: 5px; }
.rule-group-label {
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    font-weight: 600;
}
.rule-group-val {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    flex-wrap: wrap;
}
.rule-adults-badge {
    font-weight: 700;
    color: var(--text);
    background: rgba(255,255,255,.07);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-light);
    font-size: .82rem;
}
.rule-sep { color: var(--text-dim); }
.rule-juv-badge {
    font-weight: 700;
    color: #eab308;
    background: rgba(234,179,8,.1);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid rgba(234,179,8,.3);
    font-size: .82rem;
}

/* Mixed pack */
.rule-mixed-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rule-mixed-chip {
    font-size: .77rem;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 100px;
    background: rgba(200,165,74,.1);
    border: 1px solid rgba(200,165,74,.3);
    color: var(--gold-light);
    transition: background .2s, border-color .2s;
}
.rule-mixed-chip:hover {
    background: rgba(200,165,74,.2);
    border-color: var(--gold);
}
.rule-mixed-chip--all {
    background: rgba(34,197,94,.12);
    border-color: rgba(34,197,94,.4);
    color: #86efac;
    font-weight: 700;
}
.rule-mixed-chip--all:hover {
    background: rgba(34,197,94,.2);
    border-color: #4ade80;
}

/* Max CW row */
.rule-max-weight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(239,68,68,.07);
    border: 1px solid rgba(239,68,68,.22);
    border-radius: 8px;
    font-size: .82rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 16px 16px 16px;
}
.rule-max-weight-icon { flex-shrink: 0; }
.rule-max-weight-label { color: var(--text-dim); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════════════════════════
   HOME — 5 vertical panels
   ═══════════════════════════════════════════════════════════════ */
.panels {
    display: flex;
    height: calc(100vh - 70px); /* full viewport minus header */
}

.panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    transition: transform .1s ease, box-shadow .3s ease;
    border-right: 1px solid rgba(255,255,255,.04);
    transform-style: preserve-3d;
    will-change: transform;
}
.panel:last-child { border-right: none; }
.panels { perspective: 1200px; }

/* Dark overlay on each panel */
.panel-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    transition: background .4s;
}
.panel:hover .panel-bg { background: rgba(0,0,0,.3); }

/* Per-panel accent colours (subtle tint on hover) */
.panel--herb  { background: #0a1a0a; }
.panel--herb:hover  .panel-bg { background: rgba(0,0,0,.25); }
.panel--herb  .panel-bg { background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(10,40,10,.5)); }

.panel--carn  { background: #1a0808; }
.panel--carn  .panel-bg { background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(50,10,10,.5)); }

.panel--rules { background: #0c0d1a; }
.panel--rules .panel-bg { background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(15,15,50,.5)); }

.panel--tier  { background: #1a1400; }
.panel--tier  .panel-bg { background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(50,40,0,.5)); }

.panel--donation { background: #0f0a1a; }
.panel--donation .panel-bg { background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(30,10,50,.5)); }

.panel-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 12px;
    text-align: center;
}

.panel-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.6));
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.panel:hover .panel-icon { transform: scale(1.18); }

.panel-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(.9rem, 1.4vw, 1.35rem);
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.8);
    letter-spacing: .03em;
}

.panel-sub {
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-dim);
    transition: color .3s;
}
.panel:hover .panel-sub { color: var(--gold); }

/* Vertical divider glow on hover */
.panel::after {
    content: '';
    position: absolute;
    top: 10%; bottom: 10%;
    right: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity .4s;
}
.panel:last-child::after { display: none; }
.panel:hover::after { opacity: .5; }

/* Mobile: stack vertically */
@media (max-width: 640px) {
    .panels {
        flex-direction: column;
        height: auto;
    }
    .panel {
        flex: none;
        height: 120px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.04);
    }
    .panel:hover { flex: none; height: 120px; }
    .panel-content { flex-direction: row; gap: 16px; }
    .panel-title { font-size: 1rem; text-align: left; }
    .panel::after { display: none; }
}
.rule-max-weight-val {
    font-weight: 700;
    color: #f87171;
    font-family: 'Cinzel', serif;
    font-size: .9rem;
}
.rule-max-weight-val--none {
    color: var(--text-dim);
    font-family: inherit;
    font-weight: 500;
    font-size: .82rem;
}

/* Solo note */
.rule-solo-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-dim);
    padding: 6px 2px;
}

/* Passive growth row */
.rule-passive-row,
.rule-lifestyle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-top: 1px solid var(--border);
    font-size: .81rem;
}
.rule-passive-row { background: rgba(34,197,94,.05); border-top-color: rgba(34,197,94,.12); }
.rule-passive-label { color: var(--text-muted); flex: 1; font-weight: 500; }
.rule-passive-val { font-weight: 700; color: #4ade80; }
.rule-lifestyle-val { font-weight: 600; color: var(--text); }

/* Special abilities box */
.rule-special-box {
    margin: 10px 16px 4px;
    background: rgba(234,179,8,.06);
    border: 1px solid rgba(234,179,8,.2);
    border-radius: 10px;
    padding: 10px 14px;
}
.rule-special-title {
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #eab308;
    font-weight: 700;
    margin-bottom: 7px;
}
.rule-special-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.rule-special-row strong { color: var(--text); }

/* Card description */
.rule-card-desc {
    margin: 8px 16px 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: .79rem;
    color: var(--text-dim);
    line-height: 1.7;
    font-style: italic;
}

/* ── Search bar ─────────────────────────────────────────────── */
.rules-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 0 24px;
}
.rules-search-icon {
    position: absolute;
    left: 18px;
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 1;
}
.rules-search-input {
    width: 100%;
    padding: 16px 52px 16px 50px;
    background: rgba(255,255,255,.07);
    border: 2px solid rgba(255,255,255,.35);
    border-radius: 14px;
    color: #fff;
    font-size: 1.05rem;
    font-family: 'Noto Sans Georgian', sans-serif;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.rules-search-input::placeholder { color: #fff; opacity: 1; }
.rules-search-input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,.12);
}
.rules-search-clear {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    display: none;
    line-height: 1;
    transition: color .15s, background .15s;
}
.rules-search-clear:hover { color: var(--text); background: var(--border); }

/* ── No results ──────────────────────────────────────────────── */
.rules-no-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 1rem;
}
.rules-no-result span { font-size: 3rem; display: block; margin-bottom: 12px; opacity: .4; }

/* ── Pagination ──────────────────────────────────────────────── */
.rules-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 0 16px;
    flex-wrap: wrap;
}
.pag-btn {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .88rem;
    font-family: 'Noto Sans Georgian', sans-serif;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    min-width: 42px;
    text-align: center;
}
.pag-btn:hover:not(:disabled) { background: var(--gold); border-color: var(--gold); color: #000; }
.pag-btn.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 700; }
.pag-btn:disabled { opacity: .35; cursor: default; }

/* ── General rules content ───────────────────────────────────── */
.gr-hero {
    position: relative;
    text-align: center;
    padding: 48px 24px 40px;
    margin-bottom: 28px;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(200,165,74,.07), rgba(200,165,74,.02));
    border: 1px solid rgba(200,165,74,.15);
}
.gr-hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(200,165,74,.1), transparent 70%);
    pointer-events: none;
}
.gr-hero-icon { font-size: 3rem; margin-bottom: 12px; display: block; }
.gr-hero-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: .12em;
    margin: 0 0 8px;
}
.gr-hero-sub { font-size: 1rem; color: var(--text-muted); letter-spacing: .06em; margin: 0; }

.gr-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(234,179,8,.07);
    border: 1px solid rgba(234,179,8,.25);
    border-left: 4px solid #eab308;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: .92rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.gr-notice strong { color: var(--text); }
.gr-notice-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.gr-welcome {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    font-size: .93rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.gr-welcome strong { color: var(--text); }

.gr-highlight-rule {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(99,102,241,.07);
    border: 1px solid rgba(99,102,241,.25);
    border-left: 4px solid #6366f1;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 32px;
    font-size: .92rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.gr-highlight-rule strong { color: var(--text); }
.gr-highlight-rule em { color: var(--text-dim); font-size: .85rem; }
.gr-highlight-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.gr-section { margin-bottom: 32px; }
.gr-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.gr-section-header span { font-size: 1.3rem; }
.gr-section-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
    letter-spacing: .04em;
}
.gr-section-intro { color: var(--text-muted); font-size: .92rem; margin: 0 0 16px; line-height: 1.7; }

.gr-rule-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color .2s;
}
.gr-rule-card:hover { border-color: rgba(200,165,74,.3); }
.gr-rule-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(200,165,74,.12);
    border: 1px solid rgba(200,165,74,.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold);
}
.gr-rule-body { flex: 1; }
.gr-rule-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 700;
    color: var(--text);
    font-size: .93rem;
    margin-bottom: 6px;
}
.gr-rule-title em { color: var(--text-dim); font-weight: 400; font-size: .85rem; }

/* ── Rule audio (speaker) button ─────────────────────────────── */
.gr-audio-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid rgba(200,165,74,.4);
    background: rgba(200,165,74,.12);
    color: var(--gold);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.gr-audio-btn:hover {
    background: rgba(200,165,74,.24);
    border-color: var(--gold);
    transform: scale(1.1);
}
.gr-audio-btn.playing {
    background: rgba(200,165,74,.28);
    border-color: var(--gold);
    color: #fff;
    animation: grAudioPulse 1.1s ease-in-out infinite;
}
@keyframes grAudioPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(200,165,74,.45); }
    50%     { box-shadow: 0 0 0 6px rgba(200,165,74,0); }
}
.gr-audio-hint {
    font-weight: 400;
    font-size: .74rem;
    font-style: italic;
    color: var(--text-dim);
    letter-spacing: 0;
}
.gr-rule-body p { margin: 0; font-size: .88rem; color: var(--text-muted); line-height: 1.75; }
.gr-rule-body p strong { color: var(--text); }
.gr-rule-body p em { color: var(--text-dim); }
.gr-rule-badge {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    align-self: center;
}
.gr-rule-badge--warn { background: rgba(234,179,8,.12); color: #eab308; border: 1px solid rgba(234,179,8,.25); }
.gr-rule-badge--ban  { background: rgba(239,68,68,.1);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.gr-rule-badge--perma{ background: rgba(168,85,247,.1); color: #c084fc; border: 1px solid rgba(168,85,247,.25); }

.gr-steps { display: flex; flex-direction: column; gap: 12px; }
.gr-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.gr-step strong { color: var(--text); }
.gr-step em { color: var(--text-dim); }
.gr-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    margin-top: 2px;
}

.gr-sanctions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.gr-sanction {
    flex: 1;
    min-width: 130px;
    text-align: center;
    border-radius: 14px;
    padding: 20px 14px;
    border: 1px solid var(--border);
}
.gr-sanction--warn { background: rgba(234,179,8,.06); border-color: rgba(234,179,8,.2); }
.gr-sanction--ban  { background: rgba(239,68,68,.06);  border-color: rgba(239,68,68,.2); }
.gr-sanction-icon  { font-size: 1.5rem; margin-bottom: 8px; }
.gr-sanction-label { font-weight: 700; color: var(--text); font-size: .92rem; margin-bottom: 4px; }
.gr-sanction-desc  { font-size: .78rem; color: var(--text-dim); }
.gr-sanction-arrow { font-size: 1.5rem; color: var(--text-dim); flex-shrink: 0; }

@media (max-width: 600px) {
    .gr-hero-title { font-size: 1.4rem; }
    .gr-sanctions { flex-direction: column; }
    .gr-sanction-arrow { transform: rotate(90deg); }
    .gr-rule-card { flex-wrap: wrap; }
    .gr-rule-badge { align-self: flex-start; margin-left: 50px; }
}

/* ── General rules coming soon ───────────────────────────────── */
.general-rules-coming {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 360px;
    text-align: center;
    position: relative;
}
.grc-icon { font-size: 4rem; opacity: .35; }
.grc-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    opacity: .7;
}
.grc-sub { font-size: .95rem; color: var(--text-dim); letter-spacing: .08em; }
.grc-decoration {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 60% at 50% 50%, rgba(200,165,74,.04), transparent 70%);
    pointer-events: none;
}

/* ── Gameplay rules ─────────────────────────────────────────── */
.gp-tiers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.gp-tier {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1.5px solid rgba(var(--tc-rgb, 255,255,255), .2);
    border-color: color-mix(in srgb, var(--tc) 25%, transparent);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 6%, transparent), transparent);
}
.gp-tier-dot  { font-size: 1.4rem; }
.gp-tier-name { font-family: 'Cinzel', serif; font-size: .82rem; font-weight: 700; color: var(--text); }
.gp-tier-geo  { font-size: .75rem; color: var(--text-muted); }

.gp-tier-info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gp-tier-info-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.gp-tier-info-row span:first-child { flex-shrink: 0; margin-top: 2px; }
.gp-tier-info-row strong { color: var(--text); }

.gp-phases {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.gp-phase {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
}
.gp-phase--final { border-color: rgba(200,165,74,.35); background: rgba(200,165,74,.05); }
.gp-phase-icon   { font-size: 1.5rem; }
.gp-phase-eng    { font-family: 'Cinzel', serif; font-size: .72rem; font-weight: 700; color: var(--text); }
.gp-phase-geo    { font-size: .7rem; color: var(--text-muted); }
.gp-phase-arrow  { font-size: 1.1rem; color: var(--text-dim); flex-shrink: 0; }

.gp-map-wrap {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    line-height: 0;
}
.gp-map-img {
    width: 100%;
    height: auto;
    display: block;
}

.gp-exception {
    display: inline-block;
    margin-top: 8px;
    background: rgba(74,222,128,.08);
    border: 1px solid rgba(74,222,128,.2);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: .82rem;
    color: #4ade80;
}

.gp-list {
    margin: 8px 0 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.gp-list li { font-size: .88rem; color: var(--text-muted); line-height: 1.65; }
.gp-list li strong { color: var(--text); }

.gp-closing {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, rgba(200,165,74,.06), rgba(200,165,74,.02));
    border: 1px solid rgba(200,165,74,.15);
    border-radius: 18px;
    margin-top: 8px;
}
.gp-closing-icon { font-size: 2.2rem; display: block; margin-bottom: 12px; }
.gp-closing p    { margin: 0; font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
.gp-closing strong { color: var(--gold); }

@media (max-width: 600px) {
    .gp-tiers { gap: 6px; }
    .gp-tier  { min-width: 80px; padding: 10px 6px; }
    .gp-phases { gap: 4px; }
    .gp-phase  { min-width: 60px; padding: 8px 4px; }
    .gp-phase-arrow { font-size: .9rem; }
}

/* ── Rules responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .rules-chooser { gap: 14px; padding: 24px 0 32px; flex-direction: column; align-items: stretch; }
    .rules-choose-card { min-width: 0; padding: 16px 20px; }
    .group-rules-grid { grid-template-columns: 1fr; }
    .rcc-arrow { display: none; }

    /* Rule card stat boxes: allow wrap on narrow screens */
    .rule-stats-row { flex-wrap: wrap; }
    .rule-stat-box { min-width: 0; }

    /* Max-CW row: allow label to shrink */
    .rule-max-weight-row { flex-wrap: wrap; gap: 6px; }
    .rule-max-weight-label { min-width: 0; }

    /* Mixed chips: ensure they wrap */
    .rule-mixed-chips { flex-wrap: wrap; }
    .rule-mixed-chip { font-size: .72rem; padding: 3px 9px; }

    /* lifestyle row: allow wrapping */
    .rule-passive-row,
    .rule-lifestyle-row { flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .category-cards { grid-template-columns: 1fr; }
    .modal-box { border-radius: var(--radius); }
    .tier-filter { gap: 6px; padding: 20px 0; }
    .tier-btn { padding: 7px 14px; font-size: .78rem; }
    .dino-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dino-card-image { height: 130px; }
    .dino-card-body { padding: 12px 14px; }
    .dino-name { font-size: .95rem; }
    .landing-stats { flex-direction: column; border-radius: var(--radius); width: 100%; }
    .landing-stat-divider { width: 100%; height: 1px; }
    .landing-stat { justify-content: center; }
    .landing-inner { gap: 20px; padding-top: 16px; }
    .tl-chips { gap: 6px; }
    .tl-chip { padding: 6px 10px; }
    .tl-chip-eng { font-size: .8rem; }
    .rules-legend { flex-direction: column; gap: 10px; }
    .modal-dino-name { font-size: 1.2rem; }
    .modal-hero { height: 120px; }

    /* Rules page small screen */
    .rules-choose-card { padding: 14px 16px; gap: 12px; }
    .rcc-icon { font-size: 1.8rem; }
    .rcc-title { font-size: .9rem; }
    .rule-card-body { padding: 14px 14px 70px 14px; }
    .rule-stat-box { padding: 8px 10px; }
    .rule-stat-value { font-size: .95rem; }
    .rule-max-weight-row { margin: 0 12px 12px 12px; font-size: .78rem; }
    .rule-special-box { margin: 8px 12px 4px; }
    .rule-card-desc { margin: 6px 12px 12px; }
}

@media (max-width: 360px) {
    .dino-grid { grid-template-columns: 1fr; }
    .tl-row-label { flex-wrap: wrap; }
    .rule-stats-row { flex-direction: column; }
    .rule-mixed-chip { font-size: .68rem; padding: 2px 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════ */
/* ── Roar buttons ────────────────────────────────────────────── */
#roarBtnTrex, #roarBtnDiplo {
    position: fixed;
    bottom: calc(12% + 160px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(9,7,4,.85);
    backdrop-filter: blur(12px);
    font-size: 2rem;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    user-select: none;
}

/* T-Rex — right side, red */
#roarBtnTrex {
    right: 24px;
    border: 1.5px solid rgba(239,68,68,.4);
}
#roarBtnTrex:hover {
    border-color: rgba(239,68,68,.9);
    background: rgba(239,68,68,.12);
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(239,68,68,.35);
}
#roarBtnTrex.roar-active {
    transform: scale(0.88);
    border-color: #ef4444;
    box-shadow: 0 0 44px rgba(239,68,68,.6);
}

/* Diplodocus — left side, green */
#roarBtnDiplo {
    left: 24px;
    border: 1.5px solid rgba(34,197,94,.4);
}
#roarBtnDiplo:hover {
    border-color: rgba(34,197,94,.9);
    background: rgba(34,197,94,.1);
    transform: scale(1.12);
    box-shadow: 0 6px 28px rgba(34,197,94,.3);
}
#roarBtnDiplo.roar-active {
    transform: scale(0.88);
    border-color: #22c55e;
    box-shadow: 0 0 44px rgba(34,197,94,.5);
}

/* Shake driven entirely by JS via CSS variables */
main { transform: translate(var(--content-shake-x, 0px), var(--content-shake-y, 0px)); }

/* Button pulse glow while roar is active */
@keyframes trexPulse {
    0%,100% { box-shadow: 0 0 20px rgba(239,68,68,.4); }
    50%     { box-shadow: 0 0 50px rgba(239,68,68,.8), 0 0 80px rgba(239,68,68,.3); }
}
@keyframes diploPulse {
    0%,100% { box-shadow: 0 0 20px rgba(34,197,94,.4); }
    50%     { box-shadow: 0 0 50px rgba(34,197,94,.7), 0 0 80px rgba(34,197,94,.25); }
}
#roarBtnTrex.roar-active  { animation: trexPulse  .8s ease infinite; }
#roarBtnDiplo.roar-active { animation: diploPulse 1s   ease infinite; }

/* Flash overlay */
@keyframes roarFlash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* Discord invite button */
#discordBtn {
    position: fixed;
    bottom: calc(12% + 80px);
    right: 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1.5px solid rgba(88,101,242,.45);
    background: rgba(88,101,242,.1);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s, color .2s;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    text-decoration: none;
}
#discordBtn:hover {
    border-color: #5865f2;
    background: rgba(88,101,242,.22);
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(88,101,242,.45);
}

.theme-toggle {
    position: fixed;
    bottom: 12%;
    right: 24px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1.5px solid rgba(200,165,74,.35);
    background: rgba(9,7,4,.85);
    backdrop-filter: blur(12px);
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.theme-toggle:hover {
    border-color: var(--gold);
    background: rgba(200,165,74,.12);
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,.5);
}

/* ── Fixed floating buttons — mobile sizing ──────────────────── */
@media (max-width: 640px) {
    /* Shrink roar + discord + theme-toggle on phones */
    #roarBtnTrex, #roarBtnDiplo, #discordBtn, .theme-toggle {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
    #roarBtnTrex, #discordBtn, .theme-toggle { right: 14px; }
    #roarBtnDiplo { left: 14px; }

    /* Restack vertical positions so they don't overlap */
    .theme-toggle      { bottom: 16px; }
    #discordBtn        { bottom: calc(16px + 52px + 10px); }
    #roarBtnTrex       { bottom: calc(16px + (52px + 10px) * 2); }
    #roarBtnDiplo      { bottom: calc(16px + (52px + 10px) * 2); }
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES  ( html[data-theme="light"] )
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg:          #f4f0ea;
    --bg-deep:     #ede8e0;
    --surface:     #ffffff;
    --surface-2:   #faf8f4;
    --surface-3:   #f0ece4;
    --border:      #ddd6c8;
    --border-light:#c8bfb0;
    --gold:        #9a6f20;
    --gold-light:  #b8860b;
    --gold-dark:   #7a5518;
    --text:        #1c1610;
    --text-muted:  #5c4e3a;
    --text-dim:    #9a8a74;
    --shadow:      0 4px 24px rgba(0,0,0,.10);
}

/* Background atmosphere — light */
[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 80vw 70vh at 10% 15%,  rgba(160,115,30,.13)  0%, transparent 65%),
        radial-gradient(ellipse 70vw 75vh at 90% 85%,  rgba(160,115,30,.11)  0%, transparent 65%),
        radial-gradient(ellipse 55vw 50vh at 75% 20%,  rgba(200,70,70,.07)   0%, transparent 60%),
        radial-gradient(ellipse 50vw 50vh at 20% 80%,  rgba(40,150,90,.06)   0%, transparent 60%),
        radial-gradient(ellipse 40vw 40vh at 50% 50%,  rgba(160,115,30,.07)  0%, transparent 60%);
}
[data-theme="light"] body::after {
    background-image: radial-gradient(circle, rgba(140,100,30,.14) 1.5px, transparent 1.5px);
}

/* Topbar — light */
[data-theme="light"] .page-topbar {
    background: rgba(252,249,244,.96);
    border-bottom-color: rgba(160,115,30,.15);
    box-shadow: 0 2px 20px rgba(0,0,0,.07);
}
[data-theme="light"] .theme-toggle {
    border-color: rgba(154,111,32,.3);
    background: rgba(252,249,244,.9);
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
[data-theme="light"] .theme-toggle:hover {
    background: rgba(255,255,255,.95);
    box-shadow: 0 6px 28px rgba(0,0,0,.16);
}
[data-theme="light"] .topbar-switch {
    border-color: var(--border);
}

/* Site header (legacy) — light */
[data-theme="light"] .site-header {
    background: rgba(252,249,244,.95);
}
[data-theme="light"] .site-header.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
[data-theme="light"] .site-nav {
    background: rgba(252,249,244,.98);
}

/* Modal — light */
[data-theme="light"] .modal-box {
    box-shadow: 0 24px 80px rgba(0,0,0,.18);
}
[data-theme="light"] .modal-close {
    background: rgba(255,255,255,.9);
    border-color: rgba(0,0,0,.12);
    color: #444;
}
[data-theme="light"] .modal-close:hover {
    background: #fff;
    color: #111;
}

/* Terrain rows — light */
[data-theme="light"] .terrain-row {
    background: var(--surface-3);
}

/* Special tags — light */
[data-theme="light"] .special-tag {
    background: rgba(154,111,32,.1);
    border-color: rgba(154,111,32,.3);
    color: var(--gold);
}

/* Rules page — light */
[data-theme="light"] .rule-group-box {
    background: var(--surface-3);
}
[data-theme="light"] .rule-adults-badge {
    background: var(--surface);
}
[data-theme="light"] .rules-choose-card:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,.10);
}
[data-theme="light"] .rules-choose-card--group:hover,
[data-theme="light"] .rules-choose-card--group.active {
    border-color: rgba(239,68,68,.45);
    box-shadow: 0 10px 32px rgba(239,68,68,.12);
}
[data-theme="light"] .rules-choose-card--general:hover,
[data-theme="light"] .rules-choose-card--general.active {
    border-color: rgba(154,111,32,.5);
    box-shadow: 0 10px 32px rgba(154,111,32,.14);
}
[data-theme="light"] .rules-choose-card.active {
    background: var(--surface-2);
}
[data-theme="light"] .rule-mixed-chip {
    background: rgba(154,111,32,.1);
    border-color: rgba(154,111,32,.3);
    color: var(--gold);
}
[data-theme="light"] .rule-mixed-chip:hover {
    background: rgba(154,111,32,.18);
}

/* Tier buttons — light */
[data-theme="light"] .tier-btn {
    background: rgba(255,255,255,.75);
    border-color: var(--border);
}

/* Card shadows — light */
[data-theme="light"] .dino-card:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
[data-theme="light"] .tier-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
[data-theme="light"] .rule-card:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,.12);
}

/* Speed tags — light */
[data-theme="light"] .speed-ground { background: rgba(22,163,74,.10);  color: #15803d; border-color: rgba(22,163,74,.3); }
[data-theme="light"] .speed-water  { background: rgba(37,99,235,.10);  color: #1d4ed8; border-color: rgba(37,99,235,.3); }
[data-theme="light"] .speed-air    { background: rgba(126,34,206,.10); color: #7e22ce; border-color: rgba(126,34,206,.3); }

/* ── Account widget (login/register/profile pill) — used on every page ── */
#account-widget {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 26px;
    border-radius: 14px;
    border: 1px solid rgba(200,165,74,.3);
    background: linear-gradient(155deg, rgba(24,19,11,.78), rgba(7,5,4,.86));
    backdrop-filter: blur(18px) saturate(1.35);
    -webkit-backdrop-filter: blur(18px) saturate(1.35);
    box-shadow: 0 10px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}
#account-widget a {
    color: #f4ead0;
    text-decoration: none;
    font-size: .95rem;
    font-weight: 600;
    padding: 4px 10px;
}
#account-widget a:hover { color: #c8a54a; }
#account-widget a#acctRegisterLink {
    color: #1a1408;
    background: linear-gradient(135deg, #c8a54a, #8a6d24);
    border-radius: 8px;
}
#account-widget a#acctRegisterLink:hover { color: #1a1408; filter: brightness(1.1); }
@media (max-width: 780px) {
    #account-widget { top: 8px; padding: 8px 16px; }
    #account-widget a { font-size: .82rem; padding: 4px 8px; }
}

/* Inline variant used inside .topbar-right on inner pages */
.topbar-account {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.topbar-account a {
    color: inherit;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}
.topbar-account a:hover { color: #c8a54a; }
#acctProfileLink {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 600px) {
    .topbar-right { gap: 10px; }
    .topbar-account { gap: 2px; }
    .topbar-account a { font-size: .74rem; padding: 5px 8px; }
    #acctProfileLink { max-width: 70px; }
}
@media (max-width: 420px) {
    .topbar-page { display: none; }
    .topbar-account a { font-size: .68rem; padding: 4px 7px; }
    #acctProfileLink { max-width: 56px; }
}
.topbar-account a#acctRegisterLink {
    color: #1a1408;
    background: linear-gradient(135deg, #c8a54a, #8a6d24);
}
.topbar-account a#acctRegisterLink:hover { color: #1a1408; filter: brightness(1.1); }
