/**
 * @file ui_styles.css
 * @brief 《雀感 · 四川麻将直觉训练》全局视觉样式表。
 *        采用深青蓝桌布基调配合红木鎏金边框质感，兼容桌面端与移动端。
 * @author TrainMJ
 * @date 2026-11-27
 */

:root {
  --bg-deep: #0b141c;
  --panel-bg: rgba(13, 29, 41, 0.9);
  --panel-border: rgba(217, 169, 56, 0.42);
  --wood-dark: #3b1c10;
  --gold: #f0be46;
  --gold-dim: #b98926;
  --text-main: #f4efe6;
  --text-sub: #a8c6d6;
  --ok-bg: rgba(26, 108, 72, 0.92);
  --ok-border: #3bd18c;
  --err-bg: rgba(132, 34, 34, 0.92);
  --err-border: #ff6b6b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

#tmj-canvas-host {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#tmj-ui-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.is-hidden {
  display: none !important;
}

/* ==================== 大厅页面 ==================== */
#tmj-lobby {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 25%, rgba(12, 32, 46, 0.72), rgba(7, 15, 22, 0.92));
  backdrop-filter: blur(5px);
  padding: 24px 20px 44px;
}

.tmj-lobby-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.tmj-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(22, 48, 66, 0.92), rgba(38, 22, 14, 0.88));
  border: 1.5px solid var(--panel-border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  margin-bottom: 22px;
}

.tmj-hero h1 {
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
}

.tmj-hero p {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
}

.tmj-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tmj-hero-stat {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(240, 190, 70, 0.14);
  border: 1px solid rgba(240, 190, 70, 0.42);
  color: var(--gold);
}

.tmj-modules-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tmj-mod-section {
  background: var(--panel-bg);
  border: 1px solid rgba(168, 198, 214, 0.18);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.tmj-mod-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(240, 190, 70, 0.16);
}

.tmj-mod-head h2 {
  font-size: 18px;
  color: #fff6df;
}

.tmj-mod-desc {
  font-size: 13px;
  color: var(--text-sub);
}

.tmj-levels-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 9px;
}

.tmj-level-card {
  position: relative;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 66px;
  padding: 9px 6px 7px;
  border-radius: 10px;
  background: rgba(20, 44, 60, 0.85);
  border: 1px solid rgba(145, 200, 224, 0.22);
  color: var(--text-main);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

@media (hover: hover) {
  .tmj-level-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 8px 20px rgba(240, 190, 70, 0.16);
  }
}

.tmj-level-card.is-ultimate {
  grid-column: span 2;
  background: linear-gradient(145deg, rgba(64, 34, 18, 0.92), rgba(26, 40, 56, 0.92));
  border-color: rgba(240, 190, 70, 0.58);
}

.tmj-level-card.has-record {
  background: linear-gradient(160deg, rgba(20, 54, 70, 0.9), rgba(14, 34, 48, 0.92));
  border-color: rgba(114, 212, 184, 0.38);
}

.tmj-lv-num {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-family: "Consolas", "Microsoft YaHei", sans-serif;
}

.tmj-level-card.is-ultimate .tmj-lv-num {
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 2px;
}

.tmj-lv-stat {
  font-size: 11px;
  font-weight: 700;
  color: #ffe285;
  line-height: 1.2;
  white-space: nowrap;
}

.tmj-lv-stat.is-empty {
  color: rgba(136, 181, 203, 0.42);
}

.tmj-lv-grade {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  padding: 1px 4px;
  line-height: 1.2;
}

.tmj-grade {
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(240, 190, 70, 0.2);
  color: var(--gold);
}

/* ==================== 对局 HUD ==================== */
#tmj-hud {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.tmj-topbar {
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  width: 100%;
}

