/* === STACKER — Gold/Black/Cream palette, lo-fi aesthetic === */

:root {
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --gold-light: #FFF8DC;
    --gold-dim: #a08520;
    --black: #0d0d0d;
    --panel-bg: #141414;
    --panel-border: #2a2a2a;
    --cream: #FAEBD7;
    --text: #e0d6b4;
    --text-dim: #9a9080;
    --text-bright: #fff;
    --danger: #ff4444;
    --danger-glow: rgba(255, 68, 68, 0.4);
    --success: #4CAF50;
    --info: #2196F3;
    --font-mono: 'Courier New', Courier, monospace;
    --font-body: 'Georgia', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    background: var(--black);
    color: var(--text);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
}

/* === INTRO MODAL === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.modal-content { text-align: center; max-width: 400px; padding: 3rem 2rem; }
.modal-text { font-family: var(--font-body); font-size: 1.2rem; color: var(--text); line-height: 1.6; margin-bottom: 0.5rem; }
.modal-text.dim { color: var(--text-dim); font-size: 1rem; font-style: italic; margin-bottom: 2rem; }
.modal-btn {
    background: linear-gradient(145deg, var(--gold-dark), var(--gold));
    color: var(--black); border: 2px solid var(--gold);
    padding: 0.8em 2em; font-family: var(--font-mono); font-size: 1rem;
    font-weight: bold; cursor: pointer; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.1em; transition: all 0.15s;
}
.modal-btn:hover { background: linear-gradient(145deg, var(--gold), #ffe44d); box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }

/* === DASHBOARD (fixed top bar) === */
.dashboard {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--black); border-bottom: 1px solid var(--panel-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.3rem 1rem; gap: 0.5rem; height: 42px;
}
.dashboard-left { flex-shrink: 0; display: flex; align-items: center; gap: 0.7rem; }
.dashboard-title {
    font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold);
    letter-spacing: 0.15em; text-transform: uppercase; cursor: default; user-select: none;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}
.goal-display { display: inline-flex; gap: 0.4rem; align-items: center; }
.goal-text {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--gold);
    background: rgba(255, 215, 0, 0.08); border: 1px solid var(--gold-dark);
    padding: 0.15em 0.5em; border-radius: 2px; white-space: nowrap;
}
.goal-cred { color: #4CAF50; border-color: #4CAF50; background: rgba(76, 175, 80, 0.08); }
.dashboard-center { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.dash-item { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 55px; }
.dash-label { font-family: var(--font-mono); font-size: 0.5rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }
.dash-value { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); font-weight: bold; }
.dash-value.gold { color: var(--gold); }
.dash-value.usd { color: var(--success); }
.dash-value.paper { color: #aaa; }
.dash-value.dim { color: var(--text-dim); font-weight: normal; font-size: 0.7rem; }
.dashboard-right { flex-shrink: 0; min-width: 40px; text-align: right; }
.attribution { display: flex; flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.2; }
.attribution a { font-family: var(--font-mono); font-size: 0.5rem; color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.attribution a:hover { color: var(--gold); text-decoration: underline; }
.gold-rate { font-family: var(--font-mono); font-size: 0.6rem; color: var(--gold-dim); }

/* === THREE-COLUMN LAYOUT === */
.game-columns {
    display: grid; grid-template-columns: 240px 1fr 260px;
    gap: 0.5rem; padding: 0.5rem;
    height: calc(100vh - 42px); margin-top: 42px;
}
.col { overflow-y: auto; overflow-x: hidden; padding: 0.3rem; }
.col-center { display: flex; flex-direction: column; }
.col::-webkit-scrollbar { width: 4px; }
.col::-webkit-scrollbar-track { background: transparent; }
.col::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 2px; }

/* === PHASE INDICATOR === */
.phase-indicator { text-align: center; padding: 0.4rem 0; margin-bottom: 0.3rem; }
.phase-name { font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; }
.phase-subtitle { font-size: 0.7rem; color: var(--text-dim); font-style: italic; margin-top: 0.15rem; }

/* === PANELS === */
.panel { background: var(--panel-bg); border: 1px solid var(--panel-border); padding: 0.6rem; border-radius: 2px; margin-bottom: 0.4rem; }
.panel-title {
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold-dark);
    text-transform: uppercase; letter-spacing: 0.12em;
    margin-bottom: 0.35rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--panel-border);
}
.panel-desc { font-size: 0.72rem; color: #b0a890; line-height: 1.4; }

/* === CLICK AREA === */
.pan-area { text-align: center; padding: 0.5rem 0; position: relative; min-height: 70px; }
#btn-pan {
    background: linear-gradient(145deg, var(--gold-dark), var(--gold));
    color: var(--black); border: 2px solid var(--gold);
    padding: 0.8em 2em; font-family: var(--font-mono); font-size: 1rem;
    font-weight: bold; cursor: pointer; border-radius: 3px;
    transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.1em;
}
#btn-pan:hover { background: linear-gradient(145deg, var(--gold), #ffe44d); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
#btn-pan:active, #btn-pan.clicked { transform: scale(0.96); box-shadow: 0 0 5px rgba(255, 215, 0, 0.2); }
#btn-pan.diminished { padding: 0.4em 1.2em; font-size: 0.75rem; opacity: 0.7; border-width: 1px; }
#btn-pan.diminished:hover { opacity: 1; }
.click-info { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); margin-top: 0.3rem; }
#click-feedback { position: relative; height: 20px; overflow: hidden; pointer-events: none; }
.float-number { position: absolute; color: var(--gold); font-family: var(--font-mono); font-size: 0.75rem; font-weight: bold; animation: floatUp 1s ease-out forwards; pointer-events: none; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-20px); } }

