/* ================= v79: ドパガキモード effects layer =================
   Everything below is inert unless the mode is ON: the layers
   are display:none / class-gated, and every element is
   pointer-events:none so the game stays fully tappable. */
#dopaLasers { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; display: none; }
body.dopa-club #dopaLasers { display: block; }
#dopaLasers .beam {
  position: absolute; left: -30%; width: 160%; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, #ff004c, #ff8a00, #ffee00, #00e676, #00b0ff, #d500f9, #ff004c);
  background-size: 200% 100%;
  mix-blend-mode: screen; opacity: .55; filter: blur(1px);
  animation: dopaBeamHue 3s linear infinite;
}
@keyframes dopaBeamHue { from { background-position: 0% 0; } to { background-position: 200% 0; } }
body.dopa-club #table { animation: dopaHueSpin 7s linear infinite; }
@keyframes dopaHueSpin { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
body.dopa-club { background: #12041f; }
/* v80: while the in-scene club rig is running (3D stage), the
   v79 CSS lasers and hue-spin stand down — the Three.js scene
   (spotlights, lasers) does the work instead.
   On the 2D board the class is never added and v79 CSS stays. */
body.dopa-club-3d #dopaLasers { display: none; }
body.dopa-club-3d #table { animation: none; }
/* v80 heat levels (riichi headcount): the 2D CSS lasers spin
   faster as more players declare. v95: the heat-3 neon frame
   that used to pulse around the SCREEN edge is gone — at
   three riichi the rainbow now lives on the 3D table's own
   wooden frame instead (see the v87 rainbow step in the
   stage: woodMat / lipMat join the tiles' hue cycle). */
body.dopa-heat-2 #dopaLasers .beam { animation-duration: 1.5s !important; }
body.dopa-heat-3 #dopaLasers .beam { animation-duration: .7s !important; }
@media (prefers-reduced-motion: reduce) {
  body.dopa-heat-2 #dopaLasers .beam, body.dopa-heat-3 #dopaLasers .beam { animation-duration: 3s !important; }
}
#dopaFx { position: fixed; inset: 0; z-index: 65; pointer-events: none; overflow: hidden; }
.dopa-pop {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%);
  font-weight: 900; font-size: clamp(30px, 8.5vw, 58px); letter-spacing: .04em;
  white-space: nowrap; text-align: center;
  -webkit-text-stroke: 2px rgba(0,0,0,.55);
  text-shadow: 0 4px 0 rgba(0,0,0,.45), 0 10px 28px rgba(0,0,0,.6);
  animation: dopaPopIn 1.25s cubic-bezier(.2,1.6,.35,1) forwards;
}
.dopa-pop.k-shanten { color: #ffe93d; }
.dopa-pop.k-tenpai { color: #ff4d6d; font-size: clamp(38px, 11vw, 74px); }
.dopa-pop.k-dora { color: #ffb300; }
.dopa-pop.k-yakuhai { color: #4dd0ff; }
@keyframes dopaPopIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-6deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(2deg); }
  30% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  78% { opacity: 1; transform: translate(-50%, -58%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -78%) scale(1.05); }
}
#dopaConfetti { position: fixed; inset: 0; z-index: 66; pointer-events: none; display: none; }
/* v89: the four-riichi blast as a DOM layer (inside #dopaFx,
   z-index 65 — above the table AND above the draw card's
   overlay at 40). v84 put the blast only inside the 3D
   scene and fired the draw processing in the same tick, so
   the result card covered it instantly and 2D tables got
   nothing at all; this layer is what the player actually
   sees, on either board, while runLoop holds the processing
   back for ~1.1s (v97: then play continues in dopa mode;
   OFF goes on to the draw card). */
.dopa-suucha-blast { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.dopa-suucha-flash {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,246,218,.95) 0%, rgba(255,210,80,.55) 34%, rgba(255,120,40,.18) 62%, rgba(255,120,40,0) 80%);
  animation: suuchaFlash 1.15s ease-out forwards;
}
@keyframes suuchaFlash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
.dopa-suucha-ring {
  position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -61px 0 0 -61px;
  border: 6px solid #ffe93d; border-radius: 50%;
  box-shadow: 0 0 34px rgba(255,233,61,.8), inset 0 0 34px rgba(255,233,61,.5);
  animation: suuchaRing 1.05s cubic-bezier(.15,.6,.35,1) forwards;
}
@keyframes suuchaRing {
  0% { transform: scale(.25); opacity: 1; }
  100% { transform: scale(6.2); opacity: 0; }
}
.dopa-suucha-text {
  position: relative; font-weight: 900; letter-spacing: .06em; white-space: nowrap;
  font-size: clamp(38px, 11vw, 76px); color: #ffe93d;
  -webkit-text-stroke: 2px rgba(0,0,0,.55);
  text-shadow: 0 4px 0 rgba(0,0,0,.45), 0 12px 34px rgba(0,0,0,.65);
  animation: suuchaText 1.15s cubic-bezier(.2,1.4,.35,1) forwards;
}
@keyframes suuchaText {
  0% { opacity: 0; transform: scale(.3) rotate(-5deg); }
  16% { opacity: 1; transform: scale(1.15) rotate(1.5deg); }
  30% { transform: scale(1) rotate(0deg); }
  78% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.06) translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .dopa-suucha-ring { animation: none; opacity: 0; }
  .dopa-suucha-flash { animation-duration: .5s; }
  .dopa-suucha-text { animation-duration: .9s; }
}
.tile.hand.dopa-glow { animation: dopaGlowPulse .5s ease-in-out 3; }
@keyframes dopaGlowPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,179,0,.0), 0 2px 3px rgba(0,0,0,.28); }
  50% { box-shadow: 0 0 0 3px #ffb300, 0 0 22px 6px rgba(255,179,0,.85); }
}
@media (prefers-reduced-motion: reduce) {
  body.dopa-club #table { animation: none; }
  #dopaLasers .beam { animation: none; }
  .dopa-pop { animation-duration: .9s; }
}
