:root { --c1: #ff2e88; --c2: #00e5ff; --gold: #ffe600; --bg: #07061a; --panel: rgba(12, 10, 34, .88); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: #fff;
  font-family: "Russo One", system-ui, sans-serif; touch-action: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- экраны ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(7,6,26,.1) 0%, rgba(7,6,26,.7) 75%); z-index: 10; }
.panel { width: min(400px, 100%); background: var(--panel); border: 1px solid rgba(0,229,255,.3); border-radius: 22px;
  padding: 24px 20px 18px; text-align: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 60px rgba(255,46,136,.18), inset 0 0 30px rgba(0,229,255,.06); animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.logo { font-size: 50px; letter-spacing: 1px; line-height: 1; background: linear-gradient(90deg, var(--c1), #fff 50%, var(--c2));
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255,46,136,.6));
  animation: wobble 2.4s ease-in-out infinite; }
.logo span { font-size: 24px; }
@keyframes wobble { 0%, 100% { transform: rotate(-1.5deg) scale(1); } 50% { transform: rotate(1.5deg) scale(1.04); } }
.tag { color: #9fb3ff; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin: 8px 0 18px; }
#nick { width: 100%; font: inherit; font-size: 20px; text-align: center; color: #fff; background: rgba(255,255,255,.06);
  border: 2px solid rgba(0,229,255,.35); border-radius: 14px; padding: 12px; outline: none; user-select: text; -webkit-user-select: text; }