/* === SELL SECTION === */
.sell-section { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; padding: 0.3rem 0; }
.sell-btn { background: transparent; border: 1px solid var(--gold-dark); color: var(--gold-dark); padding: 0.25em 0.6em; font-family: var(--font-mono); font-size: 0.65rem; cursor: pointer; border-radius: 2px; transition: all 0.15s; }
.sell-btn:hover { background: var(--gold-dark); color: var(--black); }
.sell-btn.locked { opacity: 0.4; cursor: not-allowed; border-color: var(--panel-border); color: var(--text-dim); }
.sell-btn.locked:hover { background: transparent; color: var(--text-dim); }

/* === ORE COUNTER === */
.ore-counter { display: flex; gap: 0.5rem; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 0.75rem; }
.ore-hint { font-family: var(--font-mono); font-size: 0.6rem; color: #e8a030; text-align: center; margin-top: 0.2rem; }

/* === UPGRADE BUTTONS === */
.upgrade-btn { display: block; width: 100%; text-align: left; background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text); padding: 0.4rem 0.5rem; margin-bottom: 0.25rem; cursor: pointer; border-radius: 2px; transition: all 0.15s; font-family: var(--font-body); }
.upgrade-btn.affordable { border-color: var(--gold-dark); }
.upgrade-btn.affordable:hover { background: #1a1a10; border-color: var(--gold); box-shadow: 0 0 5px rgba(255, 215, 0, 0.1); }
.upgrade-btn.locked { opacity: 0.5; cursor: not-allowed; }
.upgrade-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.upgrade-name { font-family: var(--font-mono); font-size: 0.72rem; color: var(--gold); font-weight: bold; }
.upgrade-desc { font-size: 0.65rem; color: #b0a890; margin: 0.1rem 0; }
.upgrade-cost { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text); }

/* === BUILDING BUTTONS === */
.building-btn { display: block; width: 100%; text-align: left; background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text); padding: 0.4rem 0.5rem; margin-bottom: 0.25rem; cursor: pointer; border-radius: 2px; transition: all 0.15s; font-family: var(--font-body); }
.building-btn.affordable { border-color: var(--gold-dark); }
.building-btn.affordable:hover { background: #1a1a10; border-color: var(--gold); }
.building-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.building-header { display: flex; justify-content: space-between; align-items: center; }
.building-name { font-family: var(--font-mono); font-size: 0.72rem; color: var(--gold); font-weight: bold; }
.building-count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-bright); }
.building-desc { font-size: 0.62rem; color: #b0a890; margin: 0.05rem 0; }
.building-info { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.65rem; }
.building-cost { color: var(--text); }
.building-rate { color: var(--gold-dim); }

/* === CREDIBILITY BAR === */
.credibility-section { padding: 0.3rem 0; }
.credibility-bar { height: 8px; background: var(--panel-border); border-radius: 4px; overflow: hidden; margin: 0.2rem 0; }
.credibility-bar-fill { height: 100%; transition: width 0.3s; border-radius: 4px; }
.credibility-bar-fill.cred-green { background: linear-gradient(90deg, var(--success), #66BB6A); }
.credibility-bar-fill.cred-yellow { background: linear-gradient(90deg, #FFA000, #FFD54F); }
.credibility-bar-fill.cred-red { background: linear-gradient(90deg, var(--danger), #FF7043); }
.credibility-bar-fill.cred-default { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.credibility-label { font-family: var(--font-mono); font-size: 0.68rem; color: #b0a890; display: flex; justify-content: space-between; }

/* === NOTIFICATIONS === */
#notification-container { position: fixed; top: 46px; right: 0.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.3rem; max-width: 300px; }
.notification { background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text); padding: 0.4rem 0.6rem; font-size: 0.7rem; border-radius: 3px; opacity: 0; transform: translateX(50px); transition: all 0.3s; }
.notification.show { opacity: 1; transform: translateX(0); }
.notification-milestone { border-color: var(--gold); color: var(--gold); background: #1a1500; }
.notification-event { border-color: var(--danger); color: #ff8888; background: #1a0500; }
.notification-info { border-color: var(--info); }

/* === STATS FOOTER === */
.footer { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; margin-top: auto; border-top: 1px solid var(--panel-border); font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); }
.footer-stats { display: flex; gap: 0.6rem; }
#save-indicator { font-family: var(--font-mono); font-size: 0.55rem; color: var(--gold-dim); transition: opacity 0.3s; }
#save-indicator.flash { opacity: 1; }

/* === HIDDEN/FADE === */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === RUG PULL BUTTON === */
.rug-pull-btn { display: block; margin: 0.5rem auto; background: var(--danger); color: white; font-family: var(--font-mono); font-size: 1rem; font-weight: bold; padding: 0.8em 1.5em; border: 3px solid #ff0000; cursor: pointer; border-radius: 4px; animation: rugPulse 1.5s infinite; text-transform: uppercase; letter-spacing: 0.1em; }
.rug-pull-btn:hover { background: #ff0000; box-shadow: 0 0 40px var(--danger-glow); }
@keyframes rugPulse { 0%, 100% { box-shadow: 0 0 10px var(--danger-glow); } 50% { box-shadow: 0 0 30px var(--danger-glow), 0 0 60px rgba(255, 0, 0, 0.2); } }

/* === RESET BUTTON === */
#btn-reset { background: transparent; border: 1px solid var(--panel-border); color: var(--text-dim); padding: 0.2em 0.5em; font-family: var(--font-mono); font-size: 0.55rem; cursor: pointer; border-radius: 2px; }
#btn-reset:hover { border-color: var(--danger); color: var(--danger); }

/* === FORUM POSTS === */
.forum-post { border-bottom: 1px solid var(--panel-border); padding: 0.3rem 0; }
.forum-post:last-child { border-bottom: none; }
.forum-post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.05rem; }
.forum-username { font-family: var(--font-mono); font-size: 0.6rem; color: var(--gold-dim); }
.forum-upvotes { font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-dim); }
.forum-post-text { font-size: 0.68rem; color: var(--text); line-height: 1.3; }

/* === COIN BUTTONS === */
.coin-btn { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text); padding: 0.3rem 0.4rem; margin: 0.1rem; cursor: pointer; border-radius: 2px; font-size: 0.68rem; font-family: var(--font-mono); transition: all 0.15s; }
.coin-btn.affordable { border-color: var(--gold-dark); }
.coin-btn.affordable:hover { background: #1a1a10; border-color: var(--gold); }
.coin-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.coin-emoji { font-size: 0.9rem; }
.coin-rarity { font-size: 0.55rem; }
.coin-price { color: var(--text-dim); font-size: 0.6rem; }
.coin-show-banner { text-align: center; color: var(--gold); font-family: var(--font-mono); font-size: 0.72rem; padding: 0.3rem; margin-bottom: 0.3rem; border: 1px dashed var(--gold-dark); animation: coinShowPulse 2s infinite; }
@keyframes coinShowPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* === PAPER GOLD SECTION === */
.paper-gold-section { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }

/* === COLLECTION ITEMS === */
.collection-item { display: inline-flex; align-items: center; gap: 0.2rem; font-family: var(--font-mono); font-size: 0.68rem; padding: 0.1rem 0.3rem; margin: 0.05rem; background: #111; border-radius: 2px; border: 1px solid var(--panel-border); }

/* === FX CHART CANVAS === */
#chart-gold, #chart-btc { display: block; border: 1px solid var(--panel-border); border-radius: 2px; }

/* === MIDAS NARRATIVE === */
.midas-narrative p { font-size: 0.85rem; line-height: 1.6; color: var(--text); }

/* === RESULTS PAGE === */
.results-page { border-radius: 3px; }
.results-grid span { padding: 0.1rem 0; }

/* === ALCHEMY RESEARCH TIMER === */
.research-timer { font-family: var(--font-mono); font-size: 0.65rem; color: var(--info); padding: 0.2rem 0; }

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    html { font-size: 15px; }
    body { overflow: auto; height: auto; }
    .game-columns { grid-template-columns: 1fr; height: auto; overflow-y: auto; margin-top: 60px; }
    .col { overflow-y: visible; }
    .dashboard { padding: 0.2rem 0.5rem; flex-wrap: wrap; gap: 0.2rem; height: auto; }
    .dashboard-center { gap: 0.5rem; }
    .dash-value { font-size: 0.7rem; }
    #btn-pan { padding: 0.6em 1.5em; font-size: 0.9rem; }
    .footer-stats { flex-direction: column; gap: 0.15rem; }
    #notification-container { max-width: calc(100vw - 1rem); left: 0.5rem; right: 0.5rem; }
}

/* === GOLDEN WORLD (Prestige Midas YES variant) === */
body.golden-world {
    --black: #1a1200;
    --panel-bg: #2a2008;
    --panel-border: #5a4a20;
    --text: #ffe8b0;
    --text-dim: #c8a860;
    background: #1a1200;
}
body.golden-world .dashboard { background: #1a1200; border-bottom-color: #5a4a20; }
body.golden-world .dashboard-title { text-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }
body.golden-world .panel-desc,
body.golden-world .upgrade-desc,
body.golden-world .building-desc,
body.golden-world .credibility-label { color: #c8a860; }
body.golden-world .panel { border-color: #5a4a20; }
body.golden-world .col::-webkit-scrollbar-thumb { background: #5a4a20; }
