/* Interactive American Mahjong Window-of-Opportunity Timeline & Tournament Priority Referee (with Tactile Parlor Motion) */

.guide-content,
.guide-section {
  min-width: 0;
}

.vs-matrix-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.eq-card {
  background: var(--sheet);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0 24px;
  box-shadow: var(--shadow-card);
}

.eq-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.eq-group-label {
  display: block;
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.eq-play-btn {
  appearance: none;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: var(--parchment);
  color: var(--ink-pine);
  font: 700 12px/1.2 var(--sans);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 140ms ease;
}

.eq-play-btn:hover {
  background: var(--green);
  color: #fffdf8;
}

.eq-play-btn[aria-pressed="true"] {
  background: var(--green);
  color: #fffdf8;
}

html[data-salon-theme="baize"] .eq-play-btn:hover,
html[data-salon-theme="baize"] .eq-play-btn[aria-pressed="true"] {
  color: #14251d;
}

.eq-step-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

.eq-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.eq-btn {
  appearance: none;
  min-height: 52px;
  padding: 8px 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink-pine);
  font: 700 12.5px/1.25 var(--sans);
  text-align: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.eq-btn:active {
  transform: scale(0.98);
}

.eq-btn small {
  display: block;
  font: 500 10px/1.2 var(--sans);
  opacity: 0.82;
  margin-top: 3px;
}

.eq-btn:hover:not(:disabled):not([aria-pressed="true"]) {
  background: var(--parchment);
  border-color: var(--green);
  transform: translateY(-1px);
}

.eq-btn[aria-pressed="true"],
.eq-btn[aria-pressed="true"]:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fffdf8;
}

html[data-salon-theme="baize"] .eq-btn[aria-pressed="true"],
html[data-salon-theme="baize"] .eq-btn[aria-pressed="true"]:hover {
  color: #14251d;
}

/* Felt Window-of-Opportunity SVG Stage */
.eq-felt-stage {
  border-radius: 11px;
  background: linear-gradient(180deg, #163327 0%, #0e241b 100%);
  border: 1px solid #2a5542;
  padding: 14px;
  color: #f6f0e3;
  margin-bottom: 14px;
}

.eq-stage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.eq-stage-title {
  font: 700 13px/1.3 var(--sans);
  color: #fffdf8;
}

.eq-window-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font: 800 10.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 240ms ease, color 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.eq-window-pill.open {
  background: #a7f3d0;
  color: #06281b;
}

.eq-window-pill.closed {
  background: #fecaca;
  color: #7f1d1d;
  animation: eqLockShake 340ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.eq-stage-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: rgba(8, 22, 16, 0.45);
}

/* SVG Parlor Motion Keyframes */
@keyframes eqCallPulse {
  0% {
    opacity: 0.72;
    transform: scale(0.96);
  }
  70% {
    opacity: 0;
    transform: scale(1.22);
  }
  100% {
    opacity: 0;
    transform: scale(1.24);
  }
}

@keyframes eqHandFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes eqRailTap {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-6px); }
  65% { transform: translateY(1px); }
}

@keyframes eqRackSnap {
  0% { transform: translateY(-18px) scale(1.06); opacity: 0.5; }
  70% { transform: translateY(2px) scale(0.98); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes eqThrowSlide {
  0% { transform: translate(120px, -24px) rotate(10deg); opacity: 0.4; }
  100% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
}

@keyframes eqLockShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  65% { transform: translateX(3px); }
}

@keyframes eqTileDrop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.eq-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: eqCallPulse 1.9s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.eq-anim-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: eqHandFloat 1.8s ease-in-out infinite;
}

.eq-anim-tap {
  transform-box: fill-box;
  transform-origin: center;
  animation: eqRailTap 1.3s ease-in-out infinite;
}

.eq-anim-snap {
  transform-box: fill-box;
  transform-origin: center;
  animation: eqRackSnap 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eq-anim-throw {
  transform-box: fill-box;
  transform-origin: center;
  animation: eqThrowSlide 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eq-verdict-note {
  margin: 0;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--parchment);
  border: 1px solid var(--line-strong);
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--ink-pine);
  transition: background 200ms ease;
}

/* Priority Referee Stage */
.eq-dispute-box {
  border-radius: 10px;
  background: linear-gradient(180deg, #173528 0%, #10261d 100%);
  border: 1px solid #2b5643;
  padding: 14px;
  margin-bottom: 12px;
  color: #f6f0e3;
}

.eq-dispute-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.eq-claim-card {
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(246, 240, 227, 0.16);
  transition: background 240ms ease, border-color 240ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
}

.eq-claim-card.winner {
  background: rgba(110, 231, 183, 0.14);
  border-color: #6ee7b7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.eq-claim-card.loser {
  opacity: 0.72;
  border-color: rgba(248, 113, 113, 0.42);
}

.eq-claim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.eq-claim-seat {
  font: 700 12.5px/1.2 var(--sans);
  color: #fffdf8;
}

.eq-claim-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font: 800 9.5px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.eq-claim-tag.win {
  background: #a7f3d0;
  color: #06281b;
}

.eq-claim-tag.lose {
  background: rgba(254, 202, 202, 0.22);
  color: #fecaca;
}

.eq-tiles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.eq-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 50px;
  padding: 3px 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf9 0%, #efe3c8 100%);
  border: 1px solid #cdb992;
  box-shadow: 0 3.5px 0 #1f6b4a, 0 4px 8px rgba(0, 0, 0, 0.25);
  font: 800 13px/1.05 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #163024;
  animation: eqTileDrop 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eq-tile-d1 { animation-delay: 55ms; }
.eq-tile-d2 { animation-delay: 110ms; }

.eq-tile small {
  display: block;
  font: 700 8.5px/1 var(--sans);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.78;
  margin-top: 3px;
}

.eq-tile.red { color: #b92b27; }
.eq-tile.green { color: #166534; }
.eq-tile.blue { color: #1d4ed8; }
.eq-tile.joker {
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
}

.eq-ruling-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.eq-ruling-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font: 800 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}

.eq-ruling-title {
  font: 700 14.5px/1.3 var(--sans);
  color: var(--ink-pine);
}

.faq-item summary {
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .eq-pulse-ring,
  .eq-anim-float,
  .eq-anim-tap,
  .eq-anim-snap,
  .eq-anim-throw,
  .eq-tile,
  .eq-window-pill.closed {
    animation: none !important;
  }

  .eq-btn,
  .eq-claim-card,
  .eq-window-pill {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .eq-card {
    padding: 15px;
  }

  .eq-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eq-case-grid,
  .eq-dispute-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
