/* 情缘小游戏厅 */
.tea-toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(120%);
  z-index: 9000;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(20, 8, 14, 0.92);
  border: 1px solid rgba(232, 120, 152, 0.35);
  color: var(--hub-text, #f5e6eb);
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.tea-toast.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 顶部游戏标签（始终可见） */
.arena-game-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid var(--hub-border-strong, rgba(255, 200, 220, 0.2));
  background: linear-gradient(145deg, rgba(42, 16, 32, 0.88), rgba(18, 8, 14, 0.85));
}

.arena-game-tabs__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  min-width: 88px;
  border-radius: 12px;
  border: 1px solid var(--hub-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--hub-muted);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.arena-game-tabs__btn:hover:not(:disabled):not(.is-active) {
  border-color: rgba(232, 120, 152, 0.4);
  color: var(--hub-text);
}

.arena-game-tabs__btn.is-active {
  color: #fff8f5;
  background: linear-gradient(135deg, var(--hub-rose-deep, #8b2942), var(--hub-rose, #c41e3a));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(196, 30, 58, 0.35);
}

.arena-game-tabs__btn.is-soon {
  opacity: 0.72;
  cursor: pointer;
}

.arena-game-tabs__btn.is-soon:hover {
  opacity: 0.9;
  border-color: rgba(232, 120, 152, 0.35);
}

.arena-game-tabs__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.arena-game-tabs__name {
  font-size: 0.95rem;
  font-weight: 600;
}

.arena-game-tabs__badge {
  font-size: 0.65rem;
  opacity: 0.9;
}

/* 大厅顶栏：账号 + 情缘分 + 创建 */
.games-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .games-toolbar {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
    align-items: stretch;
  }
}

.games-toolbar--room {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 768px) {
  .games-toolbar--room {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

.games-toolbar__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  justify-content: center;
}

.games-btn-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(196, 30, 58, 0.35);
}

.games-btn-create__icon {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  line-height: 1;
}

.games-toolbar__hint {
  margin: 0;
  font-size: 0.68rem;
  color: var(--hub-muted);
  text-align: center;
}

.games-hero-line {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--hub-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--hub-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.games-hero-line strong {
  color: var(--hub-champagne, #f5d9a8);
  font-weight: 600;
}

/* 登录入口 */
/* 登录 / 注册双按钮 */
.games-auth-bar {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid rgba(232, 200, 120, 0.4);
  background: linear-gradient(135deg, rgba(139, 41, 66, 0.5), rgba(42, 16, 32, 0.92));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.games-auth-bar--warn {
  border-color: rgba(255, 180, 100, 0.45);
}

.games-auth-bar__tip {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--hub-muted);
  line-height: 1.45;
}

.games-auth-bar__btns {
  display: flex;
  gap: 8px;
}

.games-auth-bar__btn {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--hub-border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hub-text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.games-auth-bar__btn--primary {
  background: linear-gradient(135deg, var(--hub-rose-deep, #8b2942), var(--hub-rose, #c41e3a));
  border-color: transparent;
  color: #fff8f5;
  font-weight: 600;
}

.games-auth-bar__btn--ghost:hover,
.games-auth-bar__btn:hover {
  border-color: var(--hub-gold);
}

.games-account__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.games-account__link--ghost {
  color: var(--hub-muted) !important;
  border-color: var(--hub-border) !important;
  font-size: 0.7rem !important;
}

.games-login-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid rgba(232, 200, 120, 0.45);
  background: linear-gradient(135deg, rgba(139, 41, 66, 0.55), rgba(42, 16, 32, 0.9));
  color: var(--hub-text, #f5e6eb);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.games-login-cta:hover {
  border-color: var(--hub-gold, #e8c872);
  transform: translateY(-1px);
}

.games-login-cta--warn {
  border-color: rgba(255, 180, 100, 0.5);
}

.games-login-cta__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hub-font-display, 'Ma Shan Zheng', serif);
  font-size: 1rem;
  background: linear-gradient(145deg, var(--hub-rose, #c41e3a), var(--hub-rose-deep, #8b2942));
  color: #fff8f5;
}

.games-login-cta__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.games-login-cta__text strong {
  font-size: 0.92rem;
  color: #fff8f5;
}

.games-login-cta__text small {
  font-size: 0.72rem;
  color: var(--hub-muted);
}

.games-login-cta__arrow {
  font-size: 1.25rem;
  color: var(--hub-gold);
  opacity: 0.9;
}

.games-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid var(--hub-border-strong);
  background: rgba(10, 6, 8, 0.65);
}

.games-account__avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hub-font-display, 'Ma Shan Zheng', serif);
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--hub-violet, #6b3a6e), var(--hub-rose-deep));
  color: #fff;
}

.games-account__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.games-account__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hub-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.games-account__hint {
  font-size: 0.68rem;
  color: var(--hub-muted);
}

.games-account__link {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hub-border-strong);
  background: transparent;
  color: var(--hub-gold);
  font-size: 0.75rem;
  cursor: pointer;
  font: inherit;
}

.games-account__link:hover {
  background: var(--hub-rose-soft);
}

/* 情缘分卡片 */
.affection-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid rgba(232, 120, 152, 0.35);
  background: linear-gradient(120deg, rgba(42, 16, 32, 0.95), rgba(24, 10, 18, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 220, 230, 0.06);
}

.affection-card__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.2rem;
  line-height: 1.1;
}

.affection-card__heart {
  font-size: 0.85rem;
  color: #ff7aa8;
  line-height: 1;
}

.affection-card__num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff5f8;
  font-variant-numeric: tabular-nums;
}

.affection-card__label {
  font-size: 0.62rem;
  color: var(--hub-muted);
  letter-spacing: 0.08em;
}

.affection-card__divider {
  width: 1px;
  align-self: stretch;
  min-height: 36px;
  background: linear-gradient(180deg, transparent, rgba(255, 200, 220, 0.25), transparent);
}

.affection-card__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.affection-card__tier {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--hub-gold, #e8c872);
}

.affection-card__checkin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #8fd4a8;
}

