/* Main/style.css */
/* Minecraft inspired dark grass and wood theme */

:root {
    --bg-main: #050807;
    --bg-panel: #101711;
    --bg-panel-alt: #151e15;
    --bg-highlight: #1b2a1b;
    --bg-accent: #4caf50;
    --bg-accent-soft: rgba(76, 175, 80, 0.18);

    --border-soft: #263526;
    --text-main: #f4f8f4;
    --text-soft: #c6d6c6;
    --text-muted: #8c998c;

    --good: #7ad65f;
    --warn: #f7d45b;
    --danger: #ff5869;
    --xp: #9e7bff;
    --star: #ffe37a;
    --money: #9be37d;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 7px;

    --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.75);
    --shadow-chip: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Themes for future toggles */
body.theme-overworld {
    --bg-main: #050807;
}
body.theme-nether {
    --bg-main: #140707;
    --bg-panel: #1b1010;
    --bg-panel-alt: #231010;
    --bg-highlight: #311414;
    --bg-accent: #ff7043;
}
body.theme-ender {
    --bg-main: #06040c;
    --bg-panel: #110b1d;
    --bg-panel-alt: #150f23;
    --bg-highlight: #201334;
    --bg-accent: #ba68c8;
}

/* Global reset-ish */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to bottom, #101e10 0, #050807 40%, #020303 100%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow: hidden;
}

/* Scrollable game area inside fixed viewport */
#gameContainer {
    position: absolute;
    inset: 0;
    padding: 14px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.game-shell {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loading screen */
#loadingScreen {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top, #1e3021 0, #050807 55%, #020303 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#loadingContent {
    background: rgba(7, 11, 7, 0.92);
    border-radius: 22px;
    border: 1px solid #324932;
    padding: 26px 34px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    min-width: 280px;
    max-width: 440px;
}

#logoRow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}

/* Static logo square */
#staticLogo {
    height: 72px;
    width: 72px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 18px;
    background: radial-gradient(circle, #1b261b 0, #050807 65%);
    padding: 8px;
    box-shadow: var(--shadow-chip);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

/* GenBurst logo more banner-like but still uses a fixed aspect ratio */
#genburstLogo {
    height: 72px;
    width: 160px;
    object-fit: contain;
    border-radius: 16px;
    background: radial-gradient(circle, #1b261b 0, #050807 65%);
    padding: 6px 10px;
    box-shadow: var(--shadow-chip);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#staticLogo:hover,
#genburstLogo:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.1);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
}

#loadingText {
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}

#loadingDots {
    font-family: "Courier New", monospace;
    font-size: 22px;
    letter-spacing: 0.25em;
    color: var(--bg-accent);
    animation: dotsPulse 1.2s infinite;
}

@keyframes dotsPulse {
    0% { opacity: 0.2; transform: translateY(0); }
    33% { opacity: 0.7; transform: translateY(-2px); }
    66% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0.2; transform: translateY(2px); }
}

/* Fade in for main container */
.show-game {
    animation: fadeInGame 0.5s ease-out forwards;
}

@keyframes fadeInGame {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Top bar */
.top-bar {
    flex: 0 0 auto;
    background: linear-gradient(90deg, rgba(9, 15, 9, 0.98), rgba(15, 24, 15, 0.98));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-title {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 14px;
    color: var(--text-soft);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: rgba(18, 25, 18, 0.96);
    border-radius: 999px;
    border: 1px solid rgba(134, 167, 134, 0.7);
    font-size: 12px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    box-shadow: var(--shadow-chip);
}

.chip-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
    color: var(--text-muted);
}

.chip-value {
    font-weight: 600;
}

/* Money and stars display colors */
.chip-money .chip-value { color: var(--money); }
.chip-stars .chip-value { color: var(--star); }
.chip-xp .chip-value { color: var(--xp); }
.chip-prestige .chip-value { color: var(--good); }

/* Right side top bar */
.top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.small-button {
    border-radius: 999px;
    border: 1px solid rgba(133, 175, 133, 0.85);
    background: radial-gradient(circle at top left, rgba(71, 112, 71, 0.7), rgba(13, 18, 13, 0.98));
    color: var(--text-main);
    font-size: 12px;
    padding: 6px 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-chip);
    transition: background 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
}

