/* ==========================================================================
   Medievoxel UI — warm dark glass with gold accents
   ========================================================================== */
:root {
  --glass: rgba(28, 22, 17, 0.64);
  --glass-2: rgba(44, 35, 27, 0.72);
  --glass-hi: rgba(255, 240, 210, 0.08);
  --line: rgba(255, 232, 190, 0.16);
  --line-2: rgba(255, 232, 190, 0.28);
  --text: #fff6e6;
  --text-2: #d9cbb3;
  --text-3: #a89a84;
  --gold: #f2c14e;
  --gold-2: #ffdf8a;
  --gold-deep: #b9852a;
  --good: #7bd389;
  --bad: #ff7a6b;
  --warn: #ffb347;
  --blue: #7cc4ff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(10, 6, 2, 0.35), 0 2px 6px rgba(10, 6, 2, 0.25);
  --ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #c9cfbd; font-family: var(--ui); color: var(--text); user-select: none; -webkit-font-smoothing: antialiased; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; }

.glass {
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--ui); font-weight: 800; font-size: 15px; color: #2a1d0e; letter-spacing: .2px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-deep));
  border: 0; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  box-shadow: 0 4px 0 #8a5f17, 0 8px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a5f17, 0 3px 8px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6); }
.btn.ghost { background: rgba(255,240,210,.08); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: rgba(255,240,210,.16); }
.btn.danger { background: linear-gradient(180deg, #ff9a8c, #e2574a 60%, #b23a2f); color: #fff; box-shadow: 0 4px 0 #7e241c, 0 8px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.small { font-size: 13px; padding: 6px 12px; border-radius: 10px; box-shadow: 0 3px 0 #8a5f17, inset 0 1px 0 rgba(255,255,255,.6); }
.btn.small.ghost { box-shadow: inset 0 0 0 1px var(--line-2); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(255,240,210,.07); color: var(--text); font-size: 17px; font-weight: 900;
  transition: background .15s, transform .12s;
}
.icon-btn:hover { background: rgba(255,240,210,.18); transform: translateY(-1px); }

kbd {
  display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 7px; font: 800 12px var(--ui);
  color: var(--text); background: rgba(255,240,210,.12); border: 1px solid var(--line-2); border-bottom-width: 3px;
}

/* ==========================================================================
   HUD
   ========================================================================== */
#hud { position: fixed; inset: 0; pointer-events: none; animation: hud-in .7s cubic-bezier(.2,.8,.2,1) both; }
#hud > * { pointer-events: auto; }
@keyframes hud-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- resources ---------- */
#resources { position: absolute; top: 14px; left: 14px; display: flex; gap: 4px; padding: 6px; animation: drop-in .6s .05s both cubic-bezier(.2,.8,.2,1); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.res {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 11px;
  min-width: 104px; cursor: help; transition: background .2s;
}
.res:hover { background: rgba(255,240,210,.08); }
.res .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 19px; background: rgba(255,240,210,.09); box-shadow: inset 0 0 0 1px var(--line); }
.res .txt { display: flex; flex-direction: column; line-height: 1.05; }
.res .val { font-weight: 900; font-size: 18px; font-variant-numeric: tabular-nums; transition: color .3s; }
.res .rate { font-size: 11.5px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.res .rate.neg { color: var(--bad); }
.res .rate.zero { color: var(--text-3); }
.res.up .val { animation: flash-good .7s; }
.res.down .val { animation: flash-bad .7s; }
@keyframes flash-good { 0% { color: var(--good); transform: scale(1.15); } 100% { color: var(--text); transform: none; } }
@keyframes flash-bad { 0% { color: var(--bad); transform: scale(1.15); } 100% { color: var(--text); transform: none; } }
.res.alert { background: rgba(255,122,107,.16); animation: alert-pulse 1.4s infinite; }
.res.alert::after { content: '!'; position: absolute; top: -6px; right: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--bad); color: #fff; font-size: 12px; font-weight: 900; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
@keyframes alert-pulse { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,122,107,.3); } 50% { box-shadow: inset 0 0 0 1px rgba(255,122,107,.9), 0 0 14px rgba(255,122,107,.35); } }
.res-sep { width: 1px; background: var(--line); margin: 4px 2px; }