.affection-card__checkin.is-done i {
  font-style: normal;
}

.affection-card__checkin-btn {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 200, 120, 0.5);
  background: rgba(196, 30, 58, 0.25);
  color: var(--hub-champagne);
  font-size: 0.72rem;
  cursor: pointer;
  font: inherit;
}

.affection-card__checkin-btn:hover {
  background: rgba(196, 30, 58, 0.45);
}

.games-page .games-hero {
  margin-bottom: 20px;
}

.games-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.game-card {
  padding: 18px;
  border-radius: var(--hub-radius, 14px);
  border: 1px solid var(--hub-border-strong, rgba(255, 200, 220, 0.2));
  background: linear-gradient(145deg, rgba(42, 16, 32, 0.92), rgba(20, 8, 14, 0.88));
}

.game-card.is-live {
  border-color: rgba(232, 120, 152, 0.45);
}

.game-card.is-selected {
  border-color: var(--hub-gold, #e8c872);
  box-shadow: 0 0 0 1px rgba(232, 200, 120, 0.35);
}

.games-room-list {
  margin-bottom: 22px;
}

.game-card.is-soon {
  opacity: 0.55;
}

.game-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.game-card__tag {
  font-size: 0.68rem;
  color: var(--hub-rose);
  margin-bottom: 8px;
}

.game-card p {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--hub-muted);
}

.games-room-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.games-room-list__head h2 {
  margin: 0;
}

.games-btn-refresh {
  flex-shrink: 0;
  padding: 6px 12px !important;
  font-size: 0.75rem !important;
}

.games-room-list h2 {
  font-size: 1rem;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.games-empty-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: 12px;
  border: 1px dashed var(--hub-border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.games-empty-card p {
  margin: 0 0 14px;
  color: var(--hub-muted);
  font-size: 0.88rem;
}

.games-room-item__main {
  flex: 1;
  min-width: 0;
}

.games-room-item__main strong {
  display: block;
  margin-bottom: 4px;
}

.games-room-item__main small {
  color: var(--hub-muted);
  font-size: 0.75rem;
}

.games-room-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  margin-right: 4px;
  vertical-align: middle;
}

.games-room-pill.is-playing {
  background: rgba(196, 30, 58, 0.35);
  color: #ffc8d8;
}

.games-room-pill.is-ready {
  background: rgba(232, 200, 120, 0.25);
  color: var(--hub-gold);
}

.games-room-pill.is-lobby {
  background: rgba(107, 58, 110, 0.45);
  color: #e8d4ff;
}

.games-room-pill.is-ended {
  background: rgba(255, 255, 255, 0.08);
  color: var(--hub-muted);
}

.games-room-item--mine {
  border-color: rgba(232, 120, 152, 0.35);
}

.games-room-item--ended {
  opacity: 0.85;
}

.arena-overlay-modal {
  z-index: 2100;
}

.arena-overlay-modal:not(.hidden) {
  display: flex !important;
}

@media (max-width: 767px) {
  .games-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 8px 0 10px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, rgba(18, 8, 14, 0.97) 70%, rgba(18, 8, 14, 0));
  }
}

.hub-btn.is-busy {
  opacity: 0.75;
  cursor: wait;
}