.tmj-top-left,
.tmj-top-right {
  pointer-events: auto;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 33, 46, 0.86), rgba(38, 22, 14, 0.86));
  border: 1px solid rgba(217, 169, 56, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.tmj-top-left {
  justify-self: start;
}

.tmj-top-right {
  justify-self: end;
}

/* 正中超大竞速主计时台 */
.tmj-timer-stage {
  pointer-events: auto;
  justify-self: center;
  min-width: 224px;
  padding: 6px 28px 9px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, rgba(14, 29, 42, 0.96), rgba(34, 21, 14, 0.94));
  border: 1.5px solid rgba(240, 190, 70, 0.65);
  border-top: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.58), 0 0 22px rgba(240, 190, 70, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
}

.tmj-timer-stage.is-ahead {
  border-color: rgba(72, 232, 166, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.58), 0 0 24px rgba(59, 209, 140, 0.26);
}

.tmj-timer-digits {
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  font-family: "Consolas", "Bahnschrift", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #ffffff 10%, #ffe69a 62%, #e6a92e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.65));
}

.tmj-timer-stage.is-ahead .tmj-timer-digits {
  background: linear-gradient(180deg, #ffffff 10%, #b7ffd8 58%, #3dd98f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tmj-timer-unit {
  font-size: 20px;
  font-weight: 800;
  margin-left: 3px;
}

.tmj-timer-pb {
  width: 100%;
  min-width: 158px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.tmj-timer-pb span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #b7d7e8;
}

.tmj-timer-stage.is-ahead .tmj-timer-pb span {
  color: #8bf5c2;
}

.tmj-pb-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.tmj-pb-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3bd18c, #f0be46);
  transition: width 0.08s linear;
}

.tmj-timer-stage.is-over .tmj-pb-fill {
  background: rgba(240, 190, 70, 0.45);
}

.tmj-level-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.tmj-stat-chip {
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6f2f8;
}

.tmj-stat-chip b {
  color: var(--gold);
}

/* 右上角动态连击常驻徽章 */
.tmj-combo-pill {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  color: #241504;
  background: linear-gradient(135deg, #ffe58f, #f0a818);
  box-shadow: 0 0 14px rgba(240, 190, 70, 0.5);
  letter-spacing: 0.5px;
}

.tmj-combo-pill.is-tier-fire {
  color: #fff;
  background: linear-gradient(135deg, #ff7b3b, #e02424);
  box-shadow: 0 0 16px rgba(255, 92, 51, 0.65);
}

.tmj-combo-pill.is-tier-apex {
  color: #fff;
  background: linear-gradient(135deg, #d87bff, #6a38ff);
  box-shadow: 0 0 18px rgba(176, 86, 255, 0.72);
}

.tmj-combo-pill.is-pop {
  animation: tmj-pill-pop 0.34s cubic-bezier(0.2, 1.5, 0.4, 1);
}

/* ==================== 成熟游戏级连击弹出舞台 ==================== */
#tmj-combo-stage {
  position: fixed;
  top: 23%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 28;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#tmj-combo-stage.is-hand-view {
  top: 44%;
}

.tmj-combo-burst {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
  animation: tmj-combo-life 1.15s cubic-bezier(0.18, 0.89, 0.32, 1.2) forwards;
}

.tmj-combo-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid rgba(255, 214, 92, 0.88);
  box-shadow: 0 0 22px rgba(255, 214, 92, 0.75);
  animation: tmj-ring-boom 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tmj-combo-ring.is-delayed {
  animation-delay: 0.08s;
  border-width: 2px;
  opacity: 0;
}

.tmj-combo-burst.is-tier-fire .tmj-combo-ring {
  border-color: rgba(255, 118, 56, 0.92);
  box-shadow: 0 0 26px rgba(255, 84, 38, 0.85);
}

.tmj-combo-burst.is-tier-apex .tmj-combo-ring {
  border-color: rgba(206, 128, 255, 0.95);
  box-shadow: 0 0 28px rgba(164, 86, 255, 0.9);
}

.tmj-combo-sparks {
  position: absolute;
  width: 0;
  height: 0;
}

.tmj-combo-spark {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 9px;
  height: 9px;
  background: #ffe885;
  border-radius: 2px;
  box-shadow: 0 0 10px #ffd24c;
  animation: tmj-spark-fly 0.7s cubic-bezier(0.1, 0.9, 0.25, 1) forwards;
}

.tmj-combo-burst.is-tier-fire .tmj-combo-spark {
  background: #ff9c54;
  box-shadow: 0 0 12px #ff5424;
}

.tmj-combo-burst.is-tier-apex .tmj-combo-spark {
  background: #e6a8ff;
  box-shadow: 0 0 12px #b758ff;
}

.tmj-combo-banner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 34px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(10, 20, 30, 0.84) 0%, rgba(10, 20, 30, 0.45) 56%, rgba(10, 20, 30, 0) 80%);
  transform: rotate(-3deg);
  white-space: nowrap;
}

