/* ============================================================
   The 3D games: Bowling and Sniper Duel (public/js/games/*-view.js)
   ============================================================ */
.match.g-bowling { background: #05070f; }
.g-bowling .play-wrap, .g-sniper .play-wrap { padding: 0; }
.k3-canvas { display: block; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.k3-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; text-align: center; padding: 0 24px; }

/* bowling */
.bw-wrap, .sn-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; }
.bw-stage, .sn-stage { position: absolute; inset: 0; }
.bw-board { position: absolute; left: 6px; right: 6px; top: 6px; background: rgba(7, 11, 22, .82); border: 1px solid var(--line2); border-radius: 12px; padding: 4px 4px 3px; pointer-events: none; font-family: Sora, sans-serif; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bw-head, .bw-row { display: grid; grid-template-columns: 34px repeat(9, minmax(0, 1fr)) minmax(0, 1.35fr) 30px; gap: 2px; align-items: stretch; }
.bw-head span { font-size: 8px; color: var(--dim); text-align: center; letter-spacing: .3px; }
.bw-row { margin-top: 2px; position: relative; }
.bw-nm { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; font-family: Inter, sans-serif; font-weight: 600; }
.bw-row.turn .bw-nm { color: var(--gold); }
.bw-f { background: #0E1528; border-radius: 4px; min-width: 0; display: flex; flex-direction: column; }
.bw-f.live { box-shadow: inset 0 0 0 1px var(--gold); }
.bw-f .mk { display: flex; justify-content: flex-end; height: 12px; }
.bw-f .mk i { font-style: normal; font-size: 8.5px; line-height: 12px; width: 50%; text-align: center; color: var(--text); border-left: 1px solid #1F2A4A; border-bottom: 1px solid #1F2A4A; }
.bw-f.tenth .mk i { width: 33.3%; }
.bw-f .mk i.x { color: var(--gold); font-weight: 800; }
.bw-f .mk i.sp { color: var(--green); font-weight: 800; }
.bw-f b { font-size: 10px; text-align: center; line-height: 14px; color: var(--text); min-height: 14px; }
.bw-tot { font-size: 13px; font-weight: 800; color: var(--gold); align-self: center; text-align: center; }
.bw-ro { position: absolute; right: 34px; top: -2px; font-size: 8px; color: var(--purple); }
.bw-fx { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.bw-word { font-family: Sora, sans-serif; font-weight: 800; font-size: 46px; letter-spacing: 1px; color: var(--text); text-shadow: 0 4px 24px rgba(0,0,0,.7); animation: bwPop .5s cubic-bezier(.2,1.6,.4,1) both; text-align: center; }
.bw-word small { display: block; font-size: 13px; letter-spacing: 3px; color: var(--muted); font-weight: 700; margin-top: -2px; }
.bw-word.strike { color: var(--gold); font-size: 56px; text-shadow: 0 0 30px rgba(245,184,61,.65), 0 4px 0 #6a4a00; }
.bw-word.spare { color: var(--green); text-shadow: 0 0 26px rgba(61,220,151,.55), 0 4px 0 #0a4a2e; }
.bw-word.gutter { color: #FF8A80; font-size: 34px; }
@keyframes bwPop { 0% { transform: scale(.3) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.bw-confetti { position: absolute; inset: 0; overflow: hidden; }
.bw-confetti i { position: absolute; left: var(--x); top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: bwFall 1.9s var(--d) cubic-bezier(.3,.6,.5,1) forwards; transform: rotate(var(--r)); }
@keyframes bwFall { 0% { transform: translateY(0) rotate(var(--r)); opacity: 1; } 100% { transform: translateY(105vh) rotate(calc(var(--r) + 540deg)); opacity: .2; } }
.bw-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(7,11,22,.9); border: 1px solid var(--line2); color: var(--text); font-size: 12px; padding: 7px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.bw-ctl, .sn-ctl { display: flex; align-items: center; gap: 8px; width: 100%; }
.bw-hook, .sn-cover { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.bw-hook button, .sn-cover button { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 7px 2px; text-align: center; min-width: 0; touch-action: manipulation; }
.bw-hook button b, .sn-cover button b { display: block; font-family: Sora, sans-serif; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-hook button span, .sn-cover button span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.bw-hook button.on, .sn-cover button.on { border-color: var(--gold); background: var(--card3); }
.bw-hold { position: relative; overflow: hidden; min-width: 118px; touch-action: none; -webkit-user-select: none; user-select: none; }
.bw-hold b { position: relative; }
.bw-pow { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(42,28,0,.35); }
.bw-pow i { display: block; height: 100%; background: #2A1C00; transform-origin: left; transform: scaleX(0); }
.bw-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* sniper duel */
.sn-scope { position: absolute; inset: 0; pointer-events: none; --r: 170px;
  background: radial-gradient(circle at 50% 50%, transparent 0 calc(var(--r) - 2px), rgba(0,0,0,.55) calc(var(--r) - 1px), #000 calc(var(--r) + 6px)); }
.sn-scope::after { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1); border-radius: 50%;
  box-shadow: inset 0 0 calc(var(--r) * .28) rgba(0,0,0,.75), inset 0 0 0 2px rgba(80,90,120,.6); }
.sn-ret { position: absolute; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1); }
.sn-zoom { position: absolute; left: 50%; top: calc(50% + var(--r) - 30px); transform: translateX(-50%); font: 800 12px Sora, sans-serif; color: var(--gold); letter-spacing: 1px; }
.sn-cross { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; }
.sn-cross i { position: absolute; background: rgba(233,237,248,.85); box-shadow: 0 0 2px #000; }
.sn-cross i:nth-child(1) { left: 14px; top: 0; width: 2px; height: 9px; } .sn-cross i:nth-child(2) { left: 14px; bottom: 0; width: 2px; height: 9px; }
.sn-cross i:nth-child(3) { top: 14px; left: 0; width: 9px; height: 2px; } .sn-cross i:nth-child(4) { top: 14px; right: 0; width: 9px; height: 2px; }
.sn-cross[hidden] { display: none; }
.sn-hit { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; animation: snHit .9s ease-out both; }
.sn-hit i { position: absolute; left: 20px; top: 0; width: 4px; height: 44px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.sn-hit i:first-child { transform: rotate(45deg); } .sn-hit i:last-child { transform: rotate(-45deg); }
.sn-hit.head i { background: var(--gold); }
.sn-hit[hidden] { display: none; }
@keyframes snHit { 0% { transform: scale(1.6); opacity: 0; } 15% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }
.sn-fx { position: absolute; left: 0; right: 0; top: 18%; display: flex; justify-content: center; pointer-events: none; }
.sn-word { font-family: Sora, sans-serif; font-weight: 800; font-size: 38px; letter-spacing: 2px; color: var(--text); text-shadow: 0 3px 18px rgba(0,0,0,.8); animation: bwPop .45s cubic-bezier(.2,1.6,.4,1) both; text-align: center; }
.sn-word small { display: block; font-size: 12px; letter-spacing: 1.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.sn-word.head.mine { color: var(--gold); text-shadow: 0 0 26px rgba(245,184,61,.6), 0 3px 0 #6a4a00; }
.sn-word.body.mine { color: var(--green); }
.sn-word.theirs.head, .sn-word.theirs.body { color: #FF8A80; font-size: 28px; }
.sn-word.miss, .sn-word.cover, .sn-word.parapet, .sn-word.skip { color: #C9CED9; font-size: 30px; }
.match.g-sniper { background: #1a1612; }
/* v2: the Old Quarter, third person. The match controls bar is not used: the controls sit on the picture. */
.controls.sn-hidectl { display: none !important; }
.sn2 { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sn2 .sn-look { position: absolute; inset: 0; z-index: 2; touch-action: none; }
.sn2 .sn-joy { position: absolute; left: 0; bottom: 0; width: 46%; height: 42%; z-index: 3; touch-action: none; }
.sn2 .sn-base { position: absolute; left: 22px; bottom: calc(26px + var(--safe-bottom, 0px)); width: 112px; height: 112px; border-radius: 50%; background: rgba(10,14,24,.28); border: 2px solid rgba(233,237,248,.35); box-shadow: inset 0 0 18px rgba(0,0,0,.35); }
.sn2 .sn-knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: rgba(233,237,248,.82); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.sn2 .sn-joy span { position: absolute; left: 20px; bottom: calc(6px + var(--safe-bottom, 0px)); font: 700 9.5px Inter, sans-serif; letter-spacing: .8px; color: rgba(233,237,248,.7); text-shadow: 0 1px 3px #000; pointer-events: none; }
.sn2 .sn-joy.on .sn-base { background: rgba(10,14,24,.4); border-color: rgba(245,184,61,.7); }
.sn2 .sn-joy.on span { opacity: 0; }
.sn-btn { position: absolute; z-index: 4; border-radius: 50%; border: 2px solid rgba(233,237,248,.55); background: rgba(10,14,24,.55); color: #F4F1E8; font: 800 12px Sora, sans-serif; letter-spacing: .6px; touch-action: none; -webkit-tap-highlight-color: transparent; box-shadow: 0 3px 12px rgba(0,0,0,.4); }
.sn-btn[hidden] { display: none; }
.sn-a { right: 20px; bottom: calc(30px + var(--safe-bottom, 0px)); width: 88px; height: 88px; font-size: 14px; background: rgba(245,184,61,.9); color: #2A1C00; border-color: #fff3d0; }
.sn-a.fire { background: #E2463B; color: #fff; border-color: #ffd1cc; font-size: 16px; }
.sn-a.cool { background: conic-gradient(rgba(10,14,24,.7) calc(var(--cool) * 360deg), #E2463B 0); }
.sn-b { right: 124px; bottom: calc(34px + var(--safe-bottom, 0px)); width: 64px; height: 64px; font-size: 10.5px; }
.sn-b.on { border-color: var(--gold); color: var(--gold); }
.sn-c { right: 30px; bottom: calc(132px + var(--safe-bottom, 0px)); width: 60px; height: 60px; font-size: 14px; color: var(--gold); }
.sn-d { right: 112px; bottom: calc(112px + var(--safe-bottom, 0px)); width: 56px; height: 56px; font-size: 10.5px; }
.sn2.scoped .sn-b { right: 122px; bottom: calc(30px + var(--safe-bottom, 0px)); width: 58px; height: 58px; }
.sn-top { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px; background: rgba(7,11,22,.72); border: 1px solid rgba(233,237,248,.18); border-radius: 999px; padding: 4px 14px; pointer-events: none; }
.sn-top b { font: 800 18px Sora, sans-serif; min-width: 16px; text-align: center; }
.sn-top b.me { color: var(--gold); } .sn-top b.them { color: #FF8A80; }
.sn-top span { font: 700 12px Inter, sans-serif; color: #F4F1E8; text-align: center; white-space: nowrap; line-height: 1.1; }
.sn-top small { display: block; font-size: 9px; color: rgba(233,237,248,.6); font-weight: 600; letter-spacing: .4px; }
.sn-map { position: absolute; right: 8px; top: 8px; width: 96px; height: 128px; z-index: 4; border-radius: 8px; touch-action: none; cursor: pointer; }
.sn-cross3 { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: none; z-index: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 0 3px rgba(0,0,0,.6); }
.sn-cross3 i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: #fff; }
.sn-cross3[hidden] { display: none; }
.sn2 .sn-scope { z-index: 1; }
.sn2 .sn-fx { top: 22%; z-index: 4; }
.sn2 .sn-hit { z-index: 4; }
.sn-word.mine.head { color: var(--gold); text-shadow: 0 0 26px rgba(245,184,61,.6), 0 3px 0 #6a4a00; }
.sn-word.mine.body { color: var(--green); }
.sn-word.ping, .sn-word.golden { color: var(--gold); font-size: 24px; }
.sn-banner { position: absolute; left: 0; right: 0; top: 38%; z-index: 4; text-align: center; pointer-events: none; opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s; }
.sn-banner.on { opacity: 1; transform: scale(1); }
.sn-banner b { display: block; font: 800 40px Sora, sans-serif; color: #F4F1E8; letter-spacing: 2px; text-shadow: 0 3px 18px rgba(0,0,0,.8); }
.sn-banner span { display: block; font: 700 13px Inter, sans-serif; color: rgba(244,241,232,.85); letter-spacing: 1.5px; text-shadow: 0 2px 8px #000; }
.sn-sub { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.hud .dots.sn-dots i.h { background: var(--gold); }
@media (min-width: 900px) {
  .sn-a { width: 96px; height: 96px; }
  .sn-map { width: 120px; height: 160px; }
}

@media (min-width: 900px) {
  .bw-board { left: 50%; right: auto; width: 640px; transform: translateX(-50%); top: 10px; padding: 6px 8px 5px; }
  .bw-head, .bw-row { grid-template-columns: 70px repeat(9, minmax(0, 1fr)) minmax(0, 1.35fr) 44px; gap: 3px; }
  .bw-nm { font-size: 12px; } .bw-head span { font-size: 10px; }
  .bw-f .mk { height: 16px; } .bw-f .mk i { font-size: 11px; line-height: 16px; } .bw-f b { font-size: 13px; line-height: 18px; min-height: 18px; }
  .bw-tot { font-size: 17px; }
  .bw-word { font-size: 64px; } .bw-word.strike { font-size: 84px; }
  .bw-ctl { max-width: 720px; margin: 0 auto; }
  .sn-word { font-size: 54px; }
}
/* mode heroes */
.mode-hero.hero-bowling { background: radial-gradient(ellipse at 50% 0%, #2a3b8a, #0b1230 60%, #05070f); }
.h-lane { position: absolute; left: 50%; bottom: -10px; width: 170px; height: 230px; margin-left: -85px; background: linear-gradient(90deg, #a87442, #d8a368 50%, #a87442); transform: perspective(260px) rotateX(58deg); transform-origin: bottom; box-shadow: 0 0 60px rgba(245,184,61,.25); }
.h-pins { position: absolute; left: 50%; top: 52px; width: 120px; margin-left: -60px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.h-pins i { width: 14px; height: 34px; border-radius: 7px 7px 5px 5px; background: linear-gradient(#fff 0 40%, #C8252B 40% 47%, #fff 47% 53%, #C8252B 53% 60%, #fff 60%); box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.h-bowl { position: absolute; right: 22%; top: 150px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #b9a4ff, #6b3fd1 45%, #1c0b4a); box-shadow: 0 8px 18px rgba(0,0,0,.5); }
.mode-hero.hero-sniper { background: linear-gradient(#0a0f2c, #2b2a6e 45%, #ff8a5c 70%, #3a2346 72%, #120c1e); }
.h-sky { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: repeating-linear-gradient(90deg, #120c1e 0 28px, #1a1230 28px 46px, #0e0a18 46px 70px); clip-path: polygon(0 40%, 8% 40%, 8% 10%, 18% 10%, 18% 30%, 30% 30%, 30% 0, 40% 0, 40% 35%, 55% 35%, 55% 15%, 68% 15%, 68% 45%, 80% 45%, 80% 5%, 90% 5%, 90% 30%, 100% 30%, 100% 100%, 0 100%); }
.h-scope { position: absolute; right: 30px; top: 30px; width: 130px; height: 130px; border-radius: 50%; border: 6px solid #0b0b0b; box-shadow: 0 0 0 3px rgba(245,184,61,.6), 0 10px 30px rgba(0,0,0,.5); background: radial-gradient(circle, rgba(255,255,255,.04), rgba(0,0,0,.2)); }
.h-scope::before, .h-scope::after { content: ''; position: absolute; background: #0b0b0b; }
.h-scope::before { left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; } .h-scope::after { top: 50%; left: 6px; right: 6px; height: 2px; margin-top: -1px; }