.games-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--hub-border);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

.games-room-item:hover {
  border-color: rgba(232, 120, 152, 0.4);
}

/* 对战间 */
.arena-room-page .arena-layout {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .arena-layout {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

.arena-board-wrap {
  padding: 16px;
  border-radius: var(--hub-radius);
  border: 1px solid var(--hub-border-strong);
  background: rgba(10, 6, 8, 0.75);
}

.arena-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #ff6b8a;
  font-weight: 600;
}

.arena-live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3d5a;
  animation: arena-pulse 1.2s ease infinite;
}

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

.arena-gomoku {
  display: grid;
  gap: 1px;
  margin: 12px auto;
  max-width: 100%;
  aspect-ratio: 1;
  background: rgba(180, 140, 100, 0.35);
  padding: 4px;
  border-radius: 4px;
}

.arena-gomoku__cell {
  aspect-ratio: 1;
  border: none;
  padding: 0;
  background: rgba(220, 180, 120, 0.15);
  cursor: pointer;
  position: relative;
}

.arena-gomoku__cell:disabled {
  cursor: default;
}

.arena-gomoku__cell.is-last-move {
  box-shadow: inset 0 0 0 2px rgba(255, 215, 120, 0.85);
}

.arena-gomoku__stone {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
}

.arena-gomoku__stone--red {
  background: radial-gradient(circle at 30% 30%, #ff8a9a, #c41e3a);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.arena-gomoku__stone--black {
  background: radial-gradient(circle at 30% 30%, #666, #111);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.arena-side-panel {
  padding: 14px;
  border-radius: var(--hub-radius);
  border: 1px solid var(--hub-border-strong);
  background: linear-gradient(160deg, rgba(36, 14, 26, 0.95), rgba(18, 8, 12, 0.9));
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.arena-odds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.arena-odds__side {
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--hub-border);
  font-size: 0.8rem;
}

.arena-odds__side strong {
  display: block;
  font-size: 1.1rem;
  color: var(--hub-gold);
}

.arena-odds__side.is-red { border-color: rgba(196, 30, 58, 0.4); }
.arena-odds__side.is-black { border-color: rgba(80, 80, 80, 0.5); }

.arena-bet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.arena-bet-actions button {
  flex: 1;
  min-width: 72px;
}

.arena-feed {
  flex: 1;
  overflow-y: auto;
  min-height: 120px;
  max-height: 280px;
  margin: 10px 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.78rem;
  line-height: 1.5;
}

.arena-feed__item {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.arena-feed__item--bet { color: var(--hub-gold); }
.arena-feed__item--move { color: #9ad4ff; }
.arena-feed__item--comment { color: var(--hub-text); }

.arena-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.arena-comment-form input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--hub-border);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 0.85rem;
}

.arena-seat-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
  font-size: 0.85rem;
}

.arena-seat-bar .is-turn {
  color: var(--hub-gold);
  font-weight: 600;
}

.arena-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.arena-reaction-bar {
  display: flex;
  gap: 10px;
  margin: 8px 0;
}

.arena-react-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--hub-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hub-text);
  font-size: 0.82rem;
  cursor: pointer;
}

.arena-react-btn.is-on {
  border-color: rgba(232, 120, 152, 0.55);
  color: var(--hub-rose);
}

.arena-bet-side,
.arena-bet-amt {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.arena-bet-side .is-active,
.arena-bet-side button.is-active {
  border-color: var(--hub-rose);
  color: var(--hub-gold);
}

.arena-modal-panel {
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}

.arena-modal-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  color: var(--hub-gold);
}

.arena-invite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.arena-invite-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--hub-border);
  font-size: 0.78rem;
  cursor: pointer;
}

.arena-invite-chip:has(input:checked) {
  border-color: rgba(232, 120, 152, 0.5);
  background: rgba(232, 120, 152, 0.12);
}

.arena-invite-chip input {
  accent-color: var(--hub-rose);
}

.arena-my-bets {
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--hub-border);
}

.arena-my-bets__title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--hub-gold);
}

.arena-my-bets__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.6;
}

.arena-my-bets__list .side-red {
  color: #ff8a9a;
}

.arena-my-bets__list .side-black {
  color: #bbb;
}

.arena-draw-hint {
  margin: 6px 0;
}

.games-room-item--mine {
  border-color: rgba(232, 120, 152, 0.35);
}

#affectionBalance {
  color: var(--hub-muted);
  font-size: 0.85em;
}

.arena-replay-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(80, 60, 120, 0.35);
  border: 1px solid rgba(180, 160, 255, 0.25);
  font-size: 0.85rem;
  color: #d4c8ff;
  text-align: center;
}

