/* 24点 · 样式（.g-twentyfour 前缀） */

.g-twentyfour {
  padding-left: 12px;
  padding-right: 12px;
  gap: 10px;
}

/* 提示 / 步骤反馈 */
.g-twentyfour .t-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  animation: tFadeIn 0.18s ease both;
}
@keyframes tFadeIn {
  from { opacity: 0.4; transform: translateY(-1px); }
  to { opacity: 1; transform: none; }
}
.g-twentyfour .t-fb-ok {
  color: var(--ok);
  border-color: rgba(62, 207, 142, 0.3);
  background: rgba(62, 207, 142, 0.08);
}
.g-twentyfour .t-fb-win {
  color: var(--ok);
  border-color: rgba(62, 207, 142, 0.45);
  background: rgba(62, 207, 142, 0.14);
  font-weight: 700;
  box-shadow: 0 0 22px -10px rgba(62, 207, 142, 0.8);
}
.g-twentyfour .t-fb-err {
  color: #ff8b96;
  border-color: rgba(255, 92, 108, 0.34);
  background: rgba(255, 92, 108, 0.08);
}
.g-twentyfour .t-fb-warn {
  color: var(--warn);
  border-color: rgba(255, 176, 32, 0.34);
  background: rgba(255, 176, 32, 0.08);
}
.g-twentyfour .t-fb-hint {
  color: var(--accent);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.g-twentyfour .t-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0 2px;
  flex: none;
}
.g-twentyfour .t-goal-v {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #b9d9ff, var(--accent) 45%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent));
}
.g-twentyfour .t-goal-k {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.g-twentyfour .t-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-bottom: 4px;
}

.g-twentyfour .t-log {
  min-height: 78px;
  padding: 8px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.g-twentyfour .t-log-empty {
  text-align: center;
  font-size: 11px;
  color: var(--faint);
}
.g-twentyfour .t-log-line {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-twentyfour .t-log-line:last-child { color: var(--accent); }

/* 数字牌 */
.g-twentyfour .t-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-height: 108px;
}
.g-twentyfour .t-tile {
  position: relative;
  height: 108px;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 15px;
  border: 1px solid var(--line-2);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(121, 184, 255, 0.16), transparent 62%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 22px -16px rgba(0, 0, 0, 0.9);
  transition: transform 0.12s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  touch-action: manipulation;
  overflow: hidden;
}
.g-twentyfour .t-tile:active { transform: scale(0.96); }
.g-twentyfour .t-tile-v {
  font-size: clamp(21px, 6.6vw, 30px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.g-twentyfour .t-tile-e {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  line-height: 1.3;
  color: var(--faint);
  font-family: var(--mono);
  padding: 0 2px;
}
.g-twentyfour .t-tile.sel {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(121, 184, 255, 0.3), transparent 65%),
    linear-gradient(165deg, rgba(121, 184, 255, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 26px -8px color-mix(in srgb, var(--accent) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.g-twentyfour .t-tile.armed .t-tile-v { color: #cfe4ff; }
.g-twentyfour .t-tile.t-tile-ghost {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: none;
  pointer-events: none;
}

/* 运算符 */
.g-twentyfour .t-ops {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.g-twentyfour .t-op {
  height: 56px;
  min-width: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.1s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
  touch-action: manipulation;
}
.g-twentyfour .t-op:active { transform: scale(0.95); }
.g-twentyfour .t-ops.idle .t-op { opacity: 0.55; }
.g-twentyfour .t-op.on {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.g-twentyfour .t-hint { text-align: center; font-size: 10.5px; }

/* ---------------- 弹层 ---------------- */
.t-layer {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 6, 11, 0.6);
  animation: fadeIn 0.18s ease both;
}
.t-sheet {
  width: min(100%, 352px);
  max-height: min(84vh, 640px);
  overflow-y: auto;
  background: linear-gradient(180deg, #161c2b, #111623);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  padding: 19px;
  box-shadow: 0 34px 80px -18px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: popIn 0.22s cubic-bezier(0.22, 1.1, 0.36, 1) both;
}
.t-sheet-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.t-sheet-title { font-size: 18px; font-weight: 800; line-height: 1.3; }
.t-sheet-sub { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.t-sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.t-sheet-actions .btn { flex: 1; }

.t-guide { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.t-guide-row { font-size: 12.5px; line-height: 1.65; color: var(--dim); }
.t-guide-row b { display: inline-block; min-width: 34px; margin-right: 6px; color: var(--accent); font-weight: 700; }

@media (max-height: 720px) {
  .g-twentyfour .t-hint { display: none; }
  .g-twentyfour .t-tile { height: 88px; }
  .g-twentyfour .t-tiles { min-height: 88px; }
}
