/* ==========================================================
   GameMind — неоновый футуристичный стиль
   ========================================================== */
:root {
  --bg: #060818;
  --panel: rgba(16, 22, 58, 0.86);
  --panel-2: rgba(28, 36, 86, 0.9);
  --line: rgba(0, 240, 255, 0.28);
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --lime: #7dff4d;
  --yellow: #ffe14d;
  --purple: #8b5cf6;
  --orange: #ff7a1a;
  --red: #ff3d6e;
  --text: #eef3ff;
  --muted: #a3b0e0;
  --radius: 22px;
  --font: "Trebuchet MS", "Segoe UI", Verdana, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
  background: radial-gradient(ellipse at top, #1a1050 0%, var(--bg) 60%) fixed;
  overflow-x: hidden;
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, #000 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, #000 100%);
}

h1, h2, h3 { margin: 0 0 12px; letter-spacing: 0.5px; }
h1 { font-size: 36px; text-shadow: 0 0 14px var(--cyan); }
h2 { font-size: 28px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Экраны ---------- */
#app { max-width: 1200px; margin: 0 auto; padding: 16px 20px 60px; }
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.12), inset 0 0 30px rgba(139, 92, 246, 0.08);
  backdrop-filter: blur(6px);
}

/* ---------- Кнопки ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: 20px;
  border: none; border-radius: 16px; padding: 12px 22px; cursor: pointer;
  color: #061020; background: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.btn.big { font-size: 24px; padding: 16px 30px; min-height: 64px; }
.btn.small { font-size: 16px; padding: 8px 14px; }
.btn.primary { background: linear-gradient(135deg, var(--cyan), #3aa0ff); }
.btn.buy { background: linear-gradient(135deg, var(--lime), #2fd47a); box-shadow: 0 0 14px rgba(125, 255, 77, 0.5); }
.btn.cant { background: #3a4270; color: #c7cff5; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, var(--pink), var(--red)); color: #fff; box-shadow: 0 0 14px rgba(255, 43, 214, 0.5); }
.btn.ghost { background: transparent; color: var(--text); border: 2px solid var(--line); box-shadow: none; }
.btn.locked, .btn:disabled { background: #2a3058; color: #8d97c4; box-shadow: none; cursor: not-allowed; }
.link { background: none; border: none; color: var(--cyan); font: inherit; font-size: 16px; text-decoration: underline; cursor: pointer; }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: rgba(8, 10, 32, 0.92);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.15);
}
.tb-btn { font-size: 26px; background: var(--panel-2); border: 2px solid var(--line); border-radius: 14px; width: 54px; height: 54px; cursor: pointer; color: var(--text); }
.tb-btn:hover { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.tb-hero { display: flex; align-items: center; gap: 10px; }
.tb-avatar { width: 46px; height: 54px; }
.tb-avatar svg { width: 100%; height: 100%; }
.tb-name { font-weight: 700; font-size: 20px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-level { color: var(--yellow); font-size: 16px; font-weight: 700; }
.tb-xp { flex: 0 1 220px; }
.tb-xp small { color: var(--muted); font-size: 14px; }
.tb-slogan { flex: 1; text-align: center; font-weight: 900; font-size: 22px; letter-spacing: 2px; text-transform: uppercase; color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.tb-points { font-size: 26px; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 225, 77, 0.7); white-space: nowrap; }

.xpbar { height: 14px; background: #1b2150; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.xpbar > div { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); box-shadow: 0 0 10px var(--yellow); transition: width 0.6s; }
.xpbar.big { height: 20px; margin: 8px 0 4px; }

/* ---------- Стартовый экран ---------- */
.start { text-align: center; padding-top: 20px; }
.logo { font-size: 84px; font-weight: 900; letter-spacing: 6px; color: var(--cyan); text-shadow: 0 0 12px var(--cyan), 0 0 40px var(--cyan); }
.logo span { color: var(--pink); text-shadow: 0 0 12px var(--pink), 0 0 40px var(--pink); }
.slogan { font-weight: 900; color: var(--yellow); text-transform: uppercase; letter-spacing: 3px; text-shadow: 0 0 12px rgba(255, 225, 77, 0.8); }
.slogan.big { font-size: 46px; margin: 6px 0 4px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { text-shadow: 0 0 24px rgba(255, 225, 77, 1), 0 0 48px rgba(255, 43, 214, 0.6); transform: scale(1.03); } }
.tagline { font-size: 22px; color: var(--muted); margin-bottom: 26px; }
.start-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; align-items: flex-start; }
.start-grid > .card { flex: 1 1 380px; max-width: 520px; }
.profiles { display: flex; flex-direction: column; gap: 12px; }
.profile-card {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 12px 16px; border-radius: 18px; cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--line); transition: 0.15s;
}
.profile-card:hover, .profile-card:focus { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0, 240, 255, 0.5); transform: translateX(4px); outline: none; }
.pc-avatar { width: 64px; height: 76px; flex-shrink: 0; }
.pc-avatar svg { width: 100%; height: 100%; }
.pc-info { display: flex; flex-direction: column; font-size: 22px; }
.pc-info span { font-size: 17px; color: var(--muted); }
.profile-card .del { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 2px solid transparent; border-radius: 10px; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 9px; }
.profile-card .del:hover { color: var(--red); border-color: var(--red); }
.new-hero input {
  width: 100%; font: inherit; font-size: 24px; padding: 14px 18px; margin: 10px 0 14px;
  border-radius: 16px; border: 2px solid var(--line); background: #0b1030; color: var(--text); text-align: center;
}
.new-hero input.pin { letter-spacing: 10px; margin-top: 0; }
.new-hero input.pin::placeholder { letter-spacing: normal; }
.profile-card .tag { margin-left: auto; }
.card.warn { max-width: 760px; margin: 0 auto 22px; border-color: var(--yellow); color: var(--yellow); }
.new-hero input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 240, 255, 0.5); }
.np-preview { height: 170px; }
.np-preview svg { height: 100%; filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.6)); }
.colors { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.swatch { width: 48px; height: 48px; border-radius: 50%; border: 3px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 10px var(--c); transition: 0.15s; }
.swatch.active { border-color: #fff; transform: scale(1.15); }

/* ---------- Главное меню ---------- */
.hub { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.hero-panel { text-align: center; }
.hero-big { height: 280px; }
.hero-big svg { height: 100%; filter: drop-shadow(0 0 18px rgba(0, 240, 255, 0.55)); animation: idle 3s ease-in-out infinite; }
@keyframes idle { 50% { transform: translateY(-6px); } }
.lvl { color: var(--yellow); font-weight: 700; font-size: 22px; }
.stats-list { display: grid; gap: 6px; margin: 14px 0; text-align: left; }
.stat { display: flex; justify-content: space-between; background: var(--panel-2); padding: 8px 14px; border-radius: 12px; font-size: 18px; }
.stat b { color: var(--cyan); }
.record { color: var(--muted); font-size: 17px; }
.hub-menu { display: flex; flex-direction: column; gap: 16px; }
.slogan-banner {
  text-align: center; font-size: 44px; font-weight: 900; text-transform: uppercase; letter-spacing: 3px;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 43, 214, 0.2), rgba(0, 240, 255, 0.2));
  border: 2px solid var(--pink); color: #fff;
  text-shadow: 0 0 14px var(--pink), 0 0 30px var(--pink);
  animation: pulse 2.4s ease-in-out infinite;
}
.wallet-big { text-align: center; font-size: 38px; font-weight: 900; color: var(--yellow); text-shadow: 0 0 14px rgba(255, 225, 77, 0.7); }
.wallet-big small { font-size: 20px; color: var(--muted); text-shadow: none; }
.menu-btn {
  display: flex; align-items: center; gap: 18px; text-align: left;
  font: inherit; color: var(--text); cursor: pointer;
  padding: 18px 24px; min-height: 92px; border-radius: var(--radius);
  background: var(--panel); border: 2px solid var(--c, var(--cyan));
  box-shadow: 0 0 16px color-mix(in srgb, var(--c, var(--cyan)) 40%, transparent);
  transition: 0.15s;
}
.menu-btn:hover { transform: translateX(6px) scale(1.01); box-shadow: 0 0 26px var(--c, var(--cyan)); }
.menu-btn .mi { font-size: 46px; }
.menu-btn b { display: block; font-size: 30px; }
.menu-btn small { color: var(--muted); font-size: 18px; }
.m-missions { --c: var(--cyan); }
.m-shop { --c: var(--lime); }
.m-arena { --c: var(--pink); }
.m-switch { --c: var(--purple); min-height: 70px; }
.m-switch b { font-size: 22px; }
.m-switch .mi { font-size: 32px; }
.menu-btn.locked { --c: #4a5280; opacity: 0.75; }

/* ---------- Карта миссий ---------- */
.map-page h1 { text-align: center; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-top: 20px; }
.stage-card { position: relative; text-align: center; border-color: var(--c); box-shadow: 0 0 18px color-mix(in srgb, var(--c) 35%, transparent); display: flex; flex-direction: column; }
.stage-card h3 { color: var(--c); text-shadow: 0 0 10px var(--c); font-size: 22px; }
.stage-card p { font-size: 16px; min-height: 44px; }
.stage-num { position: absolute; top: -14px; left: -10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 22px; background: var(--c); color: #061020; box-shadow: 0 0 14px var(--c); }
.stage-icon { font-size: 44px; }
.stage-boss { height: 100px; margin: 6px 0; }
.stage-boss svg { height: 100%; }
.stage-boss.silhouette svg { filter: brightness(0) drop-shadow(0 0 6px #4a5280); }
.stage-status { color: var(--lime); font-weight: 700; margin-top: 6px; }
.stage-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; }
.stage-card.locked { filter: grayscale(0.7); opacity: 0.6; }
.stage-card.cleared::after { content: "★"; position: absolute; top: 8px; right: 14px; font-size: 28px; color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }

/* ---------- Вопросы ---------- */
.quiz-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.qh-title { font-weight: 700; font-size: 22px; flex: 1; }
.qh-progress { display: flex; align-items: center; gap: 10px; flex: 0 1 300px; }
.qh-progress .bar { flex: 1; height: 16px; border-radius: 10px; background: #1b2150; overflow: hidden; border: 1px solid var(--line); }
.qh-progress .bar div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width 0.4s; }
.question-card { max-width: 900px; margin: 0 auto; }
.q-top { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 17px; border: 2px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.badge.boss { --c: var(--red); }
.q-text { font-size: 30px; font-weight: 700; margin: 10px 0 22px; line-height: 1.3; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.answer {
  display: flex; align-items: center; gap: 14px; text-align: left;
  font: inherit; font-size: 24px; font-weight: 700; color: var(--text);
  min-height: 78px; padding: 14px 18px; border-radius: 18px; cursor: pointer;
  background: var(--panel-2); border: 3px solid rgba(0, 240, 255, 0.35);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.answer:hover:not(:disabled) { border-color: var(--cyan); box-shadow: 0 0 18px rgba(0, 240, 255, 0.6); transform: translateY(-2px); }
.answer:disabled { cursor: default; }
.answer .key { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: rgba(0, 240, 255, 0.15); color: var(--cyan); }
.answer.correct { background: rgba(125, 255, 77, 0.22); border-color: var(--lime); box-shadow: 0 0 24px rgba(125, 255, 77, 0.8); animation: pop 0.4s; }
.answer.correct .key { background: var(--lime); color: #061020; }
.answer.wrong { background: rgba(255, 61, 110, 0.22); border-color: var(--red); box-shadow: 0 0 24px rgba(255, 61, 110, 0.8); animation: shake 0.45s; }
.answer.wrong .key { background: var(--red); color: #fff; }
.answer:disabled:not(.correct):not(.wrong) { opacity: 0.5; }
@keyframes pop { 40% { transform: scale(1.06); } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.feedback { min-height: 40px; margin-top: 18px; font-size: 24px; font-weight: 700; text-align: center; }
.feedback.ok { color: var(--lime); text-shadow: 0 0 10px rgba(125, 255, 77, 0.7); }
.feedback.bad { color: #ffb3c6; }
.feedback.bad b { color: var(--lime); }
.next-row { text-align: center; margin-top: 12px; }

/* ---------- Чтение ---------- */
.reading-card { max-width: 900px; margin: 0 auto; }
.reading-hint { color: var(--yellow); font-size: 19px; }
.reading-title { color: var(--yellow); text-align: center; font-size: 30px; margin-top: 12px; }
.reading-text { background: #0b1030; border: 2px solid rgba(255, 225, 77, 0.4); border-radius: 18px; padding: 16px 26px; font-size: 25px; line-height: 1.6; }
.reading-text p { margin: 10px 0; text-indent: 1.5em; }
.read-timer { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.read-timer .bar { flex: 1; height: 18px; border-radius: 10px; background: #1b2150; overflow: hidden; }
.read-timer .bar div, #timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--yellow), var(--lime)); transition: width 0.1s linear; }
.read-timer span { font-size: 26px; font-weight: 900; color: var(--yellow); min-width: 40px; text-align: right; }
.low-time { background: linear-gradient(90deg, var(--red), var(--orange)) !important; animation: blink 0.5s infinite alternate; }
@keyframes blink { to { opacity: 0.55; } }
.hidden-text { text-align: center; }
.big-emoji { font-size: 90px; }

/* ---------- Бой ---------- */
.combat-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.ch-title { flex: 1; font-size: 24px; font-weight: 900; color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.ch-round { font-weight: 700; color: var(--yellow); }
.battlefield {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px;
  padding: 14px 20px 6px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.15), rgba(0, 240, 255, 0.08)), repeating-linear-gradient(90deg, transparent 0 46px, rgba(0, 240, 255, 0.07) 46px 48px);
  border: 2px solid var(--line);
}
.fighter { text-align: center; }
.fighter-svg { height: 200px; }
.fighter-svg svg { height: 100%; filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.5)); }
.fighter.enemy .fighter-svg svg { filter: drop-shadow(0 0 14px rgba(255, 43, 214, 0.6)); }
.fname { font-weight: 900; font-size: 22px; }
.fname small { color: var(--yellow); font-size: 16px; }
.fstats { color: var(--muted); font-size: 16px; }
.hp { position: relative; height: 26px; background: #1b2150; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); margin-bottom: 8px; }
.hp-fill { height: 100%; background: linear-gradient(90deg, #2fd47a, var(--lime)); transition: width 0.5s; }
.hp-fill.low { background: linear-gradient(90deg, var(--red), var(--orange)); }
.hp-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 700; text-shadow: 0 0 4px #000, 0 0 4px #000; }
.vs { font-size: 46px; font-weight: 900; color: var(--yellow); text-shadow: 0 0 16px var(--yellow); align-self: center; }
.fighter.attack .fighter-svg { animation: lunge-r 0.45s; }
.fighter.enemy.attack .fighter-svg { animation: lunge-l 0.45s; }
.fighter.hit .fighter-svg { animation: hit 0.5s; }
@keyframes lunge-r { 40% { transform: translateX(60px) scale(1.05); } }
@keyframes lunge-l { 40% { transform: translateX(-60px) scale(1.05); } }
@keyframes hit { 20%, 60% { transform: translateX(-10px); filter: brightness(2) drop-shadow(0 0 20px var(--red)); } 40%, 80% { transform: translateX(10px); } }
.combat-log { min-height: 66px; margin: 12px auto; max-width: 900px; padding: 10px 16px; border-radius: 14px; background: rgba(11, 16, 48, 0.85); font-size: 20px; text-align: center; border: 2px solid var(--line); }
.combat-log.ok { border-color: var(--lime); }
.combat-log.bad { border-color: var(--red); }
.combat-log .earn { color: var(--yellow); font-weight: 700; }
.combat-log .log2 { color: #ffc7d6; margin-top: 4px; }
.timer { display: flex; align-items: center; gap: 12px; max-width: 900px; margin: 0 auto 12px; }
.timer-bar { flex: 1; height: 18px; border-radius: 10px; background: #1b2150; overflow: hidden; border: 1px solid var(--line); }
#timer-text { font-size: 24px; font-weight: 900; color: var(--yellow); min-width: 56px; text-align: right; }

/* ---------- Магазин ---------- */
.shop-page { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.shop-side { position: sticky; top: 100px; text-align: center; }
.shop-hero { height: 230px; }
.shop-hero svg { height: 100%; filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.55)); }
.equipped-list { text-align: left; font-size: 17px; display: grid; gap: 6px; }
.eq-slot i { color: var(--muted); }
.shop-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.wallet { font-size: 32px; font-weight: 900; color: var(--yellow); text-shadow: 0 0 12px rgba(255, 225, 77, 0.7); }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.tab { font: inherit; font-size: 18px; font-weight: 700; padding: 10px 18px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--panel); border: 2px solid var(--line); }
.tab.active { background: var(--cyan); color: #061020; box-shadow: 0 0 14px var(--cyan); }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item-card { text-align: center; display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.item-card h3 { font-size: 20px; margin: 0; color: var(--cyan); }
.item-card .btn { margin-top: auto; }
.item-card.equipped { border-color: var(--lime); box-shadow: 0 0 20px rgba(125, 255, 77, 0.45); }
.item-card.locked .item-preview { opacity: 0.45; filter: grayscale(0.6); }
.item-preview { height: 150px; background: radial-gradient(circle, rgba(0, 240, 255, 0.15), transparent 70%); border-radius: 14px; }
.item-preview svg { height: 100%; }
.item-slot { font-size: 15px; color: var(--muted); }
.item-desc { font-size: 16px; color: var(--muted); margin: 0; min-height: 44px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip { font-size: 15px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(0, 240, 255, 0.14); border: 1px solid var(--line); }
.owned { color: var(--lime); font-weight: 700; font-size: 16px; }
.buy-preview { height: 180px; }

/* Легендарные предметы — оранжевая светящаяся рамка */
.item-card { position: relative; }
.item-card.legendary, .modal.legendary { border: 3px solid var(--orange); animation: legendGlow 1.8s ease-in-out infinite; }
.item-card.legendary h3 { color: var(--orange); text-shadow: 0 0 10px var(--orange); }
.item-card.legendary .item-preview { background: radial-gradient(circle, rgba(255, 122, 26, 0.3), transparent 70%); }
.modal.legendary h2 { color: var(--orange); text-shadow: 0 0 12px var(--orange); }
@keyframes legendGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 122, 26, 0.6), inset 0 0 18px rgba(255, 122, 26, 0.15); }
  50% { box-shadow: 0 0 32px rgba(255, 122, 26, 1), inset 0 0 26px rgba(255, 122, 26, 0.3); }
}
.rarity-tag { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 14px; border-radius: 999px; font-size: 15px; font-weight: 900; background: var(--orange); color: #1a0a00; box-shadow: 0 0 12px var(--orange); }

/* Обычные — белая рамка, редкие — синяя */
.item-card.common { border-color: rgba(235, 240, 255, 0.75); box-shadow: 0 0 12px rgba(235, 240, 255, 0.25); }
.item-card.common .rarity-tag { background: #eef3ff; color: #10163a; box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.item-card.rare { border-color: #3b82f6; box-shadow: 0 0 18px rgba(59, 130, 246, 0.55); }
.item-card.rare h3 { color: #6ea8ff; }
.item-card.rare .rarity-tag { background: #3b82f6; color: #fff; box-shadow: 0 0 12px #3b82f6; }

/* Эпические — бирюзовая светящаяся рамка */
.item-card.epic, .modal.epic { border: 3px solid #2ee6d6; animation: epicGlow 2s ease-in-out infinite; }
.item-card.epic h3, .modal.epic h2 { color: #2ee6d6; text-shadow: 0 0 10px #2ee6d6; }
.item-card.epic .item-preview { background: radial-gradient(circle, rgba(46, 230, 214, 0.28), transparent 70%); }
.item-card.epic .rarity-tag { background: #2ee6d6; color: #04201d; box-shadow: 0 0 14px #2ee6d6; }
.toast.epic { border-color: #2ee6d6; box-shadow: 0 0 22px rgba(46, 230, 214, 0.8); font-size: 22px; }
@keyframes epicGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(46, 230, 214, 0.55); }
  50% { box-shadow: 0 0 28px rgba(46, 230, 214, 1); }
}
/* Уберуникальные предметы — переливающаяся зелёно-фиолетовая рамка */
.item-card.uber, .modal.uber {
  border: 3px solid transparent;
  background: linear-gradient(#10163a, #10163a) padding-box, linear-gradient(135deg, #39ff14, #a855f7, #39ff14, #a855f7) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: uberGlow 2.4s ease-in-out infinite;
}
.item-card.uber h3, .modal.uber h2 { background: linear-gradient(90deg, #39ff14, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.item-card.uber .item-preview { background: radial-gradient(circle, rgba(168, 85, 247, 0.3), rgba(57, 255, 20, 0.1) 50%, transparent 72%); }
.item-card.uber .rarity-tag { background: linear-gradient(90deg, #39ff14, #a855f7); color: #0b0620; box-shadow: 0 0 14px #a855f7; }
.item-card.uber .chance { color: #b6ff9e; }
@keyframes uberGlow {
  0%, 100% { background-position: 0 0, 0% 50%; box-shadow: 0 0 18px rgba(57, 255, 20, 0.7), 0 0 30px rgba(168, 85, 247, 0.4); }
  50% { background-position: 0 0, 100% 50%; box-shadow: 0 0 30px rgba(168, 85, 247, 1), 0 0 18px rgba(57, 255, 20, 0.5); }
}
.toast.uber { border-color: #a855f7; box-shadow: 0 0 22px rgba(168, 85, 247, 0.9), 0 0 10px rgba(57, 255, 20, 0.7); font-size: 22px; }
.perk { font-size: 15px; font-weight: 700; color: #ffd76a; background: rgba(168, 85, 247, 0.18); border: 1px solid rgba(255, 215, 106, 0.5); border-radius: 12px; padding: 5px 8px; }
.gauntlet-btn { background: linear-gradient(135deg, #f2c230, #a855f7); color: #1a0b2e; box-shadow: 0 0 18px rgba(242, 194, 48, 0.8); }
.gauntlet-row { margin: -8px 0 16px; }
.gauntlet-btn small { font-size: 15px; font-weight: 700; }
.chance { color: var(--orange); font-weight: 700; font-size: 16px; }
.toast.legendary { border-color: var(--orange); box-shadow: 0 0 22px rgba(255, 122, 26, 0.8); font-size: 22px; }
.buy-preview svg { height: 100%; }

/* ---------- Арена ---------- */
.arena-head { text-align: center; border-color: var(--pink); box-shadow: 0 0 22px rgba(255, 43, 214, 0.35); }
.arena-head h1 { color: var(--pink); text-shadow: 0 0 14px var(--pink); }
.arena-rating { font-size: 26px; color: var(--yellow); }
.arena-hint { text-align: center; color: var(--muted); max-width: 820px; margin: 16px auto; font-size: 18px; }
.opponents { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 16px; }
.opp-card { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.opp-card:hover { border-color: var(--pink); box-shadow: 0 0 20px rgba(255, 43, 214, 0.5); }
.opp-svg { height: 170px; }
.opp-svg svg { height: 100%; filter: drop-shadow(0 0 12px rgba(255, 43, 214, 0.5)); }
.opp-name { font-size: 22px; font-weight: 900; }
.opp-stats { font-weight: 700; }
.opp-card .btn { margin-top: 8px; }
.tag { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(125, 255, 77, 0.2); color: var(--lime); vertical-align: middle; }
.tag.bot { background: rgba(0, 240, 255, 0.15); color: var(--cyan); }
.leaderboard { margin-top: 22px; }
.leaderboard table { width: 100%; border-collapse: collapse; font-size: 18px; }
.leaderboard th, .leaderboard td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.leaderboard th { color: var(--muted); font-size: 16px; }
.leaderboard tr.me td { color: var(--yellow); font-weight: 700; }

/* ---------- Модальные окна и уведомления ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 16, 0.75); animation: fadeIn 0.2s; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; text-align: center; border-color: var(--cyan); animation: pop 0.35s; }
.modal h2 { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); font-size: 32px; }
.modal-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.summary p { font-size: 20px; }
.big-stat { font-size: 64px; font-weight: 900; color: var(--lime); text-shadow: 0 0 16px var(--lime); }
.earned { font-size: 24px; margin: 10px 0; color: var(--yellow); }
.boss-preview { height: 130px; margin: 10px 0; }
.boss-preview svg { height: 100%; filter: drop-shadow(0 0 12px rgba(255, 43, 214, 0.6)); }
.boss-preview.defeated svg { filter: grayscale(1) opacity(0.6); transform: rotate(-12deg); }
.unlock { color: var(--lime); font-weight: 700; }
.modal .slogan { font-size: 26px; margin-top: 14px; }

#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { padding: 14px 24px; border-radius: 16px; font-size: 20px; background: var(--panel-2); border: 2px solid var(--cyan); box-shadow: 0 0 18px rgba(0, 240, 255, 0.5); animation: toastIn 0.3s; transition: opacity 0.4s, transform 0.4s; }
.toast.ok { border-color: var(--lime); }
.toast.bad { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 61, 110, 0.5); }
.toast.level { border-color: var(--yellow); box-shadow: 0 0 22px rgba(255, 225, 77, 0.7); font-size: 22px; }
.toast.out { opacity: 0; transform: translateY(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } }

.float-text { position: fixed; z-index: 70; transform: translateX(-50%); font-size: 30px; font-weight: 900; pointer-events: none; animation: floatUp 1.3s ease-out forwards; color: var(--yellow); text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 14px var(--yellow); }
.float-text.dmg { color: var(--red); text-shadow: 0 0 10px #000, 0 0 14px var(--red); font-size: 36px; }
@keyframes floatUp { to { opacity: 0; transform: translate(-50%, -80px) scale(1.3); } }

.confetti { position: fixed; top: -12px; width: 10px; height: 16px; z-index: 55; pointer-events: none; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0.8; } }

/* Анимация дрона и глаз героя */
.float { animation: hover 2s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-6px); } }
.eye { animation: blinkEye 4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blinkEye { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* ---------- Адаптивность ---------- */
@media (max-width: 900px) {
  body { font-size: 18px; }
  .hub, .shop-page { grid-template-columns: 1fr; }
  .shop-side { position: static; }
  .tb-slogan, .tb-xp { display: none; }
  .topbar { justify-content: space-between; }
  .logo { font-size: 56px; }
  .slogan.big { font-size: 32px; }
  .slogan-banner { font-size: 30px; }
}
@media (max-width: 640px) {
  .answers { grid-template-columns: 1fr; }
  .q-text { font-size: 24px; }
  .answer { font-size: 21px; min-height: 64px; }
  .fighter-svg { height: 130px; }
  .vs { font-size: 30px; }
  .battlefield { padding: 10px; }
  .reading-text { font-size: 21px; padding: 12px 16px; }
  .tb-name { max-width: 90px; }
}

/* ---------- Снаряжение и инвентарь ---------- */
.clickable { cursor: pointer; }
.hero-big.clickable:hover svg, .shop-hero.clickable:hover svg { filter: drop-shadow(0 0 26px rgba(255, 225, 77, 0.8)); }
.tb-hero.clickable { border-radius: 14px; padding: 2px 10px 2px 2px; transition: 0.15s; }
.tb-hero.clickable:hover { background: var(--panel-2); box-shadow: 0 0 12px var(--line); }
.gear-open { width: 100%; margin-top: 14px; }
.gear-modal { width: min(1100px, 100%); position: relative; text-align: center; }
.gear-modal h2 { padding: 0 52px; }
.gear-x { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 12px; font-size: 20px; cursor: pointer; color: var(--text); background: var(--panel-2); border: 2px solid var(--line); }
.gear-x:hover { border-color: var(--red); color: var(--red); }
.gear-lock { margin: 6px auto 14px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--red); color: #ffc7d6; background: rgba(255, 61, 110, 0.12); font-weight: 700; max-width: 640px; }
.doll { display: grid; grid-template-columns: 1fr minmax(220px, 280px) 1fr; gap: 16px; align-items: start; margin: 10px 0 18px; }
.doll-col { display: flex; flex-direction: column; gap: 10px; }
.doll-svg { height: 260px; }
.doll-svg svg { height: 100%; filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.55)); }
.doll-name { font-weight: 700; font-size: 20px; }
.doll-hero .stats-list { margin-bottom: 0; }
.gear-slot { text-align: left; padding: 10px 14px; border-radius: 16px; background: var(--panel-2); border: 2px solid var(--line); cursor: pointer; transition: 0.15s; display: flex; flex-direction: column; gap: 4px; }
.gear-slot .chips { justify-content: flex-start; }
.gear-slot:hover, .gear-slot:focus, .gear-slot.active { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 240, 255, 0.45); outline: none; }
.gear-slot.empty { border-style: dashed; opacity: 0.75; }
.gear-slot.rare { border-color: #3aa0ff; }
.gear-slot.epic { border-color: #2ee6d6; }
.gear-slot.legendary { border-color: var(--orange); }
.gear-slot.uber { border-color: #39ff14; }
.gs-head { font-size: 15px; color: var(--muted); }
.gs-spare { color: var(--yellow); font-weight: 700; }
.gs-name { font-size: 18px; font-weight: 700; color: var(--cyan); }
.gs-empty { color: var(--muted); font-style: italic; }
.gear-slot .link { align-self: flex-start; }
.inv-title { margin: 6px 0; }
.gear-modal .tabs { justify-content: center; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; text-align: center; }
.inv-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; position: relative; }
.inv-card h3 { font-size: 18px; margin: 0; color: var(--cyan); }
.inv-card .btn { margin-top: auto; }
.inv-preview { height: 120px; background: radial-gradient(circle, rgba(0, 240, 255, 0.15), transparent 70%); border-radius: 14px; }
.inv-preview svg { height: 100%; }
.inv-diff small { color: var(--muted); }
.chip.up { background: rgba(125, 255, 77, 0.18); border-color: var(--lime); color: var(--lime); }
.chip.down { background: rgba(255, 61, 110, 0.15); border-color: var(--red); color: #ffc7d6; }
.inv-card.rare { border-color: #3aa0ff; }
.inv-card.epic { border-color: #2ee6d6; }
.inv-card.legendary { border-color: var(--orange); }
.inv-card.uber { border-color: #39ff14; }
.inv-empty { margin: 10px 0; }
@media (max-width: 900px) {
  .doll { grid-template-columns: 1fr 1fr; }
  .doll-hero { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 520px) {
  .doll { grid-template-columns: 1fr; }
  .doll-svg { height: 200px; }
}

/* ---------- Фильтры и поиск предметов ---------- */
.filter-bar { margin: 6px 0 16px; }
.filter-bar .tabs { margin: 8px 0; }
.gear-modal .filter-bar .tabs { justify-content: center; }
.search-box { position: relative; max-width: 560px; }
.gear-modal .search-box { margin: 0 auto; }
.search-box input {
  width: 100%; font: inherit; font-size: 20px; padding: 12px 48px 12px 50px;
  border-radius: 999px; border: 2px solid var(--line); background: #0b1030; color: var(--text);
}
.search-box input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 240, 255, 0.5); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 18px; pointer-events: none; }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; background: var(--panel-2); color: var(--text); font-size: 16px; }
.search-clear:hover { background: var(--red); }
.tab.small { font-size: 15px; padding: 6px 14px; }
.rarity-tabs .rar-rare { border-color: #3aa0ff; }
.rarity-tabs .rar-epic { border-color: #2ee6d6; }
.rarity-tabs .rar-legendary { border-color: var(--orange); }
.rarity-tabs .rar-uber { border-color: #39ff14; }
.rarity-tabs .rar-rare.active { background: #3aa0ff; box-shadow: 0 0 14px #3aa0ff; }
.rarity-tabs .rar-epic.active { background: #2ee6d6; box-shadow: 0 0 14px #2ee6d6; }
.rarity-tabs .rar-legendary.active { background: var(--orange); box-shadow: 0 0 14px var(--orange); }
.rarity-tabs .rar-uber.active { background: linear-gradient(90deg, #39ff14, #c084fc); box-shadow: 0 0 14px #39ff14; }
.filter-found { color: var(--muted); font-size: 17px; }
.nothing { font-size: 20px; text-align: center; padding: 30px 0; }

/* Окно «Имя занято» */
.name-modal .new-hero input { margin: 4px 0 6px; }
.btn.suggestion { font-size: 20px; border: 2px solid var(--cyan); }

/* Всплывающие подсказки к характеристикам */
[data-tip] { cursor: help; }
.chip[data-tip]:hover, .chip[data-tip]:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 10px rgba(255, 225, 77, 0.6); }
.stat[data-tip]:hover, .stat[data-tip]:focus { outline: none; box-shadow: 0 0 0 2px var(--yellow) inset; }
.tooltip {
  position: fixed; z-index: 100; max-width: 300px; padding: 12px 14px; border-radius: 14px;
  background: #0b1030; border: 2px solid var(--yellow); box-shadow: 0 0 18px rgba(255, 225, 77, 0.45);
  color: var(--text); font-size: 16px; line-height: 1.35; text-align: left;
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
}
.tooltip.show { opacity: 1; }
.tooltip b { color: var(--yellow); }
.tooltip p { margin: 6px 0 0; }
.tip-change { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tip-change b { color: var(--lime); }
.tip-change small { color: var(--muted); }

/* Способность «Шлема Железного человека»: убранные неверные ответы */
.iron-btn { background: linear-gradient(135deg, #dc2626, #f2c230); color: #1a0505; box-shadow: 0 0 18px rgba(220, 38, 38, 0.75); }
.iron-btn small { font-size: 15px; font-weight: 700; }
.ability-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.answer.removed { opacity: 0.18 !important; text-decoration: line-through; filter: grayscale(1); }

/* Карта: миры */
.world-title { margin: 34px 0 0; font-size: 30px; color: var(--yellow); text-shadow: 0 0 12px rgba(255, 225, 77, 0.6); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.world-title small { font-size: 17px; color: var(--muted); text-shadow: none; font-weight: 400; }
.world-title.locked { color: var(--muted); text-shadow: none; }
.stage-card.current { box-shadow: 0 0 30px var(--c); }

/* ---------- Карта мира ---------- */
.wm-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wm-title { text-align: center; }
.wm-title h1 { margin: 0; }
.wm-arrow { font-size: 28px; min-width: 64px; min-height: 64px; }
.wm-layout { display: grid; grid-template-columns: 1fr 440px; gap: 18px; margin-top: 16px; align-items: start; }
.wm-board {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--line); box-shadow: 0 0 24px rgba(0, 240, 255, 0.2);
  background:
    radial-gradient(ellipse at 50% 120%, var(--ground) 0%, transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, color-mix(in srgb, var(--sky) 60%, var(--ground)) 100%);
}
.wm-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.wm-path.mob { display: none; }
.wm-node, .wm-hero { left: var(--x); top: var(--y); }
.wm-path polyline { fill: none; stroke: rgba(255, 225, 77, 0.75); stroke-width: 6; stroke-dasharray: 2 12; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 225, 77, 0.6)); }
.wm-deco { position: absolute; transform: translate(-50%, -50%); font-size: clamp(18px, 3vw, 34px); opacity: 0.55; pointer-events: none; }
.wm-node {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer; font: inherit; color: var(--text);
}
.wn-icon {
  width: clamp(48px, 7vw, 76px); height: clamp(48px, 7vw, 76px); border-radius: 50%;
  display: grid; place-items: center; font-size: clamp(24px, 3.6vw, 40px);
  background: rgba(11, 16, 48, 0.85); border: 3px solid var(--c); box-shadow: 0 0 16px var(--c); transition: 0.15s; position: relative;
}
.wm-node:hover .wn-icon, .wm-node:focus .wn-icon { transform: scale(1.1); }
.wm-node:focus { outline: none; }
.wm-node.selected .wn-icon { box-shadow: 0 0 0 4px var(--yellow), 0 0 26px var(--yellow); }
.wm-node.locked .wn-icon { border-color: #4a5280; box-shadow: none; filter: grayscale(1); opacity: 0.75; }
.wm-node.cleared .wn-icon { border-color: var(--yellow); }
.wm-node.boss-ready .wn-icon { animation: bossPulse 1.2s ease-in-out infinite; }
@keyframes bossPulse { 50% { box-shadow: 0 0 30px var(--red), 0 0 0 4px var(--red); } }
.wn-mark { position: absolute; top: -10px; right: -12px; font-size: 22px; color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }
.wn-name { font-weight: 700; font-size: clamp(12px, 1.4vw, 16px); padding: 2px 8px; border-radius: 8px; background: rgba(6, 8, 24, 0.75); max-width: 170px; text-align: center; line-height: 1.15; }
.wn-sub { font-size: 12px; color: var(--muted); }
.wn-dots { display: inline-flex; gap: 3px; }
.wn-dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3358; border: 1px solid var(--line); }
.wn-dots i.on { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.wm-hero {
  position: absolute; z-index: 3; width: clamp(44px, 6vw, 70px); height: clamp(52px, 7.2vw, 84px);
  transform: translate(-112%, -88%); transition: left 0.36s linear, top 0.36s linear; pointer-events: none;
}
.wm-hero svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.8)); }
.wm-hero.walking svg { animation: heroStep 0.36s ease-in-out infinite; }
@keyframes heroStep { 50% { transform: translateY(-6px) rotate(-4deg); } }
.wm-panel { min-height: 300px; }
.wp-head { display: flex; gap: 12px; align-items: center; text-align: left; }
.wp-head h2 { margin: 0; color: var(--c); text-shadow: 0 0 10px var(--c); font-size: 26px; }
.wp-head p { margin: 4px 0 0; font-size: 16px; }
.wp-icon { font-size: 44px; }
.wp-title { margin: 14px 0 8px; }
.wp-lessons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.wp-lesson {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  padding: 10px 12px; border-radius: 16px; background: var(--panel-2); border: 2px solid var(--c); transition: 0.15s;
}
.wp-lesson:hover { box-shadow: 0 0 16px var(--c); transform: translateY(-2px); }
.wp-lesson.done { opacity: 0.8; border-style: dashed; }
.wl-icon { font-size: 28px; }
.wl-text { display: flex; flex-direction: column; min-width: 0; }
.wp-lesson { width: 100%; min-width: 0; padding: 8px 14px; }
.wl-text small { color: var(--muted); font-size: 14px; }
.wp-boss { display: flex; gap: 12px; align-items: center; margin: 14px 0 10px; padding: 10px; border-radius: 16px; background: rgba(11, 16, 48, 0.6); border: 2px dashed var(--line); text-align: left; }
.wp-boss.open { border: 2px solid var(--red); box-shadow: 0 0 16px rgba(255, 61, 110, 0.4); }
.wp-boss-svg { width: 100px; height: 100px; flex-shrink: 0; }
.wp-boss-svg svg { width: 100%; height: 100%; }
.wp-boss-svg.silhouette svg { filter: brightness(0) drop-shadow(0 0 6px #4a5280); }
.wp-boss-info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.wp-locked { margin: 14px 0; padding: 12px; border-radius: 14px; border: 2px solid #4a5280; background: rgba(74, 82, 128, 0.15); }
.wp-gear { width: 100%; }
.wp-empty { text-align: center; padding: 30px 10px; }
@media (max-width: 1000px) {
  .wm-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wm-board { aspect-ratio: 3 / 4; }
  .wm-node, .wm-hero { left: var(--mx); top: var(--my); }
  .wm-path.desk { display: none; }
  .wm-path.mob { display: block; }
  .wn-name { white-space: normal; max-width: 90px; text-align: center; }
  .wp-lessons { grid-template-columns: 1fr; }
  .wm-head h1 { font-size: 22px; }
  .wm-arrow { min-width: 48px; min-height: 48px; }
}

/* Класс героя */
.track-picker { display: flex; gap: 10px; justify-content: center; margin: 2px 0 4px; }
.track-pick {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 18px;
  padding: 10px 12px; border-radius: 16px; cursor: pointer; color: var(--text); background: #0b1030; border: 2px solid var(--line);
}
.track-pick.active { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255, 225, 77, 0.55); }
.tp-icon { font-size: 24px; }
.track-desc { margin: 4px 0 12px; min-height: 40px; }
.track-chip { margin: 6px auto 0; display: inline-block; font: inherit; font-size: 16px; padding: 4px 14px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.track-chip:hover { border-color: var(--yellow); }
.track-chip small { color: var(--muted); }

.new-hero input.invite { margin-top: 0; letter-spacing: 1px; }

/* Панель локации: на компьютере — справа от карты, на телефоне — выезжает снизу */
.wp-sheet-bar { display: none; }
@media (max-width: 1000px) {
  .wm-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    max-height: 82vh; overflow-y: auto; min-height: 0;
    border-radius: 24px 24px 0 0; border-bottom: none; padding: 8px 16px 18px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 240, 255, 0.25);
    transform: translateY(110%); transition: transform 0.3s ease; visibility: hidden;
  }
  .wm-panel.open { transform: translateY(0); visibility: visible; }
  .wp-sheet-bar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -8px; padding: 6px 0 8px; background: inherit; z-index: 1; }
  .wp-grip { width: 48px; height: 5px; border-radius: 3px; background: var(--line); margin-left: calc(50% - 24px); }
  .wp-close { font: inherit; font-size: 15px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
  /* Компактнее, чтобы уроки, босс и кнопки помещались без прокрутки */
  .wm-panel .wp-head { gap: 10px; }
  .wm-panel .wp-icon { font-size: 34px; }
  .wm-panel .wp-head h2 { font-size: 21px; }
  .wm-panel .wp-head p { font-size: 14px; margin-top: 2px; }
  .wm-panel .wp-title { margin: 8px 0 6px; font-size: 18px; }
  .wm-panel .wp-lessons { gap: 6px; }
  .wm-panel .wp-lesson { padding: 6px 12px; border-radius: 14px; }
  .wm-panel .wl-icon { font-size: 22px; }
  .wm-panel .wl-text b { font-size: 16px; }
  .wm-panel .wl-text small { font-size: 13px; }
  .wm-panel .wp-boss { margin: 8px 0 8px; padding: 6px 10px; }
  .wm-panel .wp-boss-svg { width: 64px; height: 64px; }
  .wm-panel .wp-boss-info .btn { padding: 8px 16px; font-size: 17px; }
  .wm-panel .wp-gear { padding: 8px; font-size: 16px; }
}

/* Таблица лидеров на телефоне: звание под рейтингом, длинные имена — с многоточием */
.lb-short, .lb-rank-inline { display: none; }
.lb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 640px) {
  .leaderboard { padding-left: 12px; padding-right: 12px; }
  .leaderboard table { font-size: 15px; table-layout: fixed; }
  .leaderboard th { font-size: 13px; }
  .leaderboard th, .leaderboard td { padding: 7px 4px; vertical-align: middle; }
  .leaderboard th:nth-child(1) { width: 22px; }
  .leaderboard th:nth-child(3) { width: 34px; }
  .leaderboard th:nth-child(4) { width: 92px; }
  .lb-long, .lb-rank { display: none; }
  .lb-short { display: inline; }
  .lb-rank-inline { display: block; font-size: 11px; color: var(--muted); font-weight: 400; line-height: 1.2; }
  .lb-name { max-width: none; }
}

/* Стартовый экран на узком телефоне: карточки во всю ширину экрана, не шире */
@media (max-width: 640px) {
  .start-grid > .card { flex: 1 1 100%; min-width: 0; }
}

/* Способность «Перчаток Хроноса»: остановленное время */
.freeze-btn { background: linear-gradient(135deg, #38bdf8, #d4a017); color: #04121f; box-shadow: 0 0 18px rgba(56, 189, 248, 0.75); }
.freeze-btn small { font-size: 15px; font-weight: 700; }
#timer-fill.frozen { background: linear-gradient(90deg, #38bdf8, #a5f3fc); box-shadow: 0 0 12px #38bdf8; }

/* ---------- Рулетка удачи ---------- */
.m-roulette { border-color: #a855f7; }
.rl-page h1 { text-align: center; }
.rl-layout { display: grid; grid-template-columns: minmax(280px, 440px) minmax(280px, 420px); gap: 28px; justify-content: center; align-items: center; margin-top: 10px; }
.rl-wheel-box { position: relative; width: min(440px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.rl-pointer { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 40px; color: var(--yellow); text-shadow: 0 0 12px var(--yellow); line-height: 1; }
.rl-wheel { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 30px rgba(168, 85, 247, 0.6), 0 0 60px rgba(0, 240, 255, 0.25); }
.rl-wheel-svg { width: 100%; height: 100%; display: block; }
.rl-buttons { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
.rl-hint { padding: 8px 12px; border-radius: 12px; background: rgba(255, 225, 77, 0.1); border: 1px solid rgba(255, 225, 77, 0.4); font-size: 16px; }
.rl-odds { display: grid; gap: 6px; }
.rl-odd { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; font-size: 17px; }
.rl-odd i { width: 16px; height: 16px; border-radius: 4px; }
.rl-side h3 { margin: 16px 0 8px; }
@media (max-width: 900px) {
  .rl-layout { grid-template-columns: 1fr; }
  .rl-wheel-box { width: min(340px, 82vw); }
}

/* Необязательный урок (английский) */

/* Невысокие телефоны: ещё компактнее, чтобы 6 уроков, босс и снаряжение помещались без прокрутки */
@media (max-width: 1000px) and (max-height: 800px) {
  .wm-panel { padding: 4px 14px 12px; }
  .wm-panel .wp-sheet-bar { padding: 4px 0 4px; }
  .wm-panel .wp-head p { display: none; }
  .wm-panel .wp-icon { font-size: 28px; }
  .wm-panel .wp-head h2 { font-size: 19px; }
  .wm-panel .wp-title { margin: 4px 0 4px; font-size: 16px; }
  .wm-panel .wp-lessons { gap: 4px; }
  .wm-panel .wp-lesson { padding: 4px 10px; }
  .wm-panel .wl-icon { font-size: 19px; }
  .wm-panel .wl-text b { font-size: 15px; line-height: 1.15; }
  .wm-panel .wl-text small { font-size: 12px; line-height: 1.1; }
  .wm-panel .wp-boss { margin: 6px 0; padding: 4px 8px; }
  .wm-panel .wp-boss-svg { width: 50px; height: 50px; }
  .wm-panel .wp-boss-info { gap: 3px; }
  .wm-panel .wp-boss-info .btn { padding: 6px 14px; font-size: 16px; }
  .wm-panel .wp-gear { padding: 6px; font-size: 15px; }
}

/* Узкий телефон: верхняя панель сжимается и не растягивает страницу */
@media (max-width: 420px) {
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .tb-btn { width: 44px; height: 44px; font-size: 22px; flex-shrink: 0; }
  .tb-hero { gap: 6px; min-width: 0; flex: 1 1 auto; }
  .tb-hero > div:last-child { min-width: 0; }
  .tb-avatar { width: 36px; height: 44px; flex-shrink: 0; }
  .tb-name { font-size: 17px; max-width: 100%; }
  .tb-level { font-size: 14px; white-space: nowrap; }
  .tb-points { font-size: 21px; }
}
@media (max-width: 420px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub > * { min-width: 0; }
}

/* Картинка в вопросе (флаг, эмблема, футболка) */
.q-say { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 4px 0 14px; }
.q-say .muted { flex-basis: 100%; text-align: center; }
.say-btn { font-size: 1.15rem; }
.q-img { display: flex; justify-content: center; gap: 18px; margin: 4px 0 14px; }
.q-img svg { height: 120px; width: auto; max-width: 46%; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6)); }
.q-img svg.flag { border-radius: 4px; outline: 1px solid rgba(255, 255, 255, 0.25); }
@media (max-width: 640px) { .q-img svg { height: 88px; } }

/* Темы локации: 8 штук в две колонки */
.wp-lessons { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.wp-lesson { align-items: center; }
.wl-text b { overflow-wrap: anywhere; line-height: 1.15; }
.wp-lesson.done { border-style: solid; opacity: 1; background: rgba(125, 255, 77, 0.10); }
.wp-lesson.done small { color: var(--lime); }
.wp-lesson.failed { border-style: dashed; }
.wp-lesson.failed small { color: #ffb4c4; }

/* Строка-отсылка у вещи (например, у «Короны Леорика») */
.flavor { font-style: italic; font-size: 15px; color: #c9b896; margin: 2px 0; }
.flavor-orange { color: #ff8000; font-weight: 700; font-style: normal; text-shadow: 0 0 6px rgba(255, 128, 0, 0.5); }

/* ---------- Карточка в стиле подсказки Diablo ---------- */
.item-card.diablo, .modal.diablo {
  position: relative; text-align: left; border: 2px solid #5a4630; border-radius: 6px;
  background: linear-gradient(180deg, #2a2219 0%, #1b1712 60%, #15120e 100%);
  box-shadow: 0 0 0 1px #000, 0 0 22px rgba(191, 120, 40, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.6);
  animation: none; color: #d8d0c0;
}
.modal.diablo h2 { color: #c7a46a; text-shadow: none; font-family: Georgia, "Times New Roman", serif; letter-spacing: 2px; text-transform: uppercase; }
.d4 { font-family: Georgia, "Times New Roman", serif; }
.d4-art { position: absolute; top: 6px; right: 6px; width: 84px; height: 100px; opacity: 0.95; }
.d4-art svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(191, 140, 60, 0.6)); }
.d4-art.big { position: static; width: 140px; height: 160px; margin: 0 auto 6px; }
.d4-title { font-size: 24px; line-height: 1.15; color: #c7a46a; text-transform: uppercase; letter-spacing: 2px; padding-right: 86px; }
.d4-mark { color: #d4a24c; font-size: 18px; }
.d4-type { color: #c18b5b; font-size: 17px; margin-top: 4px; }
.d4-power { color: #b9b2a5; font-size: 15px; }
.d4-sep { position: relative; height: 14px; margin: 8px 0; }
.d4-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: linear-gradient(90deg, transparent, #6e5a40, #6e5a40, transparent); }
.d4-sep span { position: absolute; left: 50%; top: -2px; transform: translateX(-50%); color: #8c7556; font-size: 12px; background: #211b14; padding: 0 4px; }
.d4-main { font-size: 20px; color: #ece4d4; margin-bottom: 6px; cursor: help; }
.d4-stats { list-style: none; padding: 0; margin: 0 0 8px; }
.d4-stats li { position: relative; padding-left: 20px; font-size: 16px; color: #b8a98c; margin: 3px 0; cursor: help; }
.d4-stats li::before { content: "◆"; position: absolute; left: 2px; top: 1px; font-size: 10px; color: #8c7556; }
.d4-unique { display: flex; gap: 8px; color: #c18b5b; font-size: 16px; margin: 6px 0; }
.d4-unique > span { color: #d4a24c; }
.d4-unique .flavor { font-style: normal; color: #c18b5b; font-size: 16px; margin: 0; }
.d4-desc { color: #8f8677; font-size: 14px; font-style: italic; margin: 6px 0 10px; }
.item-card.diablo .btn { margin-top: auto; }
.item-card.diablo .owned { color: #9bd17a; }
.d4-modal { text-align: left; }

.flush-btn { background: linear-gradient(135deg, #e9edf6, #9ad7f5); color: #0b1030; box-shadow: 0 0 18px rgba(154, 215, 245, 0.8); }
/* Названия тем переносятся по словам; на узком экране шрифт чуть меньше, чтобы длинные слова влезали целиком */
.wl-text b { overflow-wrap: normal; word-break: normal; }
@media (max-width: 420px) {
  .wm-panel .wl-text b { font-size: 14px; }
  .wm-panel .wp-lesson { padding-left: 8px; padding-right: 6px; gap: 6px; }
  .wm-panel .wl-icon { font-size: 18px; }
}
/* Плитки тем на компьютере: панель узкая (две колонки ≈ 160 px), поэтому шрифт поменьше,
   а длинные слова («Окружающий», «Автомобильные») переносятся по слогам, не вылезая за рамку. */
.wl-text b { font-size: 16px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.wp-lesson { padding: 8px 10px; gap: 8px; }
.wl-icon { font-size: 24px; flex-shrink: 0; }
/* Сет надет: обычные вещи под ним не действуют */
.gear-slot.off { opacity: 0.55; }
.gs-off { font-size: 12px; color: #ffb4c4; margin: 2px 0; }
.eq-slot.off b { opacity: 0.6; text-decoration: line-through; }