.arena-replay-banner[hidden] {
  display: none !important;
}

.arena-btn-danger {
  border-color: rgba(196, 30, 58, 0.45) !important;
  color: #ff8a9a !important;
}

.arena-spectators {
  margin: 8px 0;
  font-size: 0.78rem;
}

.arena-spectators summary {
  cursor: pointer;
  color: var(--hub-muted);
}

.arena-spectators__list {
  margin: 8px 0 0;
}

.arena-spectators__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 8px;
}

.arena-spectator-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 72px;
}

.arena-spectator-chip__name {
  font-size: 0.68rem;
  color: var(--hub-muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-all;
}

.arena-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: hsl(var(--hue, 320) 45% 28%);
  border: 1px solid rgba(255, 200, 220, 0.25);
}

.arena-avatar--sm {
  width: 28px;
  height: 28px;
}

.arena-avatar--md {
  width: 40px;
  height: 40px;
}

.arena-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arena-avatar__initial {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.arena-avatar--md .arena-avatar__initial {
  font-size: 1rem;
}

.arena-seat-bar {
  align-items: center;
}

.arena-seat-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.arena-seat-line.is-turn {
  color: var(--hub-gold);
  font-weight: 600;
}

.arena-seat-meta {
  color: var(--hub-muted);
  font-size: 0.82rem;
}

.arena-feed__who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.arena-feed__item--comment {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

/* 象棋 · 祖龙城夕照主题 */
.arena-xiangqi {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.arena-xiangqi__board {
  position: relative;
  max-width: min(100%, 580px);
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid rgba(212, 168, 88, 0.55);
  background:
    linear-gradient(145deg, rgba(58, 38, 22, 0.88) 0%, rgba(42, 28, 16, 0.92) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 220, 160, 0.12) inset,
    0 16px 40px rgba(20, 12, 8, 0.45),
    0 0 28px rgba(255, 180, 90, 0.08);
}

.arena-xiangqi__plate {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 10.8;
  min-height: 300px;
  max-height: min(72vh, 540px);
  margin: 0 auto;
  border-radius: 6px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  z-index: 1;
}

/* 祖龙城夕照：仅外框衬底，盘面网格区透明 */
.arena-xiangqi__sky {
  position: absolute;
  inset: 8px;
  z-index: 0;
  border-radius: 8px;
  opacity: 0.92;
  background:
    radial-gradient(ellipse 95% 55% at 50% 12%, rgba(255, 210, 130, 0.45), transparent 68%),
    linear-gradient(165deg, #c9955a 0%, #a87848 38%, #8d6240 100%);
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 236, 200, 0.35) 0%,
      rgba(248, 220, 175, 0.22) 40%,
      rgba(220, 185, 140, 0.28) 100%
    ),
    url('../images/bless-01-xizhao-longcheng.jpg');
  background-size: cover, cover;
  background-position: center, center 35%;
  filter: saturate(1.05) contrast(1.02);
  pointer-events: none;
}

.arena-xiangqi__grid-veil,
.arena-xiangqi__spacer-board {
  display: none !important;
}

.arena-xiangqi__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0 0.4px rgba(255, 252, 240, 0.85));
}

.arena-xiangqi__lines line,
.arena-xiangqi__lines path {
  stroke: #3a2210;
  stroke-width: 1.5;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
  paint-order: stroke fill;
}

.arena-xiangqi__lines path {
  stroke-width: 1.25;
}

.arena-xiangqi__lines .arena-xiangqi__line-guide {
  stroke: #5a3820;
  stroke-width: 1.1;
  stroke-dasharray: 4 5;
  opacity: 0.82;
}

/* 楚河汉界：严格落在 y4–y5 两条横线之间 */
.arena-xiangqi__river-fill {
  position: absolute;
  z-index: 1;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(120, 175, 215, 0.22) 0%,
      rgba(150, 200, 235, 0.34) 42%,
      rgba(255, 215, 150, 0.14) 78%,
      rgba(120, 175, 215, 0.22) 100%
    );
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.arena-xiangqi__river-shimmer {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -10deg,
    transparent 0,
    transparent 14px,
    rgba(255, 255, 255, 0.06) 14px,
    rgba(255, 255, 255, 0.06) 28px
  );
  animation: arena-xq-river-shimmer 10s linear infinite;
  opacity: 0.7;
}

