/*
 * GOLD EMPIRE UI 1.0 — shared premium visual language.
 * A presentation-only layer on top of the legacy shell, banking and GOLD CITY.
 * Do not change game state, wallet math, API contracts or 3-D scene geometry.
 */
:root{
  color-scheme:dark;
  --ge-bg:#101217;
  --ge-surface:#1c2029;
  --ge-surface-raised:#242936;
  --ge-surface-hover:#2b3140;
  --ge-gold:#e5bc67;
  --ge-gold-light:#f1d08d;
  --ge-gold-dark:#a67a34;
  --ge-text:#f4f5f7;
  --ge-muted:#aeb4c0;
  --ge-profit:#51d4a0;
  --ge-danger:#e56f73;
  --ge-border:rgba(202,187,155,.18);
  --ge-focus:#ffdfa0;
  --ge-radius:18px;
  --ge-shadow:0 12px 32px rgba(0,0,0,.23);
  --ge-motion:180ms ease;
  --bg:var(--ge-bg);
  --gold:var(--ge-gold);
  --gold2:var(--ge-gold-dark);
  --txt:var(--ge-text);
  --muted:var(--ge-muted);
  --line:#4a4650;
  --green:var(--ge-profit);
  --red:var(--ge-danger);
  --surface:var(--ge-surface);
  --surface2:var(--ge-surface-raised);
  --radius:var(--ge-radius);
}
html{background:var(--ge-bg)}
body{
  background:
    radial-gradient(ellipse 62% 30% at 85% -7%,rgba(205,155,63,.12),transparent 90%),
    radial-gradient(ellipse 65% 35% at -10% 90%,rgba(40,59,77,.17),transparent 90%),
    var(--ge-bg);
  color:var(--ge-text);
}
button,input,textarea,select{font-family:inherit}
:is(button,input,textarea,select,summary,a):focus-visible{
  outline:2px solid var(--ge-focus);
  outline-offset:3px;
}
.app-shell{
  max-width:1060px;
  padding-bottom:calc(116px + env(safe-area-inset-bottom,0px));
}
.topbar{
  background:linear-gradient(180deg,rgba(16,18,23,.98),rgba(16,18,23,.92));
  border-bottom:1px solid var(--ge-border);
  box-shadow:0 8px 35px rgba(0,0,0,.12);
}
.brand-mark{
  border-color:rgba(229,188,103,.7);
  background:linear-gradient(145deg,#3b3120,#141821 80%);
  color:var(--ge-gold-light);
  box-shadow:0 4px 18px rgba(200,151,60,.13);
}
.brand-copy small{color:var(--ge-muted)}
.brand-copy b{color:var(--ge-gold-light);text-shadow:none}
.balance{
  border-color:rgba(229,188,103,.46);
  background:linear-gradient(125deg,#353021,#1a1e26);
  box-shadow:none;
}
.balance i{background:#4a3b23;border-color:var(--ge-border);box-shadow:none}
.avatar{background:#242633;border-color:rgba(229,188,103,.55);color:var(--ge-gold)}
#content{padding-top:20px}
.screen .card,
#page-bank .bank-overview>div,
#page-bank .bank-link,
#page-world .business-row{
  background:linear-gradient(150deg,#252936,#191d25 82%);
  border:1px solid var(--ge-border);
  border-radius:var(--ge-radius);
  box-shadow:var(--ge-shadow);
}
.screen .card.gold-border{border-color:rgba(229,188,103,.31);box-shadow:var(--ge-shadow)}
.screen .section-title h2{color:var(--ge-text)}
.screen .hint,.screen .small,.screen .entry .sub{color:var(--ge-muted)}
.screen .entry{background:#191e26;border-color:var(--ge-border)}
.screen .metric.gold,.screen .gold{color:var(--ge-gold-light)}
.screen .green,.screen .metric.green{color:var(--ge-profit)}
.screen .profit-negative{color:var(--ge-danger)}
.screen .button{
  min-height:44px;
  border-radius:13px;
  background:linear-gradient(145deg,#f1d08d,#d9ac59);
  color:#171719;
  border:1px solid rgba(243,217,156,.6);
  box-shadow:none;
  transition:background-color var(--ge-motion),transform var(--ge-motion);
}
.screen .button.subtle{
  background:#282a34;
  color:var(--ge-gold-light);
  border-color:rgba(229,188,103,.35);
}
.screen .button.green{background:var(--ge-profit);color:#091d16}
.screen .pill{
  border-color:var(--ge-border);
  background:#252a35;
  color:var(--ge-muted);
  min-height:44px;
}
.screen .pill.active{background:var(--ge-gold);color:#161719}
.bottom-nav{
  border:1px solid rgba(229,188,103,.26);
  background:rgba(24,28,36,.97);
  box-shadow:0 10px 42px rgba(0,0,0,.46);
}
.nav{color:#a8aeb9;min-height:65px}
.nav.active,.nav[aria-current="page"]{
  color:var(--ge-gold-light);
  background:rgba(229,188,103,.12);
  border-color:rgba(229,188,103,.35);
}
.nav .glyph svg{stroke:currentColor}
#more-menu{
  background:#20242d;
  border-color:var(--ge-border);
  box-shadow:var(--ge-shadow);
}
#more-menu button{color:var(--ge-text);border-color:var(--ge-border)}
#notice{background:#232735;color:var(--ge-text);border-color:rgba(229,188,103,.55)}
#notice.error{border-color:var(--ge-danger)}

/* Dashboard: real account metrics, no hard-coded example balances. */
#page-world .ge-home{display:grid;gap:16px}
#page-world .ge-home .ge-home-hero{
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(180px,.85fr);
  gap:20px;
  padding:clamp(19px,4vw,30px);
  min-height:235px;
  overflow:hidden;
  border:1px solid rgba(229,188,103,.35);
  border-radius:24px;
  background:
    radial-gradient(circle at 88% 22%,rgba(242,197,104,.16),transparent 50%),
    linear-gradient(120deg,#262938,#171b23 78%);
  box-shadow:var(--ge-shadow);
}
#page-world .ge-home .ge-home-hero::after{
  content:"";
  position:absolute;
  width:230px;height:230px;
  right:-60px;top:-90px;
  border:1px solid rgba(229,188,103,.24);
  border-radius:50%;
  box-shadow:0 0 0 44px rgba(229,188,103,.035),0 0 0 88px rgba(229,188,103,.027);
  pointer-events:none;
  z-index:-1;
}
#page-world .ge-home-eyebrow{
  display:block;color:var(--ge-gold);
  font-size:10px;letter-spacing:.17em;font-weight:800;
  text-transform:uppercase;
}
#page-world .ge-home-welcome h1{
  margin:13px 0 10px;
  font-size:clamp(22px,4vw,34px);
  letter-spacing:-.04em;line-height:1.12;
  color:var(--ge-text);
  overflow-wrap:anywhere;
}
#page-world .ge-home-welcome p{margin:0;color:var(--ge-muted);font-size:13px}
#page-world .ge-home-balance{
  align-self:center;
  min-width:0;
  padding:15px 0 15px 20px;
  border-left:1px solid var(--ge-border);
}
#page-world .ge-home-balance small{display:block;font-size:11px;letter-spacing:.1em;color:var(--ge-muted)}
#page-world .ge-home-balance strong{
  display:block;
  margin:9px 0 11px;
  font-size:clamp(25px,4.7vw,40px);
  line-height:1.13;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.04em;
  overflow-wrap:anywhere;
  color:var(--ge-gold-light);
}
#page-world .ge-home-income{
  display:inline-flex;align-items:center;gap:7px;
  border-radius:12px;
  padding:7px 10px;
  background:rgba(81,212,160,.1);
  color:var(--ge-profit);
  font-size:12px;font-weight:800;
  font-variant-numeric:tabular-nums;
}
#page-world .ge-home-income.negative{background:rgba(229,111,115,.1);color:var(--ge-danger)}
#page-world .ge-home-income.neutral{background:rgba(255,255,255,.05);color:var(--ge-muted)}
#page-world .ge-home-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
#page-world .ge-home-stat{
  min-width:0;
  display:flex;flex-direction:column;gap:9px;
  background:#20242e;
  border:1px solid var(--ge-border);
  border-radius:16px;
  padding:17px;
}
#page-world .ge-home-stat span{font-size:11px;line-height:1.4;color:var(--ge-muted)}
#page-world .ge-home-stat strong{
  font-size:clamp(16px,2.3vw,22px);font-weight:800;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
#page-world .ge-home-section{display:grid;gap:12px}
#page-world .ge-home-sectionhead{display:flex;align-items:center;justify-content:space-between;gap:12px}
#page-world .ge-home-sectionhead h2{font-size:18px;letter-spacing:-.025em;margin:0;color:var(--ge-text)}
#page-world .ge-home-sectionhead small{font-size:11px;color:var(--ge-muted)}
#page-world .ge-home-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
#page-world .ge-home-link{
  display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;
  gap:16px;min-height:143px;
  position:relative;text-align:left;
  padding:16px;border-radius:17px;
  border:1px solid var(--ge-border);
  background:linear-gradient(155deg,#272c38,#1a1e26);
  color:var(--ge-text);
  box-shadow:none;
  transition:background-color var(--ge-motion),border-color var(--ge-motion),transform var(--ge-motion);
}
#page-world .ge-home-link:hover:not(:disabled){background:#2d3240;border-color:rgba(229,188,103,.38)}
#page-world .ge-home-link:active:not(:disabled){transform:scale(.98)}
#page-world .ge-home-link-icon{
  width:42px;height:42px;
  display:grid;place-items:center;
  background:rgba(229,188,103,.13);
  border:1px solid rgba(229,188,103,.25);
  color:var(--ge-gold-light);
  border-radius:13px;
  font-size:21px;
}
#page-world .ge-home-link-content{display:grid;gap:5px;min-width:0}
#page-world .ge-home-link strong{font-size:14px;color:var(--ge-text)}
#page-world .ge-home-link small{font-size:11px;line-height:1.4;color:var(--ge-muted)}
#page-world .ge-home-link-chevron{position:absolute;top:19px;right:16px;color:var(--ge-muted);font-size:23px}
#page-world .ge-home-footnote{margin:0;color:var(--ge-muted);font-size:11px;line-height:1.5}
#page-world .ge-home-link.ge-home-link-featured{
  border-color:rgba(229,188,103,.45);
  background:linear-gradient(140deg,#393021,#25252d 70%);
}

