@font-face { font-family: Montserrat; src: url(../assets/fonts/Montserrat.ttf) format('truetype'); font-weight: 100 900; font-display: block; }
@font-face { font-family: Russo; src: url(../assets/fonts/RussoOne.ttf) format('truetype'); font-display: block; }

:root {
  --k: 1;
  --cyan: #34f5ff; --pink: #ff2fd6; --violet: #8b5cff; --text: #eaf6ff; --muted: #9aa7c7;
  --panel: rgba(14, 10, 36, 0.82); --stroke: rgba(120, 220, 255, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05030f; color: var(--text);
  font-family: Montserrat, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
body.playing #c { cursor: none; }

#ui { position: fixed; inset: 0; pointer-events: none; }
.layer { position: absolute; left: 0; top: 0; zoom: var(--k); width: calc(100vw / var(--k)); height: calc(100vh / var(--k)); }
.hidden { display: none !important; }
button, input, label { pointer-events: auto; font-family: inherit; }

/* ---------- кнопки ---------- */
.btn { border: 1px solid var(--stroke); background: linear-gradient(180deg, rgba(60, 40, 120, 0.85), rgba(25, 16, 60, 0.9));
  color: var(--text); font-weight: 700; font-size: 18px; padding: 12px 22px; border-radius: 14px; cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s; letter-spacing: .02em; }
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 0 18px rgba(52, 245, 255, .35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn.big { font-family: Russo, Montserrat, sans-serif; font-size: 34px; padding: 18px 40px; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .35);
  background: linear-gradient(90deg, #ff2fd6, #8b5cff 50%, #34f5ff); text-shadow: 0 2px 0 rgba(0,0,0,.35);
  box-shadow: 0 8px 30px rgba(255, 47, 214, .35), inset 0 -4px 0 rgba(0,0,0,.25); letter-spacing: .06em; }
.btn.big:hover { box-shadow: 0 10px 40px rgba(52, 245, 255, .55), inset 0 -4px 0 rgba(0,0,0,.25); }
.btn.big:disabled { background: linear-gradient(90deg, #4b3a6e, #34305a); }
.btn.icon { width: 52px; height: 52px; padding: 0; font-size: 22px; border-radius: 14px; }

/* ---------- главное меню ---------- */
.screen { display: flex; align-items: center; }
.menu-left { margin-left: 70px; width: 520px; display: flex; flex-direction: column; gap: 18px; }
.logo { margin: 0 0 6px; display: flex; flex-direction: column; line-height: 1; }
.logo-main { font-family: Russo, Montserrat, sans-serif; font-size: 92px; letter-spacing: .04em; color: #7ff9ff;
  text-shadow: 0 0 6px #34f5ff, 0 0 22px #34f5ff, 0 0 48px #1aa6ff, 4px 4px 0 #ff2fd6, 8px 8px 0 rgba(139, 92, 255, .6);
  transform: skewX(-8deg); }
.logo-sub { margin-top: 14px; font-weight: 800; font-size: 18px; letter-spacing: .32em; text-transform: uppercase; color: #ffb3f2;
  text-shadow: 0 0 12px rgba(255, 47, 214, .8); }

.card { background: var(--panel); border: 1px solid var(--stroke); border-radius: 18px; backdrop-filter: blur(6px); }
.player { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.avatar { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; border: 2px solid var(--cyan); box-shadow: 0 0 14px rgba(52,245,255,.4); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.pname { font-weight: 800; font-size: 18px; }
.prank { font-size: 13px; color: var(--cyan); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.pstats { margin-left: auto; display: flex; gap: 18px; text-align: center; }
.pstats b, .ostats b { display: block; font-family: Russo, Montserrat, sans-serif; font-size: 22px; font-weight: 400; color: #fff; }
.pstats span, .ostats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; font-size: 15px; }
.tile i { font-style: normal; font-size: 28px; }

.hints { position: absolute; left: 70px; bottom: 26px; display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
kbd { display: inline-block; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--stroke); background: rgba(255,255,255,.07);
  font-family: Montserrat, sans-serif; font-weight: 700; font-size: .9em; color: var(--text); }

/* ---------- модальные панели ---------- */
.modal { display: flex; align-items: center; justify-content: center; background: rgba(3, 2, 12, .45); pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--stroke); border-radius: 22px; padding: 28px 34px; min-width: 420px; max-width: 980px;
  display: flex; flex-direction: column; gap: 16px; align-items: stretch; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(139,92,255,.25);
  backdrop-filter: blur(8px); max-height: calc(100% - 40px); overflow: auto; }
.panel.wide { width: 900px; }
.panel h2 { margin: 0; font-family: Russo, Montserrat, sans-serif; font-weight: 400; font-size: 36px; text-align: center; color: #7ff9ff;
  text-shadow: 0 0 14px rgba(52, 245, 255, .6); }
.panel .sub { margin: -6px 0 0; text-align: center; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.slider { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; font-weight: 700; }
input[type=range] { accent-color: var(--pink); height: 26px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--cyan); }
.settings-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }

.skins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.skin { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: 16px; border: 2px solid var(--stroke);
  background: rgba(255,255,255,.04); cursor: pointer; pointer-events: auto; color: var(--text); font-family: inherit; }
.skin canvas { width: 140px; height: 140px; }
.skin b { font-size: 17px; }
.skin small { color: var(--muted); font-weight: 600; }
.skin.sel { border-color: var(--cyan); box-shadow: 0 0 20px rgba(52,245,255,.4); }
.skin.locked { opacity: .5; cursor: default; }
.skin:not(.locked):hover { border-color: var(--pink); }

.toplist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; min-width: 380px; counter-reset: r; }
.toplist li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.05); }
.toplist li::before { counter-increment: r; content: counter(r); font-family: Russo, sans-serif; color: var(--pink); font-size: 20px; }
.toplist li b { font-family: Russo, sans-serif; font-weight: 400; font-size: 20px; }
.toplist li span { color: var(--muted); font-size: 13px; text-align: right; }
.toplist .empty { grid-template-columns: 1fr; text-align: center; color: var(--muted); }
.toplist .empty::before { content: none; }

.help { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; line-height: 1.45; }
.help h3 { margin: 0 0 6px; color: var(--pink); }
.help p { margin: 0 0 10px; }
.score-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.score-table td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.score-table td:last-child { text-align: right; font-family: Russo, sans-serif; color: var(--cyan); }

.final { display: flex; flex-direction: column; align-items: center; }
.final span { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.final b { font-family: Russo, sans-serif; font-weight: 400; font-size: 72px; color: #fff; text-shadow: 0 0 24px rgba(255,47,214,.7); }
.newrec, .unlock { text-align: center; font-weight: 800; font-size: 20px; color: #ffd25e; text-shadow: 0 0 14px rgba(255,210,94,.7); animation: pulse 1s infinite alternate; }
.unlock { color: var(--cyan); font-size: 16px; }
@keyframes pulse { to { transform: scale(1.06); } }
.ostats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; padding: 10px 0; }

/* ---------- HUD ---------- */
.hud-top { position: absolute; top: 18px; left: 24px; right: 24px; display: flex; align-items: flex-start; gap: 26px; }
.hud-score, .hud-best { display: flex; flex-direction: column; }
.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.hud-score b { font-family: Russo, sans-serif; font-weight: 400; font-size: 44px; line-height: 1; color: #fff; text-shadow: 0 0 16px rgba(52,245,255,.7); }
.hud-score b.neg { color: #ff7a9c; text-shadow: 0 0 16px rgba(255,61,110,.7); }
.hud-best b { font-family: Russo, sans-serif; font-weight: 400; font-size: 24px; color: #ffb3f2; }
.hud-btns { margin-left: auto; display: flex; gap: 10px; }
.touch-btn { display: none; position: absolute; right: 26px; bottom: 26px; width: 130px; height: 130px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); background: radial-gradient(circle, rgba(255,47,214,.55), rgba(139,92,255,.35)); color: #fff;
  font-family: Russo, sans-serif; font-size: 18px; pointer-events: auto; }
.touch-btn.on { background: radial-gradient(circle, rgba(52,245,255,.75), rgba(139,92,255,.45)); }
body.touch .touch-btn { display: block; }

/* ---------- привязанное к миру (без зума) ---------- */
#world-ui { position: absolute; inset: 0; }
.popup { position: absolute; transform: translate(-50%, -50%); font-family: Russo, sans-serif; font-size: calc(26px * var(--k));
  color: #fff; text-shadow: 0 0 10px #ff2fd6, 0 2px 0 rgba(0,0,0,.5); animation: rise 1.4s ease-out forwards; white-space: nowrap; }
.popup.ufo { color: #b8ffcb; text-shadow: 0 0 10px #3dff6a, 0 2px 0 rgba(0,0,0,.5); font-size: calc(32px * var(--k)); }
@keyframes rise { 0% { opacity: 0; margin-top: 0; transform: translate(-50%, -50%) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  30% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; margin-top: calc(-60px * var(--k)); } }
.arrow { position: absolute; width: 0; height: 0; border-left: calc(13px * var(--k)) solid transparent; border-right: calc(13px * var(--k)) solid transparent;
  border-bottom: calc(26px * var(--k)) solid #3dff6a; filter: drop-shadow(0 0 6px currentColor); margin: calc(-13px * var(--k)) 0 0 calc(-13px * var(--k)); }
.arrow.enemy { border-bottom-color: #ff3355; color: #ff3355; }
.arrow.me { color: #3dff6a; }
.crosshair { position: absolute; width: calc(34px * var(--k)); height: calc(34px * var(--k)); margin: calc(-17px * var(--k)) 0 0 calc(-17px * var(--k));
  border: 2px solid var(--cyan); border-radius: 50%; box-shadow: 0 0 10px var(--cyan), inset 0 0 6px var(--cyan); }
.crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }

/* узкий/телефонный экран */
body.portrait .menu-left { margin: 0 auto; width: min(520px, calc(100% - 40px)); }
body.portrait .logo-main { font-size: 70px; }
body.portrait .hints { display: none; }
body.portrait .grid { grid-template-columns: repeat(2, 1fr); }
body.short .hints { display: none; }
body.short .menu-left { gap: 12px; }
body.short .logo-main { font-size: 64px; }
body.short .logo-sub { margin-top: 8px; }
