/* ==========================================================================
 * SAME NUMBER HUNT (寻找相同数字) — High-Voltage Broadcast Math Vault
 * ========================================================================== */

.snh-arena {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Target Vault & Score Race Header */
.snh-vault-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--tg-radius-lg);
  background:
    radial-gradient(ellipse 50% 100% at 50% 0%, rgba(56, 189, 248, 0.2), transparent 70%),
    linear-gradient(165deg, rgba(16, 20, 36, 0.96), rgba(7, 9, 16, 0.98));
  border: 1px solid var(--tg-border-strong);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.68);
}

.snh-score-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 12, 22, 0.78);
  border: 1px solid var(--tg-border-subtle);
}

.snh-score-card.is-active-cyan {
  border-color: var(--tg-cyan);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.28);
}

.snh-score-card.is-active-garnet {
  border-color: var(--tg-garnet-bright);
  box-shadow: 0 0 24px rgba(255, 46, 84, 0.3);
}

.snh-score-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 14px;
}

.snh-score-num {
  font-family: var(--tg-font-mono);
  font-size: 22px;
  font-weight: 900;
  color: var(--tg-gold-bright);
}

.snh-score-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.snh-score-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s var(--tg-ease);
}

.snh-score-fill.is-cyan {
  background: linear-gradient(90deg, #06b6d4, #67e8f9);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.65);
}

.snh-score-fill.is-garnet {
  background: linear-gradient(90deg, #d91b3a, #ff5d7a);
  box-shadow: 0 0 12px rgba(255, 46, 84, 0.65);
}

/* Central Lotto Target Dial Sphere */
.snh-target-orb {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.22), transparent 45%),
    radial-gradient(circle at 50% 50%, #172544 0%, #091020 70%, #05070e 100%);
  border: 2.5px solid var(--tg-cyan);
  box-shadow:
    0 0 36px rgba(56, 189, 248, 0.48),
    inset 0 0 24px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.snh-target-orb.is-sqrt-bonus {
  border-color: var(--tg-gold-bright);
  box-shadow:
    0 0 42px rgba(228, 185, 91, 0.62),
    inset 0 0 24px rgba(228, 185, 91, 0.28);
}

.snh-target-orb-label {
  font-family: var(--tg-font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #7dd3fc;
  text-transform: uppercase;
}

.snh-target-orb-num {
  font-family: var(--tg-font-mono);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.78);
}

.snh-target-orb-tag {
  font-family: var(--tg-font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--tg-gold-bright);
  margin-top: 2px;
}

/* Live Glowing Equation Conduit */
.snh-equation-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(9, 12, 22, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
  flex-wrap: wrap;
}

.snh-equation-bar.is-success {
  border-color: var(--tg-emerald);
  background: rgba(10, 32, 20, 0.92);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.36);
}

.snh-equation-bar.is-fail {
  border-color: var(--tg-garnet-bright);
  background: rgba(38, 10, 18, 0.92);
  box-shadow: 0 0 30px rgba(255, 46, 84, 0.36);
}

.snh-eq-slot {
  min-width: 72px;
  height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
  background: rgba(20, 26, 44, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--tg-font-mono);
  font-size: 17px;
  font-weight: 800;
  color: var(--tg-ink-faint);
}

.snh-eq-slot.is-filled {
  border-style: solid;
  border-color: var(--tg-cyan);
  color: #e0f2fe;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.32);
}

.snh-eq-slot.is-op.is-filled {
  border-color: var(--tg-violet);
  color: #e9d5ff;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.35);
}

.snh-eq-slot-role {
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.snh-eq-equals {
  font-family: var(--tg-font-mono);
  font-size: 22px;
  font-weight: 900;
  color: var(--tg-gold-bright);
}

/* Main Grid: 4x4 Math Flip Wall + Buzzer / Log Column */
.snh-body {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.snh-wall-card {
  padding: 16px;
  border-radius: var(--tg-radius-lg);
  background: linear-gradient(165deg, rgba(16, 20, 34, 0.96), rgba(7, 9, 15, 0.98));
  border: 1px solid var(--tg-border-strong);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72);
}

.snh-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.snh-tile {
  aspect-ratio: 1 / 1;
  perspective: 900px;
  padding: 0;
  background: none;
  border: none;
  position: relative;
}

.snh-tile:disabled {
  opacity: 1;
  cursor: default;
}

.snh-tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.snh-tile.is-flipped .snh-tile-inner {
  transform: rotateY(180deg);
}

.snh-tile-face {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.snh-tile-front {
  background:
    radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.1), transparent 60%),
    linear-gradient(165deg, #1d253e 0%, #0d1221 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.34);
  box-shadow: 0 5px 0 #06080f, 0 10px 20px rgba(0, 0, 0, 0.55);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}

.snh-tile.is-clickable:hover .snh-tile-front {
  border-color: var(--tg-gold-bright);
  box-shadow: 0 6px 0 #06080f, 0 0 24px rgba(228, 185, 91, 0.46);
  transform: translateY(-2px);
}

.snh-tile.is-picked .snh-tile-front {
  border-color: var(--tg-gold-bright);
  background: linear-gradient(165deg, #3b2d12 0%, #1d1507 100%);
  box-shadow: 0 0 24px rgba(228, 185, 91, 0.55);
}

.snh-tile-letter {
  font-family: var(--tg-font-display);
  font-size: 30px;
  font-weight: 800;
  color: #e0f2fe;
}

.snh-pick-order {
  position: absolute;
  top: 6px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--tg-font-mono);
  font-size: 10px;
  font-weight: 900;
  background: var(--tg-gold);
  color: #0b0c12;
}

/* Revealed Number / Operator Face */
.snh-tile-back {
  transform: rotateY(180deg);
  border: 2px solid var(--tg-cyan);
  background: radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.22), #090e1b 82%);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.32);
}

.snh-tile.is-op .snh-tile-back {
  border-color: var(--tg-violet);
  background: radial-gradient(circle at 50% 30%, rgba(167, 139, 250, 0.28), #170e26 82%);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.42);
}

.snh-tile.is-sqrt .snh-tile-back {
  border-color: var(--tg-gold-bright);
  background: radial-gradient(circle at 50% 30%, rgba(228, 185, 91, 0.34), #221706 82%);
  box-shadow: 0 0 28px rgba(228, 185, 91, 0.55);
}

.snh-tile.is-hint-glow .snh-tile-back {
  border-color: var(--tg-gold-bright);
  box-shadow: 0 0 34px rgba(228, 185, 91, 0.65);
}

.snh-tile-corner {
  position: absolute;
  top: 5px;
  left: 7px;
  font-family: var(--tg-font-mono);
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
}

.snh-tile-val {
  font-family: var(--tg-font-mono);
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 16px rgba(56, 189, 248, 0.5);
}

.snh-tile.is-sqrt .snh-tile-val {
  font-size: 18px;
  color: var(--tg-gold-bright);
}

.snh-tile-type {
  font-family: var(--tg-font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 2px;
}

/* Right Buzzer & Control Console */
.snh-console {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.snh-buzzer-panel {
  padding: 20px;
  border-radius: var(--tg-radius-lg);
  background: var(--tg-glass);
  border: 1px solid var(--tg-border);
  box-shadow: var(--tg-shadow-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.snh-buzzer-btn {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #ff7a93 0%, #e11d48 48%, #7a091e 100%);
  border: 5px solid #ffd1db;
  color: #fff;
  font-family: var(--tg-font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow:
    0 10px 0 #420410,
    0 0 46px rgba(255, 46, 84, 0.65),
    inset 0 4px 14px rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.12s var(--tg-ease), box-shadow 0.12s;
  animation: snh-buzz-pulse 1.2s ease-in-out infinite;
}

.snh-buzzer-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 12px 0 #420410,
    0 0 60px rgba(255, 46, 84, 0.85),
    inset 0 4px 16px rgba(255, 255, 255, 0.48);
}

.snh-buzzer-btn:active:not(:disabled) {
  transform: translateY(6px) scale(0.97);
  box-shadow: 0 4px 0 #420410, 0 0 36px rgba(255, 46, 84, 0.8);
}

.snh-buzzer-btn:disabled {
  animation: none;
  filter: grayscale(0.55);
  opacity: 0.5;
}

@keyframes snh-buzz-pulse {
  0%, 100% { box-shadow: 0 10px 0 #420410, 0 0 36px rgba(255, 46, 84, 0.55), inset 0 4px 14px rgba(255, 255, 255, 0.35); }
  50% { box-shadow: 0 10px 0 #420410, 0 0 64px rgba(255, 46, 84, 0.9), inset 0 4px 14px rgba(255, 255, 255, 0.45); }
}

.snh-hotseat-buzzers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.snh-hs-buzz-btn {
  padding: 18px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.snh-history-panel {
  padding: 14px;
  border-radius: var(--tg-radius-md);
  background: var(--tg-glass);
  border: 1px solid var(--tg-border);
}

.snh-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}

.snh-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(10, 12, 22, 0.72);
  font-family: var(--tg-font-mono);
  font-size: 12px;
}

@media (max-width: 880px) {
  .snh-vault-header {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .snh-score-card {
    width: 100%;
  }
  .snh-body {
    grid-template-columns: 1fr;
  }
  .snh-wall-card {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
  }
}
