/* ==========================================================================
   赤金德州 · 细节打磨层
   公共牌翻牌动画、下一手节奏、个人中心入口与少量交互增强。
   ========================================================================== */

/* 大厅「联机大厅」入口 */
.lobby__actions .text-link--online {
  color: var(--gold-1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lobby__actions .text-link--online:hover {
  color: var(--gold-0);
}

.text-link--online .online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(95, 224, 189, 0.08), 0 0 10px rgba(95, 224, 189, 0.5);
  animation: online-pulse 2.4s ease-in-out infinite;
}

.text-link--online em {
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(63, 200, 180, 0.2);
  color: var(--green);
  font-family: var(--font-num);
  font-size: 6.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

@keyframes online-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* 大厅档案胶囊可点击进入个人中心 */
.profile-chip {
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
}

.profile-chip:hover {
  border-color: rgba(232, 196, 125, 0.34);
  background: rgba(34, 21, 24, 0.72);
  transform: translateY(-1px);
}

.profile-chip:focus-visible {
  outline: 2px solid rgba(232, 196, 125, 0.5);
  outline-offset: 3px;
}

/* ------------------------------ 公共牌发牌 / 翻牌 ------------------------------ */

.community-cards {
  perspective: 900px;
  perspective-origin: 50% 30%;
}

.card--community {
  transform-style: preserve-3d;
  backface-visibility: visible;
  will-change: transform, opacity, filter;
}

.card__reveal-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform-origin: 0% 50%;
  backface-visibility: hidden;
  background:
    linear-gradient(135deg, rgba(255, 222, 151, 0.08), transparent 34%),
    repeating-linear-gradient(45deg, rgba(255, 221, 148, 0.06) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(255, 221, 148, 0.05) 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at 50% 45%, #6d171d 0%, #35080e 58%, #190509 100%);
  box-shadow: inset 0 0 0 1px rgba(245, 211, 145, 0.24),
    inset 0 0 0 4px rgba(0, 0, 0, 0.2),
    inset 0 0 26px rgba(0, 0, 0, 0.55);
}

.card__reveal-cover::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 4px;
  border: 1px solid rgba(245, 211, 145, 0.34);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.18);
}

.card__reveal-cover::after {
  content: "G";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  color: rgba(249, 226, 174, 0.86);
  font-family: var(--font-display);
  font-size: calc(var(--card-w, 62px) * 0.46);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72), 0 0 14px rgba(240, 197, 112, 0.16);
}

.card--flip-deal {
  animation: community-card-deal 0.62s cubic-bezier(0.16, 0.84, 0.32, 1) both;
}

.card--flip-deal .card__reveal-cover {
  opacity: 1;
  animation: community-card-cover 0.58s cubic-bezier(0.22, 0.72, 0.33, 1) both;
}

.card--flip-deal::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 0 1px rgba(255, 231, 177, 0.38), 0 0 22px rgba(255, 208, 120, 0.22);
  animation: community-card-glow 0.62s ease-out both;
}

@keyframes community-card-deal {
  0% {
    opacity: 0;
    transform: translate3d(0, -26px, 34px) rotateY(82deg) rotateZ(-3deg) scale(0.84);
    filter: brightness(1.25);
  }
  52% {
    opacity: 1;
    transform: translate3d(0, 2px, 0) rotateY(-7deg) rotateZ(0.5deg) scale(1.025);
    filter: brightness(1.05);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes community-card-cover {
  0%, 38% {
    opacity: 1;
    transform: rotateY(0deg);
  }
  76% {
    opacity: 1;
    transform: rotateY(-82deg);
  }
  100% {
    opacity: 0;
    transform: rotateY(-100deg);
  }
}

@keyframes community-card-glow {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

/* 发牌时的桌心柔光 */
.table-center.is-dealing-community::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 42%;
  height: 48%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(255, 207, 126, 0.12), transparent 68%);
  animation: community-soft-glow 0.7s ease-out both;
}

@keyframes community-soft-glow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  36% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

/* 下一手倒计时按钮：更明确的“即将自动开始”提示 */
#btn-next-hand small {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(36, 20, 8, 0.24);
  border: 1px solid rgba(54, 33, 10, 0.28);
  color: #3b2508;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
}

/* 牌桌提示条发牌中状态 */
.action-dock.is-revealing .turn-hint__dot {
  background: var(--gold-1);
  box-shadow: 0 0 0 4px rgba(232, 196, 125, 0.1), 0 0 14px rgba(232, 196, 125, 0.4);
  animation: reveal-dot 0.9s ease-in-out infinite;
}