/* Apply consistent panels and actions without touching the GOLD CITY WebGL canvas. */
#gold-city-rebirth{
  --ge-gold:var(--ge-gold-light,#f1d08d);
  font-family:Manrope,system-ui,-apple-system,sans-serif;
  color:var(--ge-text);
  background:var(--ge-bg);
}
#gold-city-rebirth .rb-app{
  background:radial-gradient(circle at 82% -11%,rgba(220,173,81,.12),transparent 47%),var(--ge-bg);
}
#gold-city-rebirth .rb-header{
  background:rgba(22,25,33,.96);
  border-bottom-color:var(--ge-border);
}
#gold-city-rebirth .rb-panel,
#gold-city-rebirth .rb-action-card,
#gold-city-rebirth .rb-industry-group,
#gold-city-rebirth .rb-my-business-detail{
  background:linear-gradient(150deg,#252936,#181c24);
  border-color:var(--ge-border);
  border-radius:var(--ge-radius);
}
#gold-city-rebirth .rb-wallet{background:#252832;border-color:rgba(229,188,103,.28)}
#gold-city-rebirth .rb-ghost{background:#282c37;border-color:rgba(229,188,103,.25);color:var(--ge-gold-light)}
#gold-city-rebirth .rb-primary{background:linear-gradient(145deg,#f1d08d,#d9ac59);color:#171719;box-shadow:none}
#gold-city-rebirth .rb-btn{min-height:44px;border-radius:12px}
#gold-city-rebirth .rb-brand strong{color:var(--ge-gold-light)}
#gold-city-rebirth .rb-positive{color:var(--ge-profit)!important}