@keyframes arena-xq-river-shimmer {
  from {
    transform: translateX(-8%);
  }
  to {
    transform: translateX(8%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .arena-xiangqi__river-shimmer {
    animation: none;
  }
}

.arena-xiangqi__river-text {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5% 0 9%;
  pointer-events: none;
  user-select: none;
}

.arena-xiangqi__river-chu,
.arena-xiangqi__river-han {
  font-family: var(--hub-font-display, 'Ma Shan Zheng', 'Noto Serif SC', serif);
  font-size: clamp(0.95rem, 4.2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  color: rgba(42, 68, 98, 0.88);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.arena-xiangqi__river-mid {
  flex: 1;
  min-width: 10px;
  height: 3px;
  margin: 0 5%;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(180, 140, 80, 0.5) 20%,
    rgba(220, 180, 110, 0.75) 50%,
    rgba(180, 140, 80, 0.5) 80%,
    transparent 100%
  );
  opacity: 0.85;
}

.arena-xiangqi__points {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.arena-xiangqi__point {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(34px, 9.5vw, 46px);
  height: clamp(34px, 9.5vw, 46px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arena-xiangqi__point:disabled {
  cursor: default;
  pointer-events: none;
}

.arena-xiangqi__point.is-selected {
  box-shadow: 0 0 0 3px var(--hub-gold, #e8c872);
  border-radius: 50%;
}

.arena-xiangqi__point.is-last-move {
  background: rgba(232, 120, 152, 0.35);
  border-radius: 50%;
}

/* legacy grid（已弃用，保留类名避免旧缓存报错） */
.arena-xiangqi__grid-full {
  display: none;
}

.arena-room-page--xiangqi .arena-board-wrap {
  max-width: min(100%, 600px);
  margin-left: auto;
  margin-right: auto;
  padding: 12px 8px 16px;
}

.arena-xiangqi__river-band {
  display: none;
}

.arena-xiangqi__cell {
  display: none;
}

.arena-xiangqi__piece {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(30px, 8.2vw, 44px);
  height: clamp(30px, 8.2vw, 44px);
  border-radius: 50%;
  font-size: clamp(0.75rem, 3.1vw, 1.02rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.55) inset,
    0 -3px 6px rgba(0, 0, 0, 0.28) inset,
    0 5px 10px rgba(40, 25, 10, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.arena-xiangqi__piece.is-red {
  color: #6b0f0f;
  background: radial-gradient(circle at 32% 28%, #fff8ee 0%, #f5d4b0 35%, #e09868 70%, #b85a38 100%);
  border-color: rgba(140, 50, 25, 0.5);
}

.arena-xiangqi__piece.is-black {
  color: #f5ead8;
  background: radial-gradient(circle at 32% 28%, #7a6a58 0%, #524038 42%, #342418 78%, #1e140c 100%);
  border-color: rgba(15, 10, 6, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.14) inset,
    0 -3px 6px rgba(0, 0, 0, 0.45) inset,
    0 5px 10px rgba(20, 12, 6, 0.45);
}

.arena-xiangqi__point.is-selected .arena-xiangqi__piece,
.arena-xiangqi__cell.is-selected .arena-xiangqi__piece {
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.6) inset,
    0 -3px 6px rgba(0, 0, 0, 0.3) inset,
    0 0 0 3px var(--hub-gold, #e8c872),
    0 5px 10px rgba(60, 30, 10, 0.4);
}

.arena-xiangqi__hint {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(120, 85, 55, 0.85);
  margin: 10px 0 0;
}

.arena-xiangqi--zulong .arena-xiangqi__hint {
  font-family: var(--hub-font-display, 'Noto Serif SC', serif);
}

/* 坦克 */
.arena-tank__grid {
  display: grid;
  grid-template-columns: repeat(var(--tw, 11), minmax(22px, 1fr));
  gap: 1px;
  max-width: min(100%, 420px);
  margin: 0 auto;
  background: #1a2433;
  padding: 4px;
  border-radius: 8px;
}

.arena-tank__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #243044;
  font-size: 0.65rem;
}

.arena-tank__wall {
  display: block;
  width: 80%;
  height: 80%;
  background: #4a5568;
  border-radius: 2px;
}

.arena-tank__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.arena-tank__unit.is-red {
  color: #f87171;
}

.arena-tank__unit.is-black {
  color: #93c5fd;
}

.arena-tank__unit small {
  font-size: 0.55rem;
  opacity: 0.9;
}

.arena-tank__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.arena-tank__hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--hub-muted);
  margin-top: 10px;
}

.arena-seat-line.is-out {
  opacity: 0.45;
  text-decoration: line-through;
}

/* 坦克 · Canvas 横屏战场 */
.arena-room-page--tank .arena-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.arena-tank-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 10px 8px 12px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(232, 120, 152, 0.18), transparent 55%),
    linear-gradient(165deg, rgba(18, 10, 14, 0.92) 0%, rgba(8, 12, 22, 0.96) 100%);
  border: 1px solid rgba(232, 168, 114, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 20px 50px rgba(0, 0, 0, 0.45);
}

.arena-tank-stage.is-my-turn {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.15) inset,
    0 0 40px rgba(251, 191, 36, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.45);
}

.arena-tank-stage__head {
  width: 100%;
  text-align: center;
  flex-shrink: 0;
}

.arena-tank-stage__badge {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 168, 114, 0.85);
}

.arena-tank-stage__map {
  margin: 0;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(118deg, #fde68a 0%, #fbbf24 42%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.arena-tank-orient {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  align-items: center;
  justify-content: center;
  background: rgba(12, 6, 10, 0.92);
  border-radius: 12px;
}

.arena-tank-orient.is-active {
  display: flex;
}

.arena-tank-orient__box {
  text-align: center;
  padding: 24px;
  max-width: 280px;
}

.arena-tank-orient__icon {
  font-size: 3rem;
  margin: 0 0 12px;
  animation: arenaTankRotate 2s ease-in-out infinite;
}

@keyframes arenaTankRotate {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(90deg);
  }
}

.arena-tank-orient__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--hub-gold, #e8c872);
}

.arena-tank-orient__sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--hub-muted);
}

.arena-tank-map-pick {
  margin: 0 0 14px;
  padding: 0;
  border: none;
}

.arena-tank-map-pick legend {
  font-size: 0.82rem;
  color: var(--hub-muted);
  margin-bottom: 8px;
}

.arena-tank-map-pick__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.arena-tank-map-pick__item {
  display: block;
  cursor: pointer;
}

.arena-tank-map-pick__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.arena-tank-map-pick__card {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--hub-border);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, background 0.15s;
}

.arena-tank-map-pick__card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.arena-tank-map-pick__card small {
  display: block;
  font-size: 0.72rem;
  color: var(--hub-muted);
  line-height: 1.35;
}

.arena-tank-map-pick__item input:checked + .arena-tank-map-pick__card {
  border-color: rgba(232, 120, 152, 0.65);
  background: rgba(232, 120, 152, 0.12);
  box-shadow: 0 0 0 1px rgba(232, 120, 152, 0.25);
}

.arena-seat-meta--map {
  color: var(--hub-gold, #e8c872);
}

.arena-tank-canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: min(52dvh, 420px);
  flex: 1;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 60px rgba(232, 120, 152, 0.08) inset;
}

.arena-tank-canvas-wrap::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.arena-tank-stage.is-my-turn .arena-tank-canvas-wrap::before {
  box-shadow: 0 0 32px rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.25);
  animation: arenaTankPulse 2s ease-in-out infinite;
}

