/* ========================================
   Tavern Game - 谎言酒馆样式
   暗色酒馆风格，暖黄灯光
   ======================================== */

/* === 基础布局 === */
.tavern-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: linear-gradient(180deg, #1a1410 0%, #2a1f18 50%, #1a1410 100%);
  color: #e8dcc8;
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tavern-screen.is-active {
  display: flex;
}

.tavern-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.tavern-view.is-active {
  display: flex;
}

/* === 顶部导航 === */
.tavern-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(20, 16, 12, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(232, 193, 112, 0.1);
  flex-shrink: 0;
}

.tavern-header__back,
.tavern-header__rules {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(232, 193, 112, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.tavern-header__back:active,
.tavern-header__rules:active {
  background: rgba(232, 193, 112, 0.2);
}

.tavern-header__back svg,
.tavern-header__rules svg {
  width: 18px;
  height: 18px;
  stroke: #e8c170;
}

.tavern-header__title {
  font-size: 15px;
  font-weight: 600;
  color: #e8c170;
  letter-spacing: 1px;
}

/* === 通用按钮 === */
.tavern-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.tavern-btn:active {
  transform: scale(0.96);
}

.tavern-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.tavern-btn--primary {
  background: linear-gradient(135deg, #e8c170, #d4a04a);
  color: #1a1410;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(232, 193, 112, 0.3);
}

.tavern-btn--primary:active {
  box-shadow: 0 1px 6px rgba(232, 193, 112, 0.2);
}

.tavern-btn--ghost {
  background: rgba(232, 193, 112, 0.08);
  color: #e8c170;
  border: 1px solid rgba(232, 193, 112, 0.2);
}

.tavern-btn--ghost:active {
  background: rgba(232, 193, 112, 0.15);
}

.tavern-btn--action {
  background: linear-gradient(135deg, #4a9eff, #2d7dd2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.tavern-btn--trust {
  background: linear-gradient(135deg, #66bb6a, #4caf50);
  color: #fff;
  box-shadow: 0 2px 8px rgba(102, 187, 106, 0.3);
}

.tavern-btn--challenge {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 83, 80, 0.3);
}

.tavern-btn--small {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(232, 193, 112, 0.08);
  color: #b8a88c;
  border: 1px solid rgba(232, 193, 112, 0.12);
}

.tavern-btn--danger {
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.2);
}

/* === 通用芯片按钮 === */
.tavern-chip {
  border: 1px solid rgba(232, 193, 112, 0.2);
  background: rgba(232, 193, 112, 0.05);
  color: #b8a88c;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.tavern-chip.is-active {
  background: rgba(232, 193, 112, 0.2);
  color: #e8c170;
  border-color: #e8c170;
}

.tavern-chip:active {
  transform: scale(0.95);
}

/* === 通用标题 === */
.tavern-section-title {
  font-size: 12px;
  color: #b8a88c;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.tavern-empty {
  text-align: center;
  color: #6b5d4d;
  font-size: 12px;
  padding: 20px;
}

/* === 大厅视图 === */
.tavern-lobby__ambience {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 20px;
}

.tavern-lobby__lamp {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 193, 112, 0.4) 0%, rgba(232, 193, 112, 0.1) 50%, transparent 70%);
  margin-bottom: 16px;
  animation: tavern-glow 3s ease-in-out infinite;
}

@keyframes tavern-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.tavern-lobby__mood {
  font-size: 13px;
  color: #b8a88c;
  text-align: center;
  font-style: italic;
  opacity: 0.8;
}

.tavern-lobby__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 0;
}

.tavern-lobby__history {
  margin-top: 16px;
}

.tavern-lobby__history-list {
  background: rgba(232, 193, 112, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(232, 193, 112, 0.08);
  min-height: 60px;
}

/* === 创建酒局视图 === */
.tavern-create__chars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.tavern-char-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(232, 193, 112, 0.04);
  border: 1px solid rgba(232, 193, 112, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tavern-char-card.is-selected {
  background: rgba(232, 193, 112, 0.12);
  border-color: #e8c170;
}

.tavern-char-card.is-busy {
  opacity: 0.5;
}

.tavern-char-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a2f25, #5a4a38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.tavern-char-card__info {
  flex: 1;
  min-width: 0;
}

.tavern-char-card__name {
  font-size: 13px;
  color: #e8dcc8;
  font-weight: 500;
}

.tavern-char-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.tavern-char-card__status {
  font-size: 10px;
  color: #8b7d6b;
}

.tavern-char-card__tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(232, 193, 112, 0.1);
  color: #b8a88c;
}

.tavern-char-card__check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 193, 112, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tavern-char-card.is-selected .tavern-char-card__check {
  background: #e8c170;
  border-color: #e8c170;
}

.tavern-char-card.is-selected .tavern-char-card__check::after {
  content: '✓';
  font-size: 11px;
  color: #1a1410;
  font-weight: bold;
}

.tavern-create__options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(232, 193, 112, 0.08);
}

.tavern-create__option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tavern-create__label {
  font-size: 12px;
  color: #b8a88c;
  min-width: 56px;
}

.tavern-create__rounds,
.tavern-create__punish {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tavern-create__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  margin-top: auto;
}

/* === 牌局视图 === */
.tavern-game__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(232, 193, 112, 0.08);
  margin-bottom: 10px;
}

.tavern-game__round {
  font-size: 11px;
  color: #b8a88c;
  background: rgba(232, 193, 112, 0.08);
  padding: 3px 8px;
  border-radius: 8px;
}