@keyframes reveal-dot {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* ------------------------------ 摊牌结果托盘（不遮挡牌桌） ------------------------------ */

.result-tray {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(232, 196, 125, 0.28);
  background:
    radial-gradient(ellipse 36% 120% at 50% 0%, rgba(126, 49, 43, 0.24), transparent 70%),
    linear-gradient(100deg, rgba(33, 20, 20, 0.94), rgba(10, 7, 8, 0.96));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 238, 199, 0.07);
  animation: result-tray-in 0.35s var(--ease-out) both;
}

@keyframes result-tray-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.action-dock.is-showdown-result .turn-hint,
.action-dock.is-showdown-result .decision-clock,
.action-dock.is-showdown-result .action-buttons,
.action-dock.is-showdown-result .action-dock__tools {
  display: none;
}

.action-dock.is-showdown-result .result-tray {
  display: flex;
}

.action-dock.is-showdown-result .turn-hint,
.action-dock.is-showdown-result .action-dock__tools {
  pointer-events: none;
}

.result-tray__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 125, 0.3);
  background: radial-gradient(circle at 50% 35%, rgba(232, 196, 125, 0.19), rgba(45, 26, 12, 0.2));
  color: var(--gold-0);
  box-shadow: 0 0 20px rgba(232, 196, 125, 0.1);
}

.result-tray__mark .icon {
  width: 19px;
  height: 19px;
}

.result-tray__copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.result-tray__eyebrow {
  color: var(--gold-2);
  font-family: var(--font-num);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.result-tray__copy strong {
  overflow: hidden;
  color: var(--gold-0);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-tray__detail {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-tray__hands {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  max-width: 46%;
  overflow: hidden;
}

.result-tray-hand {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 8px;
}

.result-tray-hand b {
  max-width: 70px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.result-tray-hand em {
  color: var(--gold-1);
  font-size: 8px;
  font-style: normal;
  white-space: nowrap;
}

.result-tray-hand .mini-cards {
  gap: 2px;
}

.result-tray-hand .mini-card {
  width: 17px;
  height: 23px;
  font-size: 8px;
  border-radius: 2px;
}

.result-tray-hand .mini-card em {
  font-size: 6px;
}

.result-tray__next {
  flex: none;
  min-width: 112px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
}

.result-tray__next small {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(52, 33, 9, 0.2);
  font-size: 10px;
}

@media (max-width: 900px) {
  .result-tray {
    gap: 9px;
    padding: 8px 12px;
  }

  .result-tray__mark {
    width: 34px;
    height: 34px;
  }

  .result-tray__copy strong {
    font-size: 16px;
  }

  .result-tray__hands {
    max-width: 38%;
  }

  .result-tray__next {
    min-width: 88px;
    height: 34px;
    padding: 0 10px;
  }
}

@media (max-width: 600px) {
  .result-tray {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 8px 10px;
  }

  .result-tray__mark {
    width: 30px;
    height: 30px;
    grid-row: 1 / 3;
  }

  .result-tray__copy {
    grid-column: 2;
    grid-row: 1;
  }

  .result-tray__hands {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
  }

  .result-tray__copy strong {
    font-size: 15px;
  }

  .result-tray__detail {
    display: none;
  }

  .result-tray__next {
    grid-column: 3;
    grid-row: 1 / 3;
    height: 34px;
    min-width: 74px;
    font-size: 11px;
  }

  .action-dock.is-showdown-result {
    height: 108px;
  }
}

/* ------------------------------ 行动倒计时 / 加时 ------------------------------ */

.decision-clock {
  position: relative;
  flex: none;
  width: 166px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 12px;
  border: 1px solid rgba(232, 196, 125, 0.15);
  background: linear-gradient(180deg, rgba(42, 27, 22, 0.54), rgba(4, 3, 4, 0.32));
  box-shadow: inset 0 1px 0 rgba(255, 238, 199, 0.05);
}

.decision-clock.is-human {
  border-color: rgba(232, 196, 125, 0.32);
  box-shadow: 0 0 18px rgba(232, 196, 125, 0.09), inset 0 1px 0 rgba(255, 238, 199, 0.08);
}

.decision-clock__dial {
  --clock-pct: 100;
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, var(--gold-1) calc(var(--clock-pct) * 1%), rgba(255, 255, 255, 0.09) 0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 10px rgba(232, 196, 125, 0.09);
  transition: background 0.16s linear;
}

.decision-clock__dial::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #211614, #0b080a 72%);
  border: 1px solid rgba(232, 196, 125, 0.12);
}

.decision-clock__dial strong {
  position: relative;
  z-index: 1;
  color: var(--gold-0);
  font-family: var(--font-num);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.decision-clock__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.decision-clock__meta > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.timebank-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(232, 196, 125, 0.32);
  background: linear-gradient(180deg, rgba(106, 71, 25, 0.55), rgba(34, 22, 10, 0.66));
  color: var(--gold-1);
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), opacity var(--dur-fast);
}

.timebank-btn b {
  color: var(--gold-0);
  font-family: var(--font-num);
  font-size: 8.5px;
}

.timebank-btn:hover:not(:disabled) {
  border-color: rgba(249, 237, 203, 0.7);
  background: linear-gradient(180deg, rgba(148, 101, 36, 0.64), rgba(48, 31, 13, 0.74));
}

.timebank-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.timebank-btn.is-used {
  opacity: 0.46;
  border-color: rgba(232, 196, 125, 0.12);
}

.decision-clock.is-low {
  border-color: rgba(255, 99, 80, 0.36);
  box-shadow: 0 0 22px rgba(186, 48, 38, 0.13), inset 0 1px 0 rgba(255, 238, 199, 0.05);
}

.decision-clock.is-low .decision-clock__dial {
  background: conic-gradient(from -90deg, #ff6b5e calc(var(--clock-pct) * 1%), rgba(255, 255, 255, 0.09) 0);
  animation: clock-low-pulse 0.7s ease-in-out infinite;
}

.decision-clock.is-low .decision-clock__dial strong {
  color: #ffb1a3;
}

.decision-clock.is-paused .decision-clock__dial {
  filter: grayscale(0.6);
  opacity: 0.7;
}

@keyframes clock-low-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 94, 0.2), 0 0 10px rgba(255, 107, 94, 0.18); }
  50% { box-shadow: 0 0 0 4px rgba(255, 107, 94, 0.05), 0 0 18px rgba(255, 107, 94, 0.32); }
}