.tmj-combo-label {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: 3px;
  color: #ffffff;
  text-shadow: 0 2px 0 #7b4904, 0 4px 12px rgba(0, 0, 0, 0.85), 0 0 16px rgba(255, 208, 72, 0.85);
}

.tmj-combo-num {
  font-size: 52px;
  line-height: 1.2;
  font-weight: 900;
  padding: 0 6px;
  font-family: "Arial Black", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #ffe36e;
  text-shadow:
    -2px -2px 0 #5b2d00,
    2px -2px 0 #5b2d00,
    -2px 2px 0 #5b2d00,
    2px 2px 0 #5b2d00,
    0 5px 0 #472100,
    0 0 22px rgba(255, 204, 60, 0.95);
}

.tmj-combo-burst.is-tier-fire .tmj-combo-num {
  color: #ff9c47;
  text-shadow:
    -2px -2px 0 #5e0e00,
    2px -2px 0 #5e0e00,
    -2px 2px 0 #5e0e00,
    2px 2px 0 #5e0e00,
    0 5px 0 #400600,
    0 0 24px rgba(255, 86, 36, 0.95);
}

.tmj-combo-burst.is-tier-apex .tmj-combo-num {
  color: #eb9eff;
  text-shadow:
    -2px -2px 0 #2d0966,
    2px -2px 0 #2d0966,
    -2px 2px 0 #2d0966,
    2px 2px 0 #2d0966,
    0 5px 0 #1c0347,
    0 0 26px rgba(178, 86, 255, 0.98);
}

.tmj-combo-sub {
  margin-top: 2px;
  padding: 2px 14px;
  border-radius: 999px;
  background: rgba(8, 18, 28, 0.72);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffeaa8;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  transform: rotate(-3deg);
}

@keyframes tmj-pill-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.26);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes tmj-combo-life {
  0% {
    opacity: 0;
    transform: scale(1.65) translateY(8px);
  }
  20% {
    opacity: 1;
    transform: scale(0.95) translateY(0);
  }
  34% {
    opacity: 1;
    transform: scale(1.04) translateY(-1px);
  }
  48% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  80% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) translateY(-18px);
  }
}

@keyframes tmj-ring-boom {
  0% {
    opacity: 0.95;
    transform: scale(0.28);
  }
  100% {
    opacity: 0;
    transform: scale(2.15);
  }
}

@keyframes tmj-spark-fly {
  0% {
    opacity: 1;
    transform: rotate(var(--ang)) translateX(12px) rotate(45deg) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--ang)) translateX(var(--dist)) rotate(135deg) scale(0);
  }
}

#tmj-bottom-panel {
  pointer-events: auto;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* ==================== 按钮与作答面板 ==================== */
.tmj-btn-primary,
.tmj-btn-secondary,
.tmj-btn-sm {
  cursor: pointer;
  touch-action: manipulation;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: filter 0.12s ease, transform 0.1s ease;
}

.tmj-btn-primary {
  padding: 8px 16px;
  font-size: 13px;
  background: linear-gradient(180deg, #f5cb5c, #d4961a);
  color: #241704;
  box-shadow: 0 3px 10px rgba(212, 150, 26, 0.35);
}

.tmj-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tmj-btn-secondary {
  padding: 7px 13px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.11);
  color: #eef6fa;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tmj-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #dcebf2;
}

.tmj-btn-sm.is-active {
  background: var(--gold);
  color: #241704;
}

