/* =====================================================================
   Minigolf: el hoyo en 3D ocupa toda la pantalla (usa el armado de la
   Ruleta Rusa: rusa-stage, rusa-hud, rusa-panel…) y esto suma lo propio.
   ===================================================================== */

body:has(#screen-golf:not([hidden])) { overflow: hidden; }
.golf-stage { background: #a9cbe6; }
.golf-stage::before { background: radial-gradient(ellipse at 50% 45%, transparent 65%, rgba(0, 0, 0, 0.3) 100%); }
.golf-canvas { cursor: grab; }
.golf-canvas:active { cursor: grabbing; }

/* Golpes de cada uno en el hoyo. */
.golf-ticker {
  position: absolute; left: 50%; top: 142px; translate: -50% 0; display: flex; gap: 6px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none;
  padding: 5px 8px; border-radius: 14px; background: rgba(10, 6, 22, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.golf-ticker[hidden] { display: none; }
.gt-p { display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 5px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); white-space: nowrap; font-size: 0.82rem; }
.gt-p i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.5); }
.gt-p b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.gt-p em { font-style: normal; font-weight: 900; color: var(--neo-gold); min-width: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.gt-p small { color: var(--neo-muted); font-size: 0.7rem; font-variant-numeric: tabular-nums; }
.gt-p.gt-me { box-shadow: 0 0 0 2px var(--neo-cyan); }
.gt-p.done em { color: var(--neo-green, #39f0a5); }
.gt-p.away { opacity: 0.55; }

/* Avisos chiquitos (castigos, máximos). */
.golf-notes { position: absolute; left: 50%; top: 186px; translate: -50% 0; display: grid; gap: 4px; justify-items: center; pointer-events: none; }
.golf-note { padding: 4px 12px; border-radius: 10px; background: rgba(10, 6, 22, 0.78); font-size: 0.85rem; font-weight: 700; animation: gn-in 4s ease forwards; }
@keyframes gn-in { 0% { opacity: 0; translate: 0 -6px; } 8% { opacity: 1; translate: 0 0; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* Carteles grandes: hoyo nuevo, birdie, hoyo en uno. */
.golf-fx { position: absolute; left: 50%; top: 38%; translate: -50% -50%; display: grid; justify-items: center; text-align: center; opacity: 0; pointer-events: none; z-index: 2; }
.golf-fx b { font: 900 clamp(2.2rem, 8vw, 4.6rem) Georgia, "Times New Roman", serif; letter-spacing: 0.02em; color: #fff; -webkit-text-stroke: 2px rgba(0, 0, 0, 0.55); paint-order: stroke fill; text-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.golf-fx span { font-weight: 800; font-size: 1.05rem; padding: 4px 14px; border-radius: 10px; background: rgba(10, 6, 22, 0.7); margin-top: 6px; }
.golf-fx.hole b { color: #fff8e1; }
.golf-fx.ace b { color: #ffd43b; text-shadow: 0 0 40px rgba(255, 200, 0, 0.8), 3px 3px 0 #c92a2a; font-size: clamp(2.4rem, 9vw, 5.4rem); }
.golf-fx.birdie b { color: #8ce99a; }
.golf-fx.par b { color: #e7f5ff; font-size: clamp(1.8rem, 6vw, 3.2rem); }
.golf-fx.show { animation: gfx var(--fx-ms, 2200ms) cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }
@keyframes gfx {
  0% { opacity: 0; scale: 0.6; }
  12% { opacity: 1; scale: 1.08; }
  22% { scale: 1; }
  82% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1.04; }
}

/* Barra de fuerza (mientras se apunta). */
.golf-power {
  position: absolute; left: 16px; top: 50%; translate: 0 -50%; display: grid; justify-items: center; gap: 6px; padding: 10px 10px 8px; border-radius: 18px;
  background: rgba(10, 6, 22, 0.72); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none;
}
.golf-power[hidden] { display: none; }
.gp-bar { position: relative; width: 22px; height: 200px; border-radius: 12px; background: rgba(0, 0, 0, 0.55); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.gp-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p, 0) * 100%); background: linear-gradient(0deg, #2f9e44, #fab005 55%, #e03131); background-size: 100% 200px; background-position: bottom; border-radius: 12px; transition: height 0.05s linear; }
.golf-power b { font: 900 1.05rem system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.golf-power small { font-size: 0.7rem; color: var(--neo-muted); white-space: nowrap; }

/* Reacciones: en fila arriba del panel (al costado quedan la fuerza y las herramientas). */
#golf-emotes { display: flex; flex-direction: row; left: 50%; right: auto; top: auto; translate: -50% 0; bottom: calc(var(--rr-panel-h, 130px) + 26px); gap: 6px; }

/* Girar la cámara. */
.golf-cam { position: absolute; left: 12px; top: 72px; display: flex; flex-direction: column; gap: 8px; }
.golf-cam[hidden] { display: none; }

/* Cómo se tira. */
.golf-howto { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--neo-muted); line-height: 1.35; }
.golf-howto b { color: var(--neo-text); }
.gh-ic { font-size: 1.8rem; animation: gh-pull 1.8s ease-in-out infinite; }
@keyframes gh-pull { 0%, 100% { translate: 0 0; } 50% { translate: -6px 8px; } }

/* Tarjeta de golpes. */
.golf-card {
  position: absolute; left: 50%; top: 50%; translate: -50% -55%; width: min(640px, calc(100% - 24px)); max-height: 62%; z-index: 4; pointer-events: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(250, 246, 234, 0.97), rgba(236, 228, 206, 0.97)); color: #2b2113; border: 2px solid #c9a96a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); animation: modal-in 0.3s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.golf-card[hidden] { display: none; }
.gc-head { display: flex; justify-content: space-between; align-items: center; font-family: Georgia, serif; font-size: 1.1rem; }
.gc-head .icon-btn { color: #2b2113; width: 32px; height: 32px; }
.gc-scroll { overflow: auto; }
.gc-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.gc-table th, .gc-table td { border: 1px solid rgba(90, 70, 40, 0.3); padding: 5px 6px; text-align: center; min-width: 28px; }
.gc-table th { background: #2b8a3e; color: #fff; font-weight: 800; }
.gc-table th.cur { background: #e8590c; }
.gc-table tr.par td { background: rgba(43, 138, 62, 0.12); font-weight: 700; color: #2b8a3e; }
.gc-table td.who { text-align: left; font-weight: 800; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.gc-table td.who i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.gc-table tr.gc-me td { background: rgba(46, 230, 255, 0.12); }
.gc-table td.ace { background: #ffd43b; font-weight: 900; border-radius: 50%; }
.gc-table td.under { color: #c92a2a; font-weight: 900; }
.gc-table td.even { font-weight: 700; }
.gc-table td.over { color: #364fc7; }
.gc-table td.live { outline: 2px dashed #e8590c; outline-offset: -3px; }
.gc-table td.tot { font-weight: 900; }
.gc-table td.tot small { display: block; font-size: 0.7rem; color: #6b5a3c; }

.gr-strokes { font-size: 0.85rem; color: var(--neo-muted); white-space: nowrap; }

/* Lobby. */
.golf-card-lobby .tc-meta b.gold { color: var(--neo-gold); }
.tc-status.practice { background: rgba(57, 240, 165, 0.16); color: var(--neo-green, #39f0a5); }

@media (max-width: 700px) {
  .golf-ticker { top: 100px; font-size: 0.74rem; padding: 4px 6px; gap: 4px; }
  .gt-p { font-size: 0.72rem; padding: 2px 6px 2px 4px; gap: 3px; }
  .gt-p b { max-width: 58px; }
  .gt-p small { display: none; }
  .golf-notes { top: 136px; }
  .golf-power { left: 8px; padding: 8px 6px 6px; }
  .gp-bar { height: 150px; width: 18px; }
  .golf-cam { top: auto; left: auto; right: 8px; bottom: calc(var(--rr-panel-h, 150px) + 60px); flex-direction: row; }
  .golf-howto { font-size: 0.8rem; }
  .gh-ic { font-size: 1.4rem; }
  .golf-card { max-height: 70%; padding: 10px; }
  .gc-table { font-size: 0.78rem; }
  .gc-table th, .gc-table td { padding: 4px 3px; min-width: 22px; }
}
@media (max-height: 520px) {
  .golf-ticker { top: 50px; left: auto; right: 110px; translate: none; max-width: 50%; }
  .golf-power { top: 56%; }
  .gp-bar { height: 110px; }
}