#nick:focus { border-color: var(--c2); box-shadow: 0 0 18px rgba(0,229,255,.35); }
#colors { display: flex; justify-content: center; gap: 9px; margin: 14px 0 16px; flex-wrap: wrap; }
#colors button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; padding: 0; }
#colors button.on { border-color: #fff; box-shadow: 0 0 14px currentColor; transform: scale(1.15); }
.big { width: 100%; font-size: 26px; letter-spacing: 2px; color: #fff; border: 0; border-radius: 16px; padding: 15px;
  background: linear-gradient(90deg, var(--c1), #ff7a3d); box-shadow: 0 6px 30px rgba(255,46,136,.5);
  animation: glow 1.4s ease-in-out infinite; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.big:active { transform: scale(.97); }
@keyframes glow { 50% { box-shadow: 0 6px 46px rgba(255,46,136,.9); } }
.ghost { width: 100%; margin-top: 10px; font-size: 16px; color: #fff; background: rgba(0,229,255,.12);
  border: 1px solid rgba(0,229,255,.5); border-radius: 14px; padding: 12px; }
.link { background: none; border: 0; color: #8b96c2; margin-top: 10px; font-size: 13px; }
.how { margin-top: 16px; font-family: system-ui, sans-serif; font-size: 13px; color: #c4cdf5; text-align: left; display: grid; gap: 6px; }
.how b { font-family: "Russo One", sans-serif; font-weight: normal; color: #fff; }
#mode { font-size: 13px; color: #c4cdf5; margin: -4px 0 12px; }
#mode b { font-weight: normal; }
#online { margin-top: 14px; font-size: 13px; color: var(--c2); }
#online .rec { color: var(--gold); display: block; margin-top: 4px; }

.dtitle { font-size: 32px; color: #ff4b6e; text-shadow: 0 0 20px rgba(255,75,110,.6); }
.place { font-size: 60px; color: var(--gold); text-shadow: 0 0 24px rgba(255,230,0,.6); margin: 2px 0; }
.killer { color: #aab3d8; margin: 4px 0 14px; font-family: system-ui, sans-serif; }
.killer b { color: #fff; font-family: "Russo One", sans-serif; font-weight: normal; }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dstats div { background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px 4px; }
.dstats span { display: block; font-size: 24px; }
.dstats small { color: #8b96c2; font-size: 11px; font-family: system-ui, sans-serif; }
.best { color: var(--gold); min-height: 20px; margin-bottom: 12px; font-size: 15px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 16px; background: rgba(12,10,34,.6);
  border: 1px solid rgba(0,229,255,.25); border-radius: 14px; padding: 6px 16px; font-size: 20px; white-space: nowrap; }
#kills { color: var(--gold); }
#feed { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); display: grid; gap: 4px; justify-items: center;
  font-family: system-ui, sans-serif; font-size: 13px; }
#feed div { background: rgba(12,10,34,.6); padding: 3px 10px; border-radius: 10px; white-space: nowrap; animation: fade 4s forwards; }
#feed b { font-family: "Russo One", sans-serif; font-weight: normal; }
@keyframes fade { 0% { opacity: 0; transform: translateY(-6px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#effects { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 8px; }
#effects div { background: rgba(12,10,34,.75); border: 2px solid currentColor; border-radius: 12px; padding: 4px 10px; font-size: 15px;
  box-shadow: 0 0 14px currentColor; animation: pop .2s ease-out; }
#hint { position: absolute; left: 14px; bottom: 14px; font-family: system-ui, sans-serif; font-size: 12px; color: #8b96c2; }
#hint b { color: #fff; font-weight: normal; font-family: "Russo One", sans-serif; }
#dashBtn { --p: 100%; pointer-events: auto; position: absolute; right: 22px; bottom: 30px; width: 108px; height: 108px; border-radius: 50%;
  border: 0; padding: 0; color: #fff; font-size: 17px; letter-spacing: 1px; display: none;
  background: conic-gradient(var(--c1) var(--p), rgba(255,255,255,.14) 0); box-shadow: 0 0 26px rgba(255,46,136,.6); }
#dashBtn b { position: absolute; inset: 7px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: normal;
  background: radial-gradient(circle, rgba(255,46,136,.55), rgba(40,10,50,.95)); }
#dashBtn.cd { box-shadow: none; }
#dashBtn.cd b { background: rgba(20,16,48,.92); color: #8b96c2; }
#dashBtn:active { transform: scale(.94); }
body.touch #dashBtn { display: block; }
body.touch #hint { display: none; }
body.touch #effects { bottom: 150px; }

#wait { position: fixed; top: 24%; left: 0; right: 0; text-align: center; font-size: 26px; text-shadow: 0 2px 8px #000; pointer-events: none; z-index: 6; }
#wait small { display: block; font-family: system-ui, sans-serif; font-size: 15px; color: #c4cdf5; margin-top: 6px; }
#wait .q { display: inline-block; background: rgba(12,10,34,.7); border: 1px solid rgba(0,229,255,.35); border-radius: 16px; padding: 12px 20px; }
#wait .q button { pointer-events: auto; margin-top: 10px; font-size: 13px; }
#count { position: fixed; top: 38%; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 7; font-size: 120px;
  color: var(--gold); text-shadow: 0 0 40px rgba(255,230,0,.8), 0 4px 0 #000; }
#count div { animation: cnt .9s ease-out forwards; }
@keyframes cnt { 0% { transform: scale(2.4); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: 0; } }

#announce { position: fixed; top: 20%; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 6; }
#announce div { font-size: clamp(28px, 7vw, 60px); letter-spacing: 2px; animation: ann 1.9s ease-out forwards; padding: 0 8px;
  text-shadow: 0 0 24px currentColor, 0 3px 0 #000; }
#announce small { display: block; font-size: .38em; color: #fff; letter-spacing: 1px; }
@keyframes ann { 0% { transform: scale(2.4) rotate(-6deg); opacity: 0; } 12% { transform: scale(1) rotate(0); opacity: 1; }
  20% { transform: scale(1.08); } 28% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
#mute { position: fixed; right: 12px; top: 12px; z-index: 11; background: rgba(12,10,34,.5); border: 0; border-radius: 10px;
  font-size: 18px; padding: 6px 8px; color: #fff; }
body.playing #mute { opacity: .5; }
#conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(255,46,136,.85); padding: 8px 14px;
  border-radius: 10px; z-index: 20; font-size: 14px; }
#toast { position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 20px); background: #fff; color: #07061a;
  padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .25s; z-index: 30; pointer-events: none; font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .logo { font-size: 40px; } .logo span { font-size: 20px; }
  #topbar { font-size: 17px; padding: 5px 12px; }
  #feed { font-size: 11px; top: 50px; }
  .panel { padding: 20px 16px 14px; }
  .how { font-size: 12px; }
}
@media (max-height: 560px) { .how { display: none; } }

/* режим съёмки роликов ?rec=1 — без интерфейса */
body.rec #hud, body.rec #mute, body.rec .screen, body.rec #toast, body.rec #conn, body.rec #wait { display: none !important; }

/* кнопка языка (в меню) */
#langBtn { position: fixed; left: 12px; top: 12px; z-index: 11; background: rgba(12,10,34,.55); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; font: 14px 'Russo One', system-ui, sans-serif; padding: 7px 10px; color: #fff; cursor: pointer; }
body.rec #langBtn { display: none !important; }