/* 规则弹窗里的时间规则 */
.rule-clock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(232, 196, 125, 0.14);
  background: rgba(232, 196, 125, 0.05);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.rule-clock-note .icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 2px;
  color: var(--gold-1);
}

.rule-clock-note b {
  color: var(--gold-1);
  font-weight: 600;
}

/* 短暂的全下氛围标记 */
.table-shell.is-runout::after {
  content: "ALL IN · RUNOUT";
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 8;
  transform: translate(-50%, -50%);
  padding: 5px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 219, 150, 0.23);
  background: rgba(12, 6, 8, 0.7);
  color: rgba(249, 219, 157, 0.86);
  font-family: var(--font-num);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  pointer-events: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: runout-label 0.55s var(--ease-out) both;
}

@keyframes runout-label {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* 个人中心里的最佳牌型牌面略去悬浮效果，避免抢视觉 */
.profile-best__cards .card {
  pointer-events: none;
}

/* 个人中心快速开始的小箭头 */
.profile-season__play .icon {
  transition: transform var(--dur-fast);
}

.profile-season__play:hover .icon {
  transform: translateX(2px);
}

@media (max-width: 1180px) {
  .decision-clock {
    width: 148px;
    gap: 6px;
    padding: 5px 7px;
  }

  .decision-clock__dial {
    width: 38px;
    height: 38px;
  }

  .decision-clock__dial strong {
    font-size: 13px;
  }

  .decision-clock__meta > span {
    font-size: 7.5px;
  }

  .timebank-btn {
    padding: 0 5px;
    font-size: 7.5px;
  }
}

@media (max-width: 900px) {
  .decision-clock {
    width: 132px;
    padding: 4px 6px;
    gap: 5px;
  }

  .decision-clock__dial {
    width: 34px;
    height: 34px;
  }

  .decision-clock__dial strong {
    font-size: 12px;
  }

  .decision-clock__meta > span {
    display: none;
  }
}

@media (max-width: 600px) {
  .action-dock__inner {
    position: relative;
  }

  .decision-clock {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    top: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 120px;
    padding: 5px 9px;
    z-index: 6;
    background: rgba(12, 8, 9, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  }

  .decision-clock__meta {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .decision-clock__meta > span {
    display: block;
  }

  .timebank-btn {
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .decision-clock.is-low .decision-clock__dial {
    animation: none !important;
  }

  .card--flip-deal,
  .card--flip-deal .card__reveal-cover,
  .card--flip-deal::after,
  .table-center.is-dealing-community::after,
  .table-shell.is-runout::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .action-dock.is-revealing .turn-hint__dot {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .table-shell.is-runout::after {
    top: 39%;
    font-size: 8px;
  }
}