/* ---------- tier ---------- */
#tierbox { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; cursor: help; animation: slide-r .6s .12s both cubic-bezier(.2,.8,.2,1); }
@keyframes drop-in-c { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translateX(-50%); } }
.tier-crest { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: radial-gradient(circle at 30% 25%, #ffe9a8, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 3px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.tier-body { flex: 1; }
.tier-name { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: .5px; color: var(--gold-2); }
.tier-bar { height: 8px; border-radius: 6px; background: rgba(255,240,210,.12); overflow: hidden; margin: 4px 0 3px; }
.tier-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-2)); box-shadow: 0 0 10px rgba(242,193,78,.6); transition: width .6s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.tier-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: shine 2.6s infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.tier-next { font-size: 12px; font-weight: 700; color: var(--text-2); }

/* ---------- time ---------- */
#timebox { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; padding: 6px; animation: drop-in .6s .18s both cubic-bezier(.2,.8,.2,1); }
#clock { font-weight: 800; font-size: 14px; padding: 0 10px 0 8px; white-space: nowrap; cursor: help; }
.speed { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,.2); }
.speed button { width: 34px; height: 30px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; transition: background .15s, color .15s; }
.speed button:hover { background: rgba(255,240,210,.1); color: var(--text); }
.speed button.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0e; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#paused { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; background: rgba(28,22,17,.78); border: 1px solid var(--line-2); font-weight: 800; font-size: 14px; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* ---------- side: quests + advisor ---------- */
#side { position: absolute; top: 84px; left: 14px; width: 300px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#side > * { pointer-events: auto; }
#quest { padding: 12px 14px; animation: slide-r .6s .25s both cubic-bezier(.2,.8,.2,1); }
@keyframes slide-r { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.panel-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-h h3 { margin: 0; font-family: var(--display); font-size: 14px; letter-spacing: 1px; color: var(--gold-2); text-transform: uppercase; }
.panel-h .count { font-size: 12px; font-weight: 800; color: var(--text-3); }
.panel-h .collapse { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; padding: 2px 4px; }
#quest.min .q-body { display: none; }
.q-main { display: flex; gap: 10px; align-items: flex-start; }
.q-ico { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(242,193,78,.15); box-shadow: inset 0 0 0 1px rgba(242,193,78,.4); }
.q-title { font-weight: 900; font-size: 15.5px; line-height: 1.2; }
.q-desc { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.35; }
.q-prog { height: 6px; border-radius: 4px; background: rgba(255,240,210,.12); overflow: hidden; margin: 9px 0 4px; }
.q-prog i { display: block; height: 100%; background: linear-gradient(90deg, #4fb36a, var(--good)); transition: width .5s; }
.q-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.q-reward { font-size: 12px; font-weight: 800; color: var(--gold-2); }
.q-list { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.q-list li { display: flex; gap: 6px; padding: 1px 0; }
.q-list li.done { color: var(--good); }
.q-list li.cur { color: var(--text); font-weight: 800; }
#quest.complete-flash { animation: quest-done .9s; }
@keyframes quest-done { 0% { box-shadow: 0 0 0 0 rgba(123,211,137,.9), var(--shadow); } 100% { box-shadow: 0 0 0 18px rgba(123,211,137,0), var(--shadow); } }

#advisor { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border-color: rgba(255,179,71,.45); animation: pop-in .4s cubic-bezier(.2,1.4,.4,1) both; }
#advisor.bad { border-color: rgba(255,122,107,.6); }
#advisor .a-ico { font-size: 26px; line-height: 1; animation: bob 2s infinite ease-in-out; }
@keyframes bob { 50% { transform: translateY(-3px); } }
#advisor .a-who { font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--warn); }
#advisor.bad .a-who { color: var(--bad); }
#advisor .a-txt { font-size: 13.5px; line-height: 1.35; margin: 2px 0 8px; color: var(--text); }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- info panel ---------- */
#info { position: absolute; right: 14px; top: 84px; width: 300px; padding: 14px; animation: slide-l .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes slide-l { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.i-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.i-head img { width: 64px; height: 64px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, rgba(255,240,210,.18), rgba(255,240,210,.03)); box-shadow: inset 0 0 0 1px var(--line); }
.i-head h3 { margin: 0; font-family: var(--display); font-size: 18px; color: var(--gold-2); }
.i-head .stars { color: var(--gold); font-size: 14px; letter-spacing: 1px; }
.i-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.4; margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 9px; font-size: 12.5px; font-weight: 800; background: rgba(255,240,210,.08); box-shadow: inset 0 0 0 1px var(--line); }
.chip.good { color: var(--good); }
.chip.bad { color: var(--bad); }
.i-btns { display: flex; gap: 8px; margin-top: 14px; }
.i-btns .btn { flex: 1; }
.close-x { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 9px; border: 0; background: rgba(255,240,210,.08); color: var(--text-2); cursor: pointer; font-size: 14px; }
.close-x:hover { background: rgba(255,240,210,.18); color: var(--text); }

/* ---------- top buttons ---------- */
.top-btn {
  height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
  background: rgba(255,240,210,.07); color: var(--text); font-size: 13.5px; font-weight: 900; transition: background .15s, transform .12s, box-shadow .15s;
}
.top-btn:hover { background: rgba(255,240,210,.18); transform: translateY(-1px); }
.top-btn.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0e; box-shadow: 0 0 16px rgba(242,193,78,.5); border-color: transparent; }
.top-btn.war { background: linear-gradient(180deg, #ff9a8c, #e2574a); color: #fff; border-color: transparent; animation: alert-pulse 1.2s infinite; }

/* ---------- war room ---------- */
#war { position: absolute; right: 14px; top: 84px; width: 330px; padding: 14px; border-color: rgba(255,122,107,.55); animation: slide-l .4s both; max-height: calc(100vh - 290px); overflow-y: auto; }
#war h3 { margin: 0; font-family: var(--display); color: #ffb3a9; font-size: 17px; letter-spacing: .5px; }
#war .w-sub { font-size: 12.5px; color: var(--text-2); margin: 2px 0 10px; }
#war .w-time { height: 6px; border-radius: 4px; background: rgba(255,240,210,.12); overflow: hidden; margin-bottom: 12px; }
#war .w-time i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a6b, var(--warn)); transition: width .3s; }
.w-reserve { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,240,210,.06); margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.w-reserve span { flex: 1; color: var(--text-2); }
.w-zone { padding: 10px; border-radius: 13px; margin-bottom: 8px; background: rgba(255,122,107,.1); box-shadow: inset 0 0 0 1px rgba(255,122,107,.4); }
.w-zone.fight { background: rgba(255,179,71,.1); box-shadow: inset 0 0 0 1px rgba(255,179,71,.45); }
.w-zone.safe { background: rgba(123,211,137,.08); box-shadow: inset 0 0 0 1px rgba(123,211,137,.35); }
.w-zone .wz-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-weight: 900; font-size: 13.5px; cursor: pointer; }
.w-zone .wz-st { font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 7px; background: rgba(255,122,107,.3); color: #ffd2cc; white-space: nowrap; }
.w-zone.fight .wz-st { background: rgba(255,179,71,.3); color: #ffe2b8; }
.w-zone.safe .wz-st { background: rgba(123,211,137,.25); color: #c8f2cf; }
.w-zone .wz-info { font-size: 12.5px; color: var(--text-2); margin: 4px 0 8px; }
.w-zone .wz-btns { display: flex; gap: 6px; }
.w-zone .wz-btns .btn { flex: 1; padding: 6px 6px; font-size: 12px; }
.w-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.w-foot .row { display: flex; gap: 8px; }
.w-foot .row .btn { flex: 1; }

#war-labels { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.zone-label { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: 12px; white-space: nowrap; font-family: var(--ui);
  background: rgba(60,14,10,.82); border: 1px solid rgba(255,122,107,.8); box-shadow: 0 0 22px rgba(255,90,70,.45); color: #fff; animation: zone-glow 1.4s ease-in-out infinite; }
/* glow only: the element's transform is its screen position, so it must not be animated */
@keyframes zone-glow { 50% { box-shadow: 0 0 6px rgba(255,90,70,.2); } }
.zone-label b { font-size: 13.5px; font-weight: 900; }
.zone-label small { font-size: 11.5px; font-weight: 800; color: #ffd2cc; }
.zone-label[data-dist]:not([data-dist=""])::after { content: attr(data-dist); font-size: 11px; font-weight: 800; color: #ffd2cc; }
.zone-label.fight { background: rgba(60,40,10,.82); border-color: rgba(255,179,71,.8); box-shadow: 0 0 22px rgba(255,179,71,.4); }
.zone-label.safe { background: rgba(14,40,20,.78); border-color: rgba(123,211,137,.7); box-shadow: none; animation: none; }
.zone-arrow { position: absolute; left: 0; top: 0; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(60,14,10,.85); border: 2px solid rgba(255,122,107,.9); box-shadow: 0 0 20px rgba(255,90,70,.6); color: #fff; font-weight: 900; font-size: 12px; }
.zone-arrow::before { content: ''; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); border: 9px solid transparent; border-left: 12px solid rgba(255,122,107,.95); }

/* ---------- first person ---------- */
#fps { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
#fps > * { pointer-events: auto; }
#fps-vignette { position: absolute; inset: 0; pointer-events: none !important; box-shadow: inset 0 0 160px 40px rgba(200,20,10,0); transition: box-shadow .25s; }
#fps-vignette.hurt { box-shadow: inset 0 0 180px 60px rgba(200,20,10,.55); transition: none; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none !important; }
.crosshair i { position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 2px rgba(0,0,0,.8); }
.crosshair i:nth-child(1) { left: 10px; top: 0; width: 2px; height: 7px; } .crosshair i:nth-child(2) { left: 10px; bottom: 0; width: 2px; height: 7px; }
.crosshair i:nth-child(3) { top: 10px; left: 0; height: 2px; width: 7px; } .crosshair i:nth-child(4) { top: 10px; right: 0; height: 2px; width: 7px; }
#fps-bow { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); width: 90px; height: 6px; border-radius: 4px; background: rgba(0,0,0,.35); overflow: hidden; pointer-events: none !important; opacity: 0; transition: opacity .15s; }
#fps-bow.on { opacity: 1; }
#fps-bow i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), #fff3c4); }
#fps-compass { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(40,10,8,.7); border: 1px solid rgba(255,122,107,.6); color: #ffd2cc; font-weight: 800; font-size: 13px; pointer-events: none !important; white-space: nowrap; }
#fps-compass .cmp-arrow { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e2574a; color: #fff; font-size: 12px; transition: transform .12s; }
#fps-compass.close { background: rgba(120,20,10,.85); animation: alert-pulse 1s infinite; }
#fps-radar { position: absolute; right: 14px; bottom: 112px; width: 180px; height: 180px; pointer-events: none !important; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
#fps-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 8px 16px; font-weight: 900; font-size: 14px; white-space: nowrap; pointer-events: none !important; }
#fps-top .red { color: #ffb3a9; }
#fps-hp { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 8px; pointer-events: none !important; }
#fps-hp .hp-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: radial-gradient(circle at 30% 25%, #ffe9a8, var(--gold) 50%, var(--gold-deep)); }
#fps-hp b { font-family: var(--display); color: var(--gold-2); font-size: 14px; }
.hp-bar { width: 200px; height: 10px; border-radius: 6px; background: rgba(255,240,210,.12); overflow: hidden; margin-top: 4px; }
.hp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d9483a, #ff8a6b); transition: width .2s; }
.st-bar { width: 200px; height: 6px; border-radius: 4px; background: rgba(255,240,210,.12); overflow: hidden; margin-top: 4px; }
.st-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #d6b84a, #f6e27a); transition: width .1s; }
.st-bar i.low { background: linear-gradient(90deg, #a87a2a, #d9a040); animation: blink .6s infinite; }
.crosshair.hit i { background: #fff; box-shadow: 0 0 6px #fff; animation: xhair .25s; }
.crosshair.kill i { background: #ff4a3a; box-shadow: 0 0 6px #ff4a3a; animation: xhair .35s; }
.crosshair.charged { animation: charged .5s infinite; }
@keyframes xhair { 0% { transform: scale(1.8); } 100% { transform: none; } }
@keyframes charged { 50% { transform: translate(-50%, -50%) scale(1.25); } }
#fps-flash { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: 1px; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 18px rgba(0,0,0,.5); pointer-events: none !important; opacity: 0; animation: flash-word 1s forwards; }
#fps-flash.parry { color: var(--gold-2); text-shadow: 0 0 20px rgba(242,193,78,.9), 0 3px 0 rgba(0,0,0,.4); }
#fps-flash.bad { color: #ff9a8c; } #fps-flash.good { color: #b8f5c2; } #fps-flash.warn { color: #ffd27a; font-size: 22px; }
@keyframes flash-word { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
.float.dmg { color: #fff3d6; font-size: 20px; }
.float.crit { color: #ffcf4a; font-size: 28px; text-shadow: 0 0 10px rgba(255,180,40,.8), 0 2px 4px rgba(0,0,0,.7); }
#fps-weapons { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; padding: 8px; pointer-events: none !important; }
#fps-weapons div { padding: 6px 10px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--text-2); }
#fps-weapons div.on { background: rgba(242,193,78,.2); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(242,193,78,.5); }
#fps-help { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 70%; font-size: 12.5px; font-weight: 700; color: #f3e6cc; text-shadow: 0 1px 4px rgba(0,0,0,.8); pointer-events: none !important; }
#fps-help span { display: flex; gap: 5px; align-items: center; }
#fps-msg { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); padding: 14px 26px; border-radius: 16px; background: rgba(40,10,8,.82); border: 1px solid rgba(255,122,107,.7); font-family: var(--display); font-size: 22px; color: #ffd2cc; pointer-events: none !important; text-align: center; }
#fps-pause { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,10,5,.45); }
#fps-pause .fp-box { width: min(380px, calc(100% - 32px)); padding: 22px; text-align: center; }
#fps-pause h2 { font-family: var(--display); color: var(--gold-2); margin: 0 0 6px; }
#fps-pause p { color: var(--text-2); font-size: 14px; margin: 0 0 16px; }
#fps-pause .btns { display: flex; flex-direction: column; gap: 10px; }

/* ---------- land for sale ---------- */
#hud > #plot-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plot-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 8px;
  border-radius: 16px; cursor: pointer; color: var(--text); font-family: var(--ui); white-space: nowrap;
  background: linear-gradient(180deg, rgba(44,35,27,.88), rgba(28,22,17,.82)); border: 1px solid rgba(242,193,78,.65);
  box-shadow: var(--shadow), 0 0 22px rgba(242,193,78,.25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: box-shadow .2s, border-color .2s;
}
.plot-label::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); background: rgba(28,22,17,.85); border-right: 1px solid rgba(242,193,78,.65); border-bottom: 1px solid rgba(242,193,78,.65); }
.plot-label > * { animation: label-bob 2.6s ease-in-out infinite; }
@keyframes label-bob { 50% { transform: translateY(-3px); } }
.plot-label:hover { border-color: var(--gold-2); box-shadow: var(--shadow), 0 0 34px rgba(242,193,78,.55); }
.plot-label .pl-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: rgba(242,193,78,.18); box-shadow: inset 0 0 0 1px rgba(242,193,78,.4); }
.plot-label .pl-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.plot-label b { font-size: 13.5px; font-weight: 900; }
.plot-label small { font-size: 12px; font-weight: 800; color: var(--text-2); }
.plot-label small .miss { color: var(--bad); }
.plot-label .pl-cta { padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 900; color: var(--text-2); background: rgba(255,240,210,.08); }
.plot-label.afford .pl-cta { color: #2a1d0e; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 2px 8px rgba(242,193,78,.5); }

/* ---------- tool banner ---------- */
#toolbar {
  position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: rgba(28,22,17,.82); border: 1px solid rgba(242,193,78,.5); box-shadow: var(--shadow), 0 0 22px rgba(242,193,78,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 700; white-space: nowrap; animation: pop-in .25s both;
}
#toolbar.demolish { border-color: rgba(255,122,107,.7); box-shadow: var(--shadow), 0 0 22px rgba(255,122,107,.25); }
#toolbar .t-name { color: var(--gold-2); font-weight: 900; }
#toolbar.demolish .t-name { color: var(--bad); }
.t-width { display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12.5px; }
.w-btn { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255,240,210,.06); color: var(--text); font-weight: 900; cursor: pointer; }
.w-btn.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0e; border-color: transparent; }
#toolbar .t-keys { display: flex; gap: 10px; color: var(--text-2); font-size: 12.5px; }

/* ---------- build bar ---------- */
#buildbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 8px 10px 10px; animation: rise .6s .1s both cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translateX(-50%); } }
#tabs { display: flex; gap: 4px; margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-2); font-weight: 800; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s;
}
.tab:hover { background: rgba(255,240,210,.08); color: var(--text); }
.tab.on { background: rgba(242,193,78,.16); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(242,193,78,.45); }
.tab .new { position: absolute; top: -3px; right: -2px; padding: 1px 5px; border-radius: 6px; font-size: 9px; font-weight: 900; background: var(--bad); color: #fff; animation: bob 1.4s infinite; }
.tab.demolish-tab { margin-left: auto; color: #ffb3a9; }
.tab.demolish-tab.on { background: rgba(255,122,107,.18); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255,122,107,.6); }
#cards { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding: 2px; min-height: 112px; }
.card {
  position: relative; flex: 0 0 auto; width: 104px; padding: 8px 6px 7px; border-radius: 14px; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, rgba(255,240,210,.1), rgba(255,240,210,.03));
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s cubic-bezier(.2,1.4,.4,1), background .15s, box-shadow .15s;
  animation: card-in .35s both cubic-bezier(.2,.8,.2,1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-5px); background: linear-gradient(180deg, rgba(255,240,210,.18), rgba(255,240,210,.06)); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 20px rgba(0,0,0,.3); }
.card.active { background: linear-gradient(180deg, rgba(242,193,78,.32), rgba(242,193,78,.08)); box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px rgba(242,193,78,.35); transform: translateY(-5px); }
.card img { width: 60px; height: 60px; display: block; margin: 0 auto; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); transition: transform .2s; }
.card:hover img { transform: scale(1.08) rotate(-2deg); }
.card .nm { font-weight: 900; font-size: 13px; line-height: 1.1; margin-top: 3px; }
.card .cost { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 6px; margin-top: 4px; font-size: 11.5px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.card .cost .miss { color: var(--bad); }
.card .key { position: absolute; top: 5px; left: 6px; font-size: 10px; font-weight: 900; color: var(--text-3); }
.card.locked { cursor: not-allowed; }
.card.locked img { filter: grayscale(1) brightness(.6); }
.card.locked .nm { opacity: .7; }
.card .lock { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 7px; background: rgba(20,15,10,.6); box-shadow: inset 0 0 0 1px var(--line); font-size: 10.5px; font-weight: 900; color: var(--text-2); }
.card.locked .cost { display: none; }
.card .new-badge { position: absolute; top: -6px; right: -4px; padding: 2px 6px; border-radius: 7px; font-size: 9.5px; font-weight: 900; background: var(--bad); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); animation: bob 1.4s infinite; }
.card.hl { animation: card-hl 1.2s 3; }
@keyframes card-hl { 50% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 24px rgba(242,193,78,.8); transform: translateY(-8px); } }

/* ---------- tooltip ---------- */
#tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px; padding: 10px 12px; border-radius: 12px;
  background: rgba(22,17,13,.94); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; color: var(--text-2);
  animation: tip-in .12s both;
}
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#tip h4 { margin: 0 0 3px; color: var(--text); font-size: 14.5px; font-weight: 900; }
#tip .t-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
#tip .t-row b { color: var(--text); }
#tip .t-good { color: var(--good); font-weight: 800; }
#tip .t-bad { color: var(--bad); font-weight: 800; }
#tip .t-hint { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--gold-2); font-weight: 700; }
#tip hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

#hint { position: fixed; z-index: 40; pointer-events: none; padding: 6px 11px; border-radius: 10px; font-size: 13px; font-weight: 800; transform: translate(16px, 16px); white-space: nowrap; background: rgba(22,17,13,.92); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
#hint.bad { color: #ffc2ba; border-color: rgba(255,122,107,.6); }
#hint.ok { color: #c8f2cf; border-color: rgba(123,211,137,.6); }

/* ---------- toasts & floating numbers ---------- */
#toasts { position: fixed; z-index: 30; top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 800;
  background: rgba(22,17,13,.9); border: 1px solid var(--line-2); border-left: 4px solid var(--gold); box-shadow: var(--shadow);
  animation: toast 3.8s forwards cubic-bezier(.2,.8,.2,1);
}
.toast .ti { font-size: 18px; }
.toast .tn { margin-left: 4px; padding: 1px 7px; border-radius: 8px; background: rgba(255,240,210,.14); font-size: 12px; }
.toast .tn:empty { display: none; }
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); color: #ffd2cc; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px) scale(.96); } 7%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
#floats { position: fixed; inset: 0; pointer-events: none; z-index: 35; }
.float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 16px; white-space: nowrap; text-shadow: 0 2px 4px rgba(0,0,0,.6), 0 0 2px rgba(0,0,0,.8); animation: float-up 1.4s forwards cubic-bezier(.2,.8,.2,1); }
.float.bad { color: #ffb3a9; }
.float.good { color: #b8f5c2; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }

/* ---------- modal ---------- */
#modal { position: fixed; z-index: 60; inset: 0; background: radial-gradient(ellipse at center, rgba(15,10,5,.6), rgba(15,10,5,.85)); display: flex; align-items: center; justify-content: center; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box.glass { background: linear-gradient(180deg, #3a2e23, #251c15); }
.modal-box { position: relative; width: min(460px, calc(100% - 32px)); padding: 26px 28px 24px; text-align: center; animation: modal-in .45s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.modal-box .big-ico { width: 76px; height: 76px; margin: -62px auto 6px; border-radius: 22px; display: grid; place-items: center; font-size: 40px; background: radial-gradient(circle at 30% 25%, #ffe9a8, var(--gold) 50%, var(--gold-deep)); box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.6); animation: ico-pop .6s .1s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes ico-pop { from { transform: scale(0) rotate(-20deg); } to { transform: none; } }
.modal-box h2 { font-family: var(--display); font-weight: 800; margin: 6px 0 8px; color: var(--gold-2); font-size: 24px; }
.modal-box p { font-size: 15.5px; line-height: 1.5; color: #efe3cc; margin: 0; }
.modal-box .btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.modal-box .btns.col { flex-direction: column; align-items: stretch; }
.modal-box .btns.col .btn { width: 100%; }
.slides { position: relative; text-align: left; }
.slide { display: none; animation: slide-r .35s both; }
.slide.on { display: block; }
.slide .s-art { font-size: 42px; text-align: center; margin: 4px 0 6px; }
.slide h3 { text-align: center; font-family: var(--display); color: var(--gold-2); margin: 0 0 10px; font-size: 19px; }
.slide ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.slide li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 11px; background: rgba(255,240,210,.1); font-size: 14.5px; color: #fff8ec; }
.slide li .li-ico { font-size: 20px; width: 28px; text-align: center; flex: 0 0 auto; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,240,210,.2); transition: background .2s, width .2s; }
.dots i.on { background: var(--gold); width: 22px; border-radius: 6px; }

/* ==========================================================================
   Title screen
   ========================================================================== */
#title { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .8s, transform .8s; }
#title.leaving { opacity: 0; transform: scale(1.06); pointer-events: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(ellipse 70% 60% at 50% 45%, rgba(20,14,8,.0) 0%, rgba(20,14,8,.35) 70%, rgba(20,14,8,.72) 100%),
  linear-gradient(180deg, rgba(20,14,8,.25), transparent 30%, transparent 70%, rgba(20,14,8,.5)); }
.motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.motes i { position: absolute; bottom: -10px; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #fff6c8, rgba(242,193,78,.6) 45%, transparent 70%); animation: mote linear infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 90% { opacity: .9; } 100% { transform: translate(var(--dx), -110vh); opacity: 0; } }
.title-box { position: relative; text-align: center; padding: 20px; }
.crest { font-size: 34px; color: var(--gold); text-shadow: 0 0 18px rgba(242,193,78,.8); animation: crest-in 1s .2s both cubic-bezier(.2,1.4,.4,1), glow 3s 1.2s infinite ease-in-out; }
@keyframes crest-in { from { opacity: 0; transform: translateY(-20px) scale(.5); } to { opacity: 1; transform: none; } }
@keyframes glow { 50% { text-shadow: 0 0 30px rgba(242,193,78,1); } }
.logo {
  position: relative; margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(54px, 10vw, 128px); letter-spacing: 6px; line-height: 1;
  background: linear-gradient(180deg, #fffaf0 0%, #ffe6a6 45%, #e9b54a 70%, #b9852a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #5a3a16) drop-shadow(0 14px 30px rgba(0,0,0,.55));
}
.logo .ch { display: inline-block; animation: letter-in .8s both cubic-bezier(.2,1.3,.4,1); background: inherit; -webkit-background-clip: text; background-clip: text; }
@keyframes letter-in { from { opacity: 0; transform: translateY(40px) rotate(8deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.logo::after {
  content: attr(data-text); position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.9) 50%, transparent 65%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: logo-shine 4.5s 1.4s infinite;
}
@keyframes logo-shine { from { background-position: 150% 0; } 45%, to { background-position: -100% 0; } }
.title-box .sub { font-size: clamp(15px, 2vw, 19px); font-weight: 700; color: #fff3dc; margin: 12px 0 30px; text-shadow: 0 2px 10px rgba(0,0,0,.7); animation: fade-up .8s 1s both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.title-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 290px)); gap: 12px; justify-content: center; }
.menu-card {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 18px; border-radius: 18px; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, rgba(44,35,27,.78), rgba(28,22,17,.7)); border: 1px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .2s cubic-bezier(.2,1.4,.4,1), box-shadow .2s, border-color .2s; animation: fade-up .7s both; position: relative; overflow: hidden;
}
.menu-card:nth-child(1) { animation-delay: 1.15s; } .menu-card:nth-child(2) { animation-delay: 1.25s; } .menu-card:nth-child(3) { animation-delay: 1.35s; } .menu-card:nth-child(4) { animation-delay: 1.45s; }
.menu-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,240,210,.18) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s; }
.menu-card:hover::before { transform: translateX(120%); }
.menu-card:hover { transform: translateY(-4px) scale(1.02); border-color: rgba(242,193,78,.7); box-shadow: var(--shadow), 0 0 26px rgba(242,193,78,.3); }
.menu-card:active { transform: translateY(0) scale(.99); }
.menu-card.primary { background: linear-gradient(180deg, rgba(242,193,78,.95), rgba(185,133,42,.95)); color: #2a1d0e; border-color: rgba(255,230,160,.9); }
.menu-card.primary small { color: #4a3416; }
.menu-card.primary .mc-ico { background: rgba(255,255,255,.35); }
.menu-card.subtle { background: rgba(28,22,17,.5); }
.mc-ico { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: rgba(255,240,210,.1); }
.mc-txt { display: flex; flex-direction: column; }
.mc-txt b { font-size: 18px; font-weight: 900; }
.mc-txt small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.title-foot { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; font-weight: 700; color: #f3e6cc; text-shadow: 0 1px 6px rgba(0,0,0,.7); animation: fade-up .8s 1.7s both; }
.title-foot span { display: flex; align-items: center; gap: 6px; }

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at 50% 40%, #3a2c1e, #15100b 75%); transition: opacity .9s; }
#loader.done { opacity: 0; pointer-events: none; }
.loader-logo { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6vw, 64px); letter-spacing: 5px; background: linear-gradient(180deg, #fffaf0, #e9b54a 70%, #b9852a); -webkit-background-clip: text; background-clip: text; color: transparent; animation: glow-pulse 2s infinite ease-in-out; }
@keyframes glow-pulse { 50% { filter: drop-shadow(0 0 16px rgba(242,193,78,.6)); } }
.loader-ring { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,240,210,.12); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-txt { font-weight: 700; color: var(--text-2); letter-spacing: .5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #toolbar { bottom: 250px; }
}
@media (max-width: 760px) {
  .res { min-width: 0; padding: 4px 6px 4px 4px; }
  .res .rate { display: none; }
  .res .ico { width: 26px; height: 26px; font-size: 15px; }
  .res .val { font-size: 15px; }
  #resources { flex-wrap: wrap; right: 14px; }
  #timebox { top: auto; bottom: 186px; right: 14px; }
  #side { width: 240px; top: 120px; }
  #side .q-list, #advisor { display: none !important; }
  #tierbox { display: none; }
  #info { top: auto; bottom: 186px; width: auto; left: 14px; }
  .title-buttons { grid-template-columns: minmax(0, 1fr); }
  .title-foot { display: none; }
  #toolbar .t-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }

/* ---------- news cards (non-blocking events) ---------- */
#news { position: fixed; z-index: 31; top: 84px; right: 14px; width: 320px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#war:not(.hidden) ~ #news, body:has(#war:not(.hidden)) #news { top: auto; bottom: 200px; }
.news { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-left: 4px solid var(--gold); animation: slide-l .35s both; transition: opacity .4s, transform .4s; }
.news.good { border-left-color: var(--good); } .news.bad { border-left-color: var(--bad); }
.news.out { opacity: 0; transform: translateX(20px); }
.news .n-ico { font-size: 24px; line-height: 1; }
.news .n-body { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.35; }
.news .n-body b { color: var(--text); font-size: 14px; }
.news .n-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; }
/* ---------- construction sites ---------- */
#hud > #build-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.build-label { position: absolute; left: 0; top: 0; padding: 4px 8px 5px; border-radius: 9px; background: rgba(22,17,13,.85); border: 1px solid var(--line-2); font-size: 11.5px; font-weight: 900; color: var(--text); white-space: nowrap; }
.build-label i { display: block; height: 4px; margin-top: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); }
/* ---------- first person extras ---------- */
#fps-res { position: absolute; top: 14px; left: 14px; padding: 7px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; pointer-events: none !important; }
#fps-res.hungry { border-color: rgba(255,122,107,.8); color: #ffd2cc; }
#fps-exit { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; align-items: center; }
