/* ---------------- Top status bar ---------------- */
#status-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + clamp(10px, calc(2.6 * var(--u)), 26px)) clamp(14px, calc(3.6 * var(--u)), 36px) clamp(10px, calc(2.6 * var(--u)), 26px);
  background: linear-gradient(#11160fe6, #11160f99 70%, #11160f00);
  pointer-events: none;
  z-index: 20;
}
.status-line {
  display: flex; align-items: center; gap: clamp(9px, calc(2.4 * var(--u)), 22px); margin-bottom: clamp(6px, calc(1.6 * var(--u)), 14px);
  font-size: clamp(16px, calc(4.6 * var(--u)), 38px); flex-wrap: wrap;
}
.s-name { font-weight: 700; font-size: clamp(20px, calc(6 * var(--u)), 50px); color: var(--accent); }
/* Top line as a 3-column grid so the boost pill sits dead-centre between the name
   (left) and the online count (right). Columns are pinned explicitly so hiding the
   boost doesn't shift the name/online out of place. */
.top-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; flex-wrap: nowrap; }
.top-line #s-name { grid-column: 1; justify-self: start; }
.top-line #s-boost { grid-column: 2; justify-self: center; }
.top-line .s-online { grid-column: 3; justify-self: end; margin-left: 0; }
.s-online { margin-left: auto; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.s-online .dot { width: clamp(11px, calc(2.4 * var(--u)), 20px); height: clamp(11px, calc(2.4 * var(--u)), 20px); border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 6px var(--accent-2); }
.pill {
  background: #1b2a1fcc; border: 1px solid #314733; border-radius: 999px;
  padding: clamp(6px, calc(1.6 * var(--u)), 14px) clamp(15px, calc(3.8 * var(--u)), 34px); font-size: clamp(16px, calc(4.6 * var(--u)), 38px);
}
.pill.hp { color: #f0c0b6; border-color: #5a2c25; }
.pill.coins::before { content: "🪙 "; }
.pill.boost { color: #1a1306; background: linear-gradient(#e8c45a, #c8922f); border-color: #7a5a1c; font-weight: 700; }
.pill.boost.hidden { display: none; }
.s-region { font-weight: 600; color: var(--accent-2); }
.s-coords {
  font-variant-numeric: tabular-nums; color: var(--muted); font-size: clamp(13px, calc(3.4 * var(--u)), 28px);
  background: #1b2a1fcc; border: 1px solid #314733; border-radius: 999px; padding: clamp(5px, calc(1.3 * var(--u)), 12px) clamp(13px, calc(3.2 * var(--u)), 28px);
}
.s-coords::before { content: "⌖ "; color: var(--accent); }
.s-dist { margin-left: auto; color: var(--muted); }

/* ---------------- Map controls ---------------- */
#map-controls {
  position: absolute; right: clamp(12px, calc(3 * var(--u)), 28px);
  bottom: calc(clamp(104px, calc(26 * var(--u)), 200px) + var(--safe-pad)); z-index: 20;
  display: flex; flex-direction: column; gap: clamp(12px, calc(3 * var(--u)), 24px); align-items: flex-end;
}
.map-btn {
  width: clamp(68px, calc(17 * var(--u)), 130px); height: clamp(68px, calc(17 * var(--u)), 130px); border-radius: clamp(16px, calc(4 * var(--u)), 28px);
  background: #1b2a1fe6; border: 1px solid #314733; color: var(--ink);
  font-size: clamp(30px, calc(7.6 * var(--u)), 58px); cursor: pointer;
}
.map-btn.wide { width: auto; padding: 0 clamp(20px, calc(4.5 * var(--u)), 40px); font-size: clamp(20px, calc(5 * var(--u)), 40px); height: clamp(58px, calc(14 * var(--u)), 100px); }
.map-btn:active { background: var(--panel-2); }
#btn-install { background: linear-gradient(#d8b25a, #b8862f); color: #1a1306; border-color: #7a5a1c; font-weight: 700; }
#btn-install:active { background: #c8922f; }

/* ---------------- Tap-a-player inspect popup ---------------- */
.inspect-pop {
  position: absolute; z-index: 27; width: 168px;
  background: #1b2a1ff5; border: 1px solid #314733; border-radius: 10px;
  padding: 9px 11px; box-shadow: 0 8px 22px rgba(0,0,0,.5);
  color: var(--ink); text-align: center;
}
.inspect-pop.hidden { display: none; }
.inspect-pop .ip-name { font-weight: 700; font-size: 14px; }
.inspect-pop .ip-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ip-attack {
  margin-top: 8px; width: 100%; height: 34px; border: none; border-radius: 8px;
  background: linear-gradient(#b6432e, #8d2f20); color: #fff; font-weight: 700;
  font-size: 14px; cursor: pointer;
}
.ip-attack:active { filter: brightness(1.15); }
.ip-attack.hidden { display: none; }

/* ---------------- Chat ---------------- */
#btn-chat { position: relative; }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--accent); color: #11160f;
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.chat-badge.hidden { display: none; }
.chat {
  position: absolute; left: 8px; right: 8px; bottom: calc(clamp(80px, calc(19 * var(--u)), 160px) + var(--safe-pad));
  z-index: 29; height: 44%; max-height: 360px; display: flex; flex-direction: column;
  background: #11160ff5; border: 1px solid #314733; border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,.5); overflow: hidden;
}
.chat.hidden { display: none; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #314733; font-weight: 700; color: var(--accent);
  font-size: clamp(18px, calc(4.8 * var(--u)), 32px);
}
.chat-log { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; }
.chat-msg { font-size: clamp(15px, calc(4.2 * var(--u)), 28px); line-height: 1.35; word-break: break-word; }
.chat-msg b { color: var(--accent-2); margin-right: 4px; }
.chat-msg.mine b { color: var(--accent); }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #314733; }
.chat-form input {
  flex: 1; min-width: 0; height: clamp(42px, calc(11 * var(--u)), 64px); padding: 0 14px; border-radius: 8px;
  border: 1px solid #314733; background: #0e130d; color: var(--ink); font-size: clamp(16px, calc(4.2 * var(--u)), 28px);
}
.chat-send {
  height: clamp(42px, calc(11 * var(--u)), 64px); padding: 0 clamp(16px, calc(4.4 * var(--u)), 30px); border: none; border-radius: 8px;
  background: var(--accent); color: #11160f; font-weight: 700; cursor: pointer; font-size: clamp(16px, calc(4.2 * var(--u)), 28px);
}

/* ---------------- Notifications ---------------- */
#notifications {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 78px);
  width: min(94%, 620px); z-index: 25;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  background: #1b2a1fee; border: 1px solid #314733; border-left: 4px solid var(--accent);
  border-radius: 8px; padding: clamp(11px, calc(2.8 * var(--u)), 20px) clamp(14px, calc(3.4 * var(--u)), 26px); font-size: clamp(16px, calc(4.4 * var(--u)), 30px);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  animation: toast-in .25s ease, toast-out .4s ease 4.6s forwards;
}
.toast.good { border-left-color: var(--accent-2); }
.toast.warn { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- Bottom navigation ---------------- */
#bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #11160ff2; border-top: 1px solid #314733;
  padding-bottom: var(--safe-pad);
}
.nav-btn {
  flex: 1; background: transparent; border: none; color: var(--muted);
  padding: clamp(14px, calc(3.4 * var(--u)), 28px) 0 clamp(13px, calc(3.2 * var(--u)), 26px); font-size: clamp(33px, calc(8.4 * var(--u)), 64px); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: clamp(4px, calc(1 * var(--u)), 9px);
}
.nav-btn span { font-size: clamp(16px, calc(4 * var(--u)), 30px); }
.nav-btn.active { color: var(--accent); }

/* ---------------- Slide-up panel ---------------- */
.panel {
  position: absolute; left: 0; right: 0;
  bottom: calc(clamp(80px, calc(19 * var(--u)), 160px) + var(--safe-pad)); z-index: 28;
  max-height: 60%; background: var(--panel);
  border-top: 1px solid #314733; border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.5);
  transform: translateY(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.panel:not(.hidden) { transform: translateY(0); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #2a3d2c; font-weight: 700; font-size: clamp(20px, calc(5.4 * var(--u)), 40px);
}
.panel-close { background: none; border: none; color: var(--muted); font-size: clamp(28px, calc(7 * var(--u)), 50px); cursor: pointer; }
.panel-body { padding: 16px 18px 24px; overflow-y: auto; font-size: clamp(18px, calc(4.8 * var(--u)), 34px); }

.stat-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #223528; font-size: clamp(18px, calc(4.8 * var(--u)), 34px); }
.stat-row span:last-child { color: var(--accent); font-weight: 600; }
.logout-btn {
  display: block; width: 100%; margin-top: 20px; padding: clamp(14px, calc(3.6 * var(--u)), 26px);
  border: 1px solid #5a2a2a; border-radius: 10px; background: #2a1a1a;
  color: #e7b3b3; font-weight: 600; font-size: clamp(17px, calc(4.6 * var(--u)), 32px); cursor: pointer;
}
.logout-btn:hover { background: #3a2020; }
.logout-btn:disabled { opacity: 0.6; cursor: default; }
.skill-bar { height: 8px; background: #0e130d; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.skill-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.placeholder { color: var(--muted); text-align: center; padding: 24px 8px; }

/* ---------------- Modals ---------------- */
.modal {
  position: absolute; inset: 0; z-index: 40;
  background: #000000aa; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid #314733; border-radius: 16px; padding: 20px;
}
.modal-card h2 { margin: 0 0 10px; color: var(--accent); }
.modal-card h3 { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }

/* Death / respawn celebration */
#death-modal { background: #06080af2; } /* near-opaque: hides the respawn teleport behind it */
.death-card { text-align: center; max-width: 600px; border-color: #6b5a2a; padding: clamp(24px, calc(6 * var(--u)), 48px); }
.death-trophy { font-size: clamp(48px, calc(13 * var(--u)), 96px); line-height: 1; margin-bottom: 4px; }
.death-card h2 { color: #f2d23a; font-size: clamp(28px, calc(7.4 * var(--u)), 52px); }
.death-body { margin: 14px 0 4px; }
.death-line { font-size: clamp(18px, calc(5 * var(--u)), 34px); padding: 8px 0; }
.death-line b { color: #f2d23a; font-size: clamp(22px, calc(6 * var(--u)), 42px); }
.death-count { margin-top: 16px; font-size: clamp(14px, calc(3.8 * var(--u)), 26px); color: var(--muted); }
.death-count span { color: var(--accent); font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #223528; font-size: 14px; }
.summary-row span:last-child { color: var(--accent-2); font-weight: 600; }

/* "While you were away" — roughly double-size, scales with screen width */
#offline-modal .modal-card { max-width: 640px; padding: clamp(28px, calc(7 * var(--u)), 56px); }
#offline-modal .modal-card h2 { font-size: clamp(30px, calc(8 * var(--u)), 56px); margin: 0 0 18px; }
#offline-modal .summary-row { padding: clamp(11px, calc(2.6 * var(--u)), 20px) 0; font-size: clamp(20px, calc(5.4 * var(--u)), 38px); }
#offline-modal #offline-close { font-size: clamp(20px, calc(5.4 * var(--u)), 38px); padding: clamp(16px, calc(3.6 * var(--u)), 28px); margin-top: 24px; }
/* Admin teleport menu */
.tp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 46vh; overflow-y: auto; margin-bottom: 10px; }
.tp-btn {
  padding: 12px 11px; border-radius: 8px; border: 1px solid #314733; background: #0e130d;
  color: var(--ink); font-size: clamp(15px, calc(4 * var(--u)), 26px); cursor: pointer; text-align: left;
}
.tp-btn:active { background: var(--panel-2); }
.tp-btn small { color: var(--muted); font-size: clamp(13px, calc(3.4 * var(--u)), 22px); }
.tp-xy { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.tp-xy input { width: clamp(70px, calc(20 * var(--u)), 120px); height: clamp(42px, calc(11 * var(--u)), 62px); padding: 0 10px; border-radius: 8px; border: 1px solid #314733; background: #0e130d; color: var(--ink); font-size: clamp(15px, calc(4 * var(--u)), 26px); }
.tp-xy button { height: clamp(42px, calc(11 * var(--u)), 62px); padding: 0 clamp(16px, calc(4.2 * var(--u)), 30px); border-radius: 8px; border: none; background: var(--accent-2); color: #11160f; font-weight: 700; cursor: pointer; font-size: clamp(15px, calc(4 * var(--u)), 26px); }

/* Leaderboards ("Hall of Wanderers") */
#board-modal .modal-card { max-width: 640px; padding: clamp(24px, calc(6 * var(--u)), 48px); }
#board-modal .modal-card h2 { font-size: clamp(26px, calc(7 * var(--u)), 50px); margin: 0 0 16px; }
#board-modal #board-close { font-size: clamp(18px, calc(4.8 * var(--u)), 32px); padding: clamp(14px, calc(3.4 * var(--u)), 24px); margin-top: 18px; width: 100%; }
.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.board-tab {
  padding: 9px 14px; border-radius: 999px; border: 1px solid #314733;
  background: #0e130d; color: var(--muted); font-size: clamp(15px, calc(4 * var(--u)), 26px); cursor: pointer;
}
.board-tab.active { border-color: var(--accent); background: var(--panel-2); color: var(--ink); }
.board-body { min-height: 120px; max-height: 46vh; overflow-y: auto; }
.board-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 8px;
  border-bottom: 1px solid #223528; font-size: clamp(16px, calc(4.4 * var(--u)), 30px);
}
.board-row.me { background: #2a3a2a; border-radius: 8px; }
.br-rank { width: clamp(28px, calc(7 * var(--u)), 48px); text-align: center; font-weight: 700; color: var(--accent); }
.br-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-val { color: var(--accent-2); font-weight: 700; }
.br-val small { color: var(--muted); font-weight: 400; }

.mode-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-opt {
  padding: 12px 10px; border-radius: 10px; border: 1px solid #314733;
  background: #0e130d; color: var(--ink); cursor: pointer; text-align: left;
}
.mode-opt small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.mode-opt.active { border-color: var(--accent); background: var(--panel-2); }
#mode-done, #offline-close { margin-top: 14px; width: 100%; }

/* ---------------- Skills extras ---------------- */
.skill-sub { font-size: clamp(14px, calc(3.8 * var(--u)), 26px); color: var(--muted); margin: 3px 0 10px; }
.focus-h { margin: 6px 0 8px; font-size: clamp(16px, calc(4.2 * var(--u)), 28px); color: var(--muted); }
.focus-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.focus-btn {
  padding: 14px; border-radius: 10px; border: 1px solid #314733;
  background: #0e130d; color: var(--ink); cursor: pointer; font-size: clamp(16px, calc(4.4 * var(--u)), 30px);
}
.focus-btn.active { border-color: var(--accent); background: var(--panel-2); color: var(--accent); }

/* ---------------- Battle panel ---------------- */
.battle-panel {
  position: absolute; left: 0; right: 0;
  bottom: calc(clamp(80px, calc(19 * var(--u)), 160px) + var(--safe-pad)); z-index: 32;
  background: var(--panel); border-top: 1px solid #5a4a2a;
  border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.55);
  transform: translateY(0); transition: transform .2s ease; padding-bottom: 12px;
}
.battle-panel.hidden { display: none; }
.battle-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 700; color: var(--accent); font-size: clamp(18px, calc(4.8 * var(--u)), 34px);
  border-bottom: 1px solid #2a3d2c;
}
.battle-combatants {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; padding: 14px 16px 6px;
}
.combatant { min-width: 0; }
.c-name { font-size: clamp(16px, calc(4.4 * var(--u)), 30px); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-hp { font-size: clamp(15px, calc(4 * var(--u)), 26px); color: var(--muted); margin-top: 4px; }
.vs { font-size: clamp(24px, calc(6 * var(--u)), 44px); color: var(--accent); }
.hpbar { position: relative; height: 18px; background: #0e130d; border-radius: 7px; overflow: visible; border: 1px solid #2a3d2c; }
.hpbar > i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, #6fae6a, #3f7e3a); transition: width .18s ease; }
.hpbar.mon > i { background: linear-gradient(90deg, #d2683f, #9c3f23); }
.hpbar .dmg {
  position: absolute; right: 4px; top: -16px; font-size: 13px; font-weight: 700;
  color: #f0c0b6; text-shadow: 0 1px 2px #000; animation: dmg-float .6s ease forwards;
}
.hpbar .dmg.miss { color: var(--muted); font-weight: 500; }
@keyframes dmg-float { to { transform: translateY(-10px); opacity: 0; } }
.battle-result { padding: 12px 16px; font-size: clamp(18px, calc(4.8 * var(--u)), 34px); text-align: center; border-top: 1px solid #2a3d2c; margin-top: 8px; }
.battle-result.win { color: #bfe6b6; }
.battle-result.lose { color: #e9b0a0; }
.battle-result .levelups { margin-top: 6px; font-size: clamp(15px, calc(4 * var(--u)), 28px); color: var(--accent); }
.battle-result .loot { margin-top: 6px; font-size: clamp(16px, calc(4.2 * var(--u)), 30px); color: #d8c08a; }

/* ---------------- Inventory ---------------- */
.inv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.inv-head .cap { color: var(--muted); font-size: clamp(15px, calc(4 * var(--u)), 28px); }
#inv-sort { background: #0e130d; color: var(--ink); border: 1px solid #314733; border-radius: 8px; padding: 10px 12px; font-size: clamp(15px, calc(4 * var(--u)), 28px); }
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-item {
  border: 1px solid #314733; border-left-width: 4px; border-radius: 10px;
  background: #0e130d; padding: 9px 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.inv-item.locked { opacity: 0.92; }
.ii-main { min-width: 0; }
.ii-name { font-size: clamp(17px, calc(4.8 * var(--u)), 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ii-sub { font-size: clamp(14px, calc(3.8 * var(--u)), 26px); color: var(--muted); margin-top: 2px; }
.ii-sub .stat-better { color: #4ade80; }
.ii-sub .stat-worse { color: #f87171; }
.ii-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ii-actions button {
  font-size: clamp(15px, calc(4.2 * var(--u)), 28px); padding: 10px 14px; border-radius: 8px;
  border: 1px solid #314733; background: var(--panel-2); color: var(--ink); cursor: pointer;
}
.ii-actions button:active { background: #2c4233; }

/* rarity accents (left border + name colour) */
.rar-worn { border-left-color: #7e8a78; } .rar-worn .ii-name, .es-item.rar-worn { color: #b7c0b0; }
.rar-standard { border-left-color: #c9c9c9; } .rar-standard .ii-name, .es-item.rar-standard { color: #e6e6e6; }
.rar-refined { border-left-color: #6fae6a; } .rar-refined .ii-name, .es-item.rar-refined { color: #93d68c; }
.rar-rare { border-left-color: #5a86c0; } .rar-rare .ii-name, .es-item.rar-rare { color: #8db4ec; }
.rar-epic { border-left-color: #b46fd0; } .rar-epic .ii-name, .es-item.rar-epic { color: #d29cef; }
.rar-relic { border-left-color: #d8a24a; } .rar-relic .ii-name, .es-item.rar-relic { color: #f0c878; }

/* ---------------- Equipment (character panel) ---------------- */
.eq-h { margin: 16px 0 8px; font-size: clamp(16px, calc(4.2 * var(--u)), 28px); color: var(--muted); }
.equip-grid { display: flex; flex-direction: column; gap: 6px; }
.equip-slot { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid #223528; }
.es-label { width: clamp(92px, calc(24 * var(--u)), 150px); color: var(--muted); font-size: clamp(15px, calc(4 * var(--u)), 26px); flex-shrink: 0; }
.es-item { flex: 1; font-size: clamp(16px, calc(4.4 * var(--u)), 30px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-item.empty { color: #5c6a54; }
.es-remove { font-size: clamp(15px, calc(4.2 * var(--u)), 28px); padding: 9px 13px; border-radius: 8px; border: 1px solid #314733; background: var(--panel-2); color: var(--ink); cursor: pointer; }
.set-bonuses { margin-top: 8px; font-size: clamp(15px, calc(4 * var(--u)), 26px); color: var(--accent); }
.set-bonuses > div { padding: 2px 0; }

/* ---------------- Shop ---------------- */
.shop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.shop-name { font-weight: 700; color: var(--accent); }
.shop-coins { color: #f0c878; font-size: clamp(16px, calc(4.2 * var(--u)), 28px); }
.shop-hint { background: #2a210f; border: 1px solid #5a4a2a; color: #e6d4a0; border-radius: 8px; padding: 12px 14px; font-size: clamp(15px, calc(4 * var(--u)), 26px); margin-bottom: 8px; }
.shop-h { margin: 14px 0 8px; font-size: clamp(15px, calc(4 * var(--u)), 26px); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.shop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid #314733; border-left-width: 4px; border-radius: 10px;
  background: #0e130d; padding: 9px 11px; margin-bottom: 8px;
}
.shop-item.service { border-left-color: #6fae6a; }
.si-main { min-width: 0; }
.si-name { font-size: clamp(17px, calc(4.8 * var(--u)), 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-sub { font-size: clamp(14px, calc(3.8 * var(--u)), 26px); color: var(--muted); margin-top: 2px; }
.buy-btn, .sell-btn {
  flex-shrink: 0; font-size: clamp(15px, calc(4.2 * var(--u)), 28px); padding: 11px 15px; border-radius: 8px; cursor: pointer;
  border: 1px solid #6a4f1c; background: linear-gradient(#d8b25a, #b8862f); color: #1a1306; font-weight: 700;
}
.sell-btn { border-color: #314733; background: var(--panel-2); color: var(--ink); font-weight: 600; }
.buy-btn:disabled, .sell-btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.5); }

/* ---------------- Random-event modal ---------------- */
#event-modal .modal-card h2 { font-size: clamp(26px, calc(7 * var(--u)), 50px); }
.event-badge {
  display: inline-block; font-size: clamp(13px, calc(3.6 * var(--u)), 24px); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 5px 12px; border-radius: 999px; margin-bottom: 10px;
  border: 1px solid #314733; background: #0e130d; color: var(--muted);
}
.event-badge.rar-common { color: #c9c9c9; }
.event-badge.rar-uncommon { color: #93d68c; border-color: #3f6e3a; }
.event-badge.rar-rare { color: #8db4ec; border-color: #3a5680; }
.event-badge.rar-epic { color: #d29cef; border-color: #6a3a80; }
.event-badge.rar-legendary { color: #f0c878; border-color: #7a5a1c; box-shadow: 0 0 10px #7a5a1c66; }
#event-text { margin: 4px 0 16px; line-height: 1.4; font-size: clamp(18px, calc(4.8 * var(--u)), 34px); }
.event-options { display: flex; flex-direction: column; gap: 8px; }
.event-opt {
  padding: 15px 16px; border-radius: 10px; border: 1px solid #314733;
  background: #0e130d; color: var(--ink); font-size: clamp(17px, calc(4.6 * var(--u)), 32px); cursor: pointer; text-align: left;
}
.event-opt:active { background: var(--panel-2); }

/* ---------------- Tutorial overlay ---------------- */
.tut-card { max-width: 340px; }
.tut-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.tut-counter { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.tut-skip { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 0; }
.tut-skip:hover { color: var(--ink); }
.tut-title { font-size: 18px; color: var(--accent); margin: 0 0 10px; }
.tut-text { color: #c8b87a; margin: 0 0 16px; line-height: 1.6; font-size: 14px; }
.tut-text strong { color: var(--ink); }
.tut-text em { color: var(--accent-2); font-style: normal; }
.tut-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.tut-dot { width: 7px; height: 7px; border-radius: 50%; background: #2a3a1a; transition: background 0.2s; }
.tut-dot.active { background: var(--accent-2); }
.tut-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.tut-prev { background: none; border: 1px solid #314733; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px; padding: 8px 14px; }
.tut-prev:hover { color: var(--ink); border-color: #4a6a3a; }
.tut-next-btn { flex: 1; }

