:root {
  --accent: #FF6B3D;
  --glass: rgba(16, 20, 30, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --muted: rgba(255, 255, 255, 0.6);
  --good: #6fd08c;
  --bad: #ff6b6b;
  --gap: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #dfeaf0; overscroll-behavior: none; }
body { font-family: 'Inter', system-ui, sans-serif; color: #fff; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; cursor: grab; touch-action: none; }
canvas.dragging { cursor: grabbing; }
canvas.paint { cursor: crosshair; }
.hidden { display: none !important; }
.ico { display: block; flex: none; }
.accent { color: var(--accent); }

.panel {
  background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(10, 20, 40, 0.25);
}
.big { font: 700 34px 'Space Grotesk', sans-serif; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbl { color: var(--muted); font-size: 12px; margin-top: 5px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }

/* ---------- 1. Setup ---------- */
#setup {
  position: fixed; inset: 0; display: flex; align-items: center; padding: 24px 0 24px 5vw; overflow-y: auto;
  transition: opacity .5s; z-index: 10;
  /* only a soft pool of shade around the menu; the city stays bright everywhere else */
  background: radial-gradient(ellipse 720px 92% at calc(5vw + 300px) 50%, rgba(10, 14, 22, 0.55), rgba(10, 14, 22, 0) 70%);
}
#setup.fade { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }   /* fully gone once faded (frosted glass can linger otherwise) */
.setup-card {
  position: relative; width: 600px; max-width: 100%; padding: 34px 36px 30px; margin: auto 0;
  background: linear-gradient(160deg, rgba(26, 32, 48, 0.78), rgba(12, 16, 26, 0.86));
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 30px;
  box-shadow: 0 30px 80px rgba(8, 12, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.setup-card::before {   /* a warm glow along the top edge */
  content: ''; position: absolute; left: 36px; right: 36px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font: 700 18px 'Space Grotesk'; letter-spacing: .3em; color: #fff; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { margin-left: auto; font: 600 12px 'Inter'; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
h1 { font: 700 46px/1.02 'Space Grotesk'; margin: 16px 0 14px; letter-spacing: -0.025em; }
h1 em { font-style: normal; background: linear-gradient(90deg, #ff8a5c, var(--accent) 60%, #ffb38a); -webkit-background-clip: text; background-clip: text; color: transparent; }
label { display: block; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 18px 0 9px; }
input[type=text], #cityName {
  width: 100%; font: 700 32px 'Space Grotesk'; color: #fff; background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--line); border-radius: 16px; padding: 14px 20px; outline: none; transition: border-color .2s; user-select: text;
}
#cityName:focus { border-color: var(--accent); }
#cityName::placeholder { color: rgba(255, 255, 255, 0.35); }

.regions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.region {
  border: 2px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.05);
  cursor: pointer; padding: 6px 5px 9px; text-align: center; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .15s, border-color .15s;
}
.region:hover { transform: translateY(-2px); }
.region canvas.thumb { position: static; width: 100%; height: auto; aspect-ratio: 16 / 11; border-radius: 10px; margin-bottom: 7px; background: rgba(255,255,255,0.06); cursor: inherit; }
.region.on { border-color: var(--accent); background: rgba(255, 107, 61, 0.14); box-shadow: 0 0 0 4px rgba(255, 107, 61, 0.12); }

.chips { display: flex; gap: 10px; }
.chip {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.05);
  font-weight: 600; font-size: 18px; padding: 12px 10px; cursor: pointer; transition: border-color .15s;
}
.chip.on { border-color: var(--accent); background: rgba(255, 107, 61, 0.16); }
.sizes .chip { flex-direction: column; gap: 2px; font-size: 16px; padding: 9px 6px; border-radius: 16px; }
.sizes .chip small { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.cta {
  margin-top: 30px; width: 100%; border: 0; border-radius: 18px; cursor: pointer; display: flex; justify-content: center; gap: 12px;
  background: var(--accent); font: 700 26px 'Space Grotesk'; padding: 22px; color: #fff;
  box-shadow: 0 14px 40px rgba(255, 107, 61, 0.45); transition: transform .15s;
}
.cta:hover { transform: translateY(-2px); }
.cta .arrow { transition: transform .2s; }
.cta:hover .arrow { transform: translateX(6px); }
.cta.ghost { background: rgba(255, 255, 255, 0.08); box-shadow: none; border: 2px solid var(--line); margin-top: 12px; font-size: 20px; padding: 16px; }
.cta.small { font-size: 18px; padding: 14px; margin-top: 18px; }

/* ---------- 2. AI log ---------- */
#genlog { position: fixed; left: var(--gap); top: var(--gap); width: 460px; padding: 26px 28px; transition: opacity .5s; z-index: 5; }
#genlog.fade { opacity: 0; }
.gen-kicker { display: flex; align-items: center; gap: 10px; color: var(--accent); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.gen-name { font: 700 38px 'Space Grotesk'; margin: 8px 0 16px; }
.bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
#genBar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
#logList { list-style: none; }
#logList li { display: flex; gap: 12px; align-items: center; font-size: 17px; padding: 6px 0; animation: slideIn .35s ease; }
#logList li.done { color: var(--muted); }
#logList li .ic { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
#logList li .spin { width: 16px; height: 16px; border: 2.5px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
#logList li .ok { color: var(--accent); font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } }

/* ---------- 3. HUD ---------- */
.leftcol { position: fixed; left: var(--gap); top: var(--gap); width: 320px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 140px); }
.empire { overflow: hidden; flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
.emp-head { display: flex; flex-direction: column; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 18px 20px 14px; cursor: pointer; position: relative; }
.hud-name { font: 700 26px 'Space Grotesk'; line-height: 1.05; padding-right: 20px; }
.hud-region { color: var(--muted); font-size: 13px; margin-top: 3px; }
.emp-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.emp-pop .big { font-size: 40px; }
.emp-happy { display: flex; align-items: center; gap: 6px; font: 700 20px 'Space Grotesk'; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,0.07); }
.emp-happy.good { color: var(--good); } .emp-happy.bad { color: var(--bad); }
.chev { position: absolute; right: 14px; top: 18px; color: var(--muted); transition: transform .2s; }
.empire.closed .chev { transform: rotate(-90deg); }
.empire.closed .city-list, .empire.closed .city-sort { display: none; }
.city-sort { display: flex; align-items: center; gap: 4px; padding: 8px 14px 4px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.city-sort span { margin-right: 4px; }
.city-sort button { border: 0; background: transparent; color: var(--muted); font: 600 12px 'Inter'; padding: 4px 8px; border-radius: 8px; cursor: pointer; letter-spacing: 0; text-transform: none; }
.city-sort button:hover { background: rgba(255,255,255,0.07); color: #fff; }
.city-sort button.on { background: rgba(255,107,61,0.16); color: var(--accent); }
.city-sort .min { margin-left: auto; display: grid; place-items: center; transform: rotate(180deg); }
.city-list li.more { display: block; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.city-list { list-style: none; padding: 2px 8px 8px; overflow-y: auto; }
.city-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 7px 12px; border-radius: 12px; cursor: pointer; }
.city-list li:hover { background: rgba(255, 255, 255, 0.07); }
.city-list .cn { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 15px; }
.city-list .cn .ico { color: var(--accent); }
.city-list .cp { font: 700 16px 'Space Grotesk'; font-variant-numeric: tabular-nums; }
.city-list .cb { grid-column: 1 / -1; height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 9px; overflow: hidden; }
.city-list .cb i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .5s; }

.goal { padding: 14px 18px 16px; flex: none; }
.goal-top { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; }
.goal-top .gl { flex: 1; }
.greward { color: var(--good); letter-spacing: 0; font: 700 14px 'Space Grotesk'; text-transform: none; }
.gtext { font: 700 18px/1.25 'Space Grotesk'; margin: 8px 0 10px; }
.goal.done { animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(111, 208, 140, 0.4); } }

.progress { padding: 14px 16px 14px 18px; flex: none; }
.prog-row { display: flex; align-items: center; gap: 12px; }
.prog-text { flex: 1; min-width: 0; }
.prog-label { font: 700 17px 'Space Grotesk'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-num { color: var(--muted); font-size: 13px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.prog-bar { height: 7px; background: rgba(255, 255, 255, 0.1); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.prog-bar > div { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s; }
#goalFill { background: var(--good); }
.advance { border: 0; border-radius: 12px; padding: 11px 16px; font: 700 16px 'Space Grotesk'; background: rgba(255, 255, 255, 0.1); color: var(--muted); cursor: not-allowed; white-space: nowrap; }
.advance.ready { background: var(--accent); color: #fff; cursor: pointer; animation: glow 1.4s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(255, 107, 61, 0.25); } }

.datebox { position: relative; padding: 16px 16px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.db-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.db-btns { display: flex; gap: 6px; flex: none; }
.datebox .date { min-width: 0; flex: 1; }
.datebox .date .big { white-space: nowrap; font-size: clamp(24px, 2.4vw, 34px); }   /* the date never pushes the buttons off the panel */
.icon-btn { width: 36px; height: 36px; flex: none; border: 2px solid var(--line); border-radius: 12px; background: none; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); }
.money { text-align: left; background: rgba(255,255,255,0.06); border: 0; border-radius: 14px; padding: 10px 12px; cursor: pointer; flex: 1; min-width: 0; }
.money:hover { background: rgba(255,255,255,0.1); }
.money .big { font-size: 28px; color: var(--good); }
.money.neg .big { color: var(--bad); }
.demand { width: 136px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.dm-title { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dm-row { display: grid; grid-template-columns: 14px 1fr 50px; gap: 5px; align-items: center; }
.dm-ico { display: grid; place-items: center; }
.dm-row[data-k=res] .dm-ico { color: #6fd08c; } .dm-row[data-k=com] .dm-ico { color: #6ea8ff; } .dm-row[data-k=ind] .dm-ico { color: #f2c14e; }
.dm-bar { position: relative; height: 7px; border-radius: 9px; background: rgba(255,255,255,0.08); }
.dm-bar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255,255,255,0.35); }
.dm-bar i { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-radius: 9px; background: var(--good); transition: all .4s; }
.dm-bar i.neg { left: auto; right: 50%; background: var(--bad); }
.dm-val { font-size: 11px; font-weight: 700; text-align: right; white-space: nowrap; }
.dm-val.hi { color: var(--good); } .dm-val.lo { color: var(--bad); } .dm-val.ok { color: var(--muted); }
.speeds { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 14px; padding: 4px; }
.speeds button { flex: 1; height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.speeds button.on { background: var(--accent); color: #fff; }

.dock { position: fixed; left: 50%; bottom: var(--gap); transform: translateX(-50%); padding: 6px; display: flex; gap: 2px; max-width: calc(100vw - 2 * var(--gap)); overflow-x: auto; scrollbar-width: none; }
.dock::-webkit-scrollbar { display: none; }
.tool { flex: none; width: 74px; height: 72px; border: 2px solid transparent; border-radius: 14px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; position: relative; }
.tool .tl { font-weight: 600; font-size: 12px; }
.tool .tc { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tool .kb { position: absolute; top: 4px; left: 7px; font-size: 9.5px; color: rgba(255,255,255,0.35); }
.tool:hover { background: rgba(255, 255, 255, 0.07); }
.tool.on { border-color: var(--accent); background: rgba(255, 107, 61, 0.16); }
.tool.poor .tc { color: var(--bad); }
.tool[data-k=res] .ico { color: #6fd08c; } .tool[data-k=com] .ico { color: #6ea8ff; } .tool[data-k=ind] .ico { color: #f2c14e; }
.tool.cat .more { position: absolute; top: 5px; right: 7px; width: 6px; height: 6px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(-45deg); }
.tray { position: fixed; bottom: 104px; display: flex; gap: 4px; padding: 6px; z-index: 7; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; animation: slideUp .2s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } }
.titem .kb { position: absolute; top: 4px; left: 8px; font-size: 9.5px; color: rgba(255,255,255,0.4); }
.titem { position: relative; flex: none; width: 92px; padding: 9px 4px 8px; border: 2px solid transparent; border-radius: 14px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.titem:hover { background: rgba(255,255,255,0.07); }
.titem.on { border-color: var(--accent); background: rgba(255,107,61,0.16); }
.titem .tn { font-weight: 600; font-size: 12px; line-height: 1.15; }
.titem .tc { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.titem.locked { opacity: .45; }
.titem.locked .tc { color: #ffd27a; }
.placebar { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; z-index: 6; max-width: calc(100vw - 16px); }
#pbText { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pbText .bad { color: #ffb3a8; }
.pb-btn { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 12px; background: rgba(255,255,255,0.1); cursor: pointer; font-weight: 700; font-size: 13px; white-space: nowrap; }
.pb-btn.go { background: var(--accent); }
.pb-btn.x { padding: 8px; }
.tool-hint { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); background: rgba(16,20,30,0.85); padding: 8px 16px; border-radius: 99px; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.tool-hint.show { opacity: 1; }

.rightcol { position: fixed; right: var(--gap); top: var(--gap); width: 330px; max-height: calc(100vh - var(--gap) * 2 - 96px); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.rightcol > .datebox { flex: none; }
.rightcol .inspector:not(.hidden) ~ .news { display: none; }   /* the card takes the news slot while it's open */
.rightcol > * { pointer-events: auto; }
.news { list-style: none; padding: 8px; }
.news:empty { display: none; }
.news li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; font-size: 14px; line-height: 1.35; animation: slideIn .35s ease; }
.news li .ni { width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 107, 61, 0.16); color: var(--accent); display: grid; place-items: center; flex: none; }
.news li.bad .ni { background: rgba(255, 107, 107, 0.18); color: var(--bad); }
.news li.good .ni { background: rgba(111, 208, 140, 0.18); color: var(--good); }
.news li + li { border-top: 1px solid var(--line); }
.news li .nt { flex: 1; }
.news li .nx { flex: none; width: 22px; height: 22px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s; }
.news li:hover .nx { opacity: 1; }
.news li .nx:hover { background: rgba(255,255,255,0.1); color: #fff; }
.news li.out { opacity: 0; transform: translateX(16px); transition: opacity .3s, transform .3s; }
@media (hover: none) { .news li .nx { opacity: .7; } }

.inspector { position: relative; padding: 18px 20px; z-index: 6; animation: slideIn .25s; min-height: 0; overflow-y: auto; flex: 0 1 auto; }   /* stacks under the date panel */
.inspector .ix { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border: 0; background: rgba(255,255,255,0.08); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.inspector .it { font: 700 22px 'Space Grotesk'; padding-right: 36px; }
.inspector .is { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.inspector dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-top: 14px; font-size: 14.5px; }
.inspector dt { color: var(--muted); }
.inspector dd { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.inspector .svc { display: flex; gap: 8px; margin-top: 14px; }
.inspector .svc span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border-radius: 10px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
.inspector .svc span.on { background: rgba(111, 208, 140, 0.16); color: var(--good); }
.inspector .ih { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.07); font-size: 14px; line-height: 1.35; }
.inspector .ih.warn { background: rgba(255, 182, 50, 0.15); color: #ffd27a; }
.inspector .act { margin-top: 12px; width: 100%; border: 0; border-radius: 12px; padding: 12px; background: var(--accent); font: 700 16px 'Space Grotesk'; cursor: pointer; }

/* research */
.research-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 14px; padding: 8px 12px; background: rgba(255,255,255,0.06); cursor: pointer; text-align: left; }
.research-btn:hover { background: rgba(255,255,255,0.1); }
.research-btn.idle { box-shadow: inset 0 0 0 2px rgba(255,107,61,0.6); animation: glow 1.6s infinite; }
.rb-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,107,61,0.18); color: var(--accent); display: grid; place-items: center; flex: none; }
.rb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
#rbName { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,0.1); overflow: hidden; }
.rb-bar i { display: block; height: 100%; width: 0; background: #8fb8ff; border-radius: 9px; transition: width .4s; }
.modal-card.research { width: min(1080px, calc(100vw - 20px)); max-width: none; max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px 28px; position: relative; }
.research .ix { position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; border: 0; background: rgba(255,255,255,0.08); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.research h2 { margin-bottom: 4px; }
.research-sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.research-sub b { color: #8fb8ff; }
.research-grid { display: block; }
/* research tree */
.rtree { position: relative; overflow: auto; max-height: calc(100vh - 300px); border-radius: 16px; background: rgba(255,255,255,0.02); border: 1px solid var(--line); }
.rtree-in { position: relative; }
.rsvg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.rl { fill: none; stroke-width: 2.2; stroke: rgba(255,255,255,0.14); }
.rl.open { stroke: #8fb8ff; }
.rl.done { stroke: rgba(111,208,140,0.75); }
.rl.or { stroke: #ffd27a; stroke-dasharray: 4 4; stroke-width: 1.6; }
.ror { fill: #ffd27a; font: 700 11px 'Inter'; }
.rhead { position: absolute; top: 0; height: 30px; display: grid; place-items: center; font: 700 11.5px 'Inter'; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,0.4); border-bottom: 1px solid var(--line); }
.rhead.now { color: var(--accent); }
.rlane { position: absolute; left: 0; right: 0; }
.rlane.alt { background: rgba(255,255,255,0.025); }
.rlabel { position: absolute; left: 0; width: 124px; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding-left: 16px; color: var(--muted); font: 700 13px 'Space Grotesk'; background: linear-gradient(90deg, #171d2b 70%, rgba(23,29,43,0)); }
.rlabel svg { color: #8fb8ff; }
.rnode { position: absolute; display: flex; align-items: center; gap: 9px; padding: 0 10px; text-align: left; border: 2px solid var(--line); border-radius: 14px; background: #1b2232; color: #fff; cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s; }
.rnode:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.35); }
.rnode .ri { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(143,184,255,0.16); color: #8fb8ff; }
.rnode .rt { display: flex; flex-direction: column; min-width: 0; }
.rnode .rn { font: 700 13px 'Space Grotesk'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rnode .rs { font-size: 11px; color: var(--muted); font-weight: 600; }
.rnode .rp { position: absolute; left: 0; bottom: 0; height: 3px; background: #8fb8ff; }
.rnode.open { border-color: rgba(143,184,255,0.55); }
.rnode.open .rs { color: #8fb8ff; }
.rnode.done { border-color: rgba(111,208,140,0.55); background: #1a2a26; }
.rnode.done .ri { background: rgba(111,208,140,0.18); color: var(--good); }
.rnode.done .rs { color: var(--good); }
.rnode.needs, .rnode.era { opacity: .55; }
.rnode.excluded { opacity: .3; }
.rnode.cur { border-color: #8fb8ff; box-shadow: 0 0 0 3px rgba(143,184,255,0.2); }
.rnode.sel { border-color: #fff; }
.rdetail { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.04); min-height: 70px; }
.rdetail.empty { color: var(--muted); font-size: 14px; }
.rdetail .ri.big { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(143,184,255,0.16); color: #8fb8ff; }
.rdt { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rdt b { font: 700 17px 'Space Grotesk'; }
.rdt b em { font: 600 10.5px 'Inter'; font-style: normal; color: #ffd27a; border: 1px solid rgba(255,210,122,0.45); border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.rdt span { color: var(--muted); font-size: 14px; }
.rgo { flex: none; border: 0; border-radius: 12px; padding: 12px 18px; background: #8fb8ff; color: #0e1420; font: 700 15px 'Space Grotesk'; cursor: pointer; }
.rgo.on { background: rgba(143,184,255,0.2); color: #8fb8ff; cursor: default; }
.rwhy { flex: none; color: #ffd27a; font-weight: 600; font-size: 13.5px; }
/* themed scrollbars inside panels */
.modal-card, .rtree, .city-list, .inspector { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
.modal-card::-webkit-scrollbar, .rtree::-webkit-scrollbar, .city-list::-webkit-scrollbar, .inspector::-webkit-scrollbar { width: 8px; height: 8px; }
.modal-card::-webkit-scrollbar-track, .rtree::-webkit-scrollbar-track, .city-list::-webkit-scrollbar-track, .inspector::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb, .rtree::-webkit-scrollbar-thumb, .city-list::-webkit-scrollbar-thumb, .inspector::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 8px; }
.modal-card::-webkit-scrollbar-thumb:hover, .rtree::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }
.modal-card::-webkit-scrollbar-corner, .rtree::-webkit-scrollbar-corner { background: transparent; }
.rcol h3 { display: flex; align-items: center; gap: 8px; }
.rera { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin: 14px 0 7px; }
.rcol h3 + .rera { margin-top: 0; }
.rcard .rn em { font: 600 10.5px 'Inter'; font-style: normal; color: #ffd27a; border: 1px solid rgba(255,210,122,0.45); border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.rcol h3 { font: 700 15px 'Space Grotesk'; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px; }
.rcard { width: 100%; text-align: left; border: 2px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.04); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: border-color .15s, transform .15s; display: grid; grid-template-columns: 36px 1fr; gap: 3px 10px; }
.rcard:hover:not(:disabled) { border-color: #8fb8ff; transform: translateY(-2px); }
.rcard .ri { width: 36px; height: 36px; border-radius: 11px; background: rgba(143,184,255,0.16); color: #8fb8ff; display: grid; place-items: center; grid-row: span 2; }
.rcard .rn { font: 700 16px 'Space Grotesk'; }
.rcard .rd { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.rcard .rs { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; margin-top: 6px; color: #8fb8ff; }
.rcard .rs .rb-bar { flex: 1; }
.rcard.done { border-color: rgba(111, 208, 140, 0.5); background: rgba(111, 208, 140, 0.08); cursor: default; }
.rcard.done .ri { background: rgba(111, 208, 140, 0.18); color: var(--good); }
.rcard.done .rs { color: var(--good); }
.rcard.cur { border-color: #8fb8ff; background: rgba(143,184,255,0.1); }
.rcard:disabled:not(.done) { opacity: .45; cursor: not-allowed; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(8, 12, 20, 0.55); display: grid; place-items: center; z-index: 20; padding: 20px; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { width: 720px; max-width: 100%; }
.modal-card h2 { font: 700 40px 'Space Grotesk'; margin: 8px 0 20px; }
.tech-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tech { text-align: left; border: 2px solid var(--line); border-radius: 22px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 24px; cursor: pointer; transition: transform .15s, border-color .15s; }
.tech:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--accent); }
.tech:disabled { opacity: .55; cursor: not-allowed; }
.tech .ti { width: 68px; height: 68px; border-radius: 20px; background: var(--accent); display: grid; place-items: center; margin-bottom: 16px; color: #fff; }
.tech .tn { font: 700 26px 'Space Grotesk'; }
.tech .td { color: var(--muted); font-size: 15px; line-height: 1.4; margin-top: 8px; }
.tech .tp { margin-top: 14px; font: 700 18px 'Space Grotesk'; color: var(--good); }
.tech:disabled .tp { color: var(--bad); }
.budget, .win { width: 460px; padding: 26px 28px; }
.budget h2, .win h2 { font-size: 34px; margin-bottom: 14px; }
.brow { display: flex; justify-content: space-between; padding: 7px 0; font-size: 15.5px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.brow span:first-child { color: var(--muted); }
.brow.total { font: 700 19px 'Space Grotesk'; border: 0; padding-top: 12px; }
.brow .pos { color: var(--good); } .brow .neg { color: var(--bad); }
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.tax-note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.win { text-align: center; }
.win-ico { width: 84px; height: 84px; border-radius: 26px; background: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.win-body { color: var(--muted); font-size: 16px; line-height: 1.5; }
.win-body b { color: #fff; }
.win-btns { display: flex; gap: 10px; }
.win-btns .cta { flex: 1; }
.win-btns.col { flex-direction: column; gap: 0; }
.win-btns .cta:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.win { position: relative; }
.win .ix { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255,255,255,0.08); font-size: 20px; cursor: pointer; }
.win-ico { font-size: 40px; color: #fff; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translate(-50%, -30px); opacity: 0; z-index: 30;
  background: var(--accent); font: 700 20px 'Space Grotesk'; padding: 12px 24px; border-radius: 999px; max-width: calc(100vw - 32px);
  box-shadow: 0 14px 40px rgba(255, 107, 61, 0.45); transition: all .4s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: #3fa86a; box-shadow: 0 14px 40px rgba(63, 168, 106, 0.45); }
.toast.bad { background: #d9453a; box-shadow: 0 14px 40px rgba(217, 69, 58, 0.45); }

@media (max-width: 1250px) { .news { display: none; } }

@media (max-height: 760px) and (min-width: 761px) { .city-list { max-height: 150px; } }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --gap: 8px; }
  #setup { padding: 16px; align-items: flex-start; background: rgba(10, 14, 22, 0.25); }
  .setup-card { padding: 24px 18px 22px; border-radius: 24px; }
  .brand small { display: none; }
  h1 { font-size: 36px; margin-bottom: 18px; }
  label { margin: 18px 0 8px; font-size: 12px; }
  #cityName { font-size: 24px; padding: 12px 16px; }
  .regions { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
  .regions::-webkit-scrollbar { display: none; }
  .region { flex: 0 0 132px; scroll-snap-align: start; }
  .chip { font-size: 15px; padding: 11px 6px; gap: 6px; }
  #terrains { flex-wrap: wrap; }
  #terrains .chip { flex: 1 1 40%; }
  .cta { font-size: 22px; padding: 18px; margin-top: 24px; }

  #genlog { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; padding: 18px 20px; }
  .gen-name { font-size: 26px; margin: 4px 0 10px; }
  #logList li { font-size: 14px; padding: 4px 0; }
  #logList li:not(:nth-last-child(-n+3)) { display: none; }

  .big { font-size: 22px; }
  .lbl { font-size: 10px; margin-top: 3px; }
  .leftcol { display: contents; }
  .empire { position: fixed; left: 8px; top: 8px; right: 178px; border-radius: 16px; max-height: 60vh; }
  .emp-head { padding: 10px 12px; gap: 6px; }
  .hud-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud-region { display: none; }
  .emp-pop .big { font-size: 22px; }
  .emp-happy { font-size: 14px; padding: 4px 7px; }
  .chev { top: 10px; right: 10px; }
  .goal { position: fixed; left: 8px; right: 178px; top: 98px; padding: 9px 12px 10px; border-radius: 14px; }
  .empire:not(.closed) ~ .goal { display: none; }
  .goal-top { font-size: 10.5px; }
  .gtext { font-size: 13.5px; margin: 4px 0 6px; }
  .greward { font-size: 12px; }
  .goal .prog-bar { margin-top: 4px; height: 5px; }
  .progress { position: fixed; left: 8px; right: 8px; bottom: 86px; padding: 8px 8px 8px 14px; border-radius: 14px; }
  .prog-label { font-size: 14px; }
  .prog-num { font-size: 11.5px; }
  .progress .prog-bar { margin-top: 6px; height: 5px; }
  .advance { font-size: 14px; padding: 9px 12px; border-radius: 10px; }

  .rightcol { right: 8px; top: 8px; width: 166px; }
  .datebox { padding: 10px; gap: 8px; border-radius: 16px; }
  .db-row { gap: 6px; }
  .date .big { font-size: 17px; }
  .db-btns { flex-direction: column; gap: 4px; }
  .icon-btn { width: 28px; height: 28px; border-radius: 8px; }
  .icon-btn .ico { width: 15px; height: 15px; }
  .money { padding: 6px 8px; border-radius: 10px; }
  .money .big { font-size: 17px; }
  .db-row:has(.demand) { flex-direction: column; align-items: stretch; }
  .demand { width: auto; }
  .dm-title { display: none; }
  .dm-row { grid-template-columns: 14px 1fr 46px; gap: 4px; }
  .dm-val { font-size: 9.5px; }
  .speeds button { height: 28px; }

  .dock { left: 8px; right: 8px; bottom: 8px; transform: none; max-width: none; border-radius: 16px; padding: 4px; }
  .tool { width: 64px; height: 64px; }
  .tool .kb { display: none; }
  .placebar { bottom: 152px; left: 8px; right: 8px; transform: none; }
  #pbText { white-space: normal; font-size: 12.5px; }
  .tray { bottom: 82px; left: 8px !important; right: 8px; }
  .titem { width: 80px; }
  .tool-hint { bottom: 158px; font-size: 12.5px; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
  .inspector { position: fixed; left: 8px; right: 8px; top: auto; bottom: 152px; width: auto; max-height: 50vh; overflow-y: auto; padding: 14px 16px; }
  .inspector .it { font-size: 18px; }

  .modal { align-items: end; padding: 10px; }
  .modal-card h2 { font-size: 26px; margin-bottom: 12px; }
  .tech-cards { grid-template-columns: 1fr; gap: 10px; }
  .tech { padding: 14px; display: grid; grid-template-columns: 52px 1fr; gap: 3px 14px; align-items: center; }
  .tech .ti { width: 52px; height: 52px; border-radius: 15px; margin: 0; grid-row: span 3; }
  .tech .tn { font-size: 19px; }
  .tech .td { font-size: 13px; margin: 0; }
  .tech .tp { margin: 2px 0 0; font-size: 15px; }
  .budget, .win { padding: 20px; }
  .toast { top: 180px; font-size: 15px; padding: 9px 16px; }
  .research-btn { padding: 5px 8px; gap: 6px; border-radius: 10px; }
  .rb-ico { width: 22px; height: 22px; border-radius: 7px; }
  .rb-ico .ico { width: 14px; height: 14px; }
  #rbName { font-size: 11px; }
  .modal-card.research { padding: 18px; max-height: calc(100dvh - 20px); }
  .rcard { margin-bottom: 8px; }
  .rtree { max-height: calc(100dvh - 300px); }
  .rdetail { flex-wrap: wrap; }
}

/* ---------- title menu: a slim, see-through card so the city stays the star ---------- */
#setup { background: radial-gradient(ellipse 520px 80% at calc(4vw + 230px) 50%, rgba(10, 14, 22, 0.35), rgba(10, 14, 22, 0) 70%); padding-left: 4vw; }
.setup-card {
  width: 460px; padding: 26px 26px 22px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(24, 30, 46, 0.55), rgba(12, 16, 26, 0.68));
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.setup-card::before { left: 26px; right: 26px; }
.setup-card h1 { font-size: 38px; margin: 14px 0 6px; }
.setup-card label { font-size: 11.5px; margin: 14px 0 7px; }
.setup-card #cityName { font-size: 24px; padding: 10px 16px; border-radius: 14px; }
/* lands: a 3×2 grid of small tiles, thumbnail beside the name */
.setup-card .regions { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.setup-card .region { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 5px; border-radius: 13px; font-size: 12.5px; text-align: left; }
.setup-card .region canvas.thumb { width: 44px; flex: none; margin: 0; border-radius: 9px; }
.setup-card .region:hover { transform: none; border-color: rgba(255, 255, 255, 0.28); }
.setup-card .chips { gap: 7px; }
.setup-card .chip { font-size: 13.5px; padding: 9px 2px; gap: 5px; border-radius: 13px; white-space: nowrap; min-width: 0; letter-spacing: -0.01em; }
.setup-card .chip svg { width: 15px; height: 15px; flex: none; }
.setup-card #terrains .chip:nth-child(3) { flex: 1.25; }   /* 'Mountains' is the longest word */
.setup-card .sizes .chip { font-size: 14px; padding: 7px 4px; }
.setup-card .sizes .chip small { font-size: 10.5px; }
.setup-card .cta { margin-top: 18px; font-size: 21px; padding: 15px; border-radius: 15px; box-shadow: 0 10px 30px rgba(255, 107, 61, 0.4); }
.setup-card .cta.ghost { margin-top: 9px; font-size: 15px; padding: 11px; box-shadow: none; }

@media (max-width: 760px) {
  /* phones: the card sits at the bottom and the city shows above it */
  #setup { align-items: flex-end; padding: 12px; background: linear-gradient(180deg, rgba(10, 14, 22, 0) 30%, rgba(10, 14, 22, 0.35)); }
  .setup-card { width: 100%; padding: 18px 16px 16px; border-radius: 22px; }
  .setup-card h1 { font-size: 26px; margin: 10px 0 2px; }
  .setup-card label { margin: 10px 0 6px; }
  .setup-card #cityName { font-size: 20px; padding: 8px 12px; }
  .setup-card .regions { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; overflow: visible; }
  .setup-card { margin: auto 0 0; }
  .setup-card .region { flex: none; flex-direction: column; font-size: 12px; gap: 3px; padding: 4px 4px 6px; text-align: center; }
  .setup-card .region canvas.thumb { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
  .setup-card .chip { font-size: 13px; padding: 8px 4px; }
  #terrains { flex-wrap: nowrap; }
  #terrains .chip { flex: 1; }
  #terrains .chip svg { display: none; }
  .setup-card .sizes .chip small { display: none; }
  .setup-card .cta { font-size: 19px; padding: 13px; margin-top: 14px; }
}

/* budget: income and spending, tax per zone, loans */
.bhead { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.taxes label { margin-top: 16px; }
.taxrow { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.taxrow b { text-align: right; font: 700 15px 'Space Grotesk'; }
.loanbox { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 13.5px; color: var(--muted); }
.loanbox b { color: #fff; }
.loanbox #loanText { flex: 1; }

/* ---------- date panel utility row: stats, photo, shortcuts ---------- */
.db-tools { display: flex; gap: 6px; margin-top: -4px; }
.db-tools button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.03); color: var(--muted); font: 600 12.5px 'Inter'; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.db-tools button:hover { color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.07); }
.db-tools #helpBtn { flex: 0 0 36px; }

/* ---------- stats ---------- */
.modal-card.stats { width: min(980px, calc(100vw - 20px)); max-width: none; position: relative; max-height: calc(100vh - 40px); overflow-y: auto; }
.stats .ix, .help .ix { position: absolute; right: 18px; top: 18px; width: 36px; height: 36px; border: 0; background: rgba(255,255,255,0.08); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.scard { border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 10px; background: rgba(255,255,255,0.03); }
.sc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sc-t { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sc-v { font: 700 22px 'Space Grotesk'; }
.sc-d { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.sc-d.up { color: var(--good); } .sc-d.down { color: var(--bad); }
.sc-svg { width: 100%; height: 92px; display: block; }
.sc-zero { stroke: rgba(255,255,255,0.2); stroke-dasharray: 3 3; }
.sc-axis { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; }
.sc-empty { height: 92px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.scard.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-content: center; }
.scard.facts div { display: flex; flex-direction: column; gap: 2px; }
.scard.facts span { font-size: 12px; color: var(--muted); }
.scard.facts b { font: 700 20px 'Space Grotesk'; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr; } }

/* ---------- shortcuts ---------- */
.modal-card.help { width: min(560px, calc(100vw - 20px)); position: relative; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin-top: 16px; align-items: center; font-size: 15px; }
.help-grid .hk { color: var(--muted); white-space: nowrap; }
.help-grid .hv { color: #fff; }
kbd { display: inline-block; min-width: 26px; padding: 3px 7px; margin: 0 2px; text-align: center; border: 1px solid rgba(255,255,255,0.22); border-bottom-width: 3px; border-radius: 7px; font: 700 12.5px 'Inter'; color: #fff; background: rgba(255,255,255,0.06); }

/* ---------- a new era ---------- */
.era-card { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(10,14,22,0.72), rgba(10,14,22,0.35)); cursor: pointer; }
.era-card .ec-in { text-align: center; padding: 0 24px; }
.era-card.show .ec-in > * { animation: ecIn .9s cubic-bezier(.2,.8,.2,1) both; }
.era-card.show .ec-title { animation-delay: .12s; } .era-card.show .ec-stats { animation-delay: .3s; } .era-card.show .ec-new { animation-delay: .45s; } .era-card.show .ec-hint { animation-delay: 1.2s; }
@keyframes ecIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.ec-kicker { color: var(--accent); font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: 14px; }
.ec-title { font: 700 clamp(44px, 8vw, 96px)/1 'Space Grotesk'; margin: 14px 0 26px; letter-spacing: -0.03em; text-shadow: 0 6px 40px rgba(0,0,0,0.4); }
.ec-stats { display: flex; justify-content: center; gap: 44px; }
.ec-stats div { display: flex; flex-direction: column; gap: 4px; }
.ec-stats b { font: 700 32px 'Space Grotesk'; }
.ec-stats span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; }
.ec-new { margin-top: 26px; color: rgba(255,255,255,0.8); font-size: 16px; max-width: 640px; }
.ec-hint { margin-top: 30px; color: rgba(255,255,255,0.45); font-size: 13px; }

/* ---------- photo mode ---------- */
body.photo #hud, body.photo .toast { display: none !important; }
body.photo::before, body.photo::after { content: ''; position: fixed; left: 0; right: 0; height: 7vh; background: #0b0f17; z-index: 9; pointer-events: none; }
body.photo::before { top: 0; } body.photo::after { bottom: 0; }
.photo-bar { position: fixed; left: 50%; bottom: calc(7vh + 16px); transform: translateX(-50%); z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px; border-radius: 16px; background: rgba(16,20,30,0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); opacity: .35; transition: opacity .3s; }
.photo-bar:hover { opacity: 1; }
.pb-name { font: 700 18px 'Space Grotesk'; }
.pb-sub { font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .db-tools button { font-size: 0; gap: 0; height: 28px; } .db-tools { margin-top: 0; } .ec-stats { gap: 22px; } }
