/* ==========================================================================
 * GYUL! HAP! (결! 합! / 结!合!) — Broadcast Studio Geometry Stage
 * ========================================================================== */

.gh-arena {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  align-items: start;
  position: relative;
}

@media (max-width: 880px) {
  .gh-arena {
    grid-template-columns: 1fr;
  }
}

/* Top Scoreboard & Round Strip */
.gh-header-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--tg-radius-md);
  background: linear-gradient(135deg, rgba(16, 20, 34, 0.92), rgba(9, 11, 19, 0.96));
  border: 1px solid var(--tg-border);
  box-shadow: var(--tg-shadow-card);
}

.gh-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--tg-border-subtle);
  transition: border-color 0.22s var(--tg-ease), box-shadow 0.22s var(--tg-ease), background 0.22s;
  position: relative;
}

.gh-score-card.is-right {
  flex-direction: row-reverse;
  text-align: right;
}

.gh-score-card.is-active {
  border-color: var(--tg-gold-bright);
  background: linear-gradient(135deg, rgba(228, 185, 91, 0.14), rgba(217, 27, 58, 0.08));
  box-shadow: 0 0 24px rgba(228, 185, 91, 0.22), inset 0 0 18px rgba(228, 185, 91, 0.08);
}

.gh-score-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gh-score-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--tg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-score-tag {
  font-size: 11px;
  font-family: var(--tg-font-mono);
  color: var(--tg-ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gh-score-num {
  font-family: var(--tg-font-mono);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--tg-gold-bright);
  text-shadow: 0 0 16px var(--tg-gold-glow);
  min-width: 44px;
  text-align: center;
}

.gh-score-num.is-negative {
  color: #ff6b86;
  text-shadow: 0 0 14px var(--tg-garnet-glow);
}

.gh-round-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
}

.gh-round-pill {
  font-family: var(--tg-font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--tg-gold-bright);
  text-transform: uppercase;
  white-space: nowrap;
}

.gh-round-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.gh-round-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.gh-round-dot.is-done {
  background: var(--tg-gold);
  border-color: var(--tg-gold-bright);
}

.gh-round-dot.is-current {
  width: 11px;
  height: 11px;
  background: var(--tg-garnet-bright);
  border-color: #fff;
  box-shadow: 0 0 10px var(--tg-garnet-bright);
}

.gh-stale-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--tg-font-mono);
  font-size: 10.5px;
  color: var(--tg-ink-muted);
}

.gh-stale-pip {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.gh-stale-pip.is-lit {
  background: var(--tg-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

/* Main 3x3 Stage Column */
.gh-stage-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

/* Dramatic Call Banner / Bonus Prompt */
.gh-status-banner {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(14, 18, 30, 0.9);
  border: 1px solid var(--tg-border);
  font-size: 13.5px;
  font-weight: 600;
  min-height: 46px;
}

.gh-status-banner.is-bonus {
  background: linear-gradient(90deg, rgba(217, 27, 58, 0.28), rgba(228, 185, 91, 0.22));
  border-color: var(--tg-garnet-bright);
  box-shadow: 0 0 28px rgba(255, 46, 84, 0.35);
  animation: gh-bonus-pulse 1.1s ease-in-out infinite;
}

.gh-status-banner.is-gyul-win {
  background: linear-gradient(90deg, rgba(228, 185, 91, 0.28), rgba(34, 211, 238, 0.2));
  border-color: var(--tg-gold-bright);
  box-shadow: 0 0 32px rgba(228, 185, 91, 0.38);
}

@keyframes gh-bonus-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 46, 84, 0.28); }
  50% { box-shadow: 0 0 34px rgba(255, 46, 84, 0.62); }
}