.tmj-btn-primary:hover:not(:disabled),
.tmj-btn-secondary:hover,
.tmj-btn-sm:hover {
  filter: brightness(1.08);
}

.tmj-ting-board,
.tmj-quiz-card,
.tmj-mem-controls {
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.tmj-quiz-card,
.tmj-ting-board {
  max-height: 62vh;
  overflow-y: auto;
}

.tmj-mem-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tmj-turn-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  color: #f4efe6;
}

.tmj-inline-tile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 5px;
  border-radius: 6px;
  background: #fdf8eb;
  color: #2c1e0e;
  font-weight: 700;
  font-size: 13px;
  border: 1.5px solid var(--gold);
}

.tmj-inline-tile img {
  width: 20px;
  height: 26px;
}

.tmj-speed-btns {
  display: flex;
  gap: 6px;
}

.tmj-board-top,
.tmj-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.tmj-quiz-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 27张快选矩阵与单排手牌 */
.tmj-27-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tmj-suit-row {
  display: grid;
  grid-template-columns: 36px repeat(9, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.tmj-suit-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(240, 190, 70, 0.14);
  border: 1px solid rgba(240, 190, 70, 0.34);
  border-radius: 8px;
}

.tmj-hand-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 2px;
}

.tmj-pick-tile {
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 5px 4px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #efe6d3);
  border: 2px solid #c9ba9b;
  box-shadow: 0 3px 0 #d49f1f;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.tmj-pick-tile.is-compact {
  min-width: 0;
  width: 100%;
  min-height: 76px;
  padding: 6px 4px 5px;
  border-radius: 9px;
  box-shadow: 0 4px 0 #d49f1f;
}

.tmj-pick-tile img {
  width: 34px;
  height: 45px;
  object-fit: contain;
  pointer-events: none;
}

.tmj-pick-tile.is-compact img {
  width: clamp(32px, 4.2vw, 48px);
  height: clamp(44px, 5.6vw, 64px);
}

.tmj-pick-tile span {
  font-size: 10.5px;
  color: #362919;
  font-weight: 700;
  margin-top: 1px;
}

@media (hover: hover) {
  .tmj-pick-tile:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: var(--gold);
  }
}

.tmj-pick-tile.is-selected {
  transform: translateY(-4px);
  border-color: #26c281;
  box-shadow: 0 0 0 2px rgba(38, 194, 129, 0.45), 0 4px 0 #1e9664;
  background: #eafff5;
}

.tmj-pick-tile.is-wrong-flash {
  border-color: #ff5b5b;
  background: #ffe9e9;
  box-shadow: 0 0 0 2px rgba(255, 91, 91, 0.45), 0 3px 0 #c0392b;
}

.tmj-pick-tile.is-drawn {
  margin-left: 10px;
  border-color: var(--gold);
}

.tmj-drawn-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  background: #e67e22;
  color: #fff;
}

