/* ===================================================================
   Throneshard UI — fonts, tokens, primitives
   =================================================================== */
@font-face { font-family: 'Cinzel'; src: url('../../assets/ui/fonts/cinzel.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Cinzel Decorative'; src: url('../../assets/ui/fonts/cinzel-decorative-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../../assets/ui/fonts/rajdhani-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../../assets/ui/fonts/rajdhani-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Rajdhani'; src: url('../../assets/ui/fonts/rajdhani-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Radley'; src: url('../../assets/ui/fonts/radley-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }

.ui-root {
  --gold: #c8a255; --gold-hi: #f1d9a0; --gold-lo: #6d5326; --gold-dk: #3a2c14;
  --bronze: #8a6a3a;
  --panel: rgba(16, 19, 23, 0.92); --panel2: rgba(26, 30, 36, 0.94);
  --text: #d8d0bc; --dim: #8d8676; --faint: #5d584e;
  --rad: #6cc84a; --rad-dk: #2f6d1f; --duskward: #e0503a; --duskward-dk: #7a2016;
  --hp: #43b92f; --hp-hi: #7ee05a; --mana: #2f7ee0; --mana-hi: #6cb2ff;
  --str: #e2412c; --agi: #35c94f; --int: #2e9be6;
  --f-title: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --f-ui: 'Rajdhani', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Radley', Georgia, serif;
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0.22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden;
  font-family: var(--f-ui); color: var(--text); font-size: 14px; user-select: none; -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}
.ui-root *, .ui-root *::before, .ui-root *::after { box-sizing: border-box; }
.ui-root button { font-family: inherit; cursor: pointer; }
.ui-root kbd { font-family: var(--f-ui); font-weight: 700; font-size: 11px; padding: 1px 5px; border-radius: 3px; background: linear-gradient(#3a3c40, #1c1d20); border: 1px solid #55504a; border-bottom-width: 2px; color: #e8dcc0; }

#game-canvas { transition: filter 0.8s ease; }
#game-canvas.ui-dead { filter: grayscale(0.9) brightness(0.72) contrast(1.05); }

/* Panels */
.panel-frame {
  position: relative; pointer-events: auto;
  background: var(--noise), linear-gradient(180deg, rgba(30, 34, 40, 0.95), rgba(12, 14, 17, 0.96));
  border: 1px solid #4a3d25;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 230, 170, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.6);
}
.panel-frame::before { content: ''; position: absolute; inset: 2px; border: 1px solid rgba(200, 162, 85, 0.16); pointer-events: none; }
.panel-inset { background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(0, 0, 0, 0.7); box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.04); }

/* Buttons */
.btn-game {
  pointer-events: auto; font-family: var(--f-ui); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px;
  color: #eadbb5; padding: 9px 20px; border: 1px solid #7a6030; border-radius: 2px;
  background: linear-gradient(180deg, #4a3b20 0%, #2e2413 55%, #221a0d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25), 0 2px 6px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px #000; transition: filter 0.15s, transform 0.08s, border-color 0.15s;
}
.btn-game:hover { filter: brightness(1.3); border-color: #c8a255; }
.btn-game:active { transform: translateY(1px); }
.btn-game.dim { background: linear-gradient(180deg, #33363b, #1d1f23); border-color: #4c4a44; color: #cfc6b0; }
.btn-game.dim:hover { border-color: #8d7a50; }
.btn-game.red { background: linear-gradient(180deg, #6a2418, #3a120b); border-color: #9a3a26; }

.btn-play {
  pointer-events: auto; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; padding: 16px 24px; border: 1px solid #9ad06a; border-radius: 2px; overflow: hidden;
  background: linear-gradient(180deg, #4d8a2c 0%, #2c5e17 50%, #1d4510 100%);
  box-shadow: inset 0 1px 0 rgba(220, 255, 180, 0.5), inset 0 -8px 20px rgba(0, 0, 0, 0.35), 0 0 24px rgba(110, 200, 70, 0.25), 0 4px 12px rgba(0, 0, 0, 0.7);
  color: #f4ffe8; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.8); transition: filter 0.15s, transform 0.08s;
}
.btn-play span { font-family: var(--f-title); font-weight: 700; font-size: 24px; letter-spacing: 0.14em; }
.btn-play em { font-style: normal; font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: #cfeab8; opacity: 0.85; }
.btn-play::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent); animation: sheen 3.2s ease-in-out infinite; }
.btn-play:hover { filter: brightness(1.15) saturate(1.1); }
.btn-play:active { transform: translateY(1px); }
.btn-play.small { width: auto; padding: 12px 48px; }
.btn-play.small span { font-size: 20px; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }

.seg { display: flex; pointer-events: auto; border: 1px solid #4a3d25; background: rgba(0, 0, 0, 0.5); border-radius: 2px; }
.seg button { flex: 1; padding: 7px 10px; background: transparent; border: 0; border-right: 1px solid rgba(74, 61, 37, 0.7); color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; transition: all 0.15s; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); background: rgba(200, 162, 85, 0.08); }
.seg button.on { color: #fff3d0; background: linear-gradient(180deg, rgba(200, 162, 85, 0.35), rgba(120, 90, 40, 0.25)); box-shadow: inset 0 0 0 1px rgba(241, 217, 160, 0.4); }
.seg.big button { padding: 10px; font-size: 14px; }

.chip { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #cfc3a4; background: rgba(200, 162, 85, 0.12); border: 1px solid rgba(200, 162, 85, 0.3); border-radius: 2px; }

/* Attribute orbs */
.orb { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.5); }
.orb-str { background: radial-gradient(circle at 35% 30%, #ffb09a, #e2412c 45%, #6a130a 100%); }
.orb-agi { background: radial-gradient(circle at 35% 30%, #c4ffc0, #35c94f 45%, #0f5a1c 100%); }
.orb-int { background: radial-gradient(circle at 35% 30%, #bfe8ff, #2e9be6 45%, #0b3a66 100%); }
.orb-uni { background: conic-gradient(#e2412c 0 120deg, #35c94f 0 240deg, #2e9be6 0); }

/* Small glyph icons */
.i-gold { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; background: radial-gradient(circle at 35% 30%, #fff5c0, #f0b92a 45%, #7a4c06 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 6px rgba(255, 190, 60, 0.4); }
.i-gold.big { width: 18px; height: 18px; }
.i-mana { display: inline-block; width: 10px; height: 10px; margin-right: 4px; background: linear-gradient(135deg, #7cc0ff, #1d5fc0); transform: rotate(45deg); vertical-align: 0; }
.i-cd { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; border: 2px solid #b8b0a0; border-top-color: transparent; vertical-align: -1px; }
.i-shop { display: inline-block; width: 16px; height: 14px; margin-right: 6px; vertical-align: -2px; background: linear-gradient(#f1d9a0, #b08840); clip-path: polygon(10% 30%, 90% 30%, 80% 100%, 20% 100%, 10% 30%, 30% 30%, 35% 0, 65% 0, 70% 30%, 60% 30%, 58% 12%, 42% 12%, 40% 30%); }

/* Icons */
.ic-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ic-glyph { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 1.6em; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.8)); }
.ic-glyph.dim { opacity: 0.25; filter: grayscale(1); }
.ic-text { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-family: var(--f-title); font-weight: 700; font-size: 1.05em; color: #f5e8c8; text-shadow: 0 1px 3px #000;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.25), transparent 55%), var(--ic-bg, #3b3325); }

/* Portraits (fallback: gradient card with glyph / initials) */
.portrait { position: relative; overflow: hidden; background-color: #111; background-size: cover; background-position: center 25%;
  background-image: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.22), transparent 60%), linear-gradient(160deg, var(--hc, #444) 0%, color-mix(in srgb, var(--hc, #444) 55%, #000) 70%, #050505 100%); }
.portrait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 45%), radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--ac, #888) 35%, transparent), transparent 60%); pointer-events: none; }
.portrait.has-img .pt-glyph, .portrait.has-img .pt-init { display: none; }
.portrait.has-img::after { background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), transparent 40%); }
.pt-glyph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2em; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7)); opacity: 0.9; }
.pt-glyph.big { font-size: 3em; }
.pt-init { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 1.1em; letter-spacing: 0.05em; color: rgba(255, 245, 220, 0.9); text-shadow: 0 2px 4px #000; z-index: 1; }
.pt-glyph:not(:empty) + .pt-init { font-size: 0.8em; opacity: 0.8; }
.pt-glyph:empty + .pt-init { top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9em; color: rgba(255, 240, 210, 0.85); }

.t-sunward { color: #8ee06a; }
.t-duskward { color: #ff7a60; }
.t-neutral { color: #e0c070; }

/* ===================================================================
   Tooltip
   =================================================================== */
.ui-tooltip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.1s; max-width: 340px; }
.ui-tooltip.show { opacity: 1; }
.tt { background: linear-gradient(180deg, #1f2328 0%, #121418 100%); border: 1px solid #5a4a2a; box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, 0.8); min-width: 220px; font-size: 13px; }
.tt-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: linear-gradient(180deg, rgba(200, 162, 85, 0.18), rgba(200, 162, 85, 0.02)); border-bottom: 1px solid rgba(200, 162, 85, 0.25); }
.tt-icon { width: 44px; height: 44px; flex: none; border: 1px solid #000; box-shadow: 0 0 0 1px #5a4a2a; overflow: hidden; font-size: 13px; }
.tt-icon.item { width: 58px; height: 42px; }
.tt-title { font-family: var(--f-title); font-weight: 700; font-size: 15px; color: #fff1cf; letter-spacing: 0.03em; }
.tt-simple .tt-title { padding: 8px 12px 0; }
.tt-simple .tt-body { padding-top: 4px; }
.tt-sub { font-size: 12px; color: var(--dim); font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.tt-sub.gold { color: #f3c64a; font-weight: 700; font-size: 14px; }
.tt-secret { font-size: 10px; color: #c89aff; text-transform: uppercase; letter-spacing: 0.1em; }
.tt-pips { display: inline-flex; gap: 2px; }
.tt-pips i { width: 8px; height: 4px; background: #333; border: 1px solid #000; }
.tt-pips i.on { background: #f1c24a; }
.tt-body { padding: 8px 12px 10px; }
.tt-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.tt-kv b { color: #e8e0cc; font-weight: 700; }
.tt-kv b span { color: var(--dim); }
.tt-kv b span.cur { color: #fff; }
.tt-kv em { font-style: normal; color: var(--dim); font-size: 11px; }
.tt-kv .orb { width: 10px; height: 10px; }
.tt-desc { margin: 6px 0; color: #cfc6b2; line-height: 1.4; font-size: 13px; }
.tt-lore { margin: 8px 0 0; font-family: var(--f-body); font-style: italic; color: #7e786a; font-size: 12px; line-height: 1.4; }
.tt-dim { color: var(--dim); }
.tt-hint { margin-top: 6px; color: #a09060; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.tt-foot { display: flex; gap: 16px; padding: 6px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); background: rgba(0, 0, 0, 0.3); font-weight: 700; font-size: 13px; }
.tt-cd { color: #d0c8b8; }
.tt-mana { color: #7ab8ff; }
.tt-bonuses { margin-bottom: 4px; }
.tt-bonus { color: #e8e0cc; font-weight: 600; font-size: 13.5px; line-height: 1.45; }
.tt-active { color: #f0d080; margin-top: 4px; }
.dmg-magical { color: #7ab8ff !important; }
.dmg-physical { color: #ff9a7a !important; }
.dmg-pure { color: #ffe28a !important; }
.tt-build { margin-top: 8px; }
.tt-label { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.tt-comp { display: flex; gap: 4px; flex-wrap: wrap; }
.tt-ci { width: 40px; height: 30px; position: relative; border: 1px solid #000; box-shadow: 0 0 0 1px #3c3322; overflow: hidden; font-size: 10px; }
.tt-ci em { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; font-weight: 700; color: #f3c64a; text-shadow: 0 1px 2px #000; }

/* ===================================================================
   Screens (shared)
   =================================================================== */
.ui-screen { position: absolute; inset: 0; pointer-events: auto; opacity: 0; transition: opacity 0.4s ease; }
.ui-screen.show { opacity: 1; }

/* ---------- Loading ---------- */
.scr-loading { opacity: 1; z-index: 50; background: #07080a; transition: opacity 0.8s ease; }
.scr-loading.out { opacity: 0; pointer-events: none; }
.ld-bg { position: absolute; inset: 0;
  background: var(--noise), radial-gradient(ellipse at 50% 38%, rgba(160, 110, 40, 0.28), transparent 55%), radial-gradient(ellipse at 20% 100%, rgba(60, 140, 60, 0.18), transparent 50%), radial-gradient(ellipse at 80% 0%, rgba(160, 40, 30, 0.2), transparent 50%), linear-gradient(180deg, #121417, #07080a); }
.ld-bg::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(2px 2px at 20% 80%, rgba(255, 190, 90, 0.8), transparent), radial-gradient(1.5px 1.5px at 70% 90%, rgba(255, 170, 70, 0.7), transparent), radial-gradient(2px 2px at 40% 95%, rgba(255, 210, 120, 0.6), transparent), radial-gradient(1px 1px at 85% 70%, rgba(255, 180, 80, 0.7), transparent), radial-gradient(1.5px 1.5px at 10% 60%, rgba(255, 200, 100, 0.6), transparent);
  background-size: 100% 100%; animation: embers 9s linear infinite; opacity: 0.8; }
@keyframes embers { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(-40%); opacity: 0; } }
.ld-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 220px 60px #000; }
.ld-center { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; }
.ld-emblem { position: relative; width: 120px; height: 120px; margin: 0 auto 26px; }
.emb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(200, 162, 85, 0.55); box-shadow: 0 0 40px rgba(200, 140, 50, 0.35), inset 0 0 30px rgba(200, 140, 50, 0.25);
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(241, 217, 160, 0.8) 85%, transparent 100%); -webkit-mask: radial-gradient(circle, transparent 54px, #000 55px); mask: radial-gradient(circle, transparent 54px, #000 55px); animation: spin 2.6s linear infinite; }
.ld-emblem::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; border: 1px solid rgba(200, 162, 85, 0.35); background: radial-gradient(circle, rgba(60, 45, 20, 0.6), rgba(0, 0, 0, 0.8)); }
.emb-core { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; color: #f1d9a0; text-shadow: 0 0 20px rgba(255, 190, 80, 0.8); animation: pulse 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.6; transform: scale(0.94); } }
.ld-title { font-family: var(--f-title); font-weight: 700; font-size: 44px; letter-spacing: 0.16em; color: #d8c49a; text-shadow: 0 2px 0 #000, 0 0 30px rgba(200, 140, 50, 0.3); }
.ld-title span { display: block; text-shadow: none; font-size: 68px; letter-spacing: 0.14em; margin-top: -4px; background: linear-gradient(180deg, #fff3d0 10%, #e0b86a 50%, #8a6428 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.9)); }
.ld-sub { margin-top: 10px; font-family: var(--f-body); font-style: italic; color: #8d8270; font-size: 17px; letter-spacing: 0.05em; }
.ld-bottom { position: absolute; left: 50%; bottom: 70px; width: min(760px, 80vw); transform: translateX(-50%); }
.ld-tip { display: flex; gap: 14px; align-items: baseline; justify-content: center; min-height: 44px; margin-bottom: 18px; color: #b5ab96; font-size: 16px; font-weight: 500; text-align: center; }
.ld-tip-h { font-family: var(--f-title); color: var(--gold); font-weight: 700; letter-spacing: 0.2em; font-size: 13px; flex: none; }
.ld-tip-t { transition: opacity 0.3s; }
.ld-tip-t.fade { opacity: 0; }
.ld-tip b { color: #f1d9a0; }
.ld-bar { position: relative; height: 10px; background: rgba(0, 0, 0, 0.7); border: 1px solid #4a3d25; box-shadow: 0 0 0 1px #000, inset 0 2px 4px #000; }
.ld-fill { position: relative; height: 100%; width: 0; background: linear-gradient(180deg, #f6dc98, #c8963c 50%, #7a5518); box-shadow: 0 0 14px rgba(255, 190, 80, 0.6); transition: width 0.3s ease; overflow: hidden; }
.ld-glint { position: absolute; right: 0; top: -4px; bottom: -4px; width: 3px; background: #fff8e0; box-shadow: 0 0 12px 4px rgba(255, 220, 140, 0.9); }
.ld-row { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #8d8270; font-weight: 600; }
.ld-pct { color: var(--gold-hi); }

/* ---------- Main menu ---------- */
.scr-menu { z-index: 30; }
.mn-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 6, 8, 0.94) 0%, rgba(5, 6, 8, 0.8) 34%, rgba(5, 6, 8, 0.25) 65%, rgba(5, 6, 8, 0.5) 100%), radial-gradient(ellipse at 70% 50%, transparent, rgba(0, 0, 0, 0.6)); }
.mn-shade::after { content: ''; position: absolute; inset: 0; background: var(--noise); opacity: 0.6; }
.mn-left { position: absolute; left: 7vw; top: 50%; transform: translateY(-50%); width: 460px; }
.mn-title { margin-bottom: 36px; }
.mn-t1 { font-family: var(--f-title); font-weight: 700; font-size: 17px; letter-spacing: 0.3em; color: #cdb88a; text-shadow: 0 2px 0 #000; }
.mn-t2 { white-space: nowrap; font-family: var(--f-title); font-weight: 900; font-size: 51px; line-height: 0.95; letter-spacing: 0.04em; margin-left: -4px;
  background: linear-gradient(180deg, #fff6da 0%, #efcf86 35%, #b98a3c 62%, #6b4a18 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 30px rgba(220, 150, 50, 0.25)); }
.mn-rule { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; width: 420px; }
.mn-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.mn-rule i { color: var(--gold-hi); font-style: normal; text-shadow: 0 0 10px rgba(255, 200, 100, 0.8); }
.mn-t3 { font-family: var(--f-title); color: #8d8270; letter-spacing: 0.4em; font-size: 13px; text-transform: uppercase; }
.mn-card { padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.mn-label { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); margin-bottom: 7px; font-weight: 700; }
.mn-diff-desc { margin-top: 8px; font-size: 13px; color: #9a927e; min-height: 18px; }
.mn-links { display: flex; gap: 10px; }
.mn-links .btn-game { flex: 1; }
.mn-foot { position: absolute; right: 24px; bottom: 16px; color: #5d584e; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; }

/* ---------- Modals ---------- */
.ui-modal-wrap { position: absolute; inset: 0; z-index: 60; pointer-events: auto; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(2px); }
.ui-modal-wrap.show { opacity: 1; }
.ui-modal { width: 480px; max-height: 84vh; display: flex; flex-direction: column; transform: scale(0.97); transition: transform 0.2s; }
.ui-modal-wrap.show .ui-modal { transform: none; }
.ui-modal.wide { width: 620px; }
.md-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgba(200, 162, 85, 0.25); background: linear-gradient(180deg, rgba(200, 162, 85, 0.14), transparent); font-family: var(--f-title); font-weight: 700; font-size: 18px; letter-spacing: 0.14em; color: #f1e2bc; text-transform: uppercase; }
.md-x { background: none; border: 1px solid transparent; color: var(--dim); font-size: 16px; width: 28px; height: 28px; border-radius: 2px; pointer-events: auto; }
.md-x:hover { color: #fff; border-color: #5a4a2a; background: rgba(255, 255, 255, 0.05); }
.md-body { padding: 14px 18px 18px; overflow: auto; }
.set-sec { font-family: var(--f-title); color: var(--gold); letter-spacing: 0.18em; font-size: 12px; text-transform: uppercase; margin: 14px 0 6px; border-bottom: 1px solid rgba(200, 162, 85, 0.15); padding-bottom: 4px; }
.set-sec:first-child { margin-top: 0; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; font-weight: 600; }
.set-row > label:first-child { flex: 1; color: #cfc6b0; }
.set-row .seg { flex: 1.3; }
.set-row input[type=range] { flex: 1.1; accent-color: #c8a255; }
.set-row output { width: 44px; text-align: right; color: var(--gold-hi); font-weight: 700; }
.switch { position: relative; width: 42px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #1a1c20; border: 1px solid #4a4238; border-radius: 12px; transition: 0.2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #807868; transition: 0.2s; }
.switch input:checked + span { background: linear-gradient(#5a8a2c, #2c5e17); border-color: #8ac860; }
.switch input:checked + span::after { left: 23px; background: #f4ffe8; }
.set-actions { display: flex; gap: 10px; margin-top: 20px; }
.set-actions .btn-game { flex: 1; }
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.ctl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-size: 14px; }
.ctl-row .kbd { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- Hero select ---------- */
.scr-pick { z-index: 30; display: flex; flex-direction: column; }
.pk-bg { position: absolute; inset: 0; background: var(--noise), radial-gradient(ellipse at 30% 0%, rgba(150, 110, 50, 0.18), transparent 50%), linear-gradient(180deg, rgba(8, 9, 11, 0.93), rgba(4, 5, 6, 0.97)); }
.pk-top { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 32px 14px; border-bottom: 1px solid rgba(200, 162, 85, 0.2); background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent); }
.pk-heading { text-align: center; }
.pk-h1 { display: block; font-family: var(--f-title); font-weight: 700; font-size: 30px; letter-spacing: 0.2em; text-transform: uppercase; color: #f1e2bc; text-shadow: 0 2px 0 #000, 0 0 20px rgba(200, 140, 50, 0.3); }
.pk-h2 { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.pk-count { width: 110px; text-align: right; color: var(--dim); letter-spacing: 0.15em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.pk-main { position: relative; flex: 1; display: flex; gap: 22px; padding: 16px 32px; min-height: 0; }
.pk-grid { flex: 1; overflow-y: auto; padding-right: 8px; display: flex; flex-direction: column; gap: 14px; }
.pk-grid::-webkit-scrollbar, .sh-grid::-webkit-scrollbar, .md-body::-webkit-scrollbar { width: 8px; }
.pk-grid::-webkit-scrollbar-thumb, .sh-grid::-webkit-scrollbar-thumb, .md-body::-webkit-scrollbar-thumb { background: #3a3222; border-radius: 4px; }
.pk-ghead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--f-title); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-size: 14px; color: #d8c49a; }
.pk-ghead::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(200, 162, 85, 0.35), transparent); margin-left: 8px; }
.pk-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.pk-card { position: relative; width: 164px; height: 100px; cursor: pointer; border: 1px solid #000; box-shadow: 0 0 0 1px #2c2518, 0 4px 10px rgba(0, 0, 0, 0.6); transition: transform 0.15s, box-shadow 0.15s, filter 0.15s; filter: saturate(0.85) brightness(0.9); }
.pk-card .pk-pt { position: absolute; inset: 0; font-size: 18px; }
.pk-card:hover { transform: scale(1.08); z-index: 2; filter: none; box-shadow: 0 0 0 1px #c8a255, 0 0 18px rgba(241, 200, 110, 0.35), 0 8px 18px rgba(0, 0, 0, 0.8); }
.pk-card.sel { filter: none; box-shadow: 0 0 0 2px #f1d9a0, 0 0 22px rgba(241, 200, 110, 0.6); }
.pk-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 3px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #000; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent); z-index: 2; }
.pk-card .pt-init { display: none; }
.pk-card .pt-glyph:empty + .pt-init { display: flex; bottom: 14px; font-size: 2em; }
.pk-detail { width: 410px; flex: none; overflow-y: auto; display: flex; flex-direction: column; }
.pk-empty { flex: 1; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-align: center; color: var(--dim); font-size: 15px; line-height: 1.5; padding: 30px; }
.pk-empty-ic { font-size: 40px; color: var(--gold); opacity: 0.5; }
.pk-empty b { color: var(--gold-hi); }
.pd-hero { position: relative; height: 210px; flex: none; }
.pd-pt { position: absolute; inset: 0; font-size: 30px; }
.pd-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 12, 14, 1) 0%, transparent 55%); }
.pd-name { position: absolute; left: 16px; bottom: 10px; display: flex; gap: 10px; align-items: center; }
.pd-name .orb { width: 22px; height: 22px; }
.pd-n { font-family: var(--f-title); font-weight: 700; font-size: 30px; color: #fff3d8; text-shadow: 0 2px 4px #000; letter-spacing: 0.04em; line-height: 1; }
.pd-t { font-size: 13px; color: #a8a08a; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 16px 4px; }
.chip.atk { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.15); }
.pd-attrs { display: flex; gap: 8px; padding: 10px 16px; }
.pk-attr { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.05); }
.pk-attr b { font-size: 18px; color: #e8e0cc; }
.pk-attr em { font-style: normal; color: var(--dim); font-size: 12px; }
.pk-attr.prim { border-color: rgba(241, 217, 160, 0.45); box-shadow: inset 0 0 12px rgba(241, 217, 160, 0.12); }
.pk-attr.prim b { color: #fff; }
.pd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 18px; padding: 2px 16px 10px; }
.pd-stats div { display: flex; justify-content: space-between; font-size: 13.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding: 3px 0; }
.pd-stats span { color: var(--dim); }
.pd-stats b { color: #e8e0cc; }
.c-hp { color: #7ee05a !important; }
.c-mana { color: #6cb2ff !important; }
.pd-abil-h { padding: 6px 16px 6px; font-family: var(--f-title); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.pd-abils { display: flex; gap: 10px; padding: 0 16px 10px; }
.pd-ab { width: 80px; text-align: center; cursor: help; }
.pd-ab .pd-ic { width: 64px; height: 64px; margin: 0 auto 4px; border: 1px solid #000; box-shadow: 0 0 0 1px #4a3d25, 0 3px 8px rgba(0, 0, 0, 0.6); overflow: hidden; font-size: 15px; transition: box-shadow 0.15s; }
.pd-ab:hover .pd-ic { box-shadow: 0 0 0 1px #f1d9a0, 0 0 12px rgba(241, 217, 160, 0.4); }
.pd-ab.ult .pd-ic { box-shadow: 0 0 0 1px #8a6a3a, 0 0 0 3px rgba(0, 0, 0, 0.8), 0 0 0 4px #6a5226; }
.pd-ab-n { font-size: 11.5px; font-weight: 600; color: #bdb49e; line-height: 1.15; }
.pd-none { color: var(--faint); font-size: 13px; padding: 8px 0; }
.pd-lore { margin: 4px 16px 14px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-family: var(--f-body); font-style: italic; color: #8a8372; font-size: 13.5px; line-height: 1.5; }
.pd-hint { margin: auto 16px 14px; text-align: center; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.pk-bottom { position: relative; display: flex; align-items: flex-end; justify-content: space-between; padding: 14px 32px 22px; border-top: 1px solid rgba(200, 162, 85, 0.2); background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent); }
.pk-teams { display: flex; gap: 10px; }
.pk-tb { display: flex; align-items: center; gap: 10px; padding: 10px 22px; min-width: 190px; border: 1px solid #3a3530; background: linear-gradient(180deg, #24262a, #16171a); color: var(--dim); font-family: var(--f-title); font-weight: 700; font-size: 16px; letter-spacing: 0.1em; transition: all 0.15s; pointer-events: auto; }
.pk-tb i { width: 18px; height: 18px; transform: rotate(45deg); border: 1px solid rgba(0, 0, 0, 0.8); }
.pk-tb.sunward i { background: linear-gradient(135deg, #b8f090, #3f8a22); }
.pk-tb.duskward i { background: linear-gradient(135deg, #ff9a80, #8a2014); }
.pk-tb:hover { color: var(--text); }
.pk-tb.sunward.on { color: #dfffc8; border-color: #7ac050; background: linear-gradient(180deg, rgba(90, 160, 50, 0.45), rgba(30, 70, 15, 0.6)); box-shadow: 0 0 18px rgba(110, 200, 70, 0.3); }
.pk-tb.duskward.on { color: #ffd8cc; border-color: #d0604a; background: linear-gradient(180deg, rgba(170, 50, 30, 0.45), rgba(80, 20, 10, 0.6)); box-shadow: 0 0 18px rgba(220, 80, 50, 0.3); }
.pk-actions { display: flex; gap: 14px; align-items: center; }
.pk-random { padding: 14px 24px; }
.btn-lock { pointer-events: auto; min-width: 260px; padding: 16px 30px; border: 1px solid #9ad06a; background: linear-gradient(180deg, #4d8a2c, #1d4510); color: #f4ffe8; font-family: var(--f-title); font-weight: 700; font-size: 22px; letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 1px 0 rgba(220, 255, 180, 0.5), 0 0 24px rgba(110, 200, 70, 0.3), 0 4px 12px rgba(0, 0, 0, 0.7); transition: filter 0.15s; }
.btn-lock:hover:not(:disabled) { filter: brightness(1.15); }
.btn-lock:disabled { filter: grayscale(1) brightness(0.55); cursor: not-allowed; box-shadow: none; }

/* ---------- End screen ---------- */
.scr-end { z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.end-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.9)); }
.scr-end.win .end-bg { background: radial-gradient(ellipse at 50% 15%, rgba(110, 170, 60, 0.35), rgba(0, 0, 0, 0.92) 65%); }
.scr-end.lose .end-bg { background: radial-gradient(ellipse at 50% 15%, rgba(170, 50, 30, 0.35), rgba(0, 0, 0, 0.92) 65%); }
.end-top { position: relative; text-align: center; }
.end-team { font-family: var(--f-title); font-weight: 700; font-size: 22px; letter-spacing: 0.4em; text-transform: uppercase; margin-bottom: 14px; text-shadow: 0 2px 4px #000; }
.end-h { font-family: var(--f-title); font-weight: 900; font-size: 110px; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; animation: endIn 1.2s cubic-bezier(.2, .9, .3, 1.2) both; }
.win .end-h { background: linear-gradient(180deg, #fff8dc, #f0cf7a 45%, #9a7020); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(255, 200, 90, 0.5)) drop-shadow(0 4px 2px #000); }
.lose .end-h { background: linear-gradient(180deg, #ffd0c0, #d05a40 45%, #5a1408); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(220, 70, 40, 0.5)) drop-shadow(0 4px 2px #000); }
@keyframes endIn { from { transform: scale(1.6); opacity: 0; letter-spacing: 0.4em; } to { transform: none; opacity: 1; } }
.end-meta { display: inline-flex; gap: 30px; justify-content: center; margin-top: 14px; padding: 6px 22px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(200, 162, 85, 0.25); color: var(--dim); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.end-meta b { color: #f1e2bc; margin-left: 6px; }
.end-tables { position: relative; width: min(1100px, 92vw); padding: 14px 18px; }
.end-actions { position: relative; }

/* ===================================================================
   HUD
   =================================================================== */
.ui-world { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.ui-hud { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s; --z: 1; }
.ui-hud.show { opacity: 1; }
.ui-hud.ended > *:not(.hud-announcer) { opacity: 0; transition: opacity 1s; pointer-events: none !important; }
.hud-top, .hud-minimap, .hud-bottom, .hud-br, .hud-shop, .hud-scoreboard, .hud-tl, .hud-killfeed, .hud-announcer, .hud-error, .hud-messages, .hud-chat, .hud-death .dt-box, .hud-pause .ps-box { zoom: var(--z); }

/* ---------- Top bar ---------- */
.hud-top { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; pointer-events: auto; }
.tb-side { display: flex; padding: 0 6px 5px; background: linear-gradient(180deg, rgba(10, 12, 14, 0.95), rgba(18, 20, 24, 0.88)); border-bottom: 1px solid #3a3222; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); }
.tb-sunward { clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%); padding-left: 16px; border-bottom-color: rgba(108, 200, 74, 0.5); }
.tb-duskward { clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); padding-right: 16px; border-bottom-color: rgba(224, 80, 58, 0.5); }
.tb-heroes { display: flex; gap: 3px; }
.tb-hero { position: relative; width: 62px; height: 40px; cursor: pointer; }
.tb-pt { position: absolute; inset: 0 0 4px 0; font-size: 10px; border: 1px solid #000; }
.tb-sunward .tb-pt { box-shadow: inset 0 -2px 0 var(--rad); }
.tb-duskward .tb-pt { box-shadow: inset 0 -2px 0 var(--duskward); }
.tb-hero.me .tb-pt { outline: 1px solid #f1d9a0; outline-offset: -1px; }
.tb-hp { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #000; }
.tb-hp i { display: block; height: 100%; background: var(--hp); transition: width 0.2s; }
.tb-duskward .tb-hp i { background: var(--duskward); }
.tb-lvl { position: absolute; right: 1px; top: 1px; min-width: 14px; padding: 0 2px; font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; color: #f1e2bc; background: rgba(0, 0, 0, 0.8); z-index: 3; }
.tb-dead { position: absolute; inset: 0 0 4px 0; display: none; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); z-index: 2; }
.tb-dead span { font-weight: 700; font-size: 18px; color: #ff6a50; text-shadow: 0 1px 3px #000; }
.tb-hero.is-dead .tb-pt { filter: grayscale(1) brightness(0.6); }
.tb-hero.is-dead .tb-dead { display: flex; }
.tb-hero.fogged .tb-pt { filter: brightness(0.55) saturate(0.6); }
.tb-ult { position: absolute; left: 50%; bottom: -5px; width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg); background: #333; border: 1px solid #000; opacity: 0; z-index: 3; }
.tb-ult.on { opacity: 1; background: #6cb2ff; box-shadow: 0 0 6px #6cb2ff; }
.tb-center { display: flex; align-items: flex-start; }
.tb-score { width: 58px; height: 42px; display: flex; align-items: center; justify-content: center; font-family: var(--f-ui); font-weight: 700; font-size: 28px; text-shadow: 0 2px 3px #000; background: linear-gradient(180deg, rgba(8, 9, 11, 0.95), rgba(18, 20, 24, 0.9)); }
.tb-score.rad { color: #8ee06a; }
.tb-score.duskward { color: #ff7a60; }
.tb-clock { position: relative; width: 104px; height: 60px; padding-top: 4px; text-align: center; cursor: default;
  background: var(--noise), linear-gradient(180deg, #1c1f24, #0c0d10); border: 1px solid #5a4a2a; border-top: 0; clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%); box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8); }
.tb-time { font-weight: 700; font-size: 21px; color: #f1e2bc; letter-spacing: 0.04em; text-shadow: 0 1px 2px #000; line-height: 1; margin-top: 16px; }
.tb-clock.pre .tb-time { color: #9a927e; }
.tb-daynight { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; }
.dn-sun, .dn-moon { position: absolute; inset: 0; border-radius: 50%; transition: opacity 0.6s; }
.dn-sun { background: radial-gradient(circle, #fff6c0, #f0b92a 55%, #b07010); box-shadow: 0 0 10px #f0b92a; }
.dn-moon { background: radial-gradient(circle at 65% 35%, transparent 38%, #cfe0ff 40%); opacity: 0; filter: drop-shadow(0 0 5px #8ab8ff); }
.tb-clock.night .dn-sun { opacity: 0; }
.tb-clock.night .dn-moon { opacity: 1; }
.tb-dn-bar { position: absolute; left: 22px; right: 22px; bottom: 19px; height: 2px; background: rgba(0, 0, 0, 0.6); }
.tb-dn-bar i { display: block; height: 100%; width: 0; background: #f0b92a; }
.tb-clock.night .tb-dn-bar i { background: #8ab8ff; }

/* ---------- Top-left buttons ---------- */
.hud-tl { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; align-items: center; pointer-events: auto; }
.tl-btn { width: 30px; height: 26px; background: linear-gradient(180deg, #2a2d32, #15171a); border: 1px solid #4a3d25; color: #cfc6b0; font-size: 14px; line-height: 1; }
.tl-btn:hover { border-color: var(--gold); color: #fff; }
.tl-fps { margin-left: 6px; font-size: 11px; color: #a79f8c; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 4px #000; }

/* ---------- Kill feed / announcer / messages ---------- */
.hud-killfeed { position: absolute; right: 10px; top: 62px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { display: flex; align-items: center; gap: 6px; padding: 3px 5px; background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75) 20%); border-right: 2px solid var(--rad); animation: kfIn 0.35s ease-out; transition: opacity 0.5s, transform 0.5s; }
.kf.bad { border-right-color: var(--duskward); }
.kf.out { opacity: 0; transform: translateX(20px); }
@keyframes kfIn { from { opacity: 0; transform: translateX(30px); } }
.kf-side { display: flex; align-items: center; gap: 3px; }
.kf-pt { width: 52px; height: 30px; font-size: 9px; border: 1px solid #000; }
.kf-side.t-sunward .kf-pt { box-shadow: 0 0 0 1px var(--rad-dk), inset 0 -2px 0 var(--rad); }
.kf-side.t-duskward .kf-pt { box-shadow: 0 0 0 1px var(--duskward-dk), inset 0 -2px 0 var(--duskward); }
.kf-unit { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(0, 0, 0, 0.5); border: 1px solid #333; }
.kf-mid { color: #d8c49a; font-size: 15px; text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); }
.kf.deny .kf-mid { color: #aaa; }
.kf-as { font-size: 11px; font-weight: 700; color: #cfc6b0; }

.hud-announcer { position: absolute; left: 50%; top: 25%; transform: translateX(-50%); width: 900px; text-align: center; pointer-events: none; }
.ann { position: absolute; left: 0; right: 0; top: 0; animation: annIn 0.45s cubic-bezier(.2, .9, .3, 1.3) both; transition: opacity 0.45s, transform 0.45s; }
.ann.out { opacity: 0; transform: translateY(-14px); }
@keyframes annIn { from { opacity: 0; transform: scale(1.5); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.ann-t { font-family: var(--f-title); font-weight: 900; font-size: 42px; letter-spacing: 0.1em; text-transform: uppercase; color: #f1e2bc; text-shadow: 0 3px 0 #000, 0 0 24px rgba(0, 0, 0, 0.9), 0 0 40px rgba(241, 200, 110, 0.35); }
.ann.big .ann-t { font-size: 56px; }
.ann.red .ann-t { color: #ff6a4a; text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 60, 30, 0.6); }
.ann.gold .ann-t { color: #ffd870; text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 190, 60, 0.5); }
.ann.purple .ann-t { color: #d7a0ff; text-shadow: 0 3px 0 #000, 0 0 30px rgba(180, 90, 255, 0.55); }
.ann.green .ann-t { color: #a8f07a; text-shadow: 0 3px 0 #000, 0 0 30px rgba(110, 220, 60, 0.45); }
.ann-s { margin-top: 4px; font-size: 18px; font-weight: 600; color: #d8d0bc; text-shadow: 0 1px 3px #000, 0 0 10px #000; letter-spacing: 0.04em; }

.hud-messages { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.msg { font-size: 19px; font-weight: 700; letter-spacing: 0.04em; text-shadow: 0 2px 3px #000, 0 0 12px #000; animation: msgIn 0.25s ease-out; transition: opacity 0.5s; white-space: nowrap; }
.msg.out { opacity: 0; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.hud-error { position: absolute; left: 50%; bottom: 196px; transform: translateX(-50%); font-size: 18px; font-weight: 700; color: #ff4a3a; letter-spacing: 0.03em; text-shadow: 0 2px 2px #000, 0 0 10px #000; opacity: 0; white-space: nowrap; }
.hud-error.show { animation: errIn 2.2s ease both; }
@keyframes errIn { 0% { opacity: 0; transform: translate(-50%, 6px); } 8% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; } }
.hud-chat { position: absolute; left: 12px; bottom: 300px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
.chat-line { transition: opacity 0.6s; }
.chat-line.out { opacity: 0; }

/* ---------- Minimap ---------- */
.hud-minimap { position: absolute; left: 0; bottom: 0; width: 262px; height: 262px; padding: 8px; border-left: 0; border-bottom: 0; border-top-right-radius: 3px; }
.hud-minimap canvas { display: block; width: 244px; height: 244px; cursor: crosshair; border: 1px solid #000; box-shadow: 0 0 0 1px #3a3222; background: #10150e; }
.mm-corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold); pointer-events: none; }
.mm-corner.tl { left: 3px; top: 3px; border-right: 0; border-bottom: 0; }
.mm-corner.br { right: 3px; top: 3px; border-left: 0; border-bottom: 0; }

/* ---------- Bottom panel ---------- */
.hud-bottom { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); pointer-events: none; }
.bp-buffs { position: absolute; left: 292px; bottom: 164px; display: flex; gap: 4px; pointer-events: auto; }
.bf { position: relative; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid #3fb03a; box-shadow: 0 0 0 1px #000, 0 2px 4px rgba(0, 0, 0, 0.7); background: #111; }
.bf.debuff { border-color: #d0402c; }
.bf-ic { position: absolute; inset: 0; font-size: 9px; }
.bf-ic .ic-glyph { font-size: 15px; }
.bf-sweep { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.6) var(--p, 0deg), transparent 0); }
.bf-st { position: absolute; right: 1px; bottom: -1px; font-size: 11px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.bp-body { position: relative; display: flex; align-items: flex-end; pointer-events: auto; height: 156px; padding: 10px 12px 8px; gap: 8px;
  background: var(--noise), linear-gradient(180deg, rgba(34, 38, 44, 0.96), rgba(12, 14, 17, 0.98)); border: 1px solid #4a3d25; border-bottom: 0;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%, 0 18px);
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.12), inset 0 0 40px rgba(0, 0, 0, 0.55); }
.bp-body::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #c8a255 20%, #f1d9a0 50%, #c8a255 80%, transparent); opacity: 0.8; }

.bp-stats { width: 118px; align-self: stretch; padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 3px; cursor: help; }
.st-row { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: #e8e0cc; }
.st-row em { font-style: normal; color: #7ee05a; font-size: 13px; }
.st-ic { width: 16px; height: 16px; flex: none; opacity: 0.85; background: #b8a888; }
.st-ic.dmg { clip-path: polygon(80% 0, 100% 0, 100% 20%, 40% 80%, 50% 90%, 40% 100%, 30% 90%, 15% 100%, 0 85%, 10% 70%, 0 60%, 10% 50%, 20% 60%); background: linear-gradient(135deg, #e8e0cc, #8a8070); }
.st-ic.arm { clip-path: polygon(50% 0, 100% 15%, 92% 60%, 50% 100%, 8% 60%, 0 15%); background: linear-gradient(135deg, #d0d8e0, #607080); }
.st-ic.ms { clip-path: polygon(20% 0, 55% 0, 55% 55%, 100% 70%, 100% 100%, 20% 100%); background: linear-gradient(135deg, #e8d0a0, #8a6a40); }
.st-attrs { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.st-attr { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #cfc6b0; padding: 0 3px; }
.st-attr .orb { width: 11px; height: 11px; }
.st-attr em { font-style: normal; color: #7ee05a; font-size: 12px; }
.st-attr.prim { background: linear-gradient(90deg, rgba(241, 217, 160, 0.14), transparent); color: #fff; }
.st-attr.hidden { display: none; }

.bp-portrait { position: relative; width: 168px; height: 138px; flex: none; cursor: pointer; }
.bp-pt-wrap { position: absolute; inset: 0; border: 1px solid #000; box-shadow: 0 0 0 1px #5a4a2a, inset 0 0 20px #000; overflow: hidden; }
.bp-pt { position: absolute; inset: 0; font-size: 22px; }
.bp-pt-wrap.dead .bp-pt { filter: grayscale(1) brightness(0.5); }
.bp-pt-wrap::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 18px 4px rgba(0, 0, 0, 0.85); pointer-events: none; }
.bp-name { position: absolute; left: 0; right: 0; top: -1px; padding: 3px 6px 8px; text-align: center; font-family: var(--f-title); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff1cf; text-shadow: 0 1px 3px #000; background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent); z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-lvl { position: absolute; left: -10px; bottom: -6px; width: 46px; height: 46px; z-index: 3; }
.bp-lvl svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.bp-lvl .ring-bg { fill: rgba(8, 9, 11, 0.95); stroke: #2a2418; stroke-width: 4; }
.bp-lvl .ring { fill: none; stroke: url(#none); stroke: #e8c060; stroke-width: 4; stroke-linecap: butt; transition: stroke-dashoffset 0.3s; filter: drop-shadow(0 0 3px rgba(255, 200, 90, 0.7)); }
.bp-lvl b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; color: #fff3d8; text-shadow: 0 1px 2px #000; }
.bp-lvl::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid #6d5326; }
.bp-lvl.pulse::after { border-color: #f1d9a0; animation: lvlPulse 1.2s ease-in-out infinite; }
@keyframes lvlPulse { 50% { box-shadow: 0 0 14px 3px rgba(255, 210, 110, 0.7); } }
.bp-lvlup { position: absolute; left: 42px; bottom: 4px; z-index: 3; font-size: 12px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #ffd870; text-shadow: 0 0 6px #000, 0 1px 2px #000; opacity: 0; transition: opacity 0.3s; }
.bp-lvlup.show { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
.hud-bottom.nohero .bp-lvl, .hud-bottom.nohero .st-attrs { display: none; }

.bp-center { display: flex; flex-direction: column; gap: 8px; width: 390px; }
.bp-abilities { display: flex; justify-content: center; gap: 8px; min-height: 92px; align-items: flex-end; }
.bp-abilities.empty::after { content: 'No abilities'; color: var(--faint); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; align-self: center; }
.ab { position: relative; width: 70px; }
.ab-frame { position: relative; width: 70px; height: 70px; border: 1px solid #000; box-shadow: 0 0 0 1px #5a4a2a, 0 4px 10px rgba(0, 0, 0, 0.8); overflow: hidden; cursor: pointer; transition: box-shadow 0.12s, transform 0.08s; background: #0c0d10; }
.ab.ult .ab-frame { box-shadow: 0 0 0 1px #8a6a3a, 0 0 0 3px #0c0d10, 0 0 0 4px #6d5326, 0 4px 10px rgba(0, 0, 0, 0.8); }
.ab-frame:hover { box-shadow: 0 0 0 1px #f1d9a0, 0 0 14px rgba(241, 217, 160, 0.35); }
.ab-frame:active { transform: scale(0.96); }
.ab-ic { position: absolute; inset: 0; font-size: 17px; }
.ab-ic .ic-glyph { font-size: 34px; }
.ab-cd { position: absolute; inset: 0; opacity: 0; background: conic-gradient(from 0deg, transparent calc(360deg - var(--p, 0deg)), rgba(0, 0, 0, 0.72) 0); }
.ab-cdt, .inv-cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; pointer-events: none; }
.ab-key { position: absolute; left: 0; top: 0; min-width: 16px; padding: 0 3px; font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; color: #e8e0cc; background: rgba(0, 0, 0, 0.8); border-right: 1px solid #3a3222; border-bottom: 1px solid #3a3222; }
.ab-mana { position: absolute; right: 0; bottom: 0; padding: 0 3px; font-size: 11px; font-weight: 700; line-height: 13px; color: #9cc8ff; background: rgba(0, 0, 0, 0.75); }
.ab-mana:empty { display: none; }
.ab-glow { position: absolute; inset: 0; pointer-events: none; }
.ab.unlearned .ab-ic { filter: grayscale(1) brightness(0.35); }
.ab.nomana .ab-ic { filter: saturate(0.5) brightness(0.55) sepia(0.4) hue-rotate(180deg) saturate(2.5); }
.ab.nomana .ab-mana { color: #ff8a70; }
.ab.silenced .ab-ic { filter: grayscale(0.8) brightness(0.5); }
.ab.cooling .ab-ic { filter: grayscale(0.4) brightness(0.8); }
.ab.active .ab-glow { box-shadow: inset 0 0 0 2px #fff, inset 0 0 18px rgba(255, 240, 180, 0.7); }
.ab.passive .ab-frame { cursor: help; }
.ab.passive .ab-glow { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ab-pips { display: flex; justify-content: center; gap: 3px; margin-top: 5px; height: 5px; }
.ab-pips i { width: 10px; height: 5px; background: #2a2620; border: 1px solid #000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6); }
.ab-pips i.on { background: linear-gradient(180deg, #ffe890, #d8a030); box-shadow: 0 0 4px rgba(255, 200, 80, 0.7); }
.ab-up { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); width: 34px; height: 20px; display: none; align-items: center; justify-content: center; padding: 0; font-size: 17px; font-weight: 700; line-height: 1; color: #1a1205;
  background: linear-gradient(180deg, #fff0b0, #e0a830 60%, #9a6a10); border: 1px solid #000; border-radius: 2px; box-shadow: 0 0 10px rgba(255, 200, 80, 0.8); z-index: 4; animation: upBob 1s ease-in-out infinite; }
.ab.can-up .ab-up { display: flex; }
.ab.can-up .ab-frame { box-shadow: 0 0 0 1px #f1d9a0, 0 0 12px rgba(255, 200, 80, 0.5); }
@keyframes upBob { 50% { transform: translate(-50%, -3px); } }
.hud-bottom.other .ab-key, .hud-bottom.other .ab-up { display: none !important; }

.bp-bars { display: flex; flex-direction: column; gap: 3px; }
.bar { position: relative; height: 20px; background: #070808; border: 1px solid #000; box-shadow: 0 0 0 1px #3a3222; overflow: hidden; }
.bar.mp { height: 17px; }
.bar.hidden { visibility: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.bar.hp .fill { background: linear-gradient(180deg, #7ee05a 0%, #3fa82a 45%, #226d14 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.bar.hp .lag { background: rgba(255, 230, 170, 0.7); transition: width 0.15s; }
.hud-bottom.enemy .bar.hp .fill { background: linear-gradient(180deg, #ff7a60 0%, #c8321c 45%, #7a160a 100%); }
.bar.mp .fill { background: linear-gradient(180deg, #7cc0ff 0%, #2f7ee0 45%, #174a9a 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.bar .val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; letter-spacing: 0.03em; }
.bar.mp .val { font-size: 13px; }
.bar .rg { position: absolute; right: 6px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.8); text-shadow: 0 1px 2px #000; }

.bp-inv { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 6px 6px; align-items: end; padding-bottom: 2px; }
.inv-grid { display: grid; grid-template-columns: repeat(3, 60px); grid-auto-rows: 44px; gap: 4px; }
.inv-back { grid-column: 1; display: grid; grid-template-columns: repeat(3, 60px); grid-auto-rows: 26px; gap: 4px; }
.inv-tp { grid-column: 2; grid-row: 1 / 3; align-self: end; }
.inv { position: relative; border: 1px solid #000; box-shadow: 0 0 0 1px #2e281c, inset 0 2px 8px rgba(0, 0, 0, 0.9); background: linear-gradient(180deg, #0c0d0f, #16181b); overflow: hidden; cursor: pointer; }
.inv.filled { box-shadow: 0 0 0 1px #5a4a2a, 0 2px 6px rgba(0, 0, 0, 0.6); }
.inv.filled:hover { box-shadow: 0 0 0 1px #f1d9a0, 0 0 10px rgba(241, 217, 160, 0.3); }
.inv.drop { box-shadow: 0 0 0 2px #7ee05a !important; }
.inv-ic { position: absolute; inset: 0; font-size: 12px; }
.inv-ic .ic-glyph { font-size: 24px; }
.inv.bk .inv-ic { filter: grayscale(0.7) brightness(0.6); }
.inv.bk .inv-ic .ic-glyph { font-size: 15px; }
.inv-cd { position: absolute; inset: 0; opacity: 0; background: conic-gradient(from 0deg, transparent calc(360deg - var(--p, 0deg)), rgba(0, 0, 0, 0.72) 0); }
.inv-cdt { font-size: 18px; }
.inv-key { position: absolute; left: 0; top: 0; padding: 0 3px; font-size: 10px; font-weight: 700; line-height: 12px; color: #cfc6b0; background: rgba(0, 0, 0, 0.75); }
.inv-ch { position: absolute; right: 2px; bottom: 0; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.inv.nomana .inv-ic { filter: brightness(0.5) sepia(0.5) hue-rotate(180deg) saturate(2); }
.inv.tp { width: 44px; height: 44px; border-radius: 50%; }
.inv.tp .inv-ic .ic-glyph { font-size: 20px; }
.hud-bottom.no-inv .bp-inv { visibility: hidden; }

/* ---------- Bottom-right: gold + shop ---------- */
.hud-br { position: absolute; right: 0; bottom: 0; width: 200px; padding: 10px 10px 10px 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto;
  background: var(--noise), linear-gradient(180deg, rgba(30, 34, 40, 0.96), rgba(12, 14, 17, 0.98)); border: 1px solid #4a3d25; border-right: 0; border-bottom: 0; clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px); }
.br-shop { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 10px; border: 1px solid #7a6030; background: linear-gradient(180deg, #4a3b20, #221a0d); color: #f1e2bc; font-family: var(--f-title); font-weight: 700; font-size: 17px; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.25); }
.br-shop kbd { margin-left: auto; }
.br-shop:hover, .br-shop.on { filter: brightness(1.3); border-color: var(--gold-hi); }
.br-gold { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(0, 0, 0, 0.8); box-shadow: inset 0 1px 6px #000; }
.br-gold b { font-size: 24px; font-weight: 700; color: #ffd24a; text-shadow: 0 1px 2px #000, 0 0 10px rgba(255, 190, 60, 0.35); letter-spacing: 0.03em; }

/* ---------- Shop ---------- */
.hud-shop { position: absolute; right: 0; top: 64px; bottom: 124px; width: 450px; display: flex; flex-direction: column; opacity: 0; transform: translateX(30px); transition: opacity 0.18s, transform 0.18s; pointer-events: none !important; border-right: 0; }
.hud-shop.show { opacity: 1; transform: none; pointer-events: auto !important; }
.sh-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid rgba(200, 162, 85, 0.25); background: linear-gradient(180deg, rgba(200, 162, 85, 0.14), transparent); }
.sh-title { font-family: var(--f-title); font-weight: 700; font-size: 18px; letter-spacing: 0.14em; text-transform: uppercase; color: #f1e2bc; display: flex; align-items: center; }
.sh-search { flex: 1; min-width: 0; padding: 7px 10px; background: rgba(0, 0, 0, 0.55); border: 1px solid #3a3222; color: #e8e0cc; font-family: var(--f-ui); font-size: 14px; font-weight: 600; outline: none; }
.sh-search:focus { border-color: var(--gold); box-shadow: 0 0 8px rgba(200, 162, 85, 0.3); }
.sh-gold { display: flex; align-items: center; font-weight: 700; color: #ffd24a; font-size: 17px; }
.sh-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid #2a2418; }
.sh-tab { padding: 6px 10px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font-weight: 700; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.sh-tab:hover { color: var(--text); }
.sh-tab.on { color: #fff1cf; border-bottom-color: var(--gold); background: linear-gradient(0deg, rgba(200, 162, 85, 0.15), transparent); }
.sh-status { display: none; padding: 5px 12px; font-size: 12.5px; font-weight: 700; color: #ff9a70; background: rgba(120, 30, 10, 0.3); letter-spacing: 0.04em; }
.sh-status.show { display: block; }
.sh-grid { flex: 1; overflow-y: auto; padding: 8px 10px; }
.sh-sec { margin-bottom: 10px; }
.sh-sec-h { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; font-weight: 700; }
.sh-items { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sh-item { position: relative; cursor: pointer; transition: transform 0.1s; }
.sh-ic { height: 44px; border: 1px solid #000; box-shadow: 0 0 0 1px #3a3222; overflow: hidden; font-size: 11px; background: #111; }
.sh-ic .ic-glyph { font-size: 24px; }
.sh-cost { text-align: center; font-size: 12px; font-weight: 700; color: #f3c64a; margin-top: 1px; }
.sh-item:hover .sh-ic { box-shadow: 0 0 0 1px #f1d9a0, 0 0 10px rgba(241, 217, 160, 0.35); }
.sh-item.sel .sh-ic { box-shadow: 0 0 0 2px #f1d9a0; }
.sh-item.poor .sh-ic { filter: grayscale(0.5) brightness(0.6); }
.sh-item.poor .sh-cost { color: #a07a50; }
.sh-item.secret .sh-ic { box-shadow: 0 0 0 1px #7a4ab0; }
.sh-item.bought { animation: bought 0.5s ease-out; }
@keyframes bought { 30% { transform: scale(1.15); filter: brightness(1.8); } }
.sh-empty { padding: 30px 14px; text-align: center; color: var(--dim); font-size: 14px; line-height: 1.5; }
.sh-detail { border-top: 1px solid rgba(200, 162, 85, 0.25); background: rgba(0, 0, 0, 0.35); padding: 0 12px; }
.sh-detail:not(:empty) { padding: 10px 12px; }
.sd-row { display: flex; align-items: center; gap: 10px; }
.sd-ic { width: 62px; height: 45px; border: 1px solid #000; box-shadow: 0 0 0 1px #5a4a2a; overflow: hidden; font-size: 12px; }
.sd-info { flex: 1; }
.sd-name { font-family: var(--f-title); font-weight: 700; color: #fff1cf; font-size: 15px; }
.sd-cost { color: #f3c64a; font-weight: 700; font-size: 15px; }
.btn-buy { padding: 9px 22px; border: 1px solid #9ad06a; background: linear-gradient(180deg, #4d8a2c, #1d4510); color: #f4ffe8; font-weight: 700; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; }
.btn-buy:hover { filter: brightness(1.2); }
.btn-buy.poor { filter: grayscale(0.8) brightness(0.7); }
.sd-build { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.sd-lbl { width: 42px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.sd-build em { font-style: normal; color: var(--dim); font-weight: 700; }
.sd-c { position: relative; width: 44px; height: 32px; border: 1px solid #000; box-shadow: 0 0 0 1px #3a3222; overflow: hidden; cursor: pointer; font-size: 10px; }
.sd-c .ic-glyph { font-size: 17px; }
.sd-c:hover { box-shadow: 0 0 0 1px #f1d9a0; }
.sd-c.recipe b { position: absolute; right: 1px; bottom: 0; font-size: 10px; color: #f3c64a; text-shadow: 0 1px 2px #000; }

/* ---------- Scoreboard ---------- */
.hud-scoreboard { position: absolute; left: 50%; top: 70px; transform: translate(-50%, -8px); width: 980px; padding: 12px 16px 14px; opacity: 0; transition: opacity 0.12s, transform 0.12s; pointer-events: none !important; }
.hud-scoreboard.show { opacity: 1; transform: translate(-50%, 0); }
.sb-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.sb-title { font-family: var(--f-title); font-weight: 700; font-size: 18px; letter-spacing: 0.18em; text-transform: uppercase; color: #f1e2bc; }
.sb-time { font-weight: 700; color: var(--dim); font-size: 15px; }
.sb-team { margin-top: 8px; }
.sb-th { display: flex; align-items: baseline; gap: 16px; padding: 5px 8px; border-left: 3px solid var(--rad); background: linear-gradient(90deg, rgba(108, 200, 74, 0.2), transparent 60%); }
.sb-team.duskward .sb-th { border-left-color: var(--duskward); background: linear-gradient(90deg, rgba(224, 80, 58, 0.2), transparent 60%); }
.sb-tn { font-family: var(--f-title); font-weight: 700; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: #a8f07a; }
.sb-team.duskward .sb-tn { color: #ff8a70; }
.sb-tn em { font-style: normal; font-size: 11px; margin-left: 8px; padding: 1px 6px; border: 1px solid currentColor; letter-spacing: 0.2em; }
.sb-ts { font-weight: 700; color: #e8e0cc; font-size: 14px; }
.sb-tnw { margin-left: auto; color: var(--dim); font-size: 13px; }
.sb-tnw b { color: #f3c64a; }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-team th { text-align: left; font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 5px 8px 3px; }
.sb-team td { padding: 3px 8px; border-top: 1px solid rgba(255, 255, 255, 0.04); }
.sb-team tr.me td { background: rgba(241, 217, 160, 0.07); }
.sb-team tr.mvp td:first-child b::after { content: ' ★'; color: #ffd24a; }
.sb-team tr.dead .sb-pt { filter: grayscale(1) brightness(0.6); }
.sb-hero { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.sb-hero b { display: block; font-weight: 700; color: #f1e2bc; font-size: 14.5px; }
.sb-hero span { font-size: 11.5px; color: var(--dim); }
.sb-hero span em { font-style: normal; color: #ff7a60; }
.sb-pt { width: 58px; height: 32px; flex: none; border: 1px solid #000; font-size: 9px; }
.num { font-weight: 700; color: #d8d0bc; white-space: nowrap; }
.num.lvl { color: #fff; }
.kda b { color: #e8e0cc; }
.kda b.d { color: #ff8a70; }
.num.gold, .num.nw { color: #f3c64a; }
.sb-items { display: flex; gap: 2px; }
.sb-it { width: 36px; height: 26px; border: 1px solid #000; background: rgba(0, 0, 0, 0.5); overflow: hidden; font-size: 9px; }
.sb-it .ic-glyph { font-size: 15px; }

/* ---------- Death & pause ---------- */
.hud-death { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s; pointer-events: none; background: radial-gradient(ellipse at center, transparent 40%, rgba(40, 0, 0, 0.45) 100%); }
.hud-death.show { opacity: 1; }
.dt-box { position: absolute; left: 50%; top: 74px; transform: translateX(-50%); text-align: center; }
.dt-h { font-family: var(--f-title); font-weight: 900; font-size: 34px; letter-spacing: 0.14em; text-transform: uppercase; color: #ff6a4a; text-shadow: 0 3px 0 #000, 0 0 24px rgba(255, 50, 20, 0.5); }
.dt-t { font-size: 20px; font-weight: 600; color: #e8e0cc; text-shadow: 0 2px 3px #000; letter-spacing: 0.05em; }
.dt-t b { font-size: 28px; color: #fff; }
.btn-buyback { margin-top: 10px; pointer-events: auto; display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px; border: 1px solid #c8a255; background: linear-gradient(180deg, #5a4320, #2a1f0e); color: #f1e2bc; font-weight: 700; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; box-shadow: 0 0 16px rgba(241, 200, 110, 0.25); }
.btn-buyback em { font-style: normal; color: #ffd24a; }
.btn-buyback:hover { filter: brightness(1.25); }
.btn-buyback.disabled { filter: grayscale(0.9) brightness(0.6); cursor: not-allowed; }
.hud-pause { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; background: rgba(0, 0, 0, 0.35); pointer-events: none; }
.hud-pause.show { opacity: 1; }
.ps-box { text-align: center; padding: 18px 60px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.8) 20%, rgba(0, 0, 0, 0.8) 80%, transparent); border-top: 1px solid rgba(200, 162, 85, 0.4); border-bottom: 1px solid rgba(200, 162, 85, 0.4); }
.ps-h { font-family: var(--f-title); font-weight: 900; font-size: 48px; letter-spacing: 0.3em; color: #f1e2bc; text-transform: uppercase; }
.ps-s { color: var(--dim); font-size: 15px; letter-spacing: 0.1em; }

/* ===================================================================
   WS4: settings tabs + hotkeys, tooltip values, tutorial tips, scaling
   =================================================================== */
.set-tabs { display: flex; gap: 2px; margin: -4px 0 12px; border-bottom: 1px solid rgba(200, 162, 85, 0.25); }
.set-tabs button { pointer-events: auto; background: transparent; border: 1px solid transparent; border-bottom: 0; padding: 8px 16px; color: var(--dim); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.set-tabs button:hover { color: var(--text); }
.set-tabs button.on { color: #fff3d0; background: linear-gradient(180deg, rgba(200, 162, 85, 0.22), rgba(200, 162, 85, 0.04)); border-color: rgba(200, 162, 85, 0.35); }
.set-note { font-size: 12.5px; color: #9a927e; line-height: 1.4; margin: 2px 0 6px; }
.btn-game.small { padding: 5px 12px; font-size: 11px; }
.kb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.kb-group { break-inside: avoid; }
.kb-gh { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin: 8px 0 2px; font-weight: 700; }
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.kb-key { pointer-events: auto; min-width: 64px; padding: 3px 8px; font-family: var(--f-ui); font-weight: 700; font-size: 12.5px; color: #f1e2bc; background: linear-gradient(#3a3c40, #1c1d20); border: 1px solid #55504a; border-bottom-width: 2px; border-radius: 3px; }
.kb-key:hover { border-color: #c8a255; color: #fff; }
.kb-key.wait { color: #1a1206; background: linear-gradient(#f6dc98, #c8963c); border-color: #fff0c0; animation: pulse 1s ease-in-out infinite; }
.kb-msg { float: right; font-family: var(--f-ui); letter-spacing: 0.05em; text-transform: none; color: #9dff7a; font-size: 12px; }
.kb-msg.bad { color: #ff8a70; }
.kb-actions { margin-top: 10px; }
.kb-actions .btn-game { flex: none; }

.tt-vals { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.tt-kv.tt-small { font-size: 11.5px; }
.tt-kv b.yes { color: #9dff7a; }
.tt-kv b.no { color: #a09a8a; }
.tt-active em { font-style: normal; color: var(--dim); font-size: 11.5px; margin-left: 4px; }
.tt-scepter { margin-top: 6px; padding: 5px 7px; font-size: 12px; color: #bcd8ff; background: rgba(60, 110, 200, 0.12); border: 1px solid rgba(90, 140, 230, 0.25); }
.tt-scepter b { color: #8fc0ff; }

.hud-tutorial { position: absolute; left: 12px; top: 26%; width: 300px; pointer-events: none; opacity: 0; transform: translateX(-12px); transition: opacity 0.35s, transform 0.35s; zoom: var(--z); }
.hud-tutorial.show { opacity: 1; transform: none; }
.hud-tutorial.show .tut-card { pointer-events: auto; }
.tut-card { background: linear-gradient(180deg, rgba(28, 32, 38, 0.94), rgba(14, 16, 19, 0.94)); border: 1px solid #5a4a2a; box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0, 0, 0, 0.6); }
.tut-h { display: flex; align-items: center; gap: 8px; padding: 7px 8px 6px 10px; border-bottom: 1px solid rgba(200, 162, 85, 0.2); background: linear-gradient(180deg, rgba(200, 162, 85, 0.16), transparent); }
.tut-h b { flex: 1; font-family: var(--f-title); font-size: 13.5px; letter-spacing: 0.08em; color: #f1e2bc; }
.tut-ic { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #1a1206; background: radial-gradient(circle at 35% 30%, #fff3c0, #d8a440); }
.tut-x { background: none; border: 0; color: var(--dim); font-size: 13px; padding: 2px 5px; }
.tut-x:hover { color: #fff; }
.tut-b { padding: 8px 12px 6px; font-size: 13.5px; line-height: 1.45; color: #d8d0bc; }
.tut-b b { color: #f1d9a0; }
.tut-b kbd { font-size: 10.5px; }
.tut-f { display: flex; align-items: center; gap: 10px; padding: 2px 10px 8px; }
.tut-off { background: none; border: 0; padding: 0; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.tut-off:hover { color: var(--dim); }
.tut-bar { flex: 1; height: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tut-bar i { display: block; height: 100%; background: var(--gold); transform-origin: left; }

/* Tooltips and modals follow the HUD scale (set on #ui-root by UI.applyScale) */
.ui-tooltip .tt { zoom: var(--uz, 1); }
.ui-modal { zoom: var(--uz, 1); }
/* overlay canvases stacked on the minimap (e.g. WS5 rune markers) must stay transparent */
.hud-minimap canvas.mm-markers { background: transparent; box-shadow: none; border-color: transparent; cursor: inherit; }

/* Settings / Game Menu: wide enough that both tabs fit a 1280x720 window without a scrollbar (columns, tighter rows) */
.ui-modal.settings { width: 900px; max-width: 96vw; max-height: 97vh; }
.ui-modal.settings .md-head { padding: 8px 16px; }
.ui-modal.settings .md-body { padding: 8px 16px 12px; }
.ui-modal.settings .set-tabs { margin-bottom: 6px; }
.ui-modal.settings .set-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; align-items: start; }
.ui-modal.settings .set-sec { margin: 10px 0 3px; }
.ui-modal.settings .set-row { padding: 3px 0; }
.ui-modal.settings .set-note { margin: 1px 0 3px; }
.ui-modal.settings .kb-grid { grid-template-columns: repeat(3, 1fr); gap: 0 22px; }
.ui-modal.settings .kb-gh { margin: 5px 0 1px; }
.ui-modal.settings .kb-row { padding: 1px 0; font-size: 13px; }
.ui-modal.settings .ctl-grid { grid-template-columns: repeat(3, 1fr); gap: 0 22px; }
.ui-modal.settings .ctl-row { padding: 2px 0; font-size: 13px; }
.ui-modal.settings .set-actions { margin-top: 8px; }
.ui-modal.settings .kb-actions { margin-top: 6px; }