/* 3x3 Geometric Board Matrix */
.gh-board-shell {
  position: relative;
  width: min(100%, 490px);
  padding: 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.14), transparent 55%),
    linear-gradient(165deg, rgba(20, 25, 42, 0.96), rgba(8, 10, 18, 0.99));
  border: 1.5px solid var(--tg-border-strong);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.72),
    inset 0 0 42px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.gh-board-shell.is-gyul-burst {
  animation: gh-gyul-shock 0.75s var(--tg-ease);
}

@keyframes gh-gyul-shock {
  0% { box-shadow: 0 0 0 0 rgba(228, 185, 91, 0.9), 0 24px 60px rgba(0, 0, 0, 0.72); }
  50% { box-shadow: 0 0 55px 12px rgba(255, 46, 84, 0.65), 0 24px 60px rgba(0, 0, 0, 0.72); }
  100% { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72); }
}

.gh-board-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gh-triad-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.gh-triad-line {
  stroke: var(--tg-cyan);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: rgba(34, 211, 238, 0.09);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.85));
}

.gh-triad-line.is-ok {
  stroke: var(--tg-gold-bright);
  fill: rgba(228, 185, 91, 0.14);
  filter: drop-shadow(0 0 12px rgba(228, 185, 91, 0.95));
}

.gh-triad-line.is-fail {
  stroke: var(--tg-garnet-bright);
  fill: rgba(255, 46, 84, 0.14);
  filter: drop-shadow(0 0 12px rgba(255, 46, 84, 0.95));
}

/* Individual Geometric Tile */
.gh-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14%;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.16s var(--tg-ease), border-color 0.16s var(--tg-ease),
    box-shadow 0.16s var(--tg-ease);
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.55),
    0 12px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.gh-tile:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
  border-color: var(--tg-gold);
}

.gh-tile:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.gh-tile.bg-black {
  background: radial-gradient(circle at 35% 25%, #1d2233 0%, #0b0d14 75%, #06070c 100%);
  border-color: rgba(228, 185, 91, 0.24);
}

.gh-tile.bg-gray {
  background: radial-gradient(circle at 35% 25%, #8490a6 0%, #5b657a 68%, #475063 100%);
  border-color: rgba(226, 232, 240, 0.35);
}

.gh-tile.bg-white {
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #f1ece0 72%, #dfd8c8 100%);
  border-color: rgba(255, 255, 255, 0.85);
}

.gh-tile.is-selected {
  border-color: var(--tg-cyan) !important;
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 8px 0 rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(34, 211, 238, 0.65),
    0 0 28px rgba(34, 211, 238, 0.55);
  z-index: 4;
}

.gh-tile.is-flash-ok {
  border-color: var(--tg-gold-bright) !important;
  box-shadow:
    0 0 0 3px rgba(255, 240, 194, 0.85),
    0 0 32px rgba(228, 185, 91, 0.85);
  z-index: 5;
}

.gh-tile.is-flash-fail {
  border-color: var(--tg-garnet-bright) !important;
  box-shadow:
    0 0 0 3px rgba(255, 46, 84, 0.85),
    0 0 32px rgba(255, 46, 84, 0.85);
  animation: gh-shake 0.35s ease-in-out;
}

@keyframes gh-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gh-tile-num {
  position: absolute;
  top: 7px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tg-font-mono);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  background: rgba(8, 10, 17, 0.78);
  color: var(--tg-gold-bright);
  border: 1px solid rgba(228, 185, 91, 0.4);
  z-index: 2;
}

.gh-tile.is-selected .gh-tile-num {
  background: var(--tg-cyan);
  color: #041017;
  border-color: #fff;
}

.gh-tile-svg {
  width: 78%;
  height: 78%;
  display: block;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.38));
  transition: transform 0.18s var(--tg-ease);
}

.gh-tile.is-selected .gh-tile-svg {
  transform: scale(1.06);
}

/* Floating Score Burst */
.gh-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  pointer-events: none;
  font-family: var(--tg-font-display);
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
  padding: 10px 26px;
  border-radius: 16px;
  animation: gh-burst-pop 1.15s var(--tg-ease) forwards;
}