@keyframes arenaTankPulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.arena-tank-canvas {
  display: block;
  border-radius: 10px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.arena-tank-touch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding: 4px 0 8px;
  touch-action: manipulation;
}

.arena-tank-touch.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.arena-tank-touch__pad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(2, 52px);
  gap: 6px;
}

.arena-tank-touch__btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  color: #f8fafc;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.arena-tank-touch__btn:active {
  background: rgba(232, 120, 152, 0.35);
  transform: scale(0.96);
}

.arena-tank-touch__btn--fwd {
  grid-column: 2;
  grid-row: 1;
}

.arena-tank-touch__btn--left {
  grid-column: 1;
  grid-row: 2;
}

.arena-tank-touch__btn--right {
  grid-column: 3;
  grid-row: 2;
}

.arena-tank-touch__fire {
  min-width: 96px;
  min-height: 96px;
  padding: 14px 22px;
  border-radius: 50%;
  border: 2px solid rgba(254, 202, 202, 0.5);
  background: linear-gradient(145deg, #ef4444 0%, #b91c1c 48%, #7f1d1d 100%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow:
    0 8px 28px rgba(220, 38, 38, 0.55),
    0 0 24px rgba(239, 68, 68, 0.25);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.arena-tank-touch__fire:active {
  transform: scale(0.95);
}

.arena-tank-touch-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--hub-muted);
  text-align: center;
}

