html, body { margin: 0; height: 100%; background: #120d1c; overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
#hud { z-index: 2; }
#load { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #3a2357 0%, #150e22 70%); transition: opacity .5s; }
#load.done { opacity: 0; pointer-events: none; }
.load-in { display: grid; gap: 14px; justify-items: center; color: #fff; font: 800 15px Barlow, sans-serif; }
.load-in b { font: 34px 'Russo One', sans-serif; letter-spacing: 1px; color: #ffcf4a;
  text-shadow: 0 0 18px rgba(255, 120, 30, .7), 0 3px 0 #7a2a00; }
#load-bar { width: 220px; height: 10px; border-radius: 6px; background: #2b2040; overflow: hidden; box-shadow: inset 0 0 0 2px #4b3870; }
#load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #9a4dff, #ff8a2a); transition: width .2s; }
#load-note { opacity: .75; }
#over { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(10, 6, 18, .62); }
#over[hidden] { display: none; }
.card { width: min(86vw, 360px); padding: 26px 22px 22px; border-radius: 20px; text-align: center; color: #fff;
  background: linear-gradient(180deg, #2c1d45, #1a1229); box-shadow: 0 0 0 2px #9a4dff, 0 18px 50px rgba(0, 0, 0, .6);
  font: 700 16px Barlow, sans-serif; animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.card h1, .card h2 { margin: 0 0 6px; font: 32px 'Russo One', sans-serif; color: #ff6a4a; text-shadow: 0 3px 0 #4a0f08; }
.card p { margin: 8px 0; }
#over-gap { font-size: 19px; color: #ffd35a; }
#over-stats { opacity: .8; font-weight: 600; }
#again { margin-top: 14px; width: 100%; padding: 16px; border: 0; border-radius: 14px; cursor: pointer;
  font: 22px 'Russo One', sans-serif; color: #2a1400; background: linear-gradient(180deg, #ffd35a, #ff8a2a);
  box-shadow: 0 5px 0 #a44a00, 0 0 24px rgba(255, 150, 40, .5); }
#again:active { transform: translateY(3px); box-shadow: 0 2px 0 #a44a00; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#over-best { color: #c9a8ff; font-weight: 800; }
#revive { margin-top: 12px; width: 100%; padding: 12px; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #a35cff, #6a2bd6); box-shadow: 0 5px 0 #3d1580, 0 0 22px rgba(160, 90, 255, .5);
  display: grid; gap: 2px; font: 20px 'Russo One', sans-serif; }
#revive small { font: 700 12px Barlow, sans-serif; opacity: .85; }
#revive[hidden] { display: none; }
#revive:disabled { opacity: .6; }
#revive:active { transform: translateY(3px); box-shadow: 0 2px 0 #3d1580; }
#ready { position: fixed; z-index: 3; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 92px); transform: translateX(-50%);
  padding: 10px 20px; border: 0; border-radius: 12px; cursor: pointer; font: 16px 'Russo One', sans-serif; color: #062431;
  background: linear-gradient(180deg, #8ff0ff, #31b8e6); box-shadow: 0 4px 0 #1a6f8c, 0 0 18px rgba(80, 220, 255, .45); }
#ready[hidden] { display: none; }
#ready:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 1px 0 #1a6f8c; }
#cards { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(8, 10, 18, .55);
  animation: fade .25s ease-out; }
#cards[hidden] { display: none; }
#cards.out { opacity: 0; transition: opacity .3s; }
.cards-in { display: grid; gap: 14px; justify-items: center; width: min(94vw, 420px); }
.cards-in h2 { margin: 0; font: 28px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 3px 0 #5a2a00, 0 0 18px rgba(255, 160, 40, .5); }
#cards-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.ucard { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 8px 14px; border: 0; border-radius: 16px;
  cursor: pointer; color: #fff; text-align: center; font: 700 13px/1.25 Barlow, sans-serif;
  background: linear-gradient(180deg, #33244f, #1b1330); box-shadow: 0 0 0 2px #9a4dff, 0 10px 26px rgba(0, 0, 0, .5);
  animation: deal .45s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.ucard:nth-child(2) { animation-delay: .08s; } .ucard:nth-child(3) { animation-delay: .16s; }
.ucard img { width: 74px; height: 74px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.ucard b { font: 15px 'Russo One', sans-serif; color: #ffd35a; }
.ucard i { font-style: normal; font-size: 11px; color: #7fe6ff; letter-spacing: .5px; text-transform: uppercase; }
.ucard:active, .ucard.picked { transform: scale(1.06); box-shadow: 0 0 0 3px #ffd35a, 0 0 30px rgba(255, 200, 60, .7); }
#reroll { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border: 0; border-radius: 12px; cursor: pointer;
  color: #fff; font: 16px 'Russo One', sans-serif; background: linear-gradient(180deg, #a35cff, #6a2bd6); box-shadow: 0 4px 0 #3d1580; }
#reroll[hidden] { display: none; }
#reroll img { width: 34px; height: 34px; }
#reroll small { font: 700 11px Barlow, sans-serif; opacity: .85; }
@keyframes deal { from { transform: translateY(60px) rotate(6deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#over-reward { font: 22px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 0 14px rgba(255, 200, 60, .6); }
#over-reward[hidden] { display: none; }
#buyflare { position: fixed; z-index: 3; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 142px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border: 0; border-radius: 12px; cursor: pointer;
  font: 14px 'Russo One', sans-serif; color: #fff; background: linear-gradient(180deg, #8a4dff, #5a24c4); box-shadow: 0 4px 0 #34127a; }
#buyflare[hidden] { display: none; }
#buyflare > img { width: 30px; height: 30px; }
#buyflare b { display: flex; align-items: center; gap: 2px; color: #ffd35a; }
#buyflare b img { width: 20px; height: 20px; }
#buyflare:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 1px 0 #34127a; }

#mode { margin-top: 10px; width: 100%; padding: 10px; border: 2px solid rgba(255,255,255,.25); border-radius: 12px; cursor: pointer;
  background: transparent; color: #e8dcff; font: 700 15px Barlow, sans-serif; }
#mode:active { transform: translateY(2px); }
#board { margin-top: 10px; width: 100%; padding: 10px; border: 2px solid #ffd35a; border-radius: 12px; cursor: pointer;
  background: rgba(255, 211, 90, .1); color: #ffd35a; font: 700 15px Barlow, sans-serif; }
#board:active { transform: translateY(2px); }
#over-rank { color: #c9a1ff; font-weight: 700; min-height: 1.2em; }

/* ---------------- Horde Road levels: the map, the sheets, the stars */
#over-stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 6px; }
#over-stars[hidden] { display: none; }
#over-stars i { font-style: normal; font-size: 46px; line-height: 1; color: #3a2c55; text-shadow: 0 3px 0 #120a20; transform: scale(.4); opacity: .4; transition: transform .3s cubic-bezier(.2, 1.8, .4, 1), opacity .3s; }
#over-stars i:nth-child(2) { font-size: 58px; margin-top: -8px; }
#over-stars i.on { color: #ffd35a; opacity: 1; transform: scale(1); text-shadow: 0 0 18px rgba(255, 200, 60, .9), 0 3px 0 #8a4a00; }
#over-stars i.off { opacity: .7; transform: scale(.9); }
#next { margin-top: 14px; width: 100%; padding: 16px; border: 0; border-radius: 14px; cursor: pointer; font: 22px 'Russo One', sans-serif; color: #062a10;
  background: linear-gradient(180deg, #8dffa8, #2fd66a); box-shadow: 0 5px 0 #138a3c, 0 0 24px rgba(80, 255, 140, .45); }
#next[hidden], #tomap[hidden], #board[hidden], #mode[hidden] { display: none; }
#next:active { transform: translateY(3px); box-shadow: 0 2px 0 #138a3c; }
#tomap { margin-top: 10px; width: 100%; padding: 10px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .06); color: #fff; font: 700 15px Barlow, sans-serif; }
#map { position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; color: #fff; font: 700 15px Barlow, sans-serif;
  background: radial-gradient(120% 70% at 50% 0%, rgba(80, 40, 140, .55), rgba(10, 6, 22, .92) 60%), linear-gradient(180deg, rgba(12, 8, 26, .7), rgba(8, 5, 16, .96));
  padding-top: env(safe-area-inset-top, 0px); animation: fade .3s ease-out; }
#map[hidden] { display: none; }
.map-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; }
.map-logo { font: 26px 'Russo One', sans-serif; color: #fff; letter-spacing: .5px; text-shadow: 0 3px 0 #2a0f50, 0 0 16px rgba(160, 90, 255, .6); }
.map-logo span { color: #ff5ad0; }
.map-bank { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 20px; background: rgba(10, 6, 20, .7); box-shadow: inset 0 0 0 2px #ffd35a55; }
.map-bank img { width: 30px; height: 30px; }
.map-bank b { font: 19px 'Russo One', sans-serif; color: #ffd35a; }
.map-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 10px 10px; }
.map-btns button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; border: 0; border-radius: 14px; cursor: pointer; color: #fff;
  font: 14px 'Russo One', sans-serif; background: linear-gradient(180deg, #3a2860, #22173a); box-shadow: 0 0 0 2px #9a4dff88, 0 6px 16px rgba(0, 0, 0, .4); }
.map-btns button img { width: 46px; height: 46px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.map-btns button:active { transform: translateY(2px); }
.map-btns em { position: absolute; top: 6px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: #ff3a4a; box-shadow: 0 0 0 2px #fff, 0 0 12px #ff3a4a; animation: pulse 1s infinite; }
.map-btns em[hidden] { display: none; }
@keyframes pulse { 50% { transform: scale(1.25); } }
#map-list { flex: 1; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 6px 0 30px; display: flex; flex-direction: column; align-items: center; }
.chap { flex-shrink: 0; width: min(88vw, 380px); margin: 22px 0 14px; padding: 10px 14px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, #120a20), #120a20cc); box-shadow: 0 0 0 2px var(--c), 0 0 22px color-mix(in srgb, var(--c) 40%, transparent); }
.chap b { font: 18px 'Russo One', sans-serif; }
.chap span { color: #ffd35a; }
.lvl { flex-shrink: 0; position: relative; width: 74px; height: 74px; margin: 16px 0 26px; transform: translateX(var(--x)); border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 50%, #000));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, #000), 0 0 0 4px #ffffff33, 0 10px 20px rgba(0, 0, 0, .5); }
.lvl .n { font: 28px 'Russo One', sans-serif; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.lvl .s { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); display: flex; gap: 1px; }
.lvl .s i { font-style: normal; font-size: 19px; color: #2a2040; text-shadow: 0 2px 0 #000; }
.lvl .s i.on { color: #ffd35a; text-shadow: 0 0 8px rgba(255, 200, 60, .8), 0 2px 0 #8a4a00; }
.lvl em { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 8px; font: 11px 'Russo One', sans-serif; font-style: normal;
  background: #ff3a4a; box-shadow: 0 2px 0 #7a0a14; }
.lvl em.nw { background: #31b8e6; box-shadow: 0 2px 0 #1a6f8c; top: -4px; left: auto; right: -26px; transform: none; }
.lvl.boss { width: 88px; height: 88px; }
.lvl.boss em:not(.nw) { top: -12px; }
.lvl.locked { background: radial-gradient(circle at 35% 30%, #4a4060, #2a2238 60%, #15101e); box-shadow: 0 6px 0 #0c0814, 0 0 0 4px #ffffff14; }
.lvl.locked .n { opacity: .35; }
.lvl.locked::after { content: ''; position: absolute; width: 30px; height: 30px; right: -6px; bottom: -4px; background: url(/assets/zombie/ui/lock.webp) center / contain no-repeat; }
.lvl.locked .s { opacity: .35; }
.lvl.cur { animation: cur 1.1s ease-in-out infinite; box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, #000), 0 0 0 5px #ffd35a, 0 0 30px #ffd35a; }
@keyframes cur { 50% { transform: translateX(var(--x)) scale(1.1); } }
.lvl.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(calc(var(--x) - 8px)); } 75% { transform: translateX(calc(var(--x) + 8px)); } }
.map-foot { display: grid; gap: 8px; justify-items: center; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, rgba(8, 5, 16, .95) 30%); }
#map-streak { color: #ffd35a; font: 15px 'Russo One', sans-serif; text-shadow: 0 0 10px rgba(255, 200, 60, .6); min-height: 4px; }
#map-play { width: min(88vw, 380px); padding: 16px; border: 0; border-radius: 16px; cursor: pointer; font: 24px 'Russo One', sans-serif; color: #2a1400;
  background: linear-gradient(180deg, #ffd35a, #ff8a2a); box-shadow: 0 6px 0 #a44a00, 0 0 28px rgba(255, 150, 40, .55); animation: cur2 1.4s ease-in-out infinite; }
@keyframes cur2 { 50% { transform: scale(1.03); } }
#map-classic { border: 0; background: none; color: #b9a6dd; font: 700 13px Barlow, sans-serif; cursor: pointer; text-decoration: underline; }
#sheet { position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; background: rgba(8, 5, 16, .7); animation: fade .2s; }
#sheet[hidden] { display: none; }
.sheet-in { width: min(92vw, 400px); max-height: 86vh; overflow-y: auto; touch-action: pan-y; padding: 20px 16px 16px; border-radius: 20px; color: #fff; font: 700 15px Barlow, sans-serif;
  background: linear-gradient(180deg, #2c1d45, #1a1229); box-shadow: 0 0 0 2px #9a4dff, 0 18px 50px rgba(0, 0, 0, .6); animation: pop .3s cubic-bezier(.2, 1.6, .4, 1); }
.sheet-in h2 { margin: 0 0 12px; text-align: center; font: 26px 'Russo One', sans-serif; color: #ffd35a; text-shadow: 0 3px 0 #5a2a00; }
#sheet-close { margin-top: 12px; width: 100%; padding: 10px; border: 2px solid rgba(255, 255, 255, .25); border-radius: 12px; background: transparent; color: #fff; font: 700 15px Barlow, sans-serif; cursor: pointer; }
.sheet-in .sub { text-align: center; opacity: .85; font-weight: 600; margin: 10px 0; }
.sheet-in .big { width: 100%; padding: 14px; border: 0; border-radius: 14px; cursor: pointer; font: 20px 'Russo One', sans-serif; color: #2a1400;
  background: linear-gradient(180deg, #ffd35a, #ff8a2a); box-shadow: 0 5px 0 #a44a00; }
.gift { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gday { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: #241938; box-shadow: inset 0 0 0 2px #ffffff18; }
.gday:last-child { grid-column: span 2; }
.gday small { opacity: .8; } .gday img { width: 34px; height: 34px; } .gday b { color: #ffd35a; font: 15px 'Russo One', sans-serif; }
.gday.got { opacity: .45; } .gday.got b::after { content: ' ✓'; color: #7dffb0; }
.gday.today { background: linear-gradient(180deg, #5a3a10, #2a1a08); box-shadow: 0 0 0 2px #ffd35a, 0 0 18px rgba(255, 200, 60, .6); animation: cur2 1s infinite; }
.mrow, .arow { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 8px 0; border-radius: 14px; background: #241938; }
.mrow > div, .arow > div { flex: 1; display: grid; gap: 4px; }
.mrow small, .arow small { opacity: .75; font-weight: 600; }
.bar { height: 8px; border-radius: 5px; background: #120a20; overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, #9a4dff, #ff8a2a); }
.mrow button, .arow button { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border: 0; border-radius: 10px; cursor: pointer; font: 15px 'Russo One', sans-serif;
  color: #2a1400; background: linear-gradient(180deg, #ffd35a, #ff8a2a); box-shadow: 0 3px 0 #a44a00; }
.mrow button img, .arow button img { width: 20px; height: 20px; }
.mrow button:disabled, .arow button:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
.mrow button.ready { animation: cur2 .8s infinite; box-shadow: 0 3px 0 #a44a00, 0 0 16px rgba(255, 200, 60, .8); }
.arow > img { width: 52px; height: 52px; }
.pips { display: flex; gap: 4px; } .pips i { width: 16px; height: 6px; border-radius: 3px; background: #120a20; } .pips i.on { background: #7fe6ff; box-shadow: 0 0 6px #7fe6ff; }

/* ---------- Venice art for the menus (the owner's rule: no art drawn in code): orb buttons, stars, button plates */
.lvl, .lvl.locked, .lvl.cur, .lvl.boss { background: url(/assets/zombie/ui/node_purple.webp) center / contain no-repeat; box-shadow: none; }
.lvl.cur { background-image: url(/assets/zombie/ui/node_gold.webp); filter: drop-shadow(0 0 14px rgba(255, 210, 80, .8)); }
.lvl.locked { background-image: url(/assets/zombie/ui/node_locked.webp); }
.lvl.boss { background-image: url(/assets/zombie/ui/node_boss.webp); }
.lvl.boss.locked { background-image: url(/assets/zombie/ui/node_locked.webp); }
.lvl .n { position: relative; z-index: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 8px rgba(0, 0, 0, .5); }
.lvl.cur .n { color: #4a2400; text-shadow: 0 1px 0 rgba(255, 240, 180, .6); }
.lvl.locked::after { background-image: url(/assets/zombie/ui/lock_purple.webp); }
.lvl .s i, #over-stars i { font-size: 0; display: inline-block; }
.lvl .s i .st { width: 20px; height: 20px; filter: grayscale(1) brightness(.35); }
.lvl .s i.on .st { filter: drop-shadow(0 0 4px rgba(255, 200, 60, .8)); }
.chap .st { width: 18px; height: 18px; vertical-align: -3px; }
#over-stars i .st { width: 54px; height: 54px; filter: grayscale(1) brightness(.35); transition: filter .3s; }
#over-stars i:nth-child(2) .st { width: 68px; height: 68px; }
#over-stars i.on .st { filter: drop-shadow(0 0 14px rgba(255, 200, 60, .9)); }
#again, #next, #revive, #tomap, #board, #mode, #map-play, #reroll, #ready, #buyflare, .sheet-in .big, #sheet-close, .mrow button, .arow button, .map-btns button, .map-bank {
  border-style: solid !important; border-width: 0 !important; border-color: transparent !important; background: none !important; box-shadow: none !important;
  border-image-source: url(/assets/zombie/ui/btn_dark.webp); border-image-slice: 0 80 fill !important; border-image-width: 0 24px; border-image-repeat: stretch !important; }
#again, #map-play, .sheet-in .big, .mrow button, .arow button { border-image-source: url(/assets/zombie/ui/btn_gold.webp); color: #3a1700 !important; }
#next { border-image-source: url(/assets/zombie/ui/btn_green.webp); color: #032a0c !important; }
#revive, #reroll, #buyflare { border-image-source: url(/assets/zombie/ui/btn_purple.webp); color: #fff !important; }
#ready { border-image-source: url(/assets/zombie/ui/btn_green.webp); color: #032a0c !important; }
#again, #next, #map-play { border-image-width: 0 32px; }
.map-btns button { border-image-width: 0 26px; border-image-slice: 0 80 fill !important; }
.mrow button:disabled, .arow button:disabled { filter: grayscale(.9) brightness(.7); }
#again:active, #next:active, #map-play:active, .sheet-in .big:active { transform: translateY(2px) scale(.98); filter: brightness(1.08); box-shadow: none; }
