/* Campfire Nights — dark glassmorphism camp UI */
:root {
  --glass: rgba(20, 24, 40, 0.6);
  --glass-strong: rgba(16, 19, 33, 0.82);
  --glass-border: rgba(255, 236, 210, 0.1);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --accent: #ff9f43;
  --accent-2: #ffcf5a;
  --accent-deep: #e8590c;
  --cream: #fff4e0;
  --muted: rgba(255, 244, 224, 0.62);
  --dim: rgba(255, 244, 224, 0.38);
  --hp: #ff5a5f;
  --hunger: #ff9f43;
  --good: #3ddc84;
  --warn: #ffcf5a;
  --danger: #ff5a5f;
  --night: #8fa8ff;
  --r: 18px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --font: 'Baloo 2', 'Fredoka', 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #070b16; color: var(--cream);
  font-family: var(--font); overscroll-behavior: none; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
input { font-family: inherit; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.hidden { display: none !important; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }

.glass {
  background: linear-gradient(160deg, rgba(34, 39, 62, 0.66), rgba(16, 19, 33, 0.6));
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-hi);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-radius: var(--r);
}

/* ---------- buttons ---------- */
.btn { font-weight: 600; border-radius: 16px; padding: 12px 20px; transition: transform 0.12s, filter 0.12s, box-shadow 0.12s; letter-spacing: 0.04em; }
.btn:active { transform: translateY(2px) scale(0.98); }
.btn:disabled { filter: grayscale(0.8) brightness(0.7); cursor: default; }
.btn-primary:disabled { filter: none; background: rgba(255, 255, 255, 0.07); color: var(--dim); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); text-shadow: none; }
.btn-primary {
  background: linear-gradient(180deg, #ffb760 0%, #ff8f2e 55%, #f2701c 100%); color: #2a1406;
  box-shadow: 0 6px 0 #b4500f, 0 10px 26px rgba(255, 140, 50, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:active { box-shadow: 0 3px 0 #b4500f, 0 6px 16px rgba(255, 140, 50, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.btn-ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--cream); }
.btn-big { font-size: 22px; padding: 14px 28px; width: 100%; font-weight: 700; }
.btn-sm { font-size: 14px; padding: 8px 14px; border-radius: 12px; }

/* ---------- start screen ---------- */
.screen {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal));
  background: radial-gradient(90% 45% at 50% 108%, rgba(255, 120, 40, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(4, 7, 18, 0.55) 0%, rgba(4, 7, 18, 0.1) 40%, rgba(4, 7, 18, 0.55) 100%);
}
.start-wrap { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; margin: auto; }
.brand { text-align: center; position: relative; }
.logo { margin: 0; line-height: 0.92; display: flex; flex-direction: column; align-items: center; font-weight: 700; letter-spacing: 0.06em; }
.logo .l1 { font-size: clamp(38px, 8.5vw, 64px);
  background: linear-gradient(180deg, #fff3d1 0%, #ffcf5a 45%, #ff8a2a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 150, 50, 0.55)) drop-shadow(0 4px 0 rgba(90, 30, 0, 0.6)); }
.logo .l2 { font-size: clamp(30px, 6.5vw, 48px); letter-spacing: 0.32em; margin-left: 0.32em; color: #c9d6ff;
  text-shadow: 0 0 22px rgba(143, 168, 255, 0.7), 0 3px 0 rgba(10, 16, 40, 0.8); }
.tagline { margin: 8px 0 0; color: var(--muted); font-size: clamp(14px, 3.4vw, 18px); letter-spacing: 0.12em; text-transform: uppercase; }
.brand-fire { position: relative; height: 34px; width: 60px; margin: 0 auto 6px; }
.brand-fire i { position: absolute; bottom: 0; left: 50%; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; transform-origin: 50% 100%; animation: flick 0.9s ease-in-out infinite alternate; }
.brand-fire i:nth-child(1) { width: 30px; height: 34px; margin-left: -15px; background: radial-gradient(circle at 50% 75%, #ffd34a, #ff7a1a 60%, rgba(255, 74, 18, 0) 72%); filter: blur(1px); }
.brand-fire i:nth-child(2) { width: 18px; height: 24px; margin-left: -14px; background: radial-gradient(circle at 50% 75%, #fff1b0, #ffb347 60%, transparent 72%); animation-delay: -0.3s; }
.brand-fire i:nth-child(3) { width: 16px; height: 22px; margin-left: -2px; background: radial-gradient(circle at 50% 75%, #fff1b0, #ff9f43 60%, transparent 72%); animation-delay: -0.6s; }
@keyframes flick { 0% { transform: scale(1, 1) rotate(-3deg); } 100% { transform: scale(0.9, 1.15) rotate(3deg); } }

.start-card { width: 100%; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, rgba(30, 35, 58, 0.72), rgba(14, 17, 30, 0.72)); }
.returning { text-align: center; font-size: 15px; color: var(--accent-2); background: rgba(255, 159, 67, 0.1); border: 1px solid rgba(255, 159, 67, 0.25); border-radius: 12px; padding: 8px 12px; }
.custom { display: flex; gap: 16px; align-items: center; }
.preview-wrap { position: relative; width: 150px; height: 190px; flex: none; border-radius: 16px;
  background: radial-gradient(70% 60% at 50% 80%, rgba(255, 150, 60, 0.28), transparent 70%), rgba(0, 0, 0, 0.18); border: 1px solid rgba(255, 255, 255, 0.06); overflow: hidden; }
#previewCanvas { width: 100%; height: 100%; display: block; position: relative; z-index: 1; }
.preview-floor { position: absolute; left: 20%; right: 20%; bottom: 14px; height: 14px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.5), transparent 70%); }
.custom-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
#nameInput { width: 100%; font-size: 20px; font-weight: 600; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(0, 0, 0, 0.3); color: var(--cream); outline: none; }
#nameInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 159, 67, 0.25); }
.field-error { min-height: 16px; font-size: 13px; color: #ff8a8e; }
.sw-row { display: flex; align-items: center; gap: 8px; }
.sw-label { width: 44px; flex: none; font-size: 13px; color: var(--muted); }
.swatches { display: flex; gap: 5px; overflow-x: auto; padding: 3px 2px; scrollbar-width: none; touch-action: pan-x; }
.swatches::-webkit-scrollbar { display: none; }
.swatch { width: 26px; height: 26px; flex: none; border-radius: 9px; border: 2px solid rgba(255, 255, 255, 0.15); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); transition: transform 0.1s; }
.swatch.sel { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 0 2px var(--accent), inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.start-actions { display: flex; flex-direction: column; gap: 10px; }
#continueBtn { font-size: 19px; }
#continueBtn:not(.hidden) + #playBtn { background: rgba(255, 255, 255, 0.08); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); font-size: 17px; text-shadow: none; }
.start-status { text-align: center; min-height: 18px; font-size: 14px; color: var(--accent-2); }
.howto { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.howto li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.howto b { font-size: 24px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 159, 67, 0.12); border: 1px solid rgba(255, 159, 67, 0.2); }
.howto strong { color: var(--cream); font-weight: 600; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > *, #hud button { pointer-events: auto; }
#hud .hud-tl, #hud .actions { pointer-events: none; }
#hud .hud-tl > *, #hud .actions > *, #hud .ctx-col > * { pointer-events: auto; }

.dial { position: absolute; top: calc(10px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; }
.dial-ring { position: relative; width: 56px; height: 56px; flex: none; }
.dial-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(0, 0, 0, 0.3); stroke: rgba(255, 255, 255, 0.1); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent-2); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 157.08; stroke-dashoffset: 157.08; transition: stroke-dashoffset 0.9s linear, stroke 0.6s; filter: drop-shadow(0 0 4px rgba(255, 207, 90, 0.7)); }
.dial.night .ring-fg { stroke: var(--night); filter: drop-shadow(0 0 5px rgba(143, 168, 255, 0.8)); }
.dial-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; color: #ffd34a; text-shadow: 0 0 12px rgba(255, 200, 80, 0.9); }
.dial.night .dial-icon { color: #dfe6ff; text-shadow: 0 0 12px rgba(160, 180, 255, 0.9); }
.dial-text { display: flex; flex-direction: column; min-width: 104px; }
.dial-title { font-size: 22px; font-weight: 700; line-height: 1.05; letter-spacing: 0.02em; }
.dial.night .dial-title { color: #dfe6ff; }
.dial-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fire-row { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.fire-ico { font-size: 12px; }
.fire-bar { flex: 1; height: 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.fire-bar i { display: block; height: 100%; width: 50%; border-radius: 4px; background: linear-gradient(90deg, #ff5a1f, #ffcf5a); transition: width 0.6s; box-shadow: 0 0 8px rgba(255, 140, 50, 0.8); }
.fire-row.low .fire-bar i { background: linear-gradient(90deg, #ff3b3b, #ff7a1a); animation: blink 0.8s infinite alternate; }
@keyframes blink { to { opacity: 0.45; } }

.hud-tl { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); display: flex; flex-direction: column; gap: 8px; width: min(290px, 34vw); }
.vitals { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hud-name { font-weight: 600; font-size: 15px; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row { display: flex; align-items: center; gap: 7px; }
.bar-ico { font-size: 15px; width: 18px; text-align: center; }
.bar { position: relative; flex: 1; height: 16px; border-radius: 9px; background: rgba(0, 0, 0, 0.4); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5); }
.bar i { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 9px; transition: width 0.35s; }
.bar.hp i { background: linear-gradient(180deg, #ff8a8e, #ff5a5f 50%, #d63b40); box-shadow: 0 0 10px rgba(255, 90, 95, 0.6); }
.bar.hunger i { background: linear-gradient(180deg, #ffc27a, #ff9f43 50%, #e07a1f); box-shadow: 0 0 10px rgba(255, 159, 67, 0.5); }
.bar span { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.bar.low i { animation: blink 0.6s infinite alternate; }

.objectives { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.obj-head { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.obj { display: flex; align-items: center; gap: 9px; font-size: 13.5px; line-height: 1.2; color: var(--cream); }
.obj.main { font-size: 15px; font-weight: 600; }
.obj.main .obj-ico { background: rgba(255, 159, 67, 0.2); border-color: rgba(255, 159, 67, 0.45); }
.obj-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 16px; }
.obj-body { flex: 1; min-width: 0; }
.obj-text { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.obj-prog { margin-top: 4px; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.obj-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.obj-nav { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 34px; }
.obj-arrow { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 159, 67, 0.18); border: 1px solid rgba(255, 159, 67, 0.5); transition: transform 0.1s linear; }
.obj-arrow svg { width: 14px; height: 14px; fill: var(--accent-2); }
.obj-dist { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

.hud-tr { position: absolute; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
#hud .hud-tr { pointer-events: none; }
#hud .hud-tr > * { pointer-events: auto; }
.hud-btns { display: flex; flex-direction: column; gap: 8px; }
.icon-btn { position: relative; width: 46px; height: 46px; border-radius: 15px; font-size: 21px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(34, 39, 62, 0.7), rgba(16, 19, 33, 0.65)); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); transition: transform 0.1s; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn b { position: absolute; right: -4px; top: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #2a1406; font-size: 11px; display: grid; place-items: center; }

.hotbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sab)); display: flex; gap: 6px; padding: 7px; border-radius: 20px; }
.slot { position: relative; width: 56px; height: 56px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.07); display: grid; place-items: center; font-size: 27px; transition: transform 0.1s, background 0.2s; }
.slot:active { transform: scale(0.92); }
.slot.empty { opacity: 0.38; filter: grayscale(0.6); }
.slot .cnt { position: absolute; right: 4px; bottom: 2px; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.slot .cnt.full { color: var(--accent-2); }
.slot .tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #2a1406; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.slot.can { background: rgba(255, 159, 67, 0.14); border-color: rgba(255, 159, 67, 0.4); }
.slot.bump { animation: bump 0.35s; }
.slot.tool { font-size: 22px; }
.slot.tool .tier { position: absolute; left: 4px; bottom: 2px; font-size: 10px; font-weight: 700; color: var(--accent-2); }
.hb-sep { width: 1px; background: rgba(255, 255, 255, 0.1); margin: 6px 2px; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.net-status { position: absolute; top: calc(84px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(255, 90, 95, 0.85); font-weight: 600; font-size: 14px; }

/* joystick & action buttons */
.joystick { position: absolute; left: calc(22px + var(--sal)); bottom: calc(22px + var(--sab)); width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.1) 70%, rgba(255, 255, 255, 0.04) 71%);
  border: 2px solid rgba(255, 236, 210, 0.16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: none; }
.joystick.active { border-color: rgba(255, 159, 67, 0.5); }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff4e0, #e9d6b8 60%, #b9a07c); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); pointer-events: none; }

.actions { position: absolute; right: calc(18px + var(--sar)); bottom: calc(18px + var(--sab)); width: 230px; height: 230px; }
.btn-action { position: absolute; right: 0; bottom: 0; width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: radial-gradient(circle at 50% 30%, #ffc27a, #ff9f43 45%, #e8590c 100%); color: #2a1406;
  box-shadow: 0 7px 0 #a8460c, 0 0 0 5px rgba(255, 159, 67, 0.22), 0 0 30px rgba(255, 140, 50, 0.55), inset 0 3px 0 rgba(255, 255, 255, 0.45); transition: transform 0.08s, filter 0.2s, box-shadow 0.2s; touch-action: none; }
.btn-action .a-ico { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2)); }
.btn-action .a-lbl { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; margin-top: 2px; }
.btn-action.ready { animation: readyPulse 1.2s ease-in-out infinite; }
.btn-action.idle { background: radial-gradient(circle at 50% 30%, rgba(80, 88, 120, 0.85), rgba(34, 39, 62, 0.85)); color: var(--muted); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.06), inset 0 2px 0 rgba(255, 255, 255, 0.1); }
.btn-action.pressed { transform: translateY(4px) scale(0.96); }
.btn-action.blocked { filter: grayscale(0.7) brightness(0.8); }
@keyframes readyPulse { 0%, 100% { box-shadow: 0 7px 0 #a8460c, 0 0 0 5px rgba(255, 159, 67, 0.22), 0 0 24px rgba(255, 140, 50, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.45); } 50% { box-shadow: 0 7px 0 #a8460c, 0 0 0 10px rgba(255, 159, 67, 0.12), 0 0 40px rgba(255, 140, 50, 0.75), inset 0 3px 0 rgba(255, 255, 255, 0.45); } }
.btn-round { position: absolute; width: 64px; height: 64px; border-radius: 50%; font-weight: 700; font-size: 13px; letter-spacing: 0.05em; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(44, 50, 78, 0.8), rgba(20, 24, 40, 0.8)); border: 1px solid rgba(255, 236, 210, 0.16); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); touch-action: none; transition: transform 0.08s; }
.btn-round.pressed { transform: translateY(3px) scale(0.95); }
.btn-jump { right: 124px; bottom: 6px; }
.ctx-col { position: absolute; right: 0; bottom: 124px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.btn-ctx { white-space: nowrap; display: flex; align-items: center; gap: 7px; padding: 8px 14px 8px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: 0.05em;
  background: linear-gradient(180deg, rgba(255, 183, 96, 0.95), rgba(242, 112, 28, 0.95)); color: #2a1406; box-shadow: 0 4px 0 #a8460c, 0 6px 18px rgba(255, 120, 40, 0.4); animation: popIn 0.25s; touch-action: none; }
.btn-ctx b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.35); font-size: 18px; }
.btn-ctx.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #a8460c; }
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.desk-hint { position: absolute; left: calc(14px + var(--sal)); bottom: calc(12px + var(--sab)); font-size: 12.5px; color: var(--dim); display: none; max-width: 30vw; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .joystick { display: none; }
  .desk-hint { display: block; }
}

/* ---------- name tags / floaters ---------- */
.tag-layer, .fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fx-layer { z-index: 6; }
.nametag { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(12, 15, 28, 0.62); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--cream); text-shadow: 0 1px 2px #000; will-change: transform; }
.nametag.me { display: none !important; }
.nametag.kid { background: rgba(255, 159, 67, 0.92); color: #2a1406; text-shadow: none; animation: helpPulse 1s infinite alternate; }
.nametag.kid.safe { background: rgba(61, 220, 132, 0.85); animation: none; }
.nametag.bench { background: rgba(255, 159, 67, 0.2); border-color: rgba(255, 159, 67, 0.4); font-size: 12px; letter-spacing: 0.08em; }
.nametag .hp-mini { display: block; height: 3px; margin-top: 2px; border-radius: 2px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.nametag .hp-mini i { display: block; height: 100%; background: var(--hp); }
@keyframes helpPulse { to { transform-origin: center; filter: brightness(1.25); } }
.bubble { position: absolute; left: 0; top: 0; font-size: 30px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); animation: bubbleIn 0.3s; }
@keyframes bubbleIn { from { opacity: 0; } }
.floater { position: absolute; left: 0; top: 0; font-size: 22px; font-weight: 700; white-space: nowrap; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 10px rgba(0, 0, 0, 0.5); will-change: transform, opacity; }
.floater.good { color: #b8ffcf; }
.floater.bad { color: #ff8a8e; font-size: 24px; }
.floater.gold { color: var(--accent-2); }

/* ---------- vignette / overlays ---------- */
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0; transition: opacity 0.5s;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 20, 30, 0.55) 100%); }
.hunger-pulse { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 140, 40, 0.45) 100%); }
.hunger-pulse.on { animation: hungerPulse 1.6s ease-in-out infinite; }
@keyframes hungerPulse { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.8; } }

.banner { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; }
.banner .bars i { position: absolute; left: 0; right: 0; height: 11vh; background: #000; transition: transform 0.7s cubic-bezier(.2, .8, .2, 1); }
.banner .bars i:first-child { top: 0; transform: translateY(-100%); }
.banner .bars i:last-child { bottom: 0; transform: translateY(100%); }
.banner.show.cine .bars i { transform: translateY(0); }
.banner-inner { text-align: center; opacity: 0; transform: scale(0.85); transition: opacity 0.6s, transform 0.8s cubic-bezier(.2, .8, .2, 1); padding: 0 20px; }
.banner.show .banner-inner { opacity: 1; transform: scale(1); }
.banner-title { font-size: clamp(42px, 10vw, 92px); font-weight: 700; letter-spacing: 0.08em; line-height: 1; }
.banner.night .banner-title { color: #dfe6ff; text-shadow: 0 0 30px rgba(120, 150, 255, 0.9), 0 0 80px rgba(80, 100, 255, 0.6), 0 4px 0 rgba(0, 0, 0, 0.5); }
.banner.dawn .banner-title { font-size: clamp(30px, 7vw, 64px); background: linear-gradient(180deg, #fff3d1, #ffcf5a 50%, #ff8a2a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(255, 170, 60, 0.7)); }
.banner.warn .banner-title { font-size: clamp(28px, 6vw, 54px); color: #ffb3a0; text-shadow: 0 0 24px rgba(255, 80, 60, 0.8); }
.banner-sub { margin-top: 12px; font-size: clamp(15px, 3.4vw, 22px); color: var(--muted); letter-spacing: 0.06em; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }

.badge-pop { position: fixed; top: calc(90px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 31; display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(60, 44, 20, 0.85), rgba(30, 22, 12, 0.85)); border: 1px solid rgba(255, 207, 90, 0.5); box-shadow: 0 0 30px rgba(255, 180, 60, 0.4); animation: badgeIn 0.5s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
.badge-pop .b-ico { font-size: 34px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: radial-gradient(circle, rgba(255, 207, 90, 0.4), rgba(255, 159, 67, 0.15)); }
.badge-pop small { display: block; font-size: 11px; letter-spacing: 0.16em; color: var(--accent-2); text-transform: uppercase; }
.badge-pop strong { font-size: 19px; }
@keyframes badgeIn { from { transform: translate(-50%, -30px) scale(0.7); opacity: 0; } }

.ko { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(20, 10, 30, 0.5), rgba(40, 0, 10, 0.85)); animation: fadeIn 0.6s; }
.ko-card { text-align: center; }
.ko-ico { font-size: 60px; animation: spin 2s linear infinite; display: inline-block; }
.ko-title { font-size: clamp(36px, 8vw, 60px); font-weight: 700; color: #ffd0c4; text-shadow: 0 0 24px rgba(255, 90, 95, 0.7); }
.ko-sub { font-size: 20px; color: var(--muted); margin-top: 4px; }
.ko-sub b { color: var(--cream); font-size: 28px; }
.ko-hint { margin-top: 14px; font-size: 15px; color: var(--accent-2); max-width: 320px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }

.victory { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at center, rgba(255, 170, 60, 0.25), rgba(5, 8, 20, 0.85)); animation: fadeIn 0.8s; }
.victory-card { text-align: center; padding: 28px 26px; width: min(440px, 100%); border-color: rgba(255, 207, 90, 0.45); box-shadow: 0 0 60px rgba(255, 170, 60, 0.35); }
.trophy { font-size: 72px; animation: float 2s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255, 200, 60, 0.8)); }
.victory h2 { margin: 6px 0; font-size: 28px; letter-spacing: 0.06em; line-height: 1.1; }
.victory h2 span { font-size: 44px; background: linear-gradient(180deg, #fff3d1, #ffcf5a 50%, #ff8a2a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.victory p { color: var(--muted); margin: 10px 0 18px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(3, 5, 12, 0.5); padding: calc(12px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); animation: fadeIn 0.2s; }
.modal-card { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; padding: 16px; background: linear-gradient(160deg, rgba(30, 35, 58, 0.9), rgba(14, 17, 30, 0.9)); animation: popIn 0.22s; }
.modal-card.small { width: min(380px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.modal-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.modal-title .mt-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-head-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.modal-head-extra:empty { display: none; }
.close-btn { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-size: 18px; }
.modal-body { overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; min-height: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; background: rgba(0, 0, 0, 0.25); padding: 4px; border-radius: 14px; }
.tab { flex: 1; padding: 8px; border-radius: 11px; font-weight: 600; color: var(--muted); }
.tab.active { background: linear-gradient(180deg, #ffb760, #f2701c); color: #2a1406; }
.panel-note { font-size: 13.5px; color: var(--accent-2); background: rgba(255, 159, 67, 0.1); border: 1px solid rgba(255, 159, 67, 0.25); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.card-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); }
.card-row.locked { opacity: 0.55; }
.card-row.owned { opacity: 0.7; }
.card-ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; font-size: 28px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.card-info { flex: 1; min-width: 0; }
.card-name { font-weight: 600; font-size: 16px; }
.card-desc { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; padding: 2px 8px 2px 5px; border-radius: 999px; background: rgba(61, 220, 132, 0.14); border: 1px solid rgba(61, 220, 132, 0.35); }
.chip.miss { background: rgba(255, 90, 95, 0.14); border-color: rgba(255, 90, 95, 0.45); color: #ffb3b5; }
.lock { font-size: 12px; font-weight: 600; color: var(--accent-2); white-space: nowrap; }
.pill-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); white-space: nowrap; }
.camp-hero { text-align: center; padding: 10px; }
.camp-lv { font-size: 46px; font-weight: 700; color: var(--accent-2); text-shadow: 0 0 20px rgba(255, 180, 60, 0.6); line-height: 1; }
.camp-lv small { font-size: 16px; color: var(--muted); display: block; letter-spacing: 0.14em; }
.lv-track { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.lv-track i { width: 30px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.lv-track i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px rgba(255, 159, 67, 0.6); }
.perks { font-size: 13px; color: var(--muted); margin: 6px 0 10px; line-height: 1.5; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.inv-item { position: relative; padding: 10px 6px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); text-align: center; }
.inv-item.zero { opacity: 0.35; }
.inv-item .ii { font-size: 30px; }
.inv-item .in { font-size: 12px; color: var(--muted); }
.inv-item .ic { font-size: 16px; font-weight: 700; }
.inv-item .btn { margin-top: 5px; width: 100%; padding: 5px; font-size: 12px; }
.sec-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 8px 0 2px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; font-size: 13px; color: var(--muted); }
.stats-grid b { color: var(--cream); }
.pl-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.pl-dot { width: 26px; height: 26px; border-radius: 8px; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.pl-row .pl-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-hp { width: 70px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.pl-hp i { display: block; height: 100%; background: var(--hp); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.badge-item { text-align: center; padding: 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); }
.badge-item .bi { font-size: 32px; }
.badge-item .bn { font-size: 13px; font-weight: 600; margin-top: 4px; }
.badge-item .bd { font-size: 11px; color: var(--muted); }
.badge-item.got { background: rgba(255, 207, 90, 0.1); border-color: rgba(255, 207, 90, 0.4); }
.badge-item:not(.got) .bi { filter: grayscale(1) brightness(0.6); }

.emote-wheel { position: fixed; inset: 0; z-index: 40; background: rgba(3, 5, 12, 0.35); }
.emote-ring { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; background: radial-gradient(circle, rgba(20, 24, 40, 0.75) 30%, rgba(20, 24, 40, 0.5) 70%, transparent 71%); }
.emote-opt { position: absolute; width: 66px; height: 66px; margin: -33px 0 0 -33px; border-radius: 50%; font-size: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(50, 56, 86, 0.95), rgba(24, 28, 46, 0.95)); border: 1px solid rgba(255, 236, 210, 0.2); }
.emote-opt small { font-size: 10px; color: var(--muted); font-weight: 600; }
.emote-opt:active { transform: scale(0.9); }

/* toasts */
.toasts { position: fixed; top: calc(92px + var(--sat)); left: 50%; transform: translateX(-50%); z-index: 32; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 460px); }
.toast { padding: 9px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; text-align: center; background: rgba(16, 19, 33, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); animation: toastIn 0.3s cubic-bezier(.2, 1.3, .4, 1); transition: opacity 0.35s, transform 0.35s; }
.toast.good { border-color: rgba(61, 220, 132, 0.5); color: #c9ffdc; }
.toast.warn { border-color: rgba(255, 207, 90, 0.55); color: #ffe7a8; }
.toast.danger { border-color: rgba(255, 90, 95, 0.6); color: #ffc4c6; background: rgba(50, 12, 18, 0.88); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.9); } }
.toasts .toast { max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.toast-n { flex: none; min-width: 26px; padding: 1px 7px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.16); color: #fff4e0; font-variant-numeric: tabular-nums; }
.toast-n.hidden { display: none; }
.toast.bump { animation: toastBump 0.28s ease-out; }
@keyframes toastBump { 40% { transform: scale(1.06); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 45; width: 100%; height: 100%; }

/* coal icon (no emoji exists) */
.i-coal { display: inline-block; width: 0.95em; height: 0.8em; vertical-align: -0.08em; background: linear-gradient(135deg, #b4bac6 0%, #5d626e 30%, #2a2c33 65%, #15161a 100%); clip-path: polygon(18% 8%, 62% 0, 96% 30%, 100% 72%, 70% 100%, 22% 94%, 0 58%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }

/* ---------- responsive ---------- */
@media (min-width: 900px) and (orientation: landscape) {
  .screen { justify-content: flex-start; }
  .start-wrap { margin: auto 0 auto 5vw; width: min(540px, 48vw); }
}
@media (max-width: 760px) and (orientation: portrait) {
  .custom { flex-direction: column; gap: 10px; }
  .preview-wrap { width: 120px; height: 140px; }
  .custom-fields { width: 100%; }
  .start-card { padding: 14px; gap: 10px; }
  .howto li { font-size: 11.5px; }

  .dial { padding: 5px 12px 5px 5px; gap: 7px; left: calc(136px + var(--sal)); transform: none; }
  .dlong { display: none; }
  .dial-ring { width: 44px; height: 44px; }
  .dial-icon { font-size: 19px; }
  .dial-text { min-width: 78px; }
  .dial-title { font-size: 17px; }
  .dial-sub { font-size: 11px; }
  .hud-tl { width: auto; }
  .vitals { padding: 7px 9px; width: 116px; gap: 4px; }
  .hud-name { display: none; }
  .bar { height: 13px; }
  .bar-ico { font-size: 12px; width: 14px; }
  .bar span { font-size: 10px; right: 5px; }
  .objectives { width: min(232px, 60vw); padding: 7px 9px; gap: 5px; }
  .obj-head { display: none; }
  .obj { font-size: 11.5px; gap: 6px; }
  .obj.main { font-size: 12px; }
  .obj.main .obj-prog { display: none; }
  .obj-ico { width: 24px; height: 24px; font-size: 13px; border-radius: 8px; }
  .obj-nav { width: 28px; }
  .obj-arrow { width: 22px; height: 22px; }
  .obj-arrow svg { width: 12px; height: 12px; }
  .hud-tr { flex-direction: column; gap: 6px; }
  .icon-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 13px; }
  .hotbar { bottom: calc(176px + var(--sab)); gap: 4px; padding: 5px; border-radius: 16px; }
  .slot { width: 44px; height: 44px; font-size: 21px; border-radius: 11px; }
  .slot .cnt { font-size: 11px; }
  .slot.tool { display: none; }
  .hb-sep { display: none; }
  .joystick { width: 124px; height: 124px; left: calc(16px + var(--sal)); bottom: calc(24px + var(--sab)); }
  .joy-knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .actions { right: calc(12px + var(--sar)); bottom: calc(18px + var(--sab)); width: 200px; height: 150px; }
  .btn-action { width: 100px; height: 100px; }
  .btn-action .a-ico { font-size: 30px; }
  .btn-jump { right: 108px; bottom: 0; width: 58px; height: 58px; }
  .ctx-col { bottom: 112px; }
  .toasts { top: calc(64px + var(--sat)); }
  .badge-pop { top: calc(64px + var(--sat)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .start-wrap { width: min(760px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: center; gap: 18px; }
  .start-card { min-width: 0; }
  .logo .l1 { font-size: clamp(30px, 6vw, 48px); }
  .logo .l2 { font-size: clamp(24px, 4.6vw, 36px); }
  .start-card { padding: 12px; gap: 8px; }
  .preview-wrap { width: 110px; height: 140px; }
  .howto { display: none; }
  .btn-big { font-size: 18px; padding: 10px 20px; }
  .dial { top: calc(6px + var(--sat)); padding: 4px 12px 4px 4px; }
  .dial-ring { width: 42px; height: 42px; }
  .dial-title { font-size: 17px; }
  .hud-tl { top: calc(6px + var(--sat)); gap: 6px; width: min(240px, 30vw); }
  .vitals { padding: 6px 9px; gap: 4px; }
  .hud-name { display: none; }
  .bar { height: 12px; }
  .objectives { padding: 7px 9px; gap: 5px; }
  .obj { font-size: 11.5px; }
  .obj-ico { width: 24px; height: 24px; font-size: 13px; }
  .obj:nth-child(n+4) { display: none; }
  .hud-tr { top: calc(6px + var(--sat)); }
  .icon-btn { width: 38px; height: 38px; font-size: 17px; }
  .hotbar { bottom: calc(8px + var(--sab)); padding: 4px; gap: 4px; }
  .slot { width: 44px; height: 44px; font-size: 21px; }
  .joystick { width: 118px; height: 118px; bottom: calc(14px + var(--sab)); }
  .actions { bottom: calc(10px + var(--sab)); width: 200px; height: 170px; }
  .btn-action { width: 92px; height: 92px; }
  .btn-jump { right: 100px; width: 56px; height: 56px; }
  .ctx-col { bottom: 102px; }
  .toasts { top: calc(56px + var(--sat)); }
}

/* =====================================================================
   v3 GAMEPLAY UI (ui/*.js modules)
   ===================================================================== */
:root { --blood: #ff3b4a; --blood-deep: #7a0d18; --gem: #5fd8ff; --stam: #ffe066; --warm: #ff8a5c; --cold: #8fd3ff; }
.btn-danger { background: linear-gradient(180deg, #ff7a7f, #e0444b); color: #2a0608; box-shadow: 0 4px 0 #8f2329, 0 6px 16px rgba(255, 70, 80, 0.3); }
.btn.busy { animation: busyPulse 0.4s; }
@keyframes busyPulse { 50% { transform: scale(0.94); } }
.dot { position: absolute; right: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-style: normal; box-shadow: 0 0 0 2px rgba(10, 12, 24, 0.8); animation: dotPop 1.4s ease-in-out infinite; }
@keyframes dotPop { 50% { transform: scale(1.18); } }
.i-iron { display: inline-block; width: 1em; height: 0.62em; vertical-align: 0; background: linear-gradient(160deg, #f4f7fb 0%, #b6bfcc 35%, #7d8796 70%, #4b525e 100%); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.i-alpha { filter: sepia(1) saturate(4) hue-rotate(-12deg) brightness(1.1) drop-shadow(0 0 3px rgba(255, 200, 60, 0.8)); }

/* ---------- segmented control ---------- */
.seg { display: flex; gap: 4px; background: rgba(0, 0, 0, 0.28); padding: 4px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.05); }
.seg-btn { flex: 1; padding: 8px 6px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background 0.18s, color 0.18s, transform 0.1s; }
.seg-btn:active { transform: scale(0.96); }
.seg-btn.active { background: linear-gradient(180deg, #ffb760, #f2701c); color: #2a1406; box-shadow: 0 2px 8px rgba(255, 120, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.seg.tabs { margin-bottom: 10px; }

/* ---------- modal sizes ---------- */
.modal-card.wide { width: min(860px, 100%); }
.modal-card.full { width: min(1100px, 100%); height: 100%; max-height: 900px; }
.mt-ico { font-size: 0.95em; }
.gem-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; font-weight: 700; background: linear-gradient(180deg, rgba(95, 216, 255, 0.22), rgba(40, 120, 200, 0.18)); border: 1px solid rgba(95, 216, 255, 0.45); color: #dff7ff; font-variant-numeric: tabular-nums; }

/* ---------- start screen v3 ---------- */
.v3-ribbon { display: inline-flex; align-items: center; gap: 8px; margin-top: -4px; padding: 6px 14px 6px 6px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--cream);
  background: linear-gradient(90deg, rgba(255, 159, 67, 0.22), rgba(143, 168, 255, 0.16)); border: 1px solid rgba(255, 207, 90, 0.35); box-shadow: 0 0 22px rgba(255, 159, 67, 0.18); transition: transform 0.15s, filter 0.15s; }
.v3-ribbon:hover { filter: brightness(1.15); }
.v3-ribbon:active { transform: scale(0.97); }
.v-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: #2a1406; background: linear-gradient(180deg, #ffe08a, #ffb347); box-shadow: 0 0 10px rgba(255, 200, 80, 0.6); }
.start-seg .seg-btn { font-size: 13.5px; padding: 8px 4px; }
.start-pane { display: flex; flex-direction: column; gap: 12px; min-height: 0; animation: paneIn 0.28s cubic-bezier(.2, .9, .3, 1); }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } }
.start-card[data-tab="classes"] .start-pane, .start-card[data-tab="top"] .start-pane, .start-card[data-tab="new"] .start-pane { min-height: 252px; }
.pane-lead { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.pane-lead b { color: var(--cream); }
.showcase { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 46%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; touch-action: pan-x pan-y; scrollbar-width: thin; scrollbar-color: rgba(255, 159, 67, 0.4) transparent; }
.sc-card { scroll-snap-align: start; position: relative; padding: 14px 12px 12px; border-radius: 18px; text-align: center; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--cc) 32%, transparent), transparent 70%), rgba(255, 255, 255, 0.04); border: 1px solid color-mix(in srgb, var(--cc) 40%, rgba(255, 255, 255, 0.08)); }
.sc-ico { width: 60px; height: 60px; margin: 0 auto 6px; display: grid; place-items: center; font-size: 32px; border-radius: 20px; background: radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--cc) 60%, #fff 10%), color-mix(in srgb, var(--cc) 35%, #000 40%)); box-shadow: 0 6px 18px color-mix(in srgb, var(--cc) 40%, transparent), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
.sc-name { font-weight: 700; font-size: 17px; }
.sc-price { display: inline-block; margin: 4px 0 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(95, 216, 255, 0.16); border: 1px solid rgba(95, 216, 255, 0.4); color: #dff7ff; }
.sc-price.free { background: rgba(61, 220, 132, 0.16); border-color: rgba(61, 220, 132, 0.45); color: #c9ffdc; }
.sc-perk { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.whatsnew-head { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.whatsnew { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.whatsnew li { display: flex; gap: 9px; align-items: flex-start; padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.whatsnew li b { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 19px; border-radius: 11px; background: rgba(255, 159, 67, 0.13); border: 1px solid rgba(255, 159, 67, 0.25); }
.whatsnew li strong { display: block; color: var(--cream); font-size: 13.5px; font-weight: 600; }

/* ---------- leaderboard ---------- */
.lb { display: flex; flex-direction: column; gap: 8px; }
.lb-table { display: flex; flex-direction: column; gap: 4px; }
.lb-row { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px 44px 44px; align-items: center; gap: 4px; padding: 7px 8px; border-radius: 12px; font-size: 14px; background: rgba(255, 255, 255, 0.035); overflow: hidden; isolation: isolate; }
.lb-row:not(.lb-hd)::before { content: ''; position: absolute; inset: 0; z-index: -1; transform-origin: left; transform: scaleX(var(--w, 0)); background: linear-gradient(90deg, rgba(255, 159, 67, 0.16), rgba(255, 159, 67, 0.02)); transition: transform 0.5s cubic-bezier(.2, .8, .2, 1); }
.lb-hd { background: none; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding-top: 0; padding-bottom: 0; }
.lb-hd span.on { color: var(--accent); }
.lb-rank { text-align: center; font-weight: 700; font-size: 15px; color: var(--muted); }
.lb-row.top .lb-rank { font-size: 19px; }
.lb-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name i { flex: none; width: 14px; height: 14px; border-radius: 5px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.lb-name small { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #2a1406; }
.lb-v { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-v.on { color: var(--cream); font-weight: 700; }
.lb-row.me { box-shadow: inset 0 0 0 1.5px rgba(255, 159, 67, 0.6); }
.lb-empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 14px; }
.lb-seg .seg-btn { font-size: 13px; }

/* ---------- top-right: buttons + minimap + menu ---------- */
.minimap-slot { position: relative; }
.minimap { --mm: 148px; position: relative; width: var(--mm); height: var(--mm); border-radius: 50%; cursor: pointer; touch-action: none; }
.mm-face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #0a0e1a; border: 3px solid rgba(255, 236, 210, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 22px rgba(0, 0, 0, 0.65); }
.mm-face::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 58%, rgba(5, 8, 18, 0.55) 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08); }
.mm-canvas { width: 100%; height: 100%; display: block; }
.mm-north { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #2a1406; background: linear-gradient(180deg, #ffe08a, #ff9f43); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); will-change: transform; pointer-events: none; }
.mm-key { position: absolute; left: 2px; bottom: 2px; width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(12, 15, 28, 0.85); border: 1px solid rgba(255, 255, 255, 0.12); pointer-events: none; }
.mm-zoom { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; font-size: 15px; font-weight: 700; background: rgba(12, 15, 28, 0.9); border: 1px solid rgba(255, 255, 255, 0.16); color: var(--cream); }
.hud-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; padding: 8px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; transform-origin: top right; animation: menuIn 0.2s cubic-bezier(.2, 1.2, .4, 1); z-index: 3; }
@keyframes menuIn { from { opacity: 0; transform: scale(0.85) translateY(-6px); } }
.hud-menu button { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06); font-weight: 600; font-size: 14px; text-align: left; transition: background 0.15s, transform 0.1s; }
.hud-menu button:active { transform: scale(0.95); }
.hud-menu button:hover { background: rgba(255, 159, 67, 0.12); }
.hud-menu button b { font-size: 19px; width: 24px; text-align: center; }
.hud-menu .count { margin-left: auto; font-style: normal; font-size: 12px; padding: 0 7px; border-radius: 8px; background: var(--accent); color: #2a1406; }
.hud-menu .dot { position: static; margin-left: auto; }

/* ---------- map panel ---------- */
.map-body { flex: 1; overflow: hidden; gap: 10px; }
.map-wrap { position: relative; flex: 1; min-height: 200px; border-radius: 16px; overflow: hidden; background: #070a14; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6); }
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.map-tools { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; font-weight: 700; background: rgba(14, 17, 30, 0.85); border: 1px solid rgba(255, 255, 255, 0.14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.map-btn:active { transform: scale(0.92); }
.map-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ping-seg { flex: 0 1 380px; }
.ping-seg .seg-btn { font-size: 13.5px; }
.map-hint { font-size: 12.5px; color: var(--dim); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.map-legend .lg-fog { color: #c9bbff; }
.map-ripple { position: absolute; width: 0; height: 0; pointer-events: none; }
.map-ripple::before { content: ''; position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--pc); animation: ripple 0.9s ease-out forwards; }
.map-ripple b { position: absolute; left: 0; top: 0; transform: translate(-50%, -110%); font-size: 26px; animation: pinDrop 0.4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes ripple { from { transform: scale(0.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes pinDrop { from { transform: translate(-50%, -260%); opacity: 0; } }

/* ---------- class panel ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.class-card { --cc: #ff9f43; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(130% 80% at 0% 0%, color-mix(in srgb, var(--cc) 22%, transparent), transparent 60%), rgba(255, 255, 255, 0.04);
  border: 1px solid color-mix(in srgb, var(--cc) 30%, rgba(255, 255, 255, 0.06)); transition: transform 0.15s, box-shadow 0.25s; }
.class-card.active { box-shadow: 0 0 0 2px var(--cc), 0 0 26px color-mix(in srgb, var(--cc) 45%, transparent); }
.class-card.locked .cc-ico { filter: grayscale(0.5) brightness(0.8); }
.cc-top { display: flex; align-items: center; gap: 10px; }
.cc-ico { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px; border-radius: 17px; background: radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--cc) 60%, #fff 10%), color-mix(in srgb, var(--cc) 30%, #000 45%)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3); }
.cc-head { flex: 1; min-width: 0; }
.cc-name { font-weight: 700; font-size: 18px; line-height: 1.1; }
.cc-tag { font-size: 12px; color: var(--muted); }
.cc-flag { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; padding: 3px 7px; border-radius: 7px; }
.cc-flag:empty { display: none; }
.class-card.owned .cc-flag { background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.class-card.active .cc-flag { background: var(--cc); color: #1a1006; }
.cc-perk { font-size: 13px; line-height: 1.4; color: var(--cream); opacity: 0.88; min-height: 36px; }
.cc-lv { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; }
.cc-lvl { font-size: 12px; font-weight: 700; color: var(--cc); }
.cc-pips { display: flex; gap: 4px; }
.cc-pips i { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.cc-pips i.on { background: var(--cc); box-shadow: 0 0 6px color-mix(in srgb, var(--cc) 60%, transparent); }
.cc-xp { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.cc-xp i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: rgba(255, 255, 255, 0.6); transition: transform 0.5s; }
.class-card.locked .cc-lv { opacity: 0.4; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.cc-price b { font-size: 16px; color: #dff7ff; }
.cc-price b.miss { color: #ffb3b5; }
.cc-perk-up { font-size: 12px; color: var(--muted); }
.cc-btn { min-width: 104px; }

/* ---------- challenges ---------- */
.chal-card { display: flex; flex-direction: column; gap: 8px; }
.chal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chal-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.chal-reset { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.chal-reset b { color: var(--muted); font-weight: 600; }
.chal-list { display: flex; flex-direction: column; gap: 7px; }
.chal { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 15px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); transition: background 0.3s, border-color 0.3s; }
.chal-ico { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.chal-body { flex: 1; min-width: 0; }
.chal-text { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chal-bar { position: relative; margin-top: 5px; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.chal-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); border-radius: 7px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: transform 0.5s cubic-bezier(.2, .8, .2, 1); }
.chal-bar span { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.chal-claim { flex: none; min-width: 64px; height: 42px; padding: 0 10px; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 3px; font-weight: 700; font-size: 15px;
  background: rgba(95, 216, 255, 0.1); border: 1px solid rgba(95, 216, 255, 0.3); color: #dff7ff; transition: transform 0.1s; }
.chal-claim:disabled { opacity: 0.6; cursor: default; }
.chal-claim:active:not(:disabled) { transform: scale(0.93); }
.chal.done { background: rgba(95, 216, 255, 0.08); border-color: rgba(95, 216, 255, 0.4); }
.chal.done .chal-bar i { background: linear-gradient(90deg, #36c2ff, #8ff0ff); }
.chal.done .chal-claim { opacity: 1; background: linear-gradient(180deg, #8ff0ff, #2fa8ea); color: #04263a; border-color: transparent; box-shadow: 0 4px 0 #1673a6, 0 0 18px rgba(95, 216, 255, 0.55); animation: claimPulse 1.2s ease-in-out infinite; }
.chal.claimed { opacity: 0.55; }
.chal.claimed .chal-claim { background: rgba(61, 220, 132, 0.15); border-color: rgba(61, 220, 132, 0.4); color: #c9ffdc; }
@keyframes claimPulse { 50% { transform: scale(1.06); } }
.chal-card.compact .chal { padding: 7px 8px; }
.chal-card.compact .chal-ico { width: 32px; height: 32px; font-size: 17px; }

/* ---------- craft panel ---------- */
.craft-list { display: flex; flex-direction: column; gap: 8px; }
.card-row.ready { border-color: rgba(255, 159, 67, 0.4); background: rgba(255, 159, 67, 0.07); }
.card-row.slim { padding: 7px 10px; }
.card-ico.sm { width: 38px; height: 38px; font-size: 21px; border-radius: 12px; }
.card-name small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.pill-badge.ok { background: rgba(61, 220, 132, 0.15); color: #c9ffdc; }
.chip.eff { background: rgba(255, 159, 67, 0.14); border-color: rgba(255, 159, 67, 0.4); color: #ffe2c4; }
.chip.buff { background: rgba(143, 168, 255, 0.14); border-color: rgba(143, 168, 255, 0.45); color: #dfe6ff; }
.prog { margin-top: 5px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.prog i { display: block; height: 100%; transform-origin: left; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }
.lv-road { display: flex; align-items: center; justify-content: center; margin: 12px 0 4px; }
.lv-step { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lv-step i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 15px; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.12); color: var(--dim); }
.lv-step small { font-size: 10.5px; color: var(--dim); }
.lv-step.on i { background: linear-gradient(180deg, #ffcf5a, #ff8f2e); border-color: #ffe2a0; color: #2a1406; box-shadow: 0 0 12px rgba(255, 159, 67, 0.6); }
.lv-step.on small { color: var(--accent-2); }
.lv-step.next i { border-color: var(--accent); color: var(--accent); border-style: dashed; animation: blink 1s infinite alternate; }
.lv-link { flex: 0 1 28px; height: 3px; margin: 0 2px 16px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.perk-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.perk-list li { font-size: 13px; color: var(--cream); padding: 6px 10px; border-radius: 10px; background: rgba(255, 207, 90, 0.08); border: 1px solid rgba(255, 207, 90, 0.2); }
.perk-list li::before { content: '✨ '; }
.scrap-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 4px; text-align: center; }
.scrap-io { display: flex; align-items: center; gap: 14px; }
.scrap-slot { position: relative; width: 92px; height: 92px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 36px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.08); }
.scrap-slot b { font-size: 16px; }
.scrap-slot small { font-size: 11px; color: var(--muted); }
.scrap-slot.out { background: rgba(255, 159, 67, 0.1); border-color: rgba(255, 159, 67, 0.35); }
.scrap-arrow { display: flex; gap: 4px; }
.scrap-arrow i { width: 10px; height: 10px; border-top: 3px solid var(--accent); border-right: 3px solid var(--accent); transform: rotate(45deg); opacity: 0.3; }
.scrap-hero.ready .scrap-arrow i { animation: chevron 0.9s infinite; }
.scrap-hero.ready .scrap-arrow i:nth-child(2) { animation-delay: 0.15s; }
.scrap-hero.ready .scrap-arrow i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chevron { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.scrap-have { font-size: 13px; color: var(--muted); }

/* ---------- build mode ---------- */
.build-ui { position: absolute; inset: 0; pointer-events: none; }
.build-ui > * { pointer-events: auto; }
.build-top { position: absolute; top: calc(92px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; white-space: nowrap; border-color: rgba(255, 159, 67, 0.35); }
.bt-ico { width: 36px; height: 36px; display: grid; place-items: center; font-size: 19px; border-radius: 50%; background: rgba(255, 159, 67, 0.2); }
.bt-txt { display: flex; flex-direction: column; line-height: 1.15; }
.bt-txt b { font-size: 15px; }
.bt-txt small { font-size: 11.5px; color: var(--muted); }
.bt-count { font-size: 12px; font-weight: 700; color: var(--muted); padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); }
.bt-count:empty { display: none; }
.build-palette { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sab)); width: min(720px, calc(100vw - 300px)); padding: 7px; border-radius: 22px; }
.bp-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.bp-strip::-webkit-scrollbar { display: none; }
.bp-item { position: relative; flex: none; width: 92px; padding: 8px 6px 7px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(0, 0, 0, 0.28); border: 1.5px solid rgba(255, 255, 255, 0.07); transition: transform 0.12s, border-color 0.2s, background 0.2s; }
.bp-item:active { transform: scale(0.94); }
.bp-item.sel { border-color: var(--accent); background: rgba(255, 159, 67, 0.16); box-shadow: 0 0 16px rgba(255, 159, 67, 0.35); }
.bp-item.poor .bp-ico { filter: grayscale(0.7) brightness(0.75); }
.bp-ico { font-size: 28px; line-height: 1.1; }
.bp-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.bp-cost { justify-content: center; margin-top: 2px; gap: 2px; }
.bp-cost .chip { font-size: 10.5px; padding: 1px 5px 1px 3px; }
.bp-hp { position: absolute; top: 4px; right: 6px; font-size: 9.5px; color: var(--dim); font-weight: 700; }
.build-btns { position: absolute; right: calc(18px + var(--sar)); bottom: calc(18px + var(--sab)); display: grid; grid-template-columns: auto auto; grid-template-areas: 'st st' 'no rot' 'ok ok'; gap: 10px; justify-items: end; align-items: end; }
.build-status { grid-area: st; max-width: 220px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 12px; background: rgba(60, 10, 16, 0.85); border: 1px solid rgba(255, 90, 95, 0.5); color: #ffc4c6; opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
.build-status.show { opacity: 1; transform: none; }
.bb-btn { width: 72px; height: 72px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 10.5px; letter-spacing: 0.06em;
  background: linear-gradient(160deg, rgba(44, 50, 78, 0.85), rgba(20, 24, 40, 0.85)); border: 1px solid rgba(255, 236, 210, 0.18); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform 0.08s, filter 0.2s, background 0.2s; touch-action: none; }
.bb-btn b { font-size: 26px; line-height: 1; }
.bb-btn.pressed { transform: translateY(3px) scale(0.95); }
.bb-rot { grid-area: rot; }
.bb-cancel { grid-area: no; }
.bb-ok { grid-area: ok; width: 104px; height: 104px; font-size: 13px; color: #06210f; background: radial-gradient(circle at 50% 30%, #8ff5b5, #3ddc84 50%, #1f9d55); box-shadow: 0 7px 0 #146b39, 0 0 26px rgba(61, 220, 132, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.45); }
.bb-ok b { font-size: 40px; }
.bb-ok.invalid { color: #3a0a0e; background: radial-gradient(circle at 50% 30%, #ff9a9e, #ff5a5f 50%, #b8323a); box-shadow: 0 7px 0 #7a1c22, 0 0 20px rgba(255, 90, 95, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.35); filter: saturate(0.85); }
.build-ctx { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--sab)); display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 18px; width: min(420px, calc(100vw - 24px)); }
.bc-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); }
.bc-info { flex: 1; min-width: 0; }
.bc-name { font-weight: 700; }
.bc-owner { font-size: 11.5px; color: var(--muted); }
.bc-owner:empty { display: none; }
.bc-hp { position: relative; margin-top: 4px; height: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.bc-hp i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, #3ddc84, #a8f0c4); transition: transform 0.3s; }
.bc-hp i.low { background: linear-gradient(90deg, #ff5a5f, #ff9a6a); }
.bc-hp span { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 9.5px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.bc-acts { display: flex; flex-direction: column; gap: 6px; }
.bc-acts .btn { white-space: nowrap; padding: 7px 10px; font-size: 13px; }
.bc-acts .btn small .chip { font-size: 10px; padding: 0 5px 0 3px; background: rgba(0, 0, 0, 0.15); border-color: rgba(0, 0, 0, 0.15); color: inherit; }
.bc-acts .btn.confirm { animation: blink 0.4s infinite alternate; }
body.is-building .objectives, body.is-building .hx-buffs, body.is-building .qc-log, body.is-building .hx-revive { opacity: 0; pointer-events: none !important; }
body.is-building #hotbar, body.is-building .actions, body.is-building #joystick ~ .btn-sprint, body.is-building .hx-stamina { opacity: 0; pointer-events: none !important; }
body.is-building #hotbar, body.is-building .actions { transform: translateY(30px); }
#hotbar, .actions { transition: opacity 0.2s, transform 0.25s; }

/* ---------- fishing ---------- */
.fish { position: fixed; inset: 0; z-index: 38; display: flex; align-items: flex-end; justify-content: center; padding: 0 12px calc(16px + var(--sab)); pointer-events: none;
  background: radial-gradient(70% 50% at 50% 100%, rgba(30, 90, 140, 0.35), transparent 70%); animation: fadeIn 0.3s; }
.fish-card { position: relative; pointer-events: auto; width: min(380px, 100%); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-color: rgba(120, 200, 255, 0.3); }
.fish-x { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-size: 16px; }
.fish-pond { position: relative; width: 100%; height: 190px; border-radius: 20px; overflow: hidden; cursor: pointer; touch-action: none;
  background: radial-gradient(80% 70% at 50% 60%, #2f86b8, #175a85 55%, #0c3554 100%); box-shadow: inset 0 0 40px rgba(0, 20, 40, 0.7), inset 0 6px 0 rgba(255, 255, 255, 0.06); }
.fish-pond::before { content: ''; position: absolute; inset: -20%; background: repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 22px); animation: waterDrift 9s linear infinite; }
@keyframes waterDrift { to { transform: translate(8%, 6%) rotate(8deg); } }
.fish-line { position: absolute; left: 50%; top: -10px; width: 2px; height: calc(50% + 10px); margin-left: -1px; background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.4)); transform-origin: top; transform: scaleY(0); transition: transform 0.45s cubic-bezier(.3, 1.4, .5, 1); }
.fish-bobber { position: absolute; left: 50%; top: 52%; width: 26px; height: 26px; transform: translate(-50%, -50%) scale(0); transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.fish-bobber i { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(180deg, #ff5a5f 0 50%, #fff4e0 50% 100%); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.fish-ripple { position: absolute; left: 50%; top: 56%; width: 80px; height: 28px; margin: -14px 0 0 -40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); opacity: 0; }
.fish-ring { position: absolute; left: 50%; top: 52%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 4px solid #ffcf5a; box-shadow: 0 0 18px rgba(255, 207, 90, 0.8); opacity: 0; }
.fish-bang { position: absolute; left: 50%; top: 18%; transform: translateX(-50%) scale(0); font-size: 54px; font-weight: 700; color: #ffcf5a; text-shadow: 0 0 20px rgba(255, 180, 40, 0.9), 0 4px 0 #7a3a00; }
.fish-catch { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.fish-catch.gem { filter: drop-shadow(0 0 18px rgba(95, 216, 255, 0.9)); }
.fish-msg { text-align: center; line-height: 1.2; min-height: 44px; }
.fish-msg b { display: block; font-size: 21px; }
.fish-msg small { font-size: 13.5px; color: var(--muted); }
.fish-msg em { font-style: normal; color: var(--accent-2); font-weight: 700; }
.fish-btn { max-width: 260px; }
.fish-card[data-state="casting"] .fish-line, .fish-card[data-state="waiting"] .fish-line, .fish-card[data-state="bite"] .fish-line, .fish-card[data-state="reeling"] .fish-line { transform: scaleY(1); }
.fish-card[data-state="waiting"] .fish-bobber, .fish-card[data-state="bite"] .fish-bobber, .fish-card[data-state="reeling"] .fish-bobber { transform: translate(-50%, -50%) scale(1); }
.fish-card[data-state="waiting"] .fish-bobber i { animation: bob 1.6s ease-in-out infinite; }
.fish-card[data-state="waiting"] .fish-ripple { animation: rippleOut 2.4s ease-out infinite; }
.fish-card[data-state="waiting"] .fish-ripple.r2 { animation-delay: 0.8s; }
.fish-card[data-state="waiting"] .fish-ripple.r3 { animation-delay: 1.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(5px) rotate(4deg); } }
@keyframes rippleOut { from { transform: scale(0.3); opacity: 0.8; } to { transform: scale(2.2); opacity: 0; } }
.fish-card[data-state="bite"] .fish-bobber i { animation: dunk 0.18s ease-in-out infinite alternate; }
.fish-card[data-state="bite"] .fish-ring { animation: ringShrink 700ms linear forwards; }
.fish-card[data-state="bite"] .fish-bang { animation: bangPop 0.25s cubic-bezier(.2, 1.8, .4, 1) forwards, bangWobble 0.3s 0.25s ease-in-out infinite alternate; }
.fish-card[data-state="bite"] .fish-pond { box-shadow: inset 0 0 0 4px rgba(255, 207, 90, 0.8), inset 0 0 40px rgba(0, 20, 40, 0.7); }
.fish-card[data-state="bite"] .fish-btn { animation: readyPulse 0.5s ease-in-out infinite; }
@keyframes dunk { to { transform: translateY(9px) scale(0.9); } }
@keyframes ringShrink { from { transform: scale(3.2); opacity: 0.2; } 15% { opacity: 1; } to { transform: scale(0.6); opacity: 1; } }
@keyframes bangPop { to { transform: translateX(-50%) scale(1); } }
@keyframes bangWobble { from { rotate: -6deg; } to { rotate: 6deg; } }
.fish-card[data-state="success"] .fish-catch { animation: catchJump 0.7s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fish-card[data-state="success"] .fish-msg b { color: #b8ffcf; }
.fish-card[data-state="fail"] .fish-msg b { color: #ffb3a0; }
.fish-card[data-state="fail"] .fish-pond { filter: saturate(0.6) brightness(0.85); }
@keyframes catchJump { 0% { transform: translate(-50%, 40%) scale(0.3) rotate(-30deg); } 60% { transform: translate(-50%, -80%) scale(1.15) rotate(10deg); } 100% { transform: translate(-50%, -55%) scale(1) rotate(0); } }

/* ---------- quick chat ---------- */
.qc-wheel { display: grid; place-items: center; background: rgba(3, 5, 12, 0.45); animation: fadeIn 0.15s; }
.qc-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qc-ring { --R: 134px; position: relative; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(20, 24, 40, 0.85) 30%, rgba(20, 24, 40, 0.55) 68%, transparent 70%); animation: popIn 0.2s cubic-bezier(.2, 1.3, .4, 1); }
.qc-opt { position: absolute; left: 50%; top: 50%; width: 92px; height: 60px; transform: translate(-50%, -50%) translate(calc(var(--x) * var(--R)), calc(var(--y) * var(--R))); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(160deg, rgba(50, 56, 86, 0.96), rgba(24, 28, 46, 0.96)); border: 1px solid rgba(255, 236, 210, 0.18); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); transition: transform 0.12s, background 0.15s; }
.qc-opt:hover, .qc-opt:focus-visible { background: linear-gradient(160deg, rgba(255, 170, 90, 0.95), rgba(220, 100, 30, 0.95)); color: #2a1406; outline: none; }
.qc-opt:active { transform: translate(-50%, -50%) translate(calc(var(--x) * var(--R)), calc(var(--y) * var(--R))) scale(0.92); }
.qc-opt b { font-size: 22px; line-height: 1; }
.qc-opt span { font-size: 12px; font-weight: 600; white-space: nowrap; }
.qc-opt kbd { position: absolute; top: 3px; left: 6px; font-family: inherit; font-size: 9.5px; color: var(--dim); }
.qc-center { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #ffc27a, #ff9f43 50%, #e8590c); color: #2a1406; box-shadow: 0 5px 0 #a8460c, 0 0 24px rgba(255, 140, 50, 0.5); }
.qc-center span { font-size: 26px; line-height: 1; }
.qc-center small { font-size: 10px; font-weight: 700; }
.qc-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 6px; border-radius: 18px; background: rgba(20, 24, 40, 0.75); border: 1px solid rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: calc(100vw - 24px); }
.qc-lbl { align-self: center; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding: 0 4px; }
.qc-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 50px; height: 50px; padding: 0 8px; border-radius: 14px; font-size: 22px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.1s; }
.qc-chip small { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.qc-chip:active { transform: scale(0.92); }
.qc-chip.ping { flex-direction: row; height: 40px; font-size: 13.5px; font-weight: 600; border-color: color-mix(in srgb, var(--pc) 55%, transparent); background: color-mix(in srgb, var(--pc) 14%, transparent); }
.qc-chip.ping.active { background: color-mix(in srgb, var(--pc) 35%, transparent); box-shadow: 0 0 0 2px var(--pc); }
.ping-picker { display: flex; gap: 6px; }
.qc-log { position: absolute; left: calc(12px + var(--sal)); bottom: calc(190px + var(--sab)); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; pointer-events: none; max-width: min(320px, 60vw); }
.qc-line { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 12px; font-size: 13.5px; background: rgba(12, 15, 28, 0.7); border: 1px solid rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: lineIn 0.3s cubic-bezier(.2, 1.3, .4, 1); transition: opacity 0.5s, transform 0.5s; }
.qc-line i { flex: none; width: 10px; height: 10px; border-radius: 4px; }
.qc-line b { font-weight: 600; color: var(--accent-2); white-space: nowrap; }
.qc-line.self b { color: var(--accent); }
.qc-line span { white-space: nowrap; }
.qc-line.out { opacity: 0; transform: translateX(-12px); }
@keyframes lineIn { from { opacity: 0; transform: translateX(-16px); } }

/* ---------- settings ---------- */
.settings-body { gap: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.05); }
.set-lbl { display: flex; align-items: center; gap: 9px; min-width: 0; }
.set-lbl b { display: block; font-weight: 600; font-size: 14.5px; }
.set-lbl small { display: block; font-size: 11.5px; color: var(--dim); }
.set-ico { font-size: 18px; width: 24px; text-align: center; flex: none; }
.set-ctl { flex: none; display: flex; align-items: center; }
.q-seg .seg-btn { padding: 6px 9px; font-size: 13px; }
.toggle { position: relative; width: 52px; height: 30px; border-radius: 15px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.toggle i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #c9c2b4; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); transition: transform 0.2s cubic-bezier(.3, 1.4, .5, 1), background 0.2s; }
.toggle.on { background: linear-gradient(180deg, #ffb760, #f2701c); border-color: transparent; }
.toggle.on i { transform: translateX(22px); background: #fff4e0; }
.toggle[data-fps]:not([data-fps=""])::before { content: attr(data-fps); position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--good); white-space: nowrap; }
.range-wrap { display: flex; align-items: center; gap: 8px; }
.range { --v: 0.5; -webkit-appearance: none; appearance: none; width: 150px; height: 28px; background: transparent; touch-action: none; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0 calc(var(--v) * 100%), rgba(0, 0, 0, 0.4) calc(var(--v) * 100%)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.range::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); }
.range::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff4e0, #e9d6b8 60%, #b9a07c); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff4e0; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.range-val { min-width: 46px; text-align: right; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.settings-reset { align-self: center; margin-top: 6px; }

/* ---------- HUD extras ---------- */
.hx-warm { overflow: hidden; max-height: 22px; transition: max-height 0.3s, opacity 0.3s, margin 0.3s; }
.hx-warm.collapsed { max-height: 0; opacity: 0; margin-top: -6px; }
.bar.warmth i { width: 100%; transform-origin: left; background: linear-gradient(90deg, #6fc3ff, #ffb36b 55%, #ff7a4a); box-shadow: 0 0 10px rgba(255, 138, 92, 0.45); transition: transform 0.35s; }
.bar.warmth.low i { background: linear-gradient(90deg, #8fd3ff, #c4ecff); box-shadow: 0 0 10px rgba(143, 211, 255, 0.7); }
.hx-buffs { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.hx-buffs:empty { display: none; }
.hx-buff { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(16, 19, 33, 0.78); border: 1px solid rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hx-buff svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.hx-buff circle { fill: none; stroke: var(--accent-2); stroke-width: 7; stroke-dasharray: 289.03; stroke-dashoffset: 0; stroke-linecap: round; }
.hx-buff span { font-size: 18px; }
.hx-buff small { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; padding: 0 5px; border-radius: 6px; background: rgba(10, 12, 24, 0.9); font-variant-numeric: tabular-nums; }
.hx-buff.ending { animation: blink 0.5s infinite alternate; }
.hx-stamina { position: absolute; left: calc(22px + var(--sal)); bottom: calc(174px + var(--sab)); width: 140px; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; border-radius: 999px; background: rgba(16, 19, 33, 0.7); border: 1px solid rgba(255, 224, 102, 0.25); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: opacity 0.4s, transform 0.4s; pointer-events: none !important; }
.hx-stamina span { font-size: 13px; }
.hx-stam-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.hx-stam-bar i { display: block; height: 100%; transform-origin: left; border-radius: 4px; background: linear-gradient(90deg, #ffb347, var(--stam)); box-shadow: 0 0 8px rgba(255, 224, 102, 0.6); transition: transform 0.12s linear; }
.hx-stamina.full { opacity: 0; transform: translateY(6px); }
.hx-stamina.low .hx-stam-bar i { background: linear-gradient(90deg, #ff5a5f, #ff9a6a); animation: blink 0.4s infinite alternate; }
.hx-top { position: absolute; top: calc(84px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none !important; }
.hx-chips { display: flex; gap: 6px; }
.hx-chip { position: relative; display: flex; align-items: center; gap: 5px; padding: 4px 11px 4px 8px; border-radius: 999px; font-size: 13px; background: rgba(16, 19, 33, 0.72); border: 1px solid rgba(255, 255, 255, 0.1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); white-space: nowrap; }
.hx-chip b { font-weight: 700; }
.hx-chip small { color: var(--muted); font-size: 11.5px; }
.hx-weather[data-kind="storm"] { border-color: rgba(200, 180, 255, 0.5); box-shadow: 0 0 14px rgba(160, 140, 255, 0.35); }
.hx-weather[data-kind="rain"] { border-color: rgba(120, 190, 255, 0.45); }
.hx-gems { border-color: rgba(95, 216, 255, 0.45); color: #dff7ff; font-variant-numeric: tabular-nums; }
.gem-float { position: absolute; left: 50%; top: -4px; font-size: 13px; font-weight: 700; color: var(--gem); text-shadow: 0 1px 2px #000; pointer-events: none; }
.hx-boss { width: min(560px, 64vw); display: flex; flex-direction: column; align-items: center; gap: 4px; filter: drop-shadow(0 6px 16px rgba(120, 0, 10, 0.5)); }
.hb-name { display: flex; align-items: center; gap: 8px; text-shadow: 0 2px 6px #000, 0 0 18px rgba(255, 40, 60, 0.6); }
.hb-ico { font-size: 22px; filter: drop-shadow(0 0 8px rgba(255, 50, 60, 0.9)); }
.hb-name b { font-size: 19px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #ffd6d9; }
.hb-name small { font-size: 12px; color: #ff9aa2; letter-spacing: 0.06em; }
.hb-name small:empty { display: none; }
.hb-bar { position: relative; width: 100%; height: 20px; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #1a0408, #2c070d); border: 2px solid rgba(255, 90, 100, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 30, 50, 0.35); }
.hb-bar i { position: absolute; inset: 0; transform-origin: left; }
.hb-trail { background: #ffd0a0; opacity: 0.85; transition: transform 0.7s 0.35s cubic-bezier(.4, 0, .2, 1); }
.hb-fill { background: linear-gradient(180deg, #ff6f7a 0%, var(--blood) 45%, #a3121f 100%); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25); transition: transform 0.2s ease-out; }
.hb-bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, 0.45); }
.hb-bar em:nth-of-type(1) { left: 25%; } .hb-bar em:nth-of-type(2) { left: 50%; } .hb-bar em:nth-of-type(3) { left: 75%; }
.hb-hp { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-shadow: 0 1px 2px #000; z-index: 1; font-variant-numeric: tabular-nums; }
.hx-boss.enraged .hb-bar { animation: enrage 0.8s ease-in-out infinite alternate; }
@keyframes enrage { to { box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 34px rgba(255, 30, 50, 0.85); border-color: #ff5a64; } }
#hud.has-boss ~ #toasts { top: calc(150px + var(--sat)); }
.toasts { top: calc(122px + var(--sat)); }
.hx-revive { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--sab)); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(16, 33, 24, 0.85); border: 1px solid rgba(61, 220, 132, 0.5); box-shadow: 0 0 20px rgba(61, 220, 132, 0.3); animation: popIn 0.25s; pointer-events: none !important; }
.hx-revive svg { position: absolute; left: 6px; top: 6px; width: 44px; height: 44px; transform: rotate(-90deg); }
.rv-bg { fill: rgba(0, 0, 0, 0.35); stroke: rgba(255, 255, 255, 0.12); stroke-width: 8; }
.rv-fg { fill: none; stroke: var(--good); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 289.03; stroke-dashoffset: 289.03; transition: stroke-dashoffset 0.12s linear; filter: drop-shadow(0 0 4px rgba(61, 220, 132, 0.9)); }
.rv-ico { position: relative; width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--good); }
.hx-revive { white-space: nowrap; }
.hx-revive.active .rv-ico { animation: dotPop 0.6s infinite; }
.rv-txt b { display: block; font-size: 14.5px; color: #c9ffdc; }
.rv-txt small { font-size: 12px; color: var(--muted); }
.hx-downed { position: fixed; inset: 0; z-index: 34; display: grid; place-items: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(40, 0, 10, 0.15) 30%, rgba(90, 0, 15, 0.7) 100%); animation: fadeIn 0.5s;
  -webkit-backdrop-filter: grayscale(0.85); backdrop-filter: grayscale(0.85); }
.dn-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translateY(-6vh); }
.dn-ring { position: relative; width: 130px; height: 130px; }
.dn-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dn-bg { fill: rgba(10, 4, 8, 0.55); stroke: rgba(255, 255, 255, 0.1); stroke-width: 6; }
.dn-time { fill: none; stroke: #ff5a5f; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 289.03; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgba(255, 90, 95, 0.9)); }
.dn-rev { fill: none; stroke: var(--good); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 238.76; stroke-dashoffset: 238.76; transition: stroke-dashoffset 0.15s linear; filter: drop-shadow(0 0 6px rgba(61, 220, 132, 0.9)); }
.dn-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.dn-num b { font-size: 42px; font-variant-numeric: tabular-nums; }
.dn-num small { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.dn-title { font-size: clamp(30px, 7vw, 48px); font-weight: 700; color: #ffd0c4; text-shadow: 0 0 24px rgba(255, 90, 95, 0.7), 0 3px 0 rgba(0, 0, 0, 0.4); margin-top: 6px; }
.dn-sub { font-size: 16px; color: var(--muted); text-shadow: 0 1px 4px #000; }
.dn-revby { margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(16, 60, 34, 0.8); border: 1px solid rgba(61, 220, 132, 0.6); color: #c9ffdc; font-weight: 600; animation: popIn 0.25s; }
.hx-downed.reviving { background: radial-gradient(ellipse at center, rgba(0, 40, 20, 0.1) 30%, rgba(0, 60, 30, 0.45) 100%); }
body.is-downed .hud-tl, body.is-downed .qc-log, body.is-downed .hx-revive { opacity: 0.2; }
body.is-downed #hud .actions, body.is-downed #hotbar, body.is-downed .btn-sprint { opacity: 0.25; pointer-events: none !important; }
.hx-dmg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 7; overflow: hidden; }
.dmg { position: absolute; left: 0; top: 0; opacity: 0; font-size: 24px; font-weight: 700; white-space: nowrap; color: #fff4e0; will-change: transform, opacity; -webkit-text-stroke: 1px rgba(40, 10, 0, 0.6); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 0 10px rgba(0, 0, 0, 0.4); }
.dmg.crit { color: #ffcf5a; font-size: 30px; text-shadow: 0 3px 0 #7a3a00, 0 0 16px rgba(255, 180, 40, 0.8); }
.dmg.heal { color: #9dffc0; }
.dmg.self { color: #ff8a8e; }
.dmg.miss { color: #c9d0e0; font-size: 18px; }
.dmg.gold { color: var(--gem); }

/* touch buttons: sprint (beside joystick), dodge & shoot (arc around ACTION) */
.touch-only { display: none; }
@media (hover: none), (pointer: coarse) { .touch-only { display: grid; } .touch-only.hidden { display: none !important; } }
.btn-round > b { font-size: 20px; line-height: 1; }
.btn-round > span { font-size: 9.5px; letter-spacing: 0.06em; }
.btn-sprint, .btn-dodge, .btn-shoot { grid-template-rows: auto auto; align-content: center; gap: 1px; }
.btn-sprint { position: absolute; left: calc(22px + 140px + 6px + var(--sal)); bottom: calc(22px + 92px + var(--sab)); width: 60px; height: 60px; }
.btn-sprint.on { background: linear-gradient(180deg, rgba(255, 224, 102, 0.95), rgba(255, 160, 50, 0.95)); color: #2a1406; border-color: transparent; box-shadow: 0 3px 0 #a8460c, 0 0 20px rgba(255, 210, 80, 0.6); transform: translateY(2px); }
.btn-dodge { right: 118px; bottom: 98px; width: 60px; height: 60px; }
.btn-dodge.dim { filter: grayscale(0.8) brightness(0.7); }
.btn-shoot { right: 30px; bottom: 128px; width: 66px; height: 66px; background: linear-gradient(160deg, rgba(120, 70, 30, 0.85), rgba(60, 30, 14, 0.85)); border-color: rgba(255, 190, 120, 0.35); }
.btn-shoot > b { font-size: 24px; }
.btn-shoot.empty { filter: grayscale(0.9) brightness(0.7); }
.btn-round .cd { position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); transform-origin: bottom; transform: scaleY(0); pointer-events: none; }
.btn-shoot .ammo { font-style: normal; position: absolute; top: -2px; right: -2px; bottom: auto; left: auto; transform: none; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 1px; background: rgba(12, 15, 28, 0.92); border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-shoot .ammo .i-coal, .btn-shoot .ammo .i-iron { font-size: 10px; }
@media (hover: none), (pointer: coarse) {
  .ctx-col { bottom: 206px; }
}
@media (hover: hover) and (pointer: fine) {
  .hx-stamina { left: 50%; bottom: calc(92px + var(--sab)); width: 240px; margin-left: -120px; }
  .qc-log { bottom: calc(60px + var(--sab)); }
}

.bubble-q { display: inline-block; font-size: 14px; font-weight: 600; padding: 5px 11px; border-radius: 14px 14px 14px 4px; background: rgba(255, 244, 224, 0.95); color: #2a1406; white-space: nowrap; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
@media (hover: none), (pointer: coarse) {
  .qc-log { bottom: calc(222px + var(--sab)); }
}

/* ===================== v3 responsive ===================== */
@media (max-width: 760px) and (orientation: portrait) {
  /* start card: compact customizer (preview beside name, swatches full width) */
  .custom { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: 'pv lbl' 'pv in' 'pv err' 'sw sw'; column-gap: 12px; row-gap: 4px; align-items: center; }
  .custom-fields { display: contents; }
  .preview-wrap { grid-area: pv; width: 92px; height: 112px; align-self: start; }
  .field-label { grid-area: lbl; align-self: end; }
  #nameInput { grid-area: in; font-size: 18px; padding: 9px 12px; }
  .field-error { grid-area: err; }
  .sw-row { grid-column: 1 / -1; }
  .swatch { width: 28px; height: 28px; }
  .start-seg .seg-btn { font-size: 12.5px; padding: 8px 2px; }
  .whatsnew { grid-template-columns: 1fr; }
  .showcase { grid-auto-columns: 62%; }
  .v3-ribbon { font-size: 12.5px; }

  /* top HUD */
  .dial-ring { width: 40px; height: 40px; }
  .dial-text { min-width: 70px; }
  .hud-tr { flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
  .hud-btns { gap: 6px; }
  .minimap { --mm: 92px; }
  .mm-key { display: none; }
  .mm-zoom { width: 24px; height: 24px; font-size: 13px; }
  .mm-north { width: 17px; height: 17px; margin: -8.5px 0 0 -8.5px; font-size: 10px; }
  .hud-menu { top: 0; right: calc(100% + 8px); }
  .hx-top { top: calc(78px + var(--sat)); left: calc(10px + var(--sal)); right: calc(112px + var(--sar)); transform: none; align-items: flex-start; gap: 5px; }
  .hx-chip { font-size: 12px; padding: 3px 9px 3px 6px; }
  .hx-chip small { display: none; }
  .hx-boss { width: 100%; align-items: stretch; }
  .hb-name { gap: 6px; }
  .hb-name b { font-size: 15px; letter-spacing: 0.08em; }
  .hb-ico { font-size: 18px; }
  .hb-name small { display: none; }
  .hb-bar { height: 16px; }
  #hud .hud-tl .objectives { margin-top: 32px; }
  #hud.has-boss .hud-tl .objectives { margin-top: 84px; }
  .hud-tl { gap: 6px; }
  .hx-buff { width: 34px; height: 34px; }
  .hx-buff span { font-size: 15px; }
  .toasts { top: calc(150px + var(--sat)); }
  #hud.has-boss ~ #toasts { top: calc(200px + var(--sat)); }
  .build-top { top: calc(78px + var(--sat)); padding: 6px 12px 6px 6px; }
  .bt-txt small { display: none; }

  /* bottom cluster */
  .hotbar { bottom: calc(198px + var(--sab)); }
  .hx-stamina { left: calc(16px + var(--sal)); bottom: calc(156px + var(--sab)); width: 124px; }
  .btn-sprint { left: calc(146px + var(--sal)); bottom: calc(104px + var(--sab)); width: 52px; height: 52px; }
  .btn-dodge { right: 100px; bottom: 84px; width: 52px; height: 52px; }
  .btn-shoot { right: 4px; bottom: 110px; width: 56px; height: 56px; }
  .btn-round > b { font-size: 18px; }
  .btn-round > span { font-size: 8.5px; }
  .ctx-col { position: fixed; left: 50%; right: auto; transform: translateX(-50%); bottom: calc(262px + var(--sab)); flex-direction: row; justify-content: center; }
  .btn-ctx { font-size: 13px; padding: 6px 12px 6px 6px; }
  .btn-ctx b { width: 28px; height: 28px; font-size: 16px; }
  .qc-log { bottom: calc(320px + var(--sab)); max-width: 70vw; }
  .qc-line { font-size: 12.5px; }
  .hx-revive { bottom: calc(318px + var(--sab)); }

  /* panels */
  .class-grid { grid-template-columns: 1fr; }
  .cc-perk { min-height: 0; }
  .qc-opt span { font-size: 11px; }
  .build-palette { width: calc(100vw - 20px); bottom: calc(150px + var(--sab)); }
  .bp-item { width: 82px; }
  .build-btns { right: calc(12px + var(--sar)); bottom: calc(14px + var(--sab)); grid-template-columns: auto auto auto; grid-template-areas: 'no rot ok'; gap: 8px; }
  .build-status { position: fixed; left: 50%; bottom: calc(282px + var(--sab)); transform: translate(-50%, 6px); white-space: nowrap; max-width: none; }
  .build-status.show { transform: translate(-50%, 0); }
  .bb-btn { width: 62px; height: 62px; }
  .bb-ok { width: 92px; height: 92px; }
  .build-ctx { bottom: calc(326px + var(--sab)); }
  .qc-ring { --R: 116px; width: 300px; height: 300px; }
  .qc-opt { width: 80px; height: 54px; }
  .map-legend { display: none; }
  .modal-card.full { max-height: none; }
  .set-row { flex-wrap: wrap; }
  .range { width: 130px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .start-pane { gap: 8px; }
  .start-card[data-tab] .start-pane { min-height: 0; }
  .v3-ribbon { display: none; }
  .showcase { grid-auto-columns: 40%; }
  .whatsnew li { padding: 6px; }
  .hud-tr { gap: 8px; }
  .hud-btns { gap: 5px; }
  .hud-btns .icon-btn { width: 36px; height: 36px; font-size: 16px; border-radius: 12px; }
  .obj.main { font-size: 12.5px; }
  .btn-ctx { white-space: nowrap; }
  .minimap { --mm: 96px; }
  .mm-key { display: none; }
  .hud-menu { top: 0; right: calc(100% + 8px); }
  .obj-head { display: none; }
  .hx-buffs { position: absolute; left: calc(100% + 8px); top: 0; flex-direction: column; }
  .slot.tool, .hb-sep { display: none; }
  .hx-top { top: calc(58px + var(--sat)); gap: 4px; }
  .hx-chip small { display: none; }
  .hx-boss { width: min(360px, 44vw); }
  .hb-name b { font-size: 14px; }
  .hb-name small { display: none; }
  .hb-bar { height: 14px; }
  .toasts { top: calc(100px + var(--sat)); }
  #hud.has-boss ~ #toasts { top: calc(140px + var(--sat)); }
  .hx-buff { width: 32px; height: 32px; }
  .hx-buff span { font-size: 14px; }
  .hx-stamina { left: calc(14px + var(--sal)); bottom: calc(136px + var(--sab)); width: 118px; padding: 2px 8px 2px 6px; }
  .btn-sprint { left: calc(140px + var(--sal)); bottom: calc(78px + var(--sab)); width: 50px; height: 50px; }
  .btn-dodge { right: 98px; bottom: 74px; width: 50px; height: 50px; }
  .btn-shoot { right: 6px; bottom: 102px; width: 54px; height: 54px; }
  .ctx-col { bottom: 100px; right: 156px; }
  .qc-log { left: calc(200px + var(--sal)); bottom: calc(72px + var(--sab)); }
  .qc-line { font-size: 12px; padding: 3px 8px 3px 5px; }
  .hx-revive { bottom: calc(76px + var(--sab)); padding: 4px 12px 4px 4px; }
  .hx-revive svg { left: 4px; top: 4px; width: 38px; height: 38px; }
  .rv-ico { width: 38px; height: 38px; font-size: 19px; }
  .qc-ring { --R: 92px; width: 250px; height: 250px; }
  .qc-opt { width: 80px; height: 50px; }
  .qc-opt b { font-size: 18px; }
  .qc-opt span { font-size: 10.5px; }
  .qc-wrap { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .qc-row { flex-direction: column; flex-wrap: nowrap; }
  .qc-chip { height: 42px; }
  .build-top { display: none; }
  .build-palette { width: calc(100vw - 280px); left: calc(14px + var(--sal)); transform: none; bottom: calc(8px + var(--sab)); }
  .bb-btn { width: 58px; height: 58px; }
  .bb-ok { width: 84px; height: 84px; }
  .build-ctx { left: calc(14px + var(--sal)); transform: none; width: min(380px, calc(100vw - 300px)); bottom: calc(120px + var(--sab)); }
  .fish { align-items: center; }
  .fish-card { flex-direction: row; flex-wrap: wrap; width: min(560px, 100%); }
  .fish-pond { height: 150px; flex: 1 1 260px; width: auto; }
  .fish-msg, .fish-btn { flex: 1 1 200px; }
  .map-legend { display: none; }
  .modal-card.full { max-height: none; }
  .dn-card { transform: none; }
  .dn-ring { width: 100px; height: 100px; }
}

#hud:has(.hx-revive:not(.hidden)) .qc-log { opacity: 0; }
.cc-xpfrom { font-size: 11.5px; color: var(--dim); margin-top: -4px; }
.banner.boss .banner-title { font-size: clamp(34px, 8vw, 76px); color: #ffd6d9; text-shadow: 0 0 30px rgba(255, 40, 60, 0.95), 0 0 80px rgba(200, 0, 20, 0.7), 0 4px 0 rgba(0, 0, 0, 0.5); }
.banner.boss .banner-sub { color: #ff9aa2; }

/* storage chest panel */
.st-meter { display: flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.st-bar { width: 70px; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.st-bar i { display: block; height: 100%; transform-origin: left; background: linear-gradient(90deg, #3ddc84, #ffcf5a); }
.st-meter.full { color: #ffc4c6; }
.st-meter.full .st-bar i { background: #ff5a5f; }
.st-list { display: flex; flex-direction: column; gap: 6px; }
.st-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }
.st-ico { font-size: 20px; text-align: center; }
.st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-n { font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.st-row .btn-sm { padding: 6px 10px; font-size: 13px; }
@media (max-width: 420px) { .st-row { grid-template-columns: 24px minmax(0, 1fr) auto auto auto; gap: 6px; padding: 5px 6px; } .st-row .btn-sm { padding: 6px 8px; font-size: 12px; } .st-meter .st-bar { width: 44px; } }

/* tablets (touch, 761–1099px wide, not landscape phones): the centred hotbar would run under JUMP/ACTION — lift it */
@media (hover: none) and (min-width: 761px) and (max-width: 1099px) and (min-height: 501px), (pointer: coarse) and (min-width: 761px) and (max-width: 1099px) and (min-height: 501px) {
  .hotbar { bottom: calc(168px + var(--sab)); }
  .hx-revive { bottom: calc(244px + var(--sab)); }
  .qc-log { bottom: calc(244px + var(--sab)); }
}

/* =====================================================================
   v4 — decluttered HUD, objective pill, juice UI, trader, upgrades, pets
   ===================================================================== */
/* top-right: minimap + one ☰ menu (+ camp shortcuts only near camp) */
#hud .hud-tr { flex-direction: row-reverse; align-items: flex-start; gap: 8px; }
.hud-btns { flex-direction: column; gap: 7px; }
.camp-btns { display: flex; flex-direction: column; gap: 7px; animation: popIn 0.25s; }
.camp-btns .icon-btn { background: linear-gradient(160deg, rgba(255, 183, 96, 0.92), rgba(232, 110, 30, 0.9)); border-color: rgba(255, 220, 160, 0.4); }
.hud-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 268px; }

/* objective pill (tap to expand) */
.objectives.obj-pill { padding: 0; gap: 0; width: min(300px, 36vw); overflow: hidden; border-radius: 16px; }
.op-main { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px 7px 7px; text-align: left; min-height: 44px; }
.op-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 159, 67, 0.2); border: 1px solid rgba(255, 159, 67, 0.45); font-size: 16px; }
.obj-pill.tut .op-ico { background: rgba(255, 210, 63, 0.3); border-color: #ffd23f; animation: tutGlow 1.4s ease-in-out infinite; }
@keyframes tutGlow { 50% { box-shadow: 0 0 14px rgba(255, 210, 63, 0.7); } }
.op-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.op-txt { font-size: 14px; font-weight: 600; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.op-prog { font-size: 11px; color: var(--accent-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.op-prog:empty { display: none; }
.op-nav { flex: none; display: flex; flex-direction: column; align-items: center; width: 34px; }
.op-arrow { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 159, 67, 0.2); border: 1px solid rgba(255, 159, 67, 0.55); transition: transform 0.1s linear; }
.op-arrow svg { width: 14px; height: 14px; fill: var(--accent-2); }
.op-dist { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.op-chev { flex: none; font-size: 12px; color: var(--dim); transition: transform 0.2s; }
.obj-pill.expanded .op-chev { transform: rotate(180deg); }
.op-bar { height: 4px; background: rgba(0, 0, 0, 0.3); }
.op-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, var(--accent)); transform-origin: left; transition: transform 0.4s; }
.op-more { padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 7px; border-top: 1px solid rgba(255, 255, 255, 0.06); max-height: 50vh; overflow-y: auto; }
.op-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.25; }
.op-ri { width: 22px; flex: none; text-align: center; font-size: 14px; }
.op-rt { flex: 1; min-width: 0; }
.op-rt small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.op-mini { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.op-mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.op-steps { display: flex; gap: 4px; padding-left: 30px; }
.op-steps i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.op-steps i.done { background: var(--good); }
.op-steps i.cur { background: #ffd23f; box-shadow: 0 0 6px rgba(255, 210, 63, 0.8); }
.op-skip { align-self: flex-end; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }

/* hotbar: owned items only, scrolls past 6, bag button at the end */
.hotbar { align-items: center; max-width: calc(100vw - 24px); }
.hb-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: calc(6 * 56px + 5 * 6px); scroll-snap-type: x mandatory; padding-top: 9px; margin-top: -9px; }
.hb-scroll::-webkit-scrollbar { display: none; }
.hb-scroll .slot { flex: none; scroll-snap-align: start; }
.hb-empty { font-size: 13px; color: var(--muted); padding: 0 10px; white-space: nowrap; align-self: center; }
.slot-bag { flex: none; background: rgba(255, 159, 67, 0.16); border-color: rgba(255, 159, 67, 0.4); margin-left: 4px; }
.slot-bag .cnt { font-size: 11px; color: var(--accent-2); }

/* touch: no SPRINT button (joystick rim = sprint); DODGE only after the tutorial */
.btn-sprint { display: none !important; }
body.tut-active .btn-dodge { display: none !important; }
.joystick.sprint { border-color: rgba(255, 210, 63, 0.75); box-shadow: 0 0 20px rgba(255, 210, 63, 0.35); }

/* combo counter */
.combo { position: absolute; right: calc(28px + var(--sar)); top: 38%; display: flex; flex-direction: column; align-items: center; pointer-events: none !important; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 159, 67, 0.6); }
.combo b { font-size: 44px; font-weight: 700; line-height: 1; color: #fff4e0; -webkit-text-stroke: 2px #b4500f; }
.combo span { font-size: 13px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent-2); }
.combo.hot b { color: #ffd23f; }
.combo.fire b { color: #ff7a3d; -webkit-text-stroke-color: #7a1f05; }
.combo.bump { animation: comboBump 0.25s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes comboBump { from { transform: scale(1.5) rotate(-6deg); } to { transform: scale(1); } }

/* dawn summary card */
.summary { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 30; pointer-events: auto; width: min(420px, 92vw); }
.summary.show { animation: sumIn 0.5s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes sumIn { from { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(0.85); } }
.sm-card { padding: 16px 18px 14px; text-align: center; background: linear-gradient(170deg, rgba(255, 196, 120, 0.28), rgba(40, 30, 60, 0.82)); }
.sm-sun { font-size: 38px; line-height: 1; margin-top: -4px; }
.sm-title { font-size: 26px; font-weight: 700; color: #ffe2a8; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.sm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 10px; }
.sm-stat { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.sm-stat b { font-size: 20px; }
.sm-stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.sm-stat small { font-size: 11px; color: var(--muted); }
.sm-mvp { font-size: 15px; padding: 7px 10px; border-radius: 12px; background: rgba(255, 210, 63, 0.14); border: 1px solid rgba(255, 210, 63, 0.35); }
.sm-mvp.me { background: rgba(255, 210, 63, 0.3); animation: tutGlow 1.2s infinite; }
.sm-mvp small { color: var(--muted); }
.sm-day { margin-top: 8px; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

/* event banner variant */
.banner.event { place-items: start center; padding-top: calc(28vh + var(--sat)); }
.banner.event .banner-inner { padding: 14px 22px 16px; border-radius: 22px; max-width: min(520px, 92vw); background: linear-gradient(170deg, rgba(60, 40, 90, 0.86), rgba(20, 20, 40, 0.86)); border: 1px solid rgba(255, 224, 138, 0.4); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.banner.event .banner-title { font-size: clamp(26px, 7vw, 46px); letter-spacing: 0.03em; color: #ffe08a; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4), 0 0 24px rgba(255, 200, 80, 0.5); }
.banner.event .banner-sub { margin-top: 6px; font-size: clamp(13px, 3.4vw, 18px); color: var(--cream); letter-spacing: 0.02em; }

/* pet picker */
.pp-sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 18px; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.1); transition: transform 0.1s, border-color 0.2s; }
.pp-card:hover, .pp-card:active { border-color: var(--accent); transform: scale(1.03); }
.pp-ico { font-size: 54px; line-height: 1; }
.pp-card b { font-size: 18px; }
.pp-card small { color: var(--muted); font-size: 12px; }

/* trader */
.tr-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 15px; }
.tr-info .dim { color: var(--muted); font-size: 12px; }
.tr-list { display: flex; flex-direction: column; gap: 7px; }
.tr-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); }
.tr-card.rare { border-color: rgba(178, 107, 255, 0.6); background: rgba(178, 107, 255, 0.12); }
.tr-card.zero { opacity: 0.55; }
.tr-ico { font-size: 26px; width: 34px; text-align: center; }
.tr-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tr-name small { color: var(--muted); font-size: 12px; }

/* workbench upgrades */
.up-note { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.up-list { display: flex; flex-direction: column; gap: 12px; }
.up-row { display: flex; flex-direction: column; gap: 6px; }
.up-kind { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 15px; }
.up-kind b { font-size: 18px; }
.up-chain { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.up-arrow { align-self: center; color: var(--dim); font-size: 16px; flex: none; }
.up-card { flex: none; width: 150px; display: flex; flex-direction: column; gap: 5px; padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.up-card.owned { background: rgba(61, 220, 132, 0.1); border-color: rgba(61, 220, 132, 0.4); }
.up-card.next { background: rgba(255, 159, 67, 0.13); border-color: rgba(255, 159, 67, 0.65); box-shadow: 0 0 14px rgba(255, 159, 67, 0.25); }
.up-card.locked { opacity: 0.55; }
.up-tier { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent-2); }
.up-name { font-weight: 700; font-size: 14px; }
.up-stats { display: flex; flex-wrap: wrap; gap: 3px; }
.up-stat { font-size: 11px; padding: 1px 6px; border-radius: 7px; background: rgba(0, 0, 0, 0.25); }
.up-owned { font-size: 12px; color: var(--good); font-weight: 700; margin-top: auto; }
.up-lock { font-size: 12px; color: var(--muted); margin-top: auto; }
.up-card .chips { display: flex; flex-wrap: wrap; gap: 3px; }
.up-card .chips.dim { opacity: 0.6; }
.up-card .btn { margin-top: auto; }
.up-banner { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; text-align: left; background: linear-gradient(160deg, rgba(255, 183, 96, 0.22), rgba(255, 120, 40, 0.12)); border: 1px solid rgba(255, 159, 67, 0.45); }
.up-banner b { font-size: 22px; }
.up-banner span { flex: 1; display: flex; flex-direction: column; }
.up-banner small { color: var(--muted); font-size: 12px; }
.up-banner i { font-style: normal; font-size: 22px; color: var(--accent-2); }

/* backpack */
.bp-cap { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); margin-bottom: 4px; }
.bp-cap-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bp-bar { height: 8px; border-radius: 5px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.bp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), #a6f07a); border-radius: 5px; }
.bp-bar.full i { background: linear-gradient(90deg, #ff9f43, #ff5a5f); }
.bp-mini { height: 3px; border-radius: 2px; background: rgba(0, 0, 0, 0.3); overflow: hidden; width: 80%; margin: 2px auto 0; }
.bp-mini i { display: block; height: 100%; background: var(--accent-2); }
.inv-item .ic small { color: var(--dim); font-weight: 500; }
.tier-pips { font-size: 8px; letter-spacing: 1px; color: var(--accent-2); }
.inv-up { float: right; margin-top: -4px; }

/* settings: keyboard help */
.key-help { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 4px 0 8px; font-size: 13px; }
.key-help div { display: flex; gap: 8px; align-items: center; }
.key-help kbd { min-width: 112px; font-family: inherit; font-size: 12px; padding: 2px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--accent-2); }
.key-help span { color: var(--muted); }
@media (hover: none), (pointer: coarse) { .key-help div:not(:last-child) { display: none; } }

/* phones (portrait) */
@media (max-width: 760px) and (orientation: portrait) {
  #hud .hud-tr { flex-direction: column; align-items: flex-end; gap: 6px; }
  .hud-btns { flex-direction: column; gap: 5px; align-items: flex-end; }
  .camp-btns { flex-direction: column; gap: 5px; }
  .hud-btns .icon-btn { width: 38px; height: 38px; font-size: 17px; border-radius: 12px; }
  .hud-menu { top: auto; right: 0; width: min(270px, 80vw); }
  .objectives.obj-pill { width: min(250px, 62vw); }
  .op-main { min-height: 40px; padding: 5px 6px 5px 5px; gap: 6px; }
  .op-ico { width: 26px; height: 26px; font-size: 14px; border-radius: 9px; }
  .op-txt { font-size: 12.5px; }
  .op-nav { width: 30px; }
  .op-arrow { width: 22px; height: 22px; }
  .hb-scroll { max-width: calc(6 * 44px + 5 * 4px); gap: 4px; }
  .combo { right: calc(14px + var(--sar)); top: 44%; }
  .combo b { font-size: 34px; }
  .summary { top: 27%; }
  .sm-title { font-size: 22px; }
  .up-card { width: 136px; }
}
/* phones (landscape) */
@media (max-height: 500px) and (orientation: landscape) {
  .objectives.obj-pill { width: min(250px, 30vw); }
  .op-main { min-height: 38px; padding: 4px 6px 4px 4px; }
  .op-txt { font-size: 12.5px; -webkit-line-clamp: 1; }
  .hb-scroll { max-width: calc(6 * 44px + 5 * 4px); gap: 4px; }
  .hud-btns .icon-btn { width: 36px; height: 36px; font-size: 16px; }
  .summary { top: 8%; }
  .sm-stats { margin: 6px 0; }
  .combo { top: 30%; }
}

/* ======================================================================================
   v5 — MineFun / Minecraft HUD (docs/V5-DIRECTION.md §3). Overrides the v4 glass HUD.
   ====================================================================================== */
:root { --mc-wood: #8a5a2e; --mc-wood-d: #4a2c12; --mc-slot: #7b5131; --mc-slot-d: #3a230f; --mc-sel: #ffd21f; --mc-text-stroke: 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 -2px 0 #000, 0 3px 4px rgba(0, 0, 0, 0.45); }
#hud { --slot: clamp(36px, min(4.1vw, 7.4vh), 74px); }
#hud .hud-tl, #hud .hud-top, #hud .hud-tr, #hud .hud-bottom { pointer-events: none; }
#hud .hud-tl > *, #hud .hud-top > *, #hud .hud-bottom > *, #hud .tr-btns > * { pointer-events: auto; }

/* crosshair (Minecraft: thin white cross, brighter when an interactable is aimed) */
.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none !important; opacity: 0.75; mix-blend-mode: difference; }
.crosshair i { position: absolute; background: #fff; }
.crosshair i:first-child { left: 10px; top: 0; width: 2px; height: 22px; }
.crosshair i:last-child { left: 0; top: 10px; width: 22px; height: 2px; }
.crosshair.on { opacity: 1; transform: scale(1.12); }
body.tp .crosshair { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #fff; mix-blend-mode: normal; opacity: 0.6; }
body.tp .crosshair i { display: none; }
#hud.hidden ~ * .crosshair { display: none; }

/* ---------- top-left: feed + ENTER ---------- */
#hud .hud-tl { top: calc(8px + var(--sat)); left: calc(8px + var(--sal)); width: min(420px, 38vw); gap: 6px; }
.feed { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-height: 32vh; overflow: hidden; pointer-events: none !important; }
.feed .fl { max-width: 100%; padding: 1px 9px 2px; border-radius: 6px; background: rgba(40, 40, 40, 0.62); color: #ffe36b; font-size: 15px; font-weight: 700; line-height: 1.35; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); word-break: break-word; transition: opacity 1.2s; animation: flIn 0.25s ease-out; }
.feed .fl.fl-chat { color: #fff; }
.feed .fl.fl-chat b { font-weight: 800; }
.feed .fl.good { color: #8dff7a; } .feed .fl.warn { color: #ffb36b; } .feed .fl.danger { color: #ff7a7a; }
.feed .fl.old { opacity: 0; }
.feed.open .fl.old { opacity: 1; }
.feed.open { max-height: 46vh; }
@keyframes flIn { from { transform: translateX(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-row { display: flex; align-items: center; gap: 6px; }
.mc-btn { font-weight: 800; letter-spacing: 0.04em; color: #fff3d6; text-shadow: 0 2px 0 #3a1f08; background: linear-gradient(180deg, #b3753c, #8a5426); border: 3px solid #4a2a0e; border-radius: 7px; box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 2px 0 rgba(0, 0, 0, 0.35); }
.mc-btn:active { transform: translateY(2px); }
.chat-btn { font-size: 19px; padding: 2px 12px 3px; }
.chat-form { flex: 1; min-width: 0; }
.chat-form input { width: 100%; font-size: 16px; font-weight: 600; padding: 7px 10px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.6); color: #fff; outline: none; }
#hud .hud-tl .vitals { background: none; border: 0; box-shadow: none; padding: 0; width: 180px; }
#hud .hud-tl .vitals:empty, #hud .hud-tl .vitals .hx-warm.collapsed { display: none; }

/* ---------- top-centre: day pill + objective + boss ---------- */
.hud-top { position: absolute; top: calc(8px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(460px, 46vw); }
.day-pill { position: relative; display: flex; align-items: center; gap: 8px; padding: 3px 16px 5px; border-radius: 999px; background: rgba(30, 30, 30, 0.72); border: 2px solid rgba(255, 255, 255, 0.12); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 0.02em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); white-space: nowrap; }
.day-pill .dp-ico { font-size: 20px; filter: drop-shadow(0 0 6px rgba(255, 220, 80, 0.7)); }
.day-pill.night .dp-ico { filter: drop-shadow(0 0 6px rgba(160, 190, 255, 0.8)); }
.day-pill .dp-prog { position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.day-pill .dp-prog b { position: absolute; inset: 0; background: #ffd23f; transform-origin: left; transform: scaleX(0); transition: transform 1s linear; }
.day-pill.night .dp-prog b { background: #8fa8ff; }
#hud .obj-line { position: relative; width: auto; max-width: 100%; background: none; border: 0; box-shadow: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.ol-main { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 12px 3px; border-radius: 8px; background: rgba(20, 20, 20, 0.55); color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.obj-line.tut .ol-main { background: rgba(70, 45, 12, 0.72); box-shadow: inset 0 0 0 2px rgba(255, 210, 63, 0.55); }
.ol-ico { font-size: 15px; } .ol-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ol-prog { color: #ffd23f; font-size: 13px; white-space: nowrap; } .ol-prog:empty { display: none; }
.ol-nav { display: flex; align-items: center; gap: 3px; color: #ffd23f; font-size: 13px; white-space: nowrap; }
.ol-arrow { display: inline-block; width: 14px; height: 14px; } .ol-arrow svg { width: 100%; height: 100%; fill: #ffd23f; }
.ol-more { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); width: min(380px, 80vw); padding: 8px 10px; border-radius: 10px; background: rgba(20, 20, 20, 0.86); display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; z-index: 3; }
.ol-row small { display: block; color: rgba(255, 255, 255, 0.65); font-weight: 500; }
.ol-skip { align-self: flex-end; font-size: 13px; color: #ffb36b; text-decoration: underline; padding: 2px 4px; }
#hud .hx-top { position: static; transform: none; order: 3; }
#hud.boss-on .obj-line { order: 4; }
#hud .hud-top .hx-top { pointer-events: none; }
#hud .hx-chips .hx-gems { background: rgba(30, 30, 30, 0.7); }

/* ---------- top-right: key-labelled buttons + compact square minimap ---------- */
#hud .hud-tr { top: calc(6px + var(--sat)); right: calc(6px + var(--sar)); display: grid; grid-template-columns: auto auto auto; grid-template-areas: 'esc q p' 'mm mm b' 'mm mm m' 'mm mm .'; gap: 2px 4px; justify-items: end; align-items: start; flex-direction: unset; }
.tr-btns { display: contents; }
#btnEsc { grid-area: esc; } #btnQ { grid-area: q; } #btnP { grid-area: p; } #btnB { grid-area: b; } #btnM { grid-area: m; }
#hud .hud-tr .minimap-slot { grid-area: mm; margin-top: 4px; }
.kbtn { position: relative; width: 64px; height: 60px; display: grid; place-items: center; pointer-events: auto; }
.kbtn .kb-ico { font-size: 38px; line-height: 1; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)); transition: transform 0.12s; }
.kbtn b { position: absolute; right: 2px; bottom: 0; font-size: 21px; font-weight: 800; line-height: 1; color: #fff; text-shadow: var(--mc-text-stroke); }
.kbtn:hover .kb-ico { transform: scale(1.08); } .kbtn:active .kb-ico { transform: scale(0.92); }
.kbtn .count { position: absolute; left: 2px; top: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font-style: normal; font-size: 11px; font-weight: 800; background: #2d6cdf; color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.kbtn .dot { position: absolute; right: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 800; background: #e8352e; color: #fff; display: grid; place-items: center; border: 2px solid #fff; animation: helpPulse 0.8s infinite alternate; }
#hud .minimap { --mm: clamp(92px, 9.5vw, 150px); border-radius: 6px; }
#hud .minimap .mm-face { border-radius: 6px; border: 3px solid #3a230f; box-shadow: 0 0 0 2px #b3753c, 0 4px 10px rgba(0, 0, 0, 0.4); }
#hud .minimap .mm-face::after { border-radius: 4px; background: none; }
#hud .minimap .mm-key { display: none; }

/* ---------- bottom: hearts + ĐÓI + armour + 9-slot hotbar ---------- */
.hud-bottom { position: absolute; left: 50%; bottom: calc(6px + var(--sab)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: calc(var(--slot) * 10 + 9 * 3px + 16px); }
.vit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 2px; }
.hearts { display: flex; gap: calc(var(--slot) * 0.06); }
.heart { width: calc(var(--slot) * 0.42); height: calc(var(--slot) * 0.38); display: block; }
.heart svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.heart .h-out { fill: #2a0606; } .heart .h-in { fill: #e8352e; } .heart .h-shine { fill: #ffb3b3; }
.heart .h-bg { fill: #3d1010; }
.heart.half .h-r { display: none; }
.heart.empty .h-in, .heart.empty .h-shine { display: none; }
.hearts.low .heart { animation: heartShake 0.5s infinite; }
.hearts.low .heart:nth-child(odd) { animation-delay: 0.12s; }
.hearts.hurt .heart .h-in { animation: heartFlash 0.4s; }
@keyframes heartShake { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes heartFlash { 0%, 60% { fill: #fff; } }
.hunger-bar { position: relative; flex: 0 0 46%; height: calc(var(--slot) * 0.38); min-height: 16px; border-radius: 4px; background: #2c3a1c; border: 2px solid #121a08; overflow: hidden; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.hunger-bar .hg-fill { position: absolute; inset: 0; background: linear-gradient(180deg, #8dff3a, #58c81c); transform-origin: left; transition: transform 0.4s; }
.hunger-bar .hg-lbl { position: absolute; left: 6px; top: 50%; transform: translateY(-52%); font-size: clamp(11px, calc(var(--slot) * 0.27), 17px); font-weight: 800; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000; letter-spacing: 0.04em; }
.hunger-bar.low { animation: blink 0.5s infinite alternate; }
.hunger-bar.low .hg-fill { background: linear-gradient(180deg, #ffb13a, #e57a12); }
.armor-row { display: flex; gap: calc(var(--slot) * 0.06); padding: 0 2px; }
.armor { width: calc(var(--slot) * 0.36); height: calc(var(--slot) * 0.36); display: block; opacity: 0.35; }
.armor svg { width: 100%; height: 100%; display: block; } .armor .a-out { fill: #1c1c1c; } .armor .a-in { fill: #6b6b6b; }
.armor.on { opacity: 1; } .armor.on .a-in { fill: #d8dde3; }
#hud .mc-hotbar { position: relative; left: auto; bottom: auto; transform: none; display: flex; gap: 3px; padding: 5px; border-radius: 6px; background: var(--mc-wood-d); border: 3px solid #2a1806; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 2px #6e4422; max-width: none; }
.hb-slot { position: relative; width: var(--slot); height: var(--slot); flex: 0 0 var(--slot); display: grid; place-items: center; border-radius: 3px; background: var(--mc-slot); box-shadow: inset 0 0 0 2px var(--mc-slot-d), inset 3px 3px 0 rgba(0, 0, 0, 0.18); padding: 0; }
.hb-slot.sel { box-shadow: inset 0 0 0 3px var(--mc-sel), 0 0 0 2px var(--mc-sel), 0 0 12px rgba(255, 210, 31, 0.55); z-index: 1; }
.hb-num { position: absolute; top: calc(var(--slot) * -0.16); left: 50%; transform: translateX(-50%); min-width: calc(var(--slot) * 0.3); height: calc(var(--slot) * 0.3); padding: 0 3px; display: grid; place-items: center; font-size: clamp(10px, calc(var(--slot) * 0.24), 17px); font-weight: 800; line-height: 1; color: #2a1806; background: #f3e6c8; border: 2px solid #2a1806; border-radius: 3px; z-index: 2; }
.hb-slot.sel .hb-num { background: var(--mc-sel); }
.hb-ico { width: 72%; height: 72%; display: grid; place-items: center; pointer-events: none; }
.hb-ico .px-ico { width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.35)); }
.hb-ico .emo-ico { font-size: calc(var(--slot) * 0.5); line-height: 1; }
.hb-cnt { position: absolute; right: 3px; bottom: 0; font-size: clamp(11px, calc(var(--slot) * 0.27), 18px); font-weight: 800; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 2px 2px 0 #3a3a3a; pointer-events: none; }
.hb-slot.bump .hb-ico { animation: slotBump 0.3s cubic-bezier(.2, 1.6, .4, 1); }
.hb-slot.use { animation: slotBump 0.3s; }
@keyframes slotBump { 50% { transform: scale(1.25); } }
.hb-more .dots { display: flex; gap: calc(var(--slot) * 0.06); }
.hb-more .dots i { width: calc(var(--slot) * 0.17); height: calc(var(--slot) * 0.17); border-radius: 50%; background: #f3e6c8; box-shadow: 0 1px 0 #000; }
.net-status { top: calc(var(--sat) + 120px); }
.lock-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, 34px); padding: 10px 18px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.62); color: #fff; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 2px; animation: fadeIn 0.3s; }
.lock-hint b { font-size: 22px; font-weight: 800; } .lock-hint small { font-size: 13px; color: rgba(255, 255, 255, 0.75); font-weight: 600; }

/* the v4 glass cards that don't fit the Minecraft HUD */
#hud .hx-stamina { display: none !important; }
#hud .combo { top: 58%; right: calc(50% - 160px); }
.toasts .toast { border-radius: 8px; background: rgba(20, 20, 20, 0.78); border: 0; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: none; backdrop-filter: none; font-weight: 700; }

/* touch controls */
.cam-btn { position: absolute; right: calc(12px + var(--sar)); top: calc(50% - 22px); width: 44px; height: 44px; border-radius: 10px; font-size: 22px; background: rgba(0, 0, 0, 0.35); border: 2px solid rgba(255, 255, 255, 0.35); display: none; }
@media (hover: none), (pointer: coarse) { .cam-btn { display: grid; place-items: center; } }
.btn-use { right: 118px; bottom: 80px; width: 70px; height: 70px; background: radial-gradient(circle at 50% 30%, #7fe07a, #2f9a2b); color: #fff; text-shadow: 0 1px 0 #000; box-shadow: 0 5px 0 #1d5f1a, inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.btn-use > b { font-size: 26px; }
@media (hover: hover) and (pointer: fine) {
  #hud .actions, #hud .joystick, #hud .btn-dodge, #hud .btn-shoot { display: none !important; }
}
@media (hover: none), (pointer: coarse) {
  body.fp .crosshair { opacity: 0.6; }
  #hud .ctx-col { bottom: 210px; }
}

/* phone portrait: hotbar full width at the bottom, sticks + buttons above it */
@media (max-width: 760px) and (orientation: portrait) {
  #hud { --slot: min(calc((100vw - 16px - 10px - 27px) / 10), 46px); }
  #hud .hud-tl { width: 58vw; }
  .feed .fl { font-size: 12.5px; }
  .chat-btn { font-size: 15px; padding: 1px 9px 2px; }
  .hud-top { top: calc(84px + var(--sat)); left: calc(8px + var(--sal)); transform: none; align-items: flex-start; width: calc(100vw - 112px); }
  .day-pill { font-size: 17px; padding: 2px 12px 4px; }
  .ol-main { font-size: 13px; }
  #hud .hud-tr { grid-template-areas: 'esc q p' 'mm mm b' 'mm mm m'; }
  .kbtn { width: 42px; height: 42px; } .kbtn .kb-ico { font-size: 25px; } .kbtn b { font-size: 14px; }
  #hud .minimap { --mm: 84px; }
  #hud .joystick { bottom: calc(var(--slot) * 2 + 40px + var(--sab)); width: 120px; height: 120px; }
  #hud .actions { bottom: calc(var(--slot) * 2 + 34px + var(--sab)); transform: scale(0.86); transform-origin: right bottom; }
  #hud .ctx-col { bottom: 230px; }
}
/* phone landscape: compact everything */
@media (max-height: 500px) and (orientation: landscape) {
  #hud { --slot: clamp(30px, 8.6vh, 40px); }
  #hud .hud-tl { width: 30vw; }
  .feed { max-height: 26vh; } .feed .fl { font-size: 12px; }
  .chat-btn { font-size: 14px; padding: 0 8px 1px; }
  .day-pill { font-size: 16px; padding: 1px 12px 3px; } .ol-main { font-size: 12.5px; }
  .hud-top { width: 36vw; }
  .kbtn { width: 40px; height: 38px; } .kbtn .kb-ico { font-size: 23px; } .kbtn b { font-size: 13px; }
  #hud .minimap { --mm: 74px; }
  #hud .joystick { width: 112px; height: 112px; bottom: calc(10px + var(--sab)); }
  #hud .actions { transform: scale(0.74); transform-origin: right bottom; right: calc(6px + var(--sar)); bottom: calc(4px + var(--sab)); }
  .cam-btn { top: auto; bottom: 46%; }
}
/* tablets: a bit bigger touch targets */
@media (hover: none) and (min-width: 761px) and (min-height: 501px), (pointer: coarse) and (min-width: 761px) and (min-height: 501px) {
  #hud { --slot: clamp(44px, 5.4vw, 62px); }
  .hud-bottom { bottom: calc(10px + var(--sab)); }
}

/* ---------- Minecraft inventory screen (E / "…") ---------- */
.modal-card.mc { background: #c6c6c6; color: #303030; border: 3px solid #000; border-radius: 6px; box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555, 0 12px 40px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: none; backdrop-filter: none; width: min(640px, 100%); }
.modal-card.mc .modal-title { color: #303030; text-shadow: none; }
.modal-card.mc .close-btn { color: #303030; background: rgba(0, 0, 0, 0.08); }
.inv-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.inv-tabs button { flex: 1; padding: 6px 8px; font-weight: 800; font-size: 14px; border-radius: 4px; background: #8b8b8b; color: #fff; text-shadow: 0 1px 0 #333; box-shadow: inset 2px 2px 0 #aaa, inset -2px -2px 0 #555; }
.inv-tabs button.on { background: #c6c6c6; color: #303030; text-shadow: none; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #888; }
.inv5 { display: flex; flex-direction: column; gap: 6px; }
.inv5 .inv-top { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.inv5 .inv-sel { flex: 1; min-width: 180px; }
.mc-label { font-size: 13px; font-weight: 800; color: #3f3f3f; margin: 2px 0; }
.mc-help { font-size: 13px; color: #4a4a4a; font-weight: 600; line-height: 1.3; }
.inv-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-row { display: flex; gap: 3px; flex-wrap: wrap; }
.mc-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; max-height: 38vh; overflow-y: auto; touch-action: pan-y; }
.mc-bar { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.mc-slot { position: relative; width: 100%; max-width: 54px; aspect-ratio: 1; min-width: 32px; display: grid; place-items: center; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; border-radius: 0; padding: 0; }
.mc-row .mc-slot { width: 48px; flex: 0 0 48px; }
.mc-grid .mc-slot, .mc-bar .mc-slot { max-width: none; }
.mc-slot .px-ico { width: 78%; height: 78%; image-rendering: pixelated; pointer-events: none; }
.mc-slot .emo-ico { font-size: 26px; pointer-events: none; }
.mc-slot .ms-cnt { position: absolute; right: 2px; bottom: 0; font-size: 14px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 #3f3f3f; pointer-events: none; }
.mc-slot .ms-num { position: absolute; left: 3px; top: 1px; font-size: 11px; font-weight: 800; color: #e0e0e0; text-shadow: 1px 1px 0 #333; pointer-events: none; }
.mc-slot .ms-ghost { opacity: 0.25; font-size: 22px; filter: grayscale(1); }
.mc-slot.picked { box-shadow: inset 0 0 0 3px #ffd21f, inset 2px 2px 0 #373737; background: #a0a0a0; }
.mc-slot:not(.static):hover { background: #9d9d9d; }
.mc-ghost { position: fixed; left: 0; top: 0; width: 48px; height: 48px; z-index: 100; pointer-events: none; opacity: 0.9; }
.inv5 .stats-grid { color: #303030; }
.inv-craft { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mc-big { display: flex; align-items: center; gap: 10px; padding: 14px; font-weight: 800; font-size: 17px; color: #303030; background: #b4b4b4; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #666; border-radius: 4px; }
.mc-big b { font-size: 28px; }
@media (max-width: 520px) { .mc-row .mc-slot { width: 40px; flex-basis: 40px; } .mc-slot .ms-cnt { font-size: 12px; } }

/* shop tab strip (B) */
.shop-tabs { display: flex; gap: 4px; margin: -4px -4px 10px; overflow-x: auto; touch-action: pan-x; }
.shop-tabs button { flex: 1 0 auto; padding: 7px 12px; font-size: 14px; font-weight: 800; border-radius: 10px 10px 4px 4px; background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap; }
.shop-tabs button.on { background: linear-gradient(180deg, #b3753c, #8a5426); color: #fff3d6; text-shadow: 0 1px 0 #3a1f08; }
.tr-ico .px-ico, .card-ico .px-ico, .up-tier .px-ico, .st-ico .px-ico { width: 34px; height: 34px; image-rendering: pixelated; }
.up-tier .px-ico { width: 40px; height: 40px; }

/* settings / Esc menu */
.set-resume { margin-bottom: 6px; }
.set-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.set-menu-btn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); font-weight: 700; font-size: 14px; text-align: left; }
.set-menu-btn b { font-size: 18px; }
.pl-face { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 4px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); }
.i-key.red { filter: hue-rotate(-40deg) saturate(2); } .i-key.blue { filter: hue-rotate(180deg) saturate(1.6); } .i-key.green { filter: hue-rotate(70deg) saturate(1.6); }
#hud .hud-top .hx-top { position: static; transform: none; }
.chat-row .hx-gems { padding: 2px 9px 2px 6px; font-size: 14px; background: rgba(30, 30, 30, 0.62); border-radius: 7px; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.chat-row .hx-gems .g-ico { font-size: 13px; }
#hud .btn-action .a-lbl { white-space: nowrap; letter-spacing: 0.02em; font-size: 13px; }
.badge-pop { top: calc(118px + var(--sat)) !important; }
@media (max-width: 760px) and (orientation: portrait) { .badge-pop { top: calc(150px + var(--sat)) !important; } }
#hud .hx-boss .hb-name { white-space: nowrap; }
#hud .hx-boss .hb-name b { white-space: nowrap; letter-spacing: 0.04em; }
/* any touch device in portrait (phones + tablets): sticks and buttons sit above the hotbar */
@media (orientation: portrait) and (pointer: coarse), (orientation: portrait) and (hover: none) {
  #hud .joystick { bottom: calc(var(--slot) * 2 + 44px + var(--sab)); }
  #hud .actions { bottom: calc(var(--slot) * 2 + 34px + var(--sab)); }
}
/* lock hint: small, low (above the hearts), never over the centre plates; touch devices never show it */
.lock-hint { top: auto; bottom: calc(var(--slot) * 2 + 64px + var(--sab)); transform: translateX(-50%); padding: 5px 14px 6px; border-radius: 8px; gap: 0; background: rgba(0, 0, 0, 0.5); }
.lock-hint b { font-size: 16px; } .lock-hint small { font-size: 11.5px; }
@media (hover: none), (pointer: coarse) { .lock-hint { display: none !important; } }
@media (max-width: 760px) and (orientation: portrait) {
  #hud .hud-top .hx-top { align-self: stretch; align-items: stretch; }
  #hud .hud-top .hx-boss { width: 100%; }
}