.small-button:hover {
    transform: translateY(-1px);
    background: radial-gradient(circle at top left, rgba(106, 161, 106, 0.9), rgba(13, 18, 13, 0.98));
}

/* Autosave indicator */
#autosaveIndicator {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main content area */
.main-content {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 240px minmax(0, 1.9fr) minmax(0, 1.3fr);
    gap: 12px;
}

/* Side tabs */
.side-tabs {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 12px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tab-header {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.tab-button {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(92, 126, 92, 0.9);
    background: linear-gradient(135deg, rgba(26, 37, 26, 0.96), rgba(12, 18, 12, 0.98));
    color: var(--text-soft);
    font-size: 13px;
    padding: 8px 12px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-chip);
    transition: background 0.15s ease, transform 0.09s ease, border-color 0.15s ease;
}

.tab-button span {
    pointer-events: none;
}

.tab-button.active {
    border-color: var(--bg-accent);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.85), rgba(18, 26, 18, 0.98));
    color: var(--text-main);
    transform: translateY(-1px);
}

.tab-button.locked {
    opacity: 0.45;
    cursor: default;
}

/* Center panel */
.center-panel {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.panel-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    border-radius: 999px;
    border: 1px solid rgba(112, 146, 112, 0.9);
    padding: 3px 9px;
    font-size: 11px;
    color: var(--text-soft);
    background: rgba(18, 24, 18, 0.96);
}

/* Panel body scroll */
.panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbars */
.panel-body::-webkit-scrollbar,
.side-tabs::-webkit-scrollbar {
    width: 7px;
}
.panel-body::-webkit-scrollbar-track,
.side-tabs::-webkit-scrollbar-track {
    background: transparent;
}
.panel-body::-webkit-scrollbar-thumb,
.side-tabs::-webkit-scrollbar-thumb {
    background: rgba(118, 143, 118, 0.7);
    border-radius: 8px;
}

/* Right column panels */
.right-panels {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Card style */
.card {
    background: var(--bg-panel-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    padding: 9px 11px 10px;
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 5px;
}

.card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
}

.card-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    border-radius: 10px;
    border: 1px solid rgba(121, 161, 121, 0.9);
    background: linear-gradient(135deg, rgba(32, 51, 32, 0.96), rgba(14, 20, 14, 0.98));
    color: var(--text-main);
    font-size: 13px;
    padding: 7px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-chip);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.16s ease;
}

.btn-primary {
    border-color: var(--bg-accent);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.88), rgba(18, 26, 18, 0.98));
}

.btn-danger {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(245, 80, 105, 0.88), rgba(32, 11, 16, 0.98));
}

.btn:disabled {
    opacity: 0.48;
    cursor: default;
    transform: none;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75);
}

/* Gen grid */
.gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.gen-tile {
    position: relative;
    border-radius: 16px;
    padding: 10px 10px 8px;
    border: 1px solid rgba(132, 168, 132, 0.9);
    background: radial-gradient(circle at top, rgba(26, 44, 26, 0.95), rgba(11, 16, 11, 0.98));
    box-shadow: var(--shadow-chip);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s;
    font-size: 13px;
}

.gen-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(169, 217, 169, 0.95);
    background: radial-gradient(circle at top, rgba(41, 80, 41, 0.95), rgba(11, 16, 11, 0.98));
}