.tmj-count-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: #1b9c6e;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 记牌顺序槽位 */
.tmj-seq-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tmj-slot-btn {
  width: 54px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.tmj-slot-btn.is-empty {
  border: 1.5px dashed rgba(240, 190, 70, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-sub);
}

.tmj-slot-btn.is-filled {
  cursor: pointer;
  border: 1.5px solid var(--gold);
  background: #fff9ec;
  color: #2c2010;
}

.tmj-slot-btn img {
  width: 34px;
  height: 46px;
}

.tmj-slot-q {
  font-size: 15px;
  font-weight: 700;
  opacity: 0.45;
}

.tmj-mini-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.tmj-mini-tag.is-ok {
  background: rgba(38, 194, 129, 0.24);
  color: #82f0be;
  border: 1px solid rgba(59, 209, 140, 0.45);
}

.tmj-mini-tag.is-err {
  background: rgba(255, 91, 91, 0.24);
  color: #ffb1b1;
  border: 1px solid rgba(255, 107, 107, 0.45);
}

/* 读牌选择题与复盘对比 */
.tmj-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tmj-choice-btn {
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(173, 216, 230, 0.25);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.tmj-choice-btn:hover {
  border-color: var(--gold);
  background: rgba(240, 190, 70, 0.14);
}

.tmj-choice-idx {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(240, 190, 70, 0.22);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.tmj-feedback {
  padding: 9px 12px;
  border-radius: 9px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tmj-feedback.is-ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
}

.tmj-feedback.is-err {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
}

.tmj-compare-list {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tmj-compare-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.tmj-compare-row.is-best {
  background: rgba(240, 190, 70, 0.22);
  color: #fff8dc;
}

.tmj-answer-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 8px 0;
}

.tmj-mini-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 4px;
  background: #fdf9ef;
  border-radius: 5px;
  border: 1px solid #cbbd9c;
}

.tmj-mini-tile img {
  width: 22px;
  height: 30px;
}

.tmj-mini-tile em {
  font-style: normal;
  font-size: 9.5px;
  color: #2f2314;
  font-weight: 700;
}

.tmj-arrow {
  color: var(--gold);
  font-weight: 700;
}

.tmj-read-reveal {
  background: rgba(0, 0, 0, 0.24);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.tmj-reveal-hand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-bottom: 6px;
}

.tmj-reason-ul {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ==================== 模态框(结算 & 模式字典) ==================== */
.tmj-modal-backdrop {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(6, 12, 18, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tmj-modal-box {
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 22px 24px;
  background: linear-gradient(155deg, #132a3a, #241610);
  border: 2px solid var(--gold);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.tmj-modal-box.is-new-record {
  border-color: #ffe373;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.65), 0 0 38px rgba(240, 190, 70, 0.4);
}

.tmj-new-record-banner {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #241402;
  background: linear-gradient(90deg, #fff099, #f5b922);
  box-shadow: 0 0 18px rgba(245, 185, 34, 0.55);
  animation: tmj-pill-pop 0.5s ease;
}

.tmj-record-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sub);
}

.tmj-result-hero-time {
  margin-top: 10px;
  font-size: 46px;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  font-family: "Consolas", "Bahnschrift", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #ffffff 12%, #ffe07d 75%, #df9a18 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.tmj-result-hero-time span {
  font-size: 20px;
  margin-left: 3px;
}

.tmj-result-grade {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f8d264, #cc8a14);
  color: #241504;
  font-size: 34px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(240, 190, 70, 0.45);
}

.tmj-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 16px;
}

.tmj-result-stats-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tmj-result-stat {
  background: rgba(0, 0, 0, 0.28);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

.tmj-result-stat span {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.tmj-result-stat strong {
  font-size: 18px;
  color: var(--gold);
}

.tmj-dict-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.tmj-dict-item {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 10px 12px;
}

.tmj-dict-item h4 {
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 4px;
}

.tmj-dict-item p {
  font-size: 12.5px;
  color: #dbeaf2;
  line-height: 1.5;
}

@media (max-height: 760px) {
  .tmj-27-grid {
    gap: 5px;
  }

  .tmj-suit-row {
    gap: 5px;
  }

  .tmj-pick-tile.is-compact {
    min-height: 54px;
    padding: 4px 2px;
  }

  .tmj-pick-tile.is-compact img {
    width: 30px;
    height: 40px;
  }
}

@media (max-width: 680px) {
  .tmj-topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
  }

  .tmj-top-left,
  .tmj-top-right {
    justify-self: center;
    margin-top: 6px;
  }

  .tmj-timer-stage {
    order: -1;
    min-width: 170px;
    padding: 4px 18px 6px;
  }

  .tmj-timer-digits {
    font-size: 34px;
  }

  .tmj-combo-num {
    font-size: 46px;
  }

  .tmj-result-stats-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tmj-suit-row {
    grid-template-columns: 26px repeat(9, minmax(0, 1fr));
    gap: 4px;
  }

  .tmj-suit-tag {
    font-size: 12px;
  }

  .tmj-pick-tile.is-compact {
    min-height: 48px;
    padding: 3px 2px;
  }

  .tmj-pick-tile.is-compact img {
    width: 24px;
    height: 32px;
  }
}