.tavern-game__target {
  font-size: 12px;
  color: #e8c170;
  font-weight: 500;
}

.tavern-game__table {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 180px;
}

.tavern-game__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tavern-game__pile {
  position: relative;
}

.tavern-card-back {
  width: 44px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3a2f25, #5a4a38);
  border: 1.5px solid rgba(232, 193, 112, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.tavern-card-back::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(232, 193, 112, 0.4);
}

.tavern-game__last-move {
  font-size: 11px;
  color: #8b7d6b;
  text-align: center;
  min-height: 16px;
}

.tavern-game__players {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.tavern-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
}

.tavern-player.is-current {
  transform: scale(1.1);
}

.tavern-player__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a2f25, #5a4a38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.tavern-player.is-current .tavern-player__avatar {
  border-color: #e8c170;
  box-shadow: 0 0 12px rgba(232, 193, 112, 0.4);
}

.tavern-player__name {
  font-size: 10px;
  color: #b8a88c;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tavern-player__cards {
  font-size: 9px;
  color: #6b5d4d;
}

/* === 对话气泡 === */
.tavern-game__dialogue {
  min-height: 40px;
  padding: 6px 0;
}

.tavern-dialogue-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 193, 112, 0.08);
  border: 1px solid rgba(232, 193, 112, 0.12);
  border-radius: 12px;
  padding: 6px 12px;
  margin-bottom: 4px;
  animation: tavern-fadeIn 0.3s ease;
}

@keyframes tavern-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tavern-dialogue-bubble__name {
  font-size: 10px;
  color: #e8c170;
  font-weight: 500;
}

.tavern-dialogue-bubble__text {
  font-size: 12px;
  color: #e8dcc8;
}

/* === 手牌区域 === */
.tavern-game__hand {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  flex-wrap: wrap;
  border-top: 1px solid rgba(232, 193, 112, 0.08);
}

.tavern-hand-card {
  width: 40px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2a2218, #3a2f25);
  border: 1.5px solid rgba(232, 193, 112, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.tavern-hand-card.is-selected {
  border-color: #e8c170;
  transform: translateY(-6px);
  box-shadow: 0 4px 12px rgba(232, 193, 112, 0.3);
}

.tavern-hand-card:active {
  transform: scale(0.95);
}

.tavern-hand-card__icon {
  font-size: 18px;
}

.tavern-hand-card__name {
  font-size: 8px;
  color: #8b7d6b;
  margin-top: 2px;
}

/* === 操作按钮区 === */
.tavern-game__actions {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  flex-wrap: wrap;
  justify-content: center;
}

/* === 结算视图 === */
.tavern-settle {
  align-items: center;
  text-align: center;
}

.tavern-settle__title {
  font-size: 18px;
  color: #e8c170;
  font-weight: 600;
  margin-bottom: 16px;
}

.tavern-settle__winner {
  font-size: 14px;
  color: #e8dcc8;
  margin-bottom: 12px;
}

.tavern-settle__stats,
.tavern-settle__highlights,
.tavern-settle__punishments {
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
}

.tavern-settle__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

/* === 弹窗 === */
.tavern-modal {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.tavern-modal.is-active {
  display: flex;
}

.tavern-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.8);
  backdrop-filter: blur(4px);
}

.tavern-modal__content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #2a2218, #1a1410);
  border: 1px solid rgba(232, 193, 112, 0.15);
  border-radius: 16px;
  padding: 20px;
  width: calc(100% - 48px);
  max-width: 300px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.tavern-modal__title {
  font-size: 15px;
  color: #e8c170;
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
}

.tavern-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* === 质疑翻牌 === */
.tavern-challenge__declared,
.tavern-challenge__reveal {
  text-align: center;
  padding: 8px;
  margin-bottom: 8px;
}

.tavern-challenge__declared {
  font-size: 12px;
  color: #b8a88c;
}

.tavern-challenge__reveal {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.tavern-reveal-card {
  width: 36px;
  height: 50px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2a2218, #3a2f25);
  border: 1px solid rgba(232, 193, 112, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.tavern-challenge__verdict {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
}

.tavern-challenge__verdict.is-bluff {
  color: #ef5350;
}

.tavern-challenge__verdict.is-honest {
  color: #66bb6a;
}

.tavern-challenge__loser {
  text-align: center;
  font-size: 12px;
  color: #b8a88c;
}

/* === 惩罚卡 === */
.tavern-punish-card {
  text-align: center;
}

.tavern-punish__icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.tavern-punish__title {
  font-size: 16px;
  color: #e8c170;
  font-weight: 600;
  margin-bottom: 8px;
}

.tavern-punish__desc {
  font-size: 13px;
  color: #e8dcc8;
  line-height: 1.5;
  margin-bottom: 8px;
}

.tavern-punish__target {
  font-size: 11px;
  color: #8b7d6b;
}

/* === 规则弹窗 === */
.tavern-rules__body p {
  font-size: 12px;
  color: #e8dcc8;
  line-height: 1.8;
  padding-left: 4px;
}

/* === 出牌声明 === */
.tavern-play-declare__hint {
  font-size: 11px;
  color: #8b7d6b;
  text-align: center;
  margin-bottom: 10px;
}

.tavern-play-declare__selected {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 56px;
  align-items: center;
}

.tavern-play-declare__counts {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* === Toast === */
.tavern-toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(232, 193, 112, 0.9);
  color: #1a1410;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}

.tavern-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