@media (orientation: landscape) and (max-height: 520px) {
  .arena-room-page--tank .arena-layout {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 32vw);
    align-items: stretch;
  }

  .arena-room-page--tank .arena-board-wrap {
    min-height: calc(100vh - 140px);
  }

  .arena-tank-stage {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .arena-tank-canvas-wrap {
    flex: 1 1 auto;
    min-width: 55vw;
    max-height: calc(100vh - 160px);
  }

  .arena-tank-touch {
    flex: 0 0 auto;
    flex-direction: column;
    padding-right: env(safe-area-inset-right, 0);
  }

  .arena-tank-touch__pad {
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(2, 56px);
  }

  .arena-tank-touch__fire {
    min-width: 96px;
    min-height: 96px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .arena-room-page--tank .arena-tank-canvas-wrap,
  .arena-room-page--tank .arena-tank-touch {
    pointer-events: none;
    opacity: 0.35;
  }
}

/* —— 手机横屏沉浸：棋盘铺满视口 —— */
.arena-mobile-portrait-hint {
  display: none;
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0));
  left: 50%;
  transform: translateX(-50%);
  z-index: 180;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 8, 14, 0.92);
  border: 1px solid rgba(232, 120, 152, 0.35);
  font-size: 0.78rem;
  color: var(--hub-muted);
  pointer-events: none;
  max-width: calc(100vw - 24px);
  text-align: center;
}

.arena-mobile-portrait-hint__icon {
  font-size: 1.1rem;
  color: var(--hub-gold, #e8c872);
}

.arena-mobile-portrait-hint strong {
  color: var(--hub-gold, #e8c872);
  font-weight: 700;
}

.arena-mobile-dock {
  display: none;
  position: fixed;
  z-index: 190;
  bottom: max(8px, env(safe-area-inset-bottom, 0));
  left: max(8px, env(safe-area-inset-left, 0));
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100vw - 16px);
}

.arena-mobile-dock__btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(232, 120, 152, 0.45);
  background: rgba(18, 8, 14, 0.88);
  color: #f5e6eb;
  font-size: 0.75rem;
  font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px);
}

.arena-mobile-dock__btn:active {
  background: rgba(232, 120, 152, 0.25);
}

.arena-room-page--mobile .arena-mobile-dock {
  display: flex;
}

.arena-room-page--immersive {
  overflow: hidden;
  height: 100dvh;
  height: 100svh;
}

.arena-room-page--immersive .hub-bg {
  opacity: 0.35;
}

.arena-room-page--immersive .hub-wrap {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}

.arena-room-page--immersive .tea-header,
.arena-room-page--immersive .hub-site-nav,
.arena-room-page--immersive .arena-game-tabs,
.arena-room-page--immersive .games-toolbar,
.arena-room-page--immersive .arena-replay-banner {
  display: none;
}

.arena-room-page--immersive.arena-chrome-open .tea-header,
.arena-room-page--immersive.arena-chrome-open .hub-site-nav,
.arena-room-page--immersive.arena-chrome-open .arena-game-tabs,
.arena-room-page--immersive.arena-chrome-open .games-toolbar {
  display: block;
  flex-shrink: 0;
}

.arena-room-page--immersive.arena-chrome-open .tea-header {
  padding: 6px 10px;
  margin: 0;
}

.arena-room-page--immersive .arena-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  position: relative;
}

.arena-room-page--immersive .arena-board-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 4px 6px;
  padding-bottom: max(44px, env(safe-area-inset-bottom, 0));
  border: none;
  border-radius: 0;
  background: rgba(8, 4, 6, 0.55);
}

.arena-room-page--immersive .arena-seat-bar {
  flex-shrink: 0;
  margin: 0 0 4px;
  padding: 4px 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.arena-room-page--immersive #boardRoot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.arena-room-page--immersive .arena-toolbar {
  flex-shrink: 0;
  margin-top: 4px;
  gap: 6px;
}

.arena-room-page--immersive .arena-toolbar .hub-btn {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.arena-room-page--immersive .arena-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  width: min(300px, 42vw);
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top, 0));
  padding-right: max(12px, env(safe-area-inset-right, 0));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  border-left: 1px solid var(--hub-border-strong);
  background: rgba(12, 6, 10, 0.97);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
}

.arena-room-page--immersive.arena-side-open .arena-side-panel {
  transform: translateX(0);
}

.arena-room-page--immersive .arena-side-panel::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.arena-room-page--immersive.arena-side-open .arena-side-panel::before {
  opacity: 1;
  pointer-events: auto;
}