.gh-burst.is-hap {
  color: var(--tg-gold-bright);
  background: rgba(10, 14, 24, 0.88);
  border: 2px solid var(--tg-gold-bright);
  text-shadow: 0 0 24px rgba(228, 185, 91, 0.9);
  box-shadow: 0 0 40px rgba(228, 185, 91, 0.45);
}

.gh-burst.is-gyul {
  color: #fff;
  background: linear-gradient(135deg, rgba(217, 27, 58, 0.94), rgba(228, 185, 91, 0.92));
  border: 2px solid #fff0c2;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.65);
  box-shadow: 0 0 60px rgba(255, 46, 84, 0.7);
}

.gh-burst.is-penalty {
  color: #ff99ab;
  background: rgba(45, 5, 14, 0.92);
  border: 2px solid var(--tg-garnet-bright);
  text-shadow: 0 0 20px rgba(255, 46, 84, 0.85);
}

@keyframes gh-burst-pop {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  75% { opacity: 1; transform: translate(-50%, -56%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -72%) scale(0.95); }
}

/* Tactical Broadcast Controls Console */
.gh-controls {
  width: min(100%, 490px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gh-selected-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 15, 25, 0.86);
  border: 1px solid var(--tg-border-subtle);
  font-size: 12.5px;
  color: var(--tg-ink-muted);
}

.gh-sel-slots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gh-sel-slot {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tg-font-mono);
  font-weight: 800;
  font-size: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--tg-ink-faint);
}

.gh-sel-slot.is-filled {
  border-style: solid;
  border-color: var(--tg-cyan);
  background: rgba(34, 211, 238, 0.16);
  color: #a5f3fc;
}

.gh-btn-row {
  display: grid;
  grid-template-columns: 1.35fr 1.15fr 0.72fr;
  gap: 10px;
}

@media (max-width: 520px) {
  .gh-btn-row {
    grid-template-columns: 1fr 1fr;
  }
  .gh-btn-row .gh-pass-btn {
    grid-column: 1 / -1;
  }
}

.gh-hap-btn {
  min-height: 54px;
  font-family: var(--tg-font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.gh-gyul-btn {
  min-height: 54px;
  font-family: var(--tg-font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  position: relative;
}

.gh-gyul-btn.is-pulsing:not(:disabled) {
  animation: gh-gyul-glow 1.5s ease-in-out infinite;
}

@keyframes gh-gyul-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(217, 27, 58, 0.45); }
  50% { box-shadow: 0 8px 36px rgba(255, 46, 84, 0.85), 0 0 0 3px rgba(255, 46, 84, 0.35); }
}

.gh-pass-btn {
  min-height: 54px;
  font-weight: 700;
}

/* Right Ledger Column */
.gh-ledger-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gh-ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tg-gold);
  border-bottom: 1px solid var(--tg-border-subtle);
  padding-bottom: 8px;
}

.gh-hap-chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
}

.gh-hap-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--tg-border-subtle);
  font-family: var(--tg-font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.gh-hap-chip:hover {
  border-color: var(--tg-gold);
  background: rgba(228, 185, 91, 0.08);
}

.gh-hap-chip.is-missed {
  border-color: rgba(255, 46, 84, 0.5);
  background: rgba(217, 27, 58, 0.12);
  color: #ffb3c1;
}

.gh-hap-triple {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--tg-gold-bright);
}

.gh-hap-owner {
  font-family: var(--tg-font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--tg-ink-muted);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-legend-box {
  padding-top: 10px;
  border-top: 1px solid var(--tg-border-subtle);
  font-size: 11.5px;
  color: var(--tg-ink-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gh-legend-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.gh-round-recap {
  width: min(100%, 490px);
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(228, 185, 91, 0.14), rgba(14, 18, 30, 0.94));
  border: 1px solid var(--tg-border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