/* Investment and banking overlays share the same surface, text and tokens. */
#page-invest .ge9{
  --g9-gold:var(--ge-gold);
  --g9-muted:var(--ge-muted);
  --g9-text:var(--ge-text);
  --g9-green:var(--ge-profit);
  --g9-red:var(--ge-danger);
  --g9-edge:var(--ge-border);
  background:linear-gradient(160deg,#171c26,#141820);
  border:1px solid var(--ge-border);
}
#page-invest .ge9-hero,
#page-invest .ge9-tools,
#page-invest .ge9-chart-card,
#page-invest .ge9-asset{background:linear-gradient(150deg,#272c39,#1a1f29);border-color:var(--ge-border)}
#finance-modal .finance-panel{
  background:var(--ge-bg);
  color:var(--ge-text);
  border-color:rgba(229,188,103,.35);
}
#finance-modal .finance-header,#finance-modal #finance-nav{border-color:var(--ge-border)}
#finance-modal .finance-card,
#finance-modal .finance-metrics>div{background:var(--ge-surface);border-color:var(--ge-border)}
#finance-modal .finance-header h2{color:var(--ge-text)}
#finance-modal .finance-panel .button-primary{background:var(--ge-gold-light);color:#151719}

@media (max-width:720px){
  #page-world .ge-home-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  #page-world .ge-home-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:530px){
  .app-shell{padding-left:12px;padding-right:12px;padding-bottom:calc(112px + max(env(safe-area-inset-bottom,0px),var(--tg-content-safe-area-inset-bottom,0px)))}
  .brand-mark{width:41px;height:41px;font-size:19px;border-radius:12px}
  .brand-copy b{font-size:clamp(16px,4.6vw,21px)}
  .brand-copy small{font-size:8px}
  .topbar{padding:11px 0}
  .balance{max-width:43vw}
  .nav span:last-child{font-size:10px}
  #page-world .ge-home .ge-home-hero{grid-template-columns:1fr;gap:15px;min-height:0;padding:19px}
  #page-world .ge-home-balance{
    padding:14px 0 0;
    border-left:0;
    border-top:1px solid var(--ge-border);
  }
  #page-world .ge-home-balance strong{font-size:clamp(25px,8vw,33px)}
  #page-world .ge-home-stat{padding:13px;gap:6px}
  #page-world .ge-home-link{min-height:138px;padding:13px}
  #page-world .ge-home-link strong{font-size:13px}
}
@media (max-width:350px){
  #page-world .ge-home-grid{gap:8px}
  #page-world .ge-home-link{min-height:124px;padding:11px}
  .brand-copy small{display:none}
  .bottom-nav{padding:5px 3px}
}
@media (prefers-reduced-motion:reduce){
  .screen{animation:none}
  .ge-home-link,.screen .button{transition:none!important;animation:none!important}
}
