:root {
  --pink: #ff5a9a;
  --sky: #38b6ff;
  --gold: #ffd23f;
  --ink: #1d2340;
  --panel: rgba(18, 28, 64, 0.72);
  --panel-edge: rgba(255, 255, 255, 0.25);
  font-family: 'Baloo 2', 'Mitr', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd3ff; color: #fff; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.primary { background: linear-gradient(#ffe066, #ffb703); }
.btn.small { padding: 4px 12px; font-size: 13px; }
input {
  font: inherit; border-radius: 12px; border: 2px solid #cfe6ff; padding: 8px 12px; color: var(--ink); min-width: 0;
}

/* ---------- Lobby ---------- */
.panel-screen {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.35), rgba(30,90,180,.35));
  overflow: auto;
}
.lobby-card {
  width: min(820px, 100%); background: rgba(255,255,255,.92); color: var(--ink); border-radius: 28px;
  padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,40,120,.35); border: 4px solid #fff;
}
.logo {
  margin: 0; font-size: clamp(40px, 8vw, 68px); line-height: 1; letter-spacing: 2px;
  background: linear-gradient(#ffcc00, #ff6a00); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #7a2c00; font-weight: 800;
}
.logo span { font-size: .4em; -webkit-text-stroke: 0; color: var(--sky); margin-left: 8px; }
.tagline { margin: 4px 0 18px; font-family: Mitr, sans-serif; color: #4a5680; }
label { display: flex; flex-direction: column; gap: 4px; font-family: Mitr, sans-serif; font-size: 14px; max-width: 260px; }
.char-title { margin: 16px 0 8px; font-family: Mitr, sans-serif; font-size: 14px; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.char {
  border: 3px solid transparent; border-radius: 18px; padding: 8px; cursor: pointer; text-align: center;
  background: #eef6ff; transition: transform .1s; font-weight: 700;
}
.char:hover { transform: translateY(-2px); }
.char.sel { border-color: var(--gold); background: #fff8d6; }
.char canvas, .char img { width: 100%; aspect-ratio: 1; border-radius: 12px; display: block; background: linear-gradient(#bfe6ff, #eaf7ff); object-fit: cover; }
.char small { display: block; font-weight: 500; color: #6a7599; font-size: 11px; line-height: 1.2; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.or { color: #8a93b5; font-family: Mitr, sans-serif; }
#room-code { width: 120px; text-transform: uppercase; }
.error { color: #e0294a; font-family: Mitr, sans-serif; min-height: 1.2em; }
.muted { color: #6a7599; font-family: Mitr, sans-serif; }
.room-code { font-size: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-code b { letter-spacing: 3px; color: #ff6a00; }
.round-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 4px 0 12px; font-family: Mitr, sans-serif; font-size: 14px; }
.round-pick > span { font-weight: 600; }
.round-pick label { flex-direction: row; align-items: center; gap: 4px; max-width: none; cursor: pointer; }
.room-players { list-style: none; padding: 0; display: grid; gap: 8px; }
.room-players li { display: flex; align-items: center; gap: 10px; background: #eef6ff; padding: 8px 14px; border-radius: 14px; font-weight: 700; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; font-weight: 700; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
#hud > * { position: absolute; }
.hole-info { top: 14px; left: 14px; display: flex; gap: 12px; align-items: center; background: var(--panel); padding: 8px 16px 8px 8px; border-radius: 999px; border: 2px solid var(--panel-edge); }
.hole-no { width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(#ffe066, #ff9f1c); color: var(--ink); text-shadow: none; display: grid; place-items: center; line-height: .8; }
.hole-no small { font-size: 10px; } .hole-no b { font-size: 28px; }
.hole-name { font-size: 20px; }
.hole-meta { font-size: 14px; opacity: .9; }

.wind { top: 14px; right: 14px; display: flex; flex-direction: column; align-items: center; background: var(--panel); border-radius: 22px; padding: 10px 14px; border: 2px solid var(--panel-edge); }
.wind-dial { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(#fff 0 30%, #bfe4ff 31% 100%); display: grid; place-items: center; border: 3px solid #fff; }
.wind-arrow { color: #ff4d6d; font-size: 34px; transition: transform .4s; text-shadow: none; }
.wind-speed { font-size: 22px; } .wind-speed b { color: var(--gold); font-size: 28px; }

.turn-banner { top: 90px; left: 50%; transform: translateX(-50%); font-size: 26px; background: var(--panel); padding: 6px 24px; border-radius: 999px; border: 2px solid var(--panel-edge); white-space: nowrap; }
.turn-banner:empty { display: none; }

.clubs { left: 14px; top: 100px; display: flex; flex-direction: column; gap: 4px; }
.club { background: var(--panel); border-radius: 10px; padding: 3px 10px; font-size: 15px; border: 2px solid transparent; display: flex; gap: 10px; justify-content: space-between; min-width: 112px; }
.club.sel { border-color: var(--gold); background: rgba(255, 190, 40, .85); color: var(--ink); text-shadow: none; }
.club small { opacity: .8; }

.right-col { right: 14px; top: 150px; bottom: 120px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.right-col > * { position: static; }
.shot-info { background: var(--panel); border-radius: 16px; padding: 10px 14px; font-size: 15px; border: 2px solid var(--panel-edge); min-width: 150px; }
.shot-info b { color: var(--gold); }
#minimap { flex: 0 1 auto; min-height: 0; aspect-ratio: 3 / 5; width: auto; height: 250px; max-height: 100%; border-radius: 16px; border: 3px solid rgba(255,255,255,.7); background: #2a6b3a; }

.spin-box { left: 22px; bottom: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.spin-ball { width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #d9dde8); border: 3px solid #fff; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.spin-ball::before, .spin-ball::after { content: ''; position: absolute; background: rgba(0,0,0,.12); }
.spin-ball::before { left: 50%; top: 8%; bottom: 8%; width: 2px; }
.spin-ball::after { top: 50%; left: 8%; right: 8%; height: 2px; }
.spin-dot { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #ff3d6e; border: 2px solid #fff; left: 50%; top: 50%; transform: translate(-50%, -50%); }

.gauge-wrap { left: 50%; bottom: 22px; transform: translateX(-50%); width: min(620px, 92vw); text-align: center; }
.gauge { position: relative; height: 34px; border-radius: 999px; background: linear-gradient(#26345e, #121b3a); border: 3px solid #fff; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.gauge-impact { position: absolute; left: 0; top: 0; bottom: 0; width: 13%; background: linear-gradient(90deg, #ff4d6d, #ffd23f 50%, #ff4d6d); opacity: .85; }
.gauge-perfect { position: absolute; left: calc(13% - 4px); top: 0; bottom: 0; width: 8px; background: #fff; box-shadow: 0 0 10px #fff; }
.tick { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.3); }
.gauge-fill { position: absolute; left: 13%; top: 4px; bottom: 4px; width: 0; border-radius: 0 999px 999px 0; background: linear-gradient(90deg, #38b6ff, #7af0c8, #ffd23f, #ff6a3d); }
.gauge-lock { position: absolute; top: -2px; bottom: -2px; width: 4px; background: #ffd23f; box-shadow: 0 0 8px #ffd23f; }
.gauge-cursor { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; background: #fff; border-radius: 3px; box-shadow: 0 0 8px rgba(0,0,0,.6); left: 13%; }
.gauge-zones { position: absolute; left: 13%; right: 0; top: 0; bottom: 0; }
.gauge-target { position: absolute; top: 0; bottom: 0; border-left: 2px solid #b8ffb0; border-right: 2px solid #b8ffb0; background: rgba(80, 230, 110, .55); box-shadow: 0 0 14px #5dff7a, inset 0 0 8px rgba(255,255,255,.6); animation: pulse 1.1s ease-in-out infinite; }
.gauge-target.far { background: rgba(255, 170, 40, .55); border-color: #ffe0a0; box-shadow: 0 0 14px #ffb13d; }
.gauge-calm { position: absolute; top: 3px; bottom: 3px; width: 0; border-left: 2px dashed rgba(255,255,255,.85); }
@keyframes pulse { 50% { opacity: .65; } }
.gauge-top { position: relative; height: 26px; margin-bottom: 2px; }
.gs { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; opacity: .8; }
.gauge-range { position: absolute; left: 0; bottom: 0; font-size: 12px; background: var(--panel); border: 1px solid var(--panel-edge); padding: 0 8px; border-radius: 999px; pointer-events: auto; cursor: pointer; }
.gauge-range b { color: var(--gold); }
.gauge-tag { position: absolute; bottom: 2px; transform: translateX(-50%); background: #2fd35a; color: #fff; padding: 1px 9px; border-radius: 999px; font-size: 14px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); z-index: 2; }
.gauge-tag.far { background: #ff9f1c; }
.gauge-tag::after { content: ''; position: absolute; left: var(--tip, 50%); bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: inherit; border-bottom: 0; }
.gauge-readout { position: absolute; bottom: 28px; transform: translateX(-50%); background: #fff; color: var(--ink); text-shadow: none; padding: 1px 8px; border-radius: 8px; font-size: 15px; z-index: 3; min-width: 44px; }
.gauge-readout.ok { background: #2fd35a; color: #fff; }
.gauge-readout.near { background: #ffd23f; }
.gauge-readout.off { background: #ff4d6d; color: #fff; }
.shot-info .best b { color: #2bff6a; }
.shot-info .best small { display: block; font-size: 11px; opacity: .8; font-weight: 400; }
.shot-info .need { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.25); }
.shot-info .need b { color: #5dff7a; font-size: 18px; }
.shot-info .need small { display: block; font-size: 11px; opacity: .8; font-weight: 400; }
.gauge-help { font-size: 12px; margin-top: 6px; opacity: .85; font-family: Mitr, sans-serif; font-weight: 400; }

.popup { left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); font-size: clamp(40px, 9vw, 96px); font-weight: 800; opacity: 0; transition: opacity .2s, transform .35s cubic-bezier(.2, 1.6, .4, 1); white-space: nowrap; -webkit-text-stroke: 3px var(--ink); text-shadow: 0 6px 0 var(--ink); }
.popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.popup.perfect { background: linear-gradient(#fff36b, #ff8f1f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.popup.bad { color: #7fd2ff; }
.popup.good { color: #8dff7a; }

.chat { right: 14px; bottom: 14px; width: 260px; pointer-events: auto; }
.chat-log { max-height: 140px; overflow-y: auto; font-size: 13px; font-family: Mitr, sans-serif; font-weight: 400; display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.chat-log div { background: rgba(0,0,0,.35); border-radius: 8px; padding: 2px 8px; }
.chat input { width: 100%; font-size: 13px; padding: 5px 10px; opacity: .8; }

.scoreboard { left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(255,255,255,.95); color: var(--ink); text-shadow: none; padding: 18px 22px; border-radius: 22px; min-width: min(520px, 94vw); pointer-events: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.scoreboard h2 { margin: 0 0 10px; }
.scoreboard table { border-collapse: collapse; width: 100%; font-size: 16px; }
.scoreboard td, .scoreboard th { padding: 6px 10px; text-align: center; border-bottom: 1px solid #e3e8f5; }
.scoreboard td:first-child, .scoreboard th:first-child { text-align: left; }
.under { color: #e0294a; } .over { color: #2a6bd6; }

/* ---------- touch controls: hidden on desktop ---------- */
.mctl, .mtools, .m-brief { display: none; }
#game { touch-action: none; }

/* ======================================================================
   Phones & tablets (body.mobile is set from JS: coarse pointer or small screen)
   ====================================================================== */
body.mobile { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
body.mobile #hud button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body.mobile .clubs, body.mobile .gauge-help { display: none; }

/* top bar */
body.mobile .hole-info { top: calc(6px + env(safe-area-inset-top, 0px)); left: calc(6px + env(safe-area-inset-left, 0px)); gap: 8px; padding: 4px 12px 4px 4px; }
body.mobile .hole-no { width: 38px; height: 38px; } body.mobile .hole-no b { font-size: 19px; } body.mobile .hole-no small { font-size: 7px; }
body.mobile .hole-name { font-size: 14px; } body.mobile .hole-meta { font-size: 11px; }
body.mobile .wind { top: calc(6px + env(safe-area-inset-top, 0px)); right: calc(6px + env(safe-area-inset-right, 0px)); padding: 4px 8px; border-radius: 16px; }
body.mobile .wind-dial { width: 40px; height: 40px; border-width: 2px; } body.mobile .wind-arrow { font-size: 19px; }
body.mobile .wind-speed { font-size: 13px; } body.mobile .wind-speed b { font-size: 17px; }
body.mobile .turn-banner { font-size: 14px; padding: 2px 14px; top: calc(64px + env(safe-area-inset-top, 0px)); }
body.mobile .popup { font-size: clamp(34px, 11vw, 64px); }

/* one-line summary: distance · needed power · best spot (tap ℹ︎ for the full panel) */
body.mobile .m-brief { display: block; left: 50%; transform: translateX(-50%); top: calc(100px + env(safe-area-inset-top, 0px)); background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 3px 10px; font-size: 12px; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
body.mobile .m-brief b { color: var(--gold); } body.mobile .m-brief .ok { color: #5dff7a; }
body.mobile .m-brief:empty { display: none; }

/* full info / minimap only on demand */
body.mobile .right-col { top: calc(128px + env(safe-area-inset-top, 0px)); right: 6px; bottom: auto; max-height: 60vh; overflow: auto; pointer-events: auto; }
body.mobile .shot-info { display: none; font-size: 12px; padding: 8px 10px; }
body.mobile #minimap { display: none; height: 190px; }
body.mobile.show-info .shot-info { display: block; }
body.mobile.show-map #minimap { display: block; }

/* chat: collapsed behind 💬 */
body.mobile .chat { display: none; left: 50%; right: auto; transform: translateX(-50%); top: calc(112px + env(safe-area-inset-top, 0px)); bottom: auto; width: min(340px, 92vw); }
body.mobile.show-chat .chat { display: block; }

body.mobile .scoreboard { min-width: 0; width: min(560px, 96vw); max-height: 82vh; overflow: auto; padding: 12px; }
body.mobile .scoreboard table { font-size: 12px; } body.mobile .scoreboard td, body.mobile .scoreboard th { padding: 4px 5px; }

/* spin: tap/drag the ball */
body.mobile .spin-box { pointer-events: auto; }
body.mobile .spin-ball { width: 54px; height: 54px; touch-action: none; }
body.mobile .spin-dot { width: 13px; height: 13px; }
body.mobile .spin-box small { font-size: 10px; }

/* gauge */
body.mobile .gauge-wrap { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)); pointer-events: auto; touch-action: manipulation; }
body.mobile .gauge { height: 30px; }
body.mobile .gauge-tag { font-size: 12px; } body.mobile .gauge-readout { font-size: 13px; } body.mobile .gs { font-size: 10px; }

/* controls */
body.mobile .mctl { display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
body.mobile .mctl > * { pointer-events: auto; }
body.mobile .mctl button, body.mobile .mtools button { font: inherit; color: #fff; border: 2px solid rgba(255,255,255,.85); background: var(--panel); touch-action: none; }
body.mobile .mctl button:active, body.mobile .mtools button:active { transform: scale(.92); background: rgba(255, 190, 40, .9); color: var(--ink); }
body.mobile .mctl-aim { display: flex; gap: 8px; }
body.mobile .mctl-aim button { width: 56px; height: 56px; border-radius: 50%; font-size: 22px; }
body.mobile .mctl-club { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 2px solid var(--panel-edge); border-radius: 999px; padding: 3px; }
body.mobile .mctl-club button { width: 40px; height: 40px; border-radius: 50%; font-size: 15px; }
body.mobile .m-club { min-width: 54px; text-align: center; line-height: 1; }
body.mobile .m-club b { display: block; font-size: 18px; color: var(--gold); } body.mobile .m-club small { font-size: 10px; opacity: .85; }
body.mobile .m-shot { width: 96px; height: 64px; border-radius: 999px !important; font-size: 22px !important; font-weight: 800; color: var(--ink) !important; background: linear-gradient(#ffe066, #ff9f1c) !important; box-shadow: 0 4px 0 rgba(0,0,0,.3); }
body.mobile .mtools { display: flex; gap: 6px; pointer-events: auto; }
body.mobile .mtools button { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; padding: 0; }
body.mobile.show-info #m-info, body.mobile.show-map #m-map, body.mobile.show-chat #m-chat { background: rgba(255, 190, 40, .9); }

/* ---- portrait: stacked bottom dock (tools · controls · gauge) ---- */
@media (orientation: portrait) {
  body.mobile .mctl { left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.mobile .mtools { left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); gap: 4px; }
  body.mobile .mtools button { width: 33px; height: 33px; font-size: 14px; }
  body.mobile .spin-box { left: 8px; bottom: calc(198px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- landscape: short screen, controls go to the sides of a narrower gauge ---- */
@media (orientation: landscape) {
  body.mobile .gauge-wrap { width: min(52vw, 520px); }
  body.mobile .mctl { left: calc(8px + env(safe-area-inset-left, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); align-items: flex-end; }
  body.mobile .mctl-aim { flex-direction: row; }
  body.mobile .mctl-club { position: absolute; left: 0; bottom: 66px; }
  body.mobile .mctl-aim button { width: 52px; height: 52px; }
  body.mobile .m-shot { width: 88px; height: 58px; }
  body.mobile .mtools { left: 50%; transform: translateX(-50%); top: calc(6px + env(safe-area-inset-top, 0px)); }
  body.mobile .mtools button { width: 34px; height: 34px; font-size: 14px; }
  body.mobile .turn-banner { top: calc(46px + env(safe-area-inset-top, 0px)); }
  body.mobile .m-brief { top: calc(80px + env(safe-area-inset-top, 0px)); }
  body.mobile .spin-box { left: calc(8px + env(safe-area-inset-left, 0px)); bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
  body.mobile .right-col { top: calc(100px + env(safe-area-inset-top, 0px)); right: calc(72px + env(safe-area-inset-right, 0px)); max-height: calc(100vh - 190px); }
  body.mobile .chat { top: calc(100px + env(safe-area-inset-top, 0px)); }
  body.mobile .chat-log { max-height: 90px; }
  body.mobile .popup { top: 42%; }
}
/* very short landscape phones (e.g. 667×375): hide the long hole name */
@media (orientation: landscape) and (max-height: 400px) {
  body.mobile .hole-name { display: none; }
}
/* narrow landscape (≤ 720px wide): the tool row moves next to the wind dial so it clears the hole card */
@media (orientation: landscape) and (max-width: 720px) {
  body.mobile .mtools { left: auto; right: calc(66px + env(safe-area-inset-right, 0px)); transform: none; gap: 4px; }
  body.mobile .mtools button { width: 30px; height: 30px; font-size: 13px; border-radius: 10px; }
}

/* lobby on phones */
@media (max-width: 700px), (max-height: 500px) {
  .panel-screen { place-items: start center; padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 20px; }
  .lobby-card { padding: 16px; border-radius: 20px; }
  .chars { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .row { margin-top: 12px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .chars { grid-template-columns: repeat(6, 1fr); }
  .char small { display: none; }
  .tagline { margin-bottom: 8px; }
}

.loading { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--panel); padding: 6px 18px; border-radius: 999px; font-family: Mitr, sans-serif; }

.netstatus { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 50; background: rgba(200, 40, 70, .92); color: #fff; padding: 8px 18px; border-radius: 999px; font-family: Mitr, sans-serif; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.35); max-width: 92vw; }

/* scorecard: one table per nine so 18 holes fit on a phone */
.scoreboard .nine { margin-bottom: 10px; overflow-x: auto; }
.scoreboard .nine table { min-width: 100%; }
.scoreboard .sub { background: #eef3ff; font-weight: 700; }
.scoreboard .cur { outline: 2px solid #ffb703; outline-offset: -2px; }

/* spin ball labels + readout */
.spin-ball .sl { position: absolute; font-style: normal; font-size: 9px; color: #6a7599; text-shadow: none; font-weight: 700; pointer-events: none; }
.spin-ball .t { top: 3px; left: 50%; transform: translateX(-50%); }
.spin-ball .b { bottom: 3px; left: 50%; transform: translateX(-50%); }
.spin-ball .l { left: 5px; top: 50%; transform: translateY(-50%); }
.spin-ball .r { right: 5px; top: 50%; transform: translateY(-50%); }
.spin-text { font-size: 11px; background: var(--panel); border-radius: 999px; padding: 1px 8px; white-space: nowrap; font-family: Mitr, sans-serif; font-weight: 500; }
.spin-text.on { background: #ff3d6e; }

/* pin view + help */
.pin-btn, .help-btn { pointer-events: auto; font: inherit; font-weight: 700; color: #fff; background: var(--panel); border: 2px solid var(--panel-edge); cursor: pointer; }
.pin-btn { right: 14px; top: 162px; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.help-btn { right: 118px; top: 162px; width: 30px; height: 30px; border-radius: 50%; font-size: 16px; padding: 0; }
.pin-btn.on, .mtools button.on { background: rgba(255, 60, 90, .9) !important; }
.right-col { top: 200px; }
.pinview-tag { left: 50%; top: 140px; transform: translateX(-50%); background: rgba(255, 60, 90, .9); padding: 3px 14px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.help { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, 94vw); max-height: 86vh; overflow: auto; background: rgba(255,255,255,.97); color: var(--ink); text-shadow: none; border-radius: 20px; padding: 16px 20px; pointer-events: auto; z-index: 30; font-family: Mitr, sans-serif; font-weight: 400; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.help h3 { margin: 0 0 8px; font-family: 'Baloo 2', Mitr, sans-serif; }
.help h4 { margin: 6px 0 4px; color: #ff6a00; }
.help p { margin: 3px 0; font-size: 14px; }
.help-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 18px; }
body.mobile .pin-btn, body.mobile .help-btn { display: none; }
body.mobile .spin-text { font-size: 10px; }
body.mobile .pinview-tag { top: calc(128px + env(safe-area-inset-top, 0px)); font-size: 12px; }
@media (orientation: landscape) { body.mobile .pinview-tag { top: calc(108px + env(safe-area-inset-top, 0px)); } }
/* while looking at the hole the one-line summary is hidden (the tag takes its place) */
body.mobile.pinview .m-brief { display: none; }