/* 象棋 · 横屏铺满 */
.arena-room-page--immersive .arena-xiangqi {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.arena-room-page--immersive .arena-xiangqi__board {
  width: min(calc(100vw - 40px), calc((100dvh - 96px) * 0.88));
  max-width: 100%;
  max-height: calc(100dvh - 88px);
}

.arena-room-page--immersive .arena-xiangqi__plate {
  max-height: calc(100dvh - 120px);
}

.arena-room-page--immersive .arena-xiangqi__hint {
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 0.7rem;
}

/* 五子棋 · 横屏 */
.arena-room-page--immersive .arena-gomoku {
  width: min(calc(100vh - 100px), calc(100vw - 56px));
  height: min(calc(100vh - 100px), calc(100vw - 56px));
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

/* 坦克 · 横屏铺满（与沉浸布局合并） */
.arena-room-page--immersive.arena-room-page--tank .arena-layout {
  grid-template-columns: minmax(0, 1fr);
}

.arena-room-page--immersive.arena-room-page--tank .arena-tank-stage {
  flex: 1;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 8px;
}

.arena-room-page--immersive.arena-room-page--tank .arena-tank-canvas-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: min(78dvh, 100%);
  max-width: none;
  max-height: none;
  height: 100%;
}

.arena-room-page--immersive.arena-room-page--tank .arena-tank-touch {
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  padding-right: env(safe-area-inset-right, 0);
}

.arena-room-page--immersive.arena-room-page--tank .arena-tank-touch-hint {
  display: none;
}

/* 手机横屏（非对局也略收紧侧栏） */
@media (max-width: 900px) and (orientation: landscape) {
  .arena-room-page--mobile .arena-layout {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 34vw);
    gap: 8px;
    align-items: stretch;
  }

  .arena-room-page--mobile .hub-wrap {
    padding-bottom: 8px;
  }

  .arena-room-page--mobile .tea-header {
    padding: 6px 0;
  }

  .arena-room-page--mobile .games-toolbar {
    display: none;
  }

  .arena-room-page--mobile .arena-board-wrap {
    padding: 8px;
  }

  .arena-room-page--mobile .arena-xiangqi__board {
    width: min(calc(100vw - 220px), calc(100dvh - 110px));
    max-height: calc(100dvh - 100px);
    margin: 0 auto;
  }

  .arena-room-page--mobile .arena-gomoku {
    width: min(calc(100dvh - 130px), calc(100vw - 220px));
    height: min(calc(100dvh - 130px), calc(100vw - 220px));
    margin: 0 auto;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .arena-room-page--tank:not(.arena-room-page--immersive) .arena-layout {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 30vw);
  }

  .arena-room-page--tank:not(.arena-room-page--immersive) .arena-tank-canvas-wrap {
    max-height: calc(100dvh - 120px);
  }
}

:fullscreen .arena-room-page--immersive .hub-wrap,
:fullscreen .arena-room-page--immersive .arena-board-wrap {
  height: 100%;
}

:fullscreen .arena-room-page--immersive .arena-xiangqi__board {
  width: min(calc(100vw - 32px), calc(100dvh - 64px));
  max-height: calc(100dvh - 64px);
}

:fullscreen .arena-room-page--immersive .arena-gomoku {
  width: min(calc(100dvh - 80px), calc(100vw - 48px));
  height: min(calc(100dvh - 80px), calc(100vw - 48px));
}

/* 连连看 */
.arena-linklink {
  width: 100%;
  max-width: min(100%, 720px);
  margin: 0 auto;
}

.arena-linklink__boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.arena-room-page--linklink .arena-board-wrap {
  max-width: min(100%, 760px);
}

.arena-linklink__panel {
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(92, 61, 30, 0.25);
  background: rgba(255, 248, 235, 0.55);
}

.arena-linklink__panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.arena-linklink__side-label {
  font-weight: 800;
  color: var(--hub-ink, #3d2818);
}

.arena-linklink__score {
  color: var(--hub-muted, #6b5344);
}

.arena-linklink__grid {
  display: grid;
  gap: 3px;
}

.arena-linklink__tile {
  aspect-ratio: 1;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(60, 40, 20, 0.2);
  background: linear-gradient(165deg, #fff9f0 0%, #f3e2c8 100%);
  font-size: clamp(1rem, 3.2vw, 1.35rem);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.2s ease;
}

.arena-linklink__tile.is-gone {
  visibility: hidden;
  pointer-events: none;
}

.arena-linklink__tile.is-selected {
  transform: scale(1.06);
  box-shadow:
    inset 0 0 0 2px var(--hub-gold, #e8c872),
    0 4px 12px rgba(60, 30, 10, 0.25);
  z-index: 2;
}

.arena-linklink__tile.is-hint {
  animation: arena-ll-hint 0.9s ease-in-out infinite;
}

.arena-linklink__tile.is-last {
  background: rgba(232, 120, 152, 0.35);
}

@keyframes arena-ll-hint {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(232, 180, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(232, 120, 152, 0.75);
  }
}

.arena-linklink__tile:disabled:not(.is-gone) {
  cursor: default;
  opacity: 0.85;
}

.arena-linklink__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.arena-linklink__hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--hub-muted);
  flex: 1 1 200px;
}
