:root {
  --bg: #14080b; --bg2: #22101500; --card: #1f1014; --card2: #2c161c; --line: #ffffff22;
  --text: #f6e9e9; --muted: #c9a9ad; --blood: #c4122f; --blood2: #ff3355; --gold: #ffd34d;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid #ffffff30; background: var(--card2); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; transition: transform .08s, background .15s; touch-action: manipulation; }
.btn:hover { background: #3a1d25; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn.ghost { background: transparent; }
.btn.icon { min-width: 44px; padding: 0; font-size: 18px; }
.btn.play { background: linear-gradient(#e0193a, #8f0a20); border-color: #ff5a73; font-size: 22px; font-weight: 900; letter-spacing: .04em; min-height: 58px; box-shadow: 0 6px 0 #4a0510, 0 0 30px #c4122f66; text-transform: uppercase; }
.btn.play.small { font-size: 16px; min-height: 46px; }
.btn.danger { background: #5a0a17; border-color: #ff5a73; }
.btn[aria-pressed="true"] { background: var(--blood); border-color: #ff5a73; }
.btn.provider { background: #fff; color: #1b1b1f; border-color: #fff; font-size: 14px; }
.btn.provider:hover { background: #f0eaea; }
.logo { width: 20px; height: 20px; display: inline-block; flex: none; }
.logo svg { width: 100%; height: 100%; }

/* ---------- menu ---------- */
#menu { height: 100%; overflow-y: auto; padding: calc(12px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal)); background: radial-gradient(ellipse at 50% -10%, #5a0a17 0, transparent 60%), radial-gradient(ellipse at 20% 110%, #3a0610 0, transparent 50%), var(--bg); position: relative; }
.drips { position: absolute; inset: 0 0 auto 0; height: 70px; pointer-events: none; background: radial-gradient(circle at 8% 0, var(--blood) 0 22px, transparent 23px), radial-gradient(circle at 23% 0, var(--blood) 0 14px, transparent 15px), radial-gradient(circle at 41% 0, var(--blood) 0 26px, transparent 27px), radial-gradient(circle at 63% 0, var(--blood) 0 16px, transparent 17px), radial-gradient(circle at 82% 0, var(--blood) 0 24px, transparent 25px), radial-gradient(circle at 96% 0, var(--blood) 0 12px, transparent 13px); opacity: .85; }
.top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.lang { display: flex; gap: 6px; }
.title { text-align: center; margin: 18px 0 2px; font-size: clamp(34px, 10vw, 64px); line-height: .92; font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; color: #ff2a48; text-shadow: 0 3px 0 #5a0010, 0 0 30px #ff1a3a88; display: flex; flex-direction: column; align-items: center; }
.title span:nth-child(2) { color: #fff; text-shadow: 0 3px 0 #5a0010, 0 0 22px #ff1a3a; }
.tagline { text-align: center; color: var(--muted); margin: 8px 0 14px; font-style: italic; }
.menu-body { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #00000055; border: 1px solid var(--line); border-radius: 12px; }
.acct-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #43d17a; box-shadow: 0 0 8px #43d17a; }
.dot.guest { background: #b9a2a6; box-shadow: none; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffffff44; border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stats-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.lvl { flex: 1 1 200px; background: #00000055; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; }
.lvl small { grid-column: 2; color: var(--muted); font-size: 12px; }
.bar { height: 10px; background: #3a0a14; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #8f0a20, #ff3355); border-radius: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; background: #00000055; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.chip.big { font-size: 18px; }
.lock-note { margin: 0; text-align: center; color: var(--gold); font-weight: 600; font-size: 14px; }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.btn.tile { flex-direction: column; gap: 4px; min-height: 76px; padding: 8px 4px; font-size: 13px; position: relative; text-align: center; line-height: 1.15; }
.tile .ico { font-size: 24px; }
.badge { position: absolute; top: 4px; right: 6px; font-size: 12px; }
.badge.new { background: var(--blood2); color: #fff; border-radius: 10px; min-width: 20px; height: 20px; display: grid; place-items: center; font-weight: 900; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.2); } }
@media (max-width: 420px) { .menu-grid { grid-template-columns: repeat(2, 1fr); } .btn.tile { flex-direction: row; min-height: 52px; justify-content: flex-start; padding: 8px 12px; } .tile .ico { font-size: 20px; } }
@media (max-height: 500px) and (orientation: landscape) { .title { flex-direction: row; justify-content: center; gap: 10px; font-size: 34px; margin-top: 6px; } .drips { height: 40px; } .tagline { margin: 4px 0 8px; } .menu-grid { grid-template-columns: repeat(8, 1fr); } .btn.tile { min-height: 64px; font-size: 11px; } .menu-body { max-width: 860px; } }

/* ---------- panels ---------- */
.panel { position: fixed; inset: 0; z-index: 50; background: #070204cc; display: grid; place-items: center; padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal)); }
.panel-card { width: min(640px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--card); border: 1px solid #ff335544; border-radius: 18px; box-shadow: 0 20px 60px #000c; overflow: hidden; }
.panel-card header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #2a0d14; }
.panel-card h2 { margin: 0; font-size: 20px; }
.panel-body { overflow-y: auto; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel-body h3 { margin: 6px 0 4px; font-size: 16px; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
.center { text-align: center; }
.scope { font-size: 12px; font-weight: 600; color: var(--gold); border: 1px solid #ffd34d66; border-radius: 8px; padding: 2px 6px; margin-left: 6px; }
.locked-box { text-align: center; padding: 20px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big-ico { font-size: 48px; }
.big-level { display: grid; gap: 6px; } .big-level b { font-size: 26px; } .big-level .bar { height: 14px; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; } .stats dt { color: var(--muted); } .stats dd { margin: 0; font-weight: 700; }
.reward-list { margin: 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; font-size: 13px; }
.reward-list li { padding: 6px 8px; border-radius: 8px; background: #00000044; } .reward-list li.done { opacity: .55; text-decoration: line-through; }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ach-list li { display: flex; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #00000044; border: 1px solid var(--line); opacity: .7; }
.ach-list li.earned { opacity: 1; border-color: #ff335588; background: #3a0a1499; }
.ach-list p { margin: 2px 0; font-size: 14px; color: var(--muted); } .ach-list small { font-size: 12px; color: var(--gold); }
.medal { font-size: 26px; width: 32px; text-align: center; }
.lb { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lb li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; padding: 8px 12px; background: #00000044; border-radius: 10px; }
.lb .rank { color: var(--gold); font-weight: 800; } .lb small { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day { aspect-ratio: 1 / 1.15; border-radius: 10px; background: #00000055; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3px; font-size: 11px; min-width: 0; }
.cal-day small { color: var(--muted); font-size: 10px; } .cal-ico { font-size: 18px; } .cal-r { font-size: 10px; line-height: 1.1; overflow-wrap: anywhere; }
.cal-day.cos { border-color: #ffd34d66; }
.cal-day.claimed { background: #3a0a14; opacity: .6; }
.cal-day.today { border: 2px solid var(--blood2); box-shadow: 0 0 14px #ff335588; animation: pulse 1.6s infinite; }
.cal-day.next { border: 2px dashed var(--muted); }
@media (max-width: 360px) { .cal-r { display: none; } }
.cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.cos-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 12px; background: #00000044; border: 1px solid var(--line); text-align: center; font-size: 14px; }
.cos-card.owned { border-color: #ff335566; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #120a0c; display: grid; place-items: center; }
.swatch.emoji { font-size: 26px; border: none; }
.tag { font-size: 12px; color: var(--muted); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.tag.on { color: #43d17a; border-color: #43d17a88; }
.profile-name { font-size: 22px; font-weight: 800; margin: 0; }
.slider { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; } .slider input { width: 100%; accent-color: var(--blood2); min-height: 32px; }
.lang-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .lang-row span { min-width: 120px; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.pause { position: absolute; top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); z-index: 5; background: #000a; }
.tut-box { position: absolute; left: 50%; bottom: calc(18px + var(--sab)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 6; background: #1f1014ee; border: 2px solid var(--blood2); border-radius: 16px; padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; box-shadow: 0 10px 30px #000a; }
.tut-box small { grid-column: 1 / -1; color: var(--gold); font-weight: 800; }
.tut-box p { margin: 0; font-weight: 600; }
#touch:not([hidden]) ~ .tut-box { bottom: auto; top: calc(64px + var(--sat)); }
#stick-zone { position: absolute; left: 0; top: 60px; bottom: 0; width: 60%; z-index: 3; touch-action: none; }
#stick-base { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid #ffffff55; background: #ffffff14; z-index: 4; pointer-events: none; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; border-radius: 50%; background: #ff3355bb; border: 2px solid #fff8; transform: translate(-50%, -50%); }
.dash-btn { position: absolute; right: calc(22px + var(--sar)); bottom: calc(26px + var(--sab)); width: 84px; height: 84px; border-radius: 50%; border: 3px solid #ff8a9c; background: radial-gradient(#e0193a, #6a0718); color: #fff; font-size: 32px; z-index: 5; touch-action: none; box-shadow: 0 6px 20px #000a; }
.dash-btn:active { transform: scale(.92); }
.rotate-hint { position: absolute; top: calc(60px + var(--sat)); left: 50%; transform: translateX(-50%); margin: 0; z-index: 6; background: #000c; padding: 6px 12px; border-radius: 10px; font-size: 13px; white-space: nowrap; }
.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: #0a0204cc; padding: 16px; }
.overlay-card { width: min(420px, 100%); max-height: 100%; overflow-y: auto; background: var(--card); border: 2px solid #ff335566; border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; text-align: center; box-shadow: 0 20px 60px #000; }
.overlay-card h2 { margin: 0; font-size: 26px; }
.blood-title { color: #ff2a48; text-transform: uppercase; font-weight: 900; text-shadow: 0 3px 0 #5a0010; font-size: 32px !important; }
.big-time { font-size: 22px; font-weight: 800; margin: 0; }
.pb { color: var(--gold); font-weight: 900; margin: 0; font-size: 18px; }
.gains { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lvlup, .badge-earned, .unlocked { margin: 0; font-weight: 700; padding: 8px; border-radius: 10px; background: #3a0a1499; }
.unlocked { color: var(--gold); }
.row { display: flex; gap: 8px; } .row .btn { flex: 1; }
.toast { position: fixed; left: 50%; bottom: calc(20px + var(--sab)); transform: translateX(-50%); z-index: 100; width: max-content; max-width: calc(100% - 32px); background: #2a0d14; border: 1px solid var(--blood2); border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: 0 8px 24px #000a; }
#cynnx-game-chip { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- arenas & mutations ---------- */
.arena-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.arena { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; min-height: 64px; padding: 8px 10px; border-radius: 12px; border: 2px solid #ffffff22; color: var(--text); cursor: pointer; font: inherit; }
.arena b { font-size: 14px; } .arena small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.arena-morgue { background: linear-gradient(135deg, #2a2326, #3a3236); }
.arena-slaughterhouse { background: linear-gradient(135deg, #2b1d17, #4a2a1c); }
.arena-bloodbath { background: linear-gradient(135deg, #2a0c12, #5a1220); }
.arena.on { border-color: var(--blood2); box-shadow: 0 0 16px #ff335566; }
.arena:disabled { opacity: .55; cursor: not-allowed; }
.arena:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 420px) { .arena-pick { grid-template-columns: 1fr; } .arena { min-height: 48px; } }
.overlay-card.wide { width: min(640px, 100%); }
.mut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .mut-grid { grid-template-columns: 1fr; } }
.mut-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; min-height: 44px; border-radius: 14px; border: 2px solid #ff335566; background: #2c161c; color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.mut-card:hover, .mut-card:focus-visible { border-color: var(--gold); outline: none; transform: translateY(-2px); }
.mut-card span { font-size: 13px; color: var(--muted); }
.mut-ico { font-size: 34px; color: inherit !important; }
.mut-card kbd { position: absolute; top: 6px; right: 8px; font: 700 11px system-ui; color: var(--gold); border: 1px solid #ffd34d66; border-radius: 5px; padding: 1px 5px; }
.reached { margin: 0; font-weight: 700; color: var(--muted); }
.lb-stage { font-size: 12px; color: var(--gold); font-weight: 700; }
