﻿:root {
    --soil-900: #140f0d;
    --soil-850: #1b1410;
    --soil-800: #241913;
    --soil-700: #3f281d;
    --soil-500: #8b593a;
    --mint: #7cf0c6;
    --gold: #ffd56a;
    --coral: #ff9369;
    --sky: #77c7ff;
    --text-main: #fff5ea;
    --text-muted: #ceb9a8;
    --line: rgba(255, 238, 223, 0.09);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    overflow-x: hidden;
    font-family: "Space Grotesk", "Outfit", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 147, 105, 0.16), transparent 30%),
        radial-gradient(circle at 82% 12%, rgba(124, 240, 198, 0.12), transparent 24%),
        linear-gradient(180deg, #120d0b 0%, #0b0908 100%);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.18;
    pointer-events: none;
}
button { font: inherit; }
a { color: inherit; text-decoration: none; }
.earthbite-shell {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 32px), 1480px);
    margin: 0 auto;
    padding: 22px 0 40px;
}
.topbar, .hero-stats, .hero-actions, .control-row, .overlay-actions, .topbar-badges, .legend, .hud, .hud-group {
    display: flex;
    gap: 14px;
}
.topbar {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.back-link, .mini-pill, .ghost-btn, .primary-btn {
    border-radius: 999px;
    min-height: 46px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.back-link, .mini-pill, .ghost-btn {
    background: rgba(255,255,255,0.03);
    color: var(--text-main);
}
.primary-btn {
    border: 0;
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #271710;
    font-weight: 700;
}
.back-link:hover, .ghost-btn:hover, .primary-btn:hover { transform: translateY(-2px); }
.panel,
.insight-popover {
    background: linear-gradient(180deg, rgba(35, 24, 18, 0.92), rgba(19, 14, 11, 0.95));
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: var(--shadow);
}
.layout {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.hero-panel, .game-panel { padding: 22px; }
.hero-panel {
    display: grid;
    gap: 24px;
    position: sticky;
    top: 20px;
    z-index: 3;
}
.eyebrow, .overlay-eyebrow {
    margin: 0 0 8px;
    color: var(--mint);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.hero-panel h1 {
    margin: 0;
    font-family: "Outfit", sans-serif;
    font-size: clamp(2.6rem, 5vw, 4.7rem);
    word-break: break-word;
    line-height: 0.9;
}
.hero-text, .feature-list li, .control-desc, .overlay-card p, .log-item {
    color: var(--text-muted);
    line-height: 1.7;
}
.hero-actions { flex-wrap: wrap; }
.hero-stats {
    display: grid;
    grid-template-columns: 1fr;
}
.stat-card, .hud-item, .control-key, .log-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 22px;
}
.stat-card { padding: 16px; }
.stat-card span, .hud-item span { color: var(--text-muted); font-size: .82rem; }
.stat-card strong, .hud-item strong { display: block; margin-top: 8px; font-size: 1.45rem; }
.game-panel {
    padding: 18px;
    min-height: 100%;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.hud {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.hud-group {
    min-width: 0;
    flex-wrap: wrap;
}
.hud-group.right { justify-content: flex-end; }
.hud-item { padding: 12px 16px; min-width: 110px; }
.hud-item.compact { min-width: 130px; }
.canvas-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(18, 28, 22, 0.66), rgba(31, 17, 12, 0.96));
}
canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3 / 2;
}
.overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(5, 4, 3, 0.58);
    backdrop-filter: blur(10px);
}
.overlay.active { display: flex; }
.overlay-card {
    width: min(100%, 560px);
    padding: 30px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(46, 29, 21, 0.94), rgba(22, 16, 13, 0.98));
    box-shadow: 0 20px 50px rgba(0,0,0,.38);
}
.overlay-card h2 { margin: 0 0 10px; font-size: 2.1rem; font-family: "Outfit", sans-serif; }
.small-card { width: min(100%, 420px); text-align: center; }
.control-row {
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}
.legend { flex-wrap: wrap; color: var(--text-muted); font-size: .92rem; }
.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot.berry { background: var(--coral); }
.dot.gold { background: var(--gold); }
.dot.chill { background: var(--sky); }
.dot.rock { background: #87624a; }
.insight-popover {
    display: none;
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 40;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 24px;
}
.insight-popover.active { display: grid; gap: 22px; }
.popover-close-btn {
    align-self: flex-end;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    cursor: pointer;
}
.popover-close-btn:hover {
    background: rgba(255,255,255,0.12);
}
.insight-popover h2 { margin: 0 0 10px; font-family: "Outfit", sans-serif; font-size: 1.45rem; }
.feature-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.control-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
}
.control-key {
    min-width: 90px;
    padding: 10px 12px;
    text-align: center;
    font-weight: 700;
    color: var(--gold);
}
.feed-log {
    display: grid;
    gap: 10px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}
.log-item { padding: 12px 14px; }
.feed-log::-webkit-scrollbar,
.insight-popover::-webkit-scrollbar { width: 8px; }
.feed-log::-webkit-scrollbar-thumb,
.insight-popover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
@media (max-width: 1360px) {
    .layout { grid-template-columns: 1fr; }
    .hero-panel { position: static; }
    .insight-popover {
        position: fixed;
        right: 16px;
        left: 16px;
        width: auto;
    }
}
@media (max-width: 760px) {
    .earthbite-shell { width: min(calc(100% - 20px), 1480px); }
    .topbar, .hero-actions, .hero-stats, .hud, .hud-group, .control-row { flex-direction: column; align-items: stretch; }
    .hero-stats { display: grid; grid-template-columns: 1fr; }
    .hud-group.right { justify-content: stretch; }
    .overlay-card { padding: 22px; }
    .insight-popover {
        top: 74px;
        right: 12px;
        left: 12px;
        max-height: calc(100vh - 92px);
    }
}


