/* 斗地主专用样式：变量与按钮基样来自 ../base.css，此处不再重复定义 */

button.primary { color: #1a1a1a; }

/* 大厅 */
#lobby {
  flex-direction: column;
  align-items: center;
}
.home-link {
  display: block;
  width: 100%;
  max-width: 320px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 18px;
  transition: color .15s;
}
.home-link:hover { color: var(--gold-bright); }
#lobby { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 36px;
  width: 320px;
  text-align: center;
}
.panel h1 { color: var(--gold); margin-bottom: 20px; font-weight: 600; }
.panel h2 { color: var(--gold); margin-bottom: 12px; font-weight: 600; }
.field { text-align: left; margin: 10px 0; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.field input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px;
  font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--gold); }
.row { margin: 12px 0 4px; }
.row button { width: 100%; margin: 4px 0; }
.divider { color: var(--text-dim); margin: 14px 0; font-size: 13px; }

/* 游戏界面 */
#game { padding: 20px 28px; max-width: 1100px; margin: 0 auto; }
#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  font-size: 14px;
  color: var(--text-dim);
}
#roomBox { display: flex; align-items: center; }
#topbar #roomCode { color: var(--gold); font-weight: 600; }
button.mini {
  padding: 3px 12px;
  font-size: 12px;
  margin: 0 0 0 6px;
  border-radius: 4px;
}

#table { display: flex; align-items: stretch; gap: 18px; margin: 20px 0; }
.seat {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  min-height: 180px;
  position: relative;
}
.seat .seat-name { font-weight: 600; }
.seat .seat-name.landlord { color: var(--gold); }
.seat .seat-name.current {
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(212, 175, 55, .7);
}
.seat .seat-score { color: var(--text-dim); font-size: 13px; }
.seat .seat-bot { color: var(--gold-dim); font-size: 12px; }
.seat .hand-count { margin-top: 8px; color: var(--text-dim); font-size: 13px; }
.seat-empty { color: var(--text-dim); }

/* 地主标签 */
.landlord-tag {
  display: inline-block;
  color: #1a1a1a;
  background: var(--gold);
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 8px;
  margin-top: 2px;
}

/* 当前回合座位整体高亮 */
.seat.current-turn, .seat-self.current-turn {
  border: 2px solid var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, .7);
}
.seat-self.current-turn { border-radius: 8px; padding: 4px; }

/* 对手剩余牌数对应的牌背 */
.hand-backs {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
.hand-backs .card.back.small {
  width: 20px;
  height: 30px;
  margin-left: -13px;
}
.hand-backs .card.back.small:first-child { margin-left: 0; }

.pass-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--gold-bright);
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 3px 10px;
  background: rgba(26, 26, 26, .92);
  box-shadow: 0 0 12px rgba(212, 175, 55, .7);
}

.bid-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--gold-bright);
  border-radius: 6px;
  padding: 3px 10px;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, .95);
}

#center {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 0;
}
#bottomCards { display: flex; gap: 6px; min-height: 72px; align-items: center; }
#playRow {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}
.play-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 84px;
  justify-content: flex-start;
}
.play-name {
  font-size: 14px;
  color: var(--gold-bright);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(212, 175, 55, .6);
  margin-bottom: 4px;
}
.play-cards {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}
.play-pass {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 700;
}
#playSelf { min-height: 64px; }
#countdown { font-size: 24px; font-weight: 700; color: var(--gold-bright); min-height: 28px; text-shadow: 0 0 12px rgba(212, 175, 55, .7); }
#statusText { font-size: 14px; color: var(--gold); min-height: 18px; }

/* 自己座位 */
.seat-self { text-align: center; margin-top: 12px; position: relative; }
.seat-self .seat-name { font-weight: 600; }
.seat-self .seat-name.landlord { color: var(--gold); }
.seat-self .seat-name.current { color: var(--gold-bright); text-shadow: 0 0 10px rgba(212, 175, 55, .7); }
.seat-self .seat-score { color: var(--text-dim); font-size: 13px; }

/* 手牌 */
#myHand {
  display: flex;
  justify-content: center;
  min-height: 132px;
  align-items: flex-end;
  margin-top: 22px;
  touch-action: none;
}

/* 牌面 */
.card {
  width: 56px;
  height: 84px;
  background: var(--card-bg);
  color: var(--black);
  border-radius: 6px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-left: -10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.card:first-child { margin-left: 0; }
.card.red { color: var(--red); }

.card .corner {
  position: absolute;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  font-weight: 700;
}
.card .corner .suit { display: block; font-size: 12px; margin-top: 1px; }
.card .corner.tl { top: 4px; left: 5px; }
.card .corner.br { bottom: 4px; right: 5px; transform: rotate(180deg); }

.card .center-suit { font-size: 30px; }

.card .joker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  font-size: 18px;
}
.card.joker .joker-word { writing-mode: vertical-rl; font-size: 16px; }

.card.small { width: 36px; height: 52px; margin-left: -4px; }
.card.small:first-child { margin-left: 0; }
.card.small .center-suit { font-size: 16px; }
.card.small .corner { font-size: 9px; }
.card.small .corner .suit { font-size: 8px; }
.card.small .joker-col { font-size: 12px; }

.card.back {
  background: repeating-linear-gradient(45deg, #2a2a2a 0 6px, #333 6px 12px);
  border: 1px solid var(--gold-dim);
}

.card.selected { transform: translateY(-16px); border: 2px solid var(--gold); }

/* 操作按钮 */
#actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  min-height: 46px;
  gap: 6px;
}
.wait-info { color: var(--text-dim); font-size: 14px; }

/* 互动表情 */
#emojiBar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.emoji-btn {
  padding: 6px 16px;
  font-size: 14px;
  border-radius: 20px;
}
.emoji-btn.active {
  background: var(--gold);
  color: #1a1a1a;
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(212, 175, 55, .7);
}

/* 对手座位可发送表情高亮 */
.emoji-target {
  border-color: var(--gold-bright) !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, .8);
  cursor: pointer;
}

/* 表情飘动动画 */
.emoji-pop {
  position: fixed;
  font-size: 42px;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
  animation: emoji-float 1.5s ease-out forwards;
}
@keyframes emoji-float {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  20% { opacity: 1; transform: translate(-50%, -70%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}

/* 快捷对话菜单 */
#quickChatMenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px auto 0;
  width: 280px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px;
}
.quick-item {
  width: 100%;
  text-align: center;
  padding: 9px 6px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}
.quick-item:hover { background: var(--bg2); color: var(--gold-bright); }

/* 对话气泡 */
.chat-bubble {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--gold);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 0, 0, .5);
  transform: translate(-50%, -100%);
  animation: bubble-float 2.6s ease-out forwards;
}
@keyframes bubble-float {
  0% { opacity: 0; transform: translate(-50%, -70%); }
  12% { opacity: 1; transform: translate(-50%, -100%); }
  80% { opacity: 1; transform: translate(-50%, -130%); }
  100% { opacity: 0; transform: translate(-50%, -160%); }
}

/* 提示 */
#toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--gold);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 99;
}
#toast.show { opacity: 1; }
#toast.error { border-color: var(--red); color: #e57373; }

/* 结果弹窗 */
#result {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#resultDetail { color: var(--text-dim); margin: 8px 0; font-size: 14px; }