.gen-tier {
    font-size: 26px;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.gen-amount {
    position: absolute;
    right: 7px;
    bottom: 5px;
    font-size: 13px;
    background: rgba(3, 2, 10, 0.8);
    border-radius: 999px;
    padding: 3px 8px;
    border: 1px solid rgba(180, 200, 180, 0.95);
}

/* Tier colors */
.gen-tier-1 { color: #cce9ff; }
.gen-tier-5 { color: #d6ffc9; }
.gen-tier-10 { color: #ffeb99; }
.gen-tier-15 { color: #ffc9cc; }
.gen-tier-20 { color: #e0c2ff; }
.gen-tier-25 { color: #ffd0ff; }
.gen-tier-30 { color: #ffffff; }

/* Gen detail panel */
.gen-detail {
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(10, 16, 10, 0.96);
    border: 1px solid rgba(88, 112, 88, 0.9);
    font-size: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 4px 10px;
}

/* Farming tiles */
.crop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.crop-card {
    border-radius: 16px;
    background: radial-gradient(circle at top, rgba(25, 51, 25, 0.97), rgba(9, 14, 9, 0.98));
    border: 1px solid rgba(122, 167, 122, 0.9);
    padding: 10px;
    box-shadow: var(--shadow-chip);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.crop-name {
    font-size: 13px;
    font-weight: 700;
    color: #eaffdf;
}

.crop-tier {
    font-size: 12px;
    color: #c2ffb3;
}

.crop-yields {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    color: var(--text-soft);
}

.crop-actions {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

/* Mining tiles */
.ore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.ore-card {
    border-radius: 16px;
    background: radial-gradient(circle at top, rgba(45, 32, 32, 0.97), rgba(9, 7, 9, 0.98));
    border: 1px solid rgba(153, 101, 101, 0.9);
    padding: 10px;
    box-shadow: var(--shadow-chip);
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ore-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.ore-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffe8e8;
}

.ore-yields {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    color: var(--text-soft);
}

.ore-actions {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.ore-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 11px;
    border: 1px solid rgba(200, 180, 180, 0.7);
}

/* Progress bars */
.progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(10, 14, 10, 0.98);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(114, 136, 114, 0.9);
}

.progress-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, #7ad65f, #ffe37a);
    border-radius: inherit;
    transition: width 0.2s ease-out;
}

.progress-label {
    font-size: 11px;
    margin-top: 2px;
    color: var(--text-muted);
}

/* XP bar */
.xp-bar {
    background: rgba(15, 8, 30, 0.98);
    border-color: rgba(159, 129, 255, 0.9);
}
.xp-bar .progress-fill {
    background: linear-gradient(90deg, #9e7bff, #ffe37a);
}

/* Stats list */
.stat-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--text-soft);
}
.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 500; }

/* Tutorial banner */
.tutorial-banner {
    border-radius: 13px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 12px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.16), rgba(12, 19, 12, 0.98));
    border: 1px solid rgba(120, 188, 120, 0.95);
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.tutorial-highlight {
    animation: tutorialPulse 1.2s ease-in-out infinite;
}

@keyframes tutorialPulse {
    0% { box-shadow: 0 0 0 rgba(122, 188, 122, 0.0); }
    50% { box-shadow: 0 0 16px rgba(122, 188, 122, 0.9); }
    100% { box-shadow: 0 0 0 rgba(122, 188, 122, 0.0); }
}

/* Static favicon flyer */
.static-flyer {
    position: fixed;
    width: 38px;
    height: 38px;
    pointer-events: none;
    z-index: 9000;
    animation: staticFly 4s linear forwards;
    filter: drop-shadow(0 0 16px rgba(156, 220, 130, 0.9));
}

@keyframes staticFly {
    0%   { transform: translate(-10vw, 40vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    50%  { transform: translate(30vw, 5vh) rotate(18deg); opacity: 1; }
    100% { transform: translate(110vw, -10vh) rotate(38deg); opacity: 0; }
}

/* Responsive tweaks */
@media (max-width: 1080px) {
    .main-content {
        grid-template-columns: 220px minmax(0, 1.7fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }
    .right-panels {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .right-panels .card {
        flex: 1 1 230px;
    }
}

@media (max-width: 800px) {
    #gameContainer {
        padding: 8px;
    }
    .game-shell {
        max-width: 100%;
    }
    .main-content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
    }
    .side-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .tab-button {
        flex: 0 0 auto;
        width: auto;
        white-space: nowrap;
    }
}
