/* 掼蛋牌桌样式（布局照 uno.css，牌面为扑克样式） */
.screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}

/* ===== 大厅 / 房间 ===== */
.lobby-card {
  background: #fff; border-radius: 24px; padding: 36px;
  width: 400px; max-width: 92vw; text-align: center;
  box-shadow: 0 8px 30px rgba(30, 120, 80, .25);
}
.lobby-card h1 { color: #1e7850; font-size: 42px; }
.lobby-card h2 { color: #1e7850; }
.subtitle { color: #888; margin: 8px 0 20px; }
.lobby-card input {
  width: 100%; padding: 12px; margin-bottom: 12px; font-size: 16px;
  border: 2px solid #c9e8d8; border-radius: 12px; outline: none; text-align: center;
}
.lobby-card input:focus { border-color: #1e7850; }
.btn-primary {
  background: #1e7850; color: #fff; border: none; border-radius: 12px;
  padding: 12px 24px; font-size: 17px; font-weight: bold; cursor: pointer;
  transition: transform .1s;
}
.btn-primary:hover { transform: scale(1.05); }
.btn-primary:disabled { background: #9dc5b3; cursor: not-allowed; transform: none; }
.btn-plain {
  background: #f0f0f0; color: #666; border: none; border-radius: 12px;
  padding: 10px 24px; font-weight: bold; cursor: pointer; margin-top: 14px;
}
.join-row { display: flex; gap: 10px; align-items: stretch; }
.join-row input { flex: 1; text-transform: uppercase; margin-bottom: 0 !important; }
.join-row .btn-secondary { flex-shrink: 0; }

.lobby-hello {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 20px;
}
.lobby-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #e2f4ea; display: inline-flex; overflow: hidden;
  align-items: center; justify-content: center; font-size: 30px;
}
.lobby-option {
  background: #f2faf5; border-radius: 18px; padding: 18px;
  transition: box-shadow .15s;
}
.lobby-option:hover { box-shadow: 0 4px 16px rgba(30, 120, 80, .18); }
.btn-big { width: 100%; padding: 14px; font-size: 18px; }
.btn-secondary {
  background: #fff; color: #1e7850; border: 2px solid #1e7850;
  border-radius: 12px; padding: 12px 18px; font-size: 16px;
  font-weight: bold; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: #e2f4ea; }
.option-desc { color: #aaa; font-size: 13px; margin-top: 10px; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: #ccc; margin: 16px 8px; font-size: 14px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: #d5ecdf;
}
.bot-tag {
  background: #1e7850; color: #fff; border-radius: 8px;
  font-size: 11px; padding: 1px 6px; margin-left: 4px;
}
.bot-remove {
  background: none; border: none; color: #ccc; cursor: pointer;
  margin-left: auto; font-size: 14px; padding: 2px 6px;
}
.bot-remove:hover { color: #e63946; }
#btn-add-bot { margin-top: 4px; width: 100%; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rp-avatar {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2f4ea; flex-shrink: 0; font-size: 20px;
}
.opp-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
  background: #e2f4ea; font-size: 26px;
}
.my-avatar {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  overflow: hidden; vertical-align: middle;
}
.error { color: #e63946; min-height: 20px; margin-top: 10px; }
.hint { color: #aaa; font-size: 13px; margin-top: 12px; }
.hint a { color: #1e7850; }

.room-code-big {
  font-size: 44px; font-weight: bold; letter-spacing: 10px; color: #333;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.room-code-big button {
  background: #e2f4ea; border: none; border-radius: 10px;
  font-size: 22px; padding: 6px 10px; cursor: pointer; letter-spacing: 0;
}
#room-players { list-style: none; margin: 16px 0; }
#room-players li {
  background: #f2faf5; border-radius: 12px; padding: 10px 16px;
  margin-bottom: 8px; font-size: 17px; font-weight: bold; color: #444;
  display: flex; align-items: center; gap: 8px;
}
#room-players li .offline { color: #e63946; font-size: 12px; }
.host-star { color: #f5a623; }
.team-tag {
  border-radius: 8px; font-size: 11px; padding: 1px 6px; font-weight: normal;
}
.team-tag.team0 { background: #dcebff; color: #2b7cd3; }
.team-tag.team1 { background: #ffe0e0; color: #e63329; }

/* ===== 牌桌 ===== */
#screen-table {
  flex-direction: column; justify-content: flex-start;
  padding: 8px; gap: 6px;
  background: radial-gradient(ellipse at center, #2e8b57 0%, #1c5c38 80%);
  min-height: 100vh; min-height: 100dvh;
}

#top-bar {
  width: 100%; max-width: 900px;
  display: flex; align-items: center; gap: 10px;
}
#top-bar button {
  background: rgba(255,255,255,.85); border: none; border-radius: 10px;
  font-size: 20px; padding: 6px 10px; cursor: pointer;
}
#last-action {
  flex: 1; text-align: center; color: #175c39; font-weight: bold;
  background: rgba(255,255,255,.8); border-radius: 12px; padding: 8px;
  font-size: 14px; min-height: 20px;
}

#chat-bar {
  width: 100%; max-width: 900px;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: rgba(255,255,255,.85); border-radius: 12px; padding: 8px;
}
#chat-bar span {
  background: #e2f4ea; border-radius: 14px; padding: 6px 12px;
  font-size: 14px; cursor: pointer;
}
#chat-bar span:hover { background: #c5e8d3; }

/* 级别信息条 */
#level-bar {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  flex-wrap: wrap; color: #fff; font-size: 14px;
}
#level-bar .lvl-cur {
  background: #f5b800; color: #4a3500; border-radius: 12px;
  padding: 3px 12px; font-size: 15px;
}
#level-bar .lvl-team {
  background: rgba(255,255,255,.25); border-radius: 12px; padding: 3px 10px;
}
#level-bar .lvl-team.mine { background: rgba(245,184,0,.35); }
#level-bar .lvl-offense {
  background: rgba(255,255,255,.15); border-radius: 12px; padding: 3px 10px;
  font-size: 12px;
}

/* 对手区 */
#opponents {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  width: 100%; max-width: 900px; min-height: 96px;
}
.opp {
  background: rgba(255,255,255,.88); border-radius: 16px;
  padding: 8px 12px; text-align: center; min-width: 120px;
  border: 3px solid transparent;
}
.opp.partner { border-color: rgba(245,184,0,.55); }
.opp.current { border-color: #f5b800; animation: glow 1s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 16px #f5b800; } }
.opp .opp-name { font-weight: bold; font-size: 14px; color: #444; }
.opp .opp-name .offline { color: #e63946; font-size: 11px; }
.opp .seat-tag {
  background: #e2f4ea; color: #1e7850; border-radius: 8px;
  font-size: 10px; padding: 1px 5px; margin-left: 2px; font-weight: normal;
}
.opp .opp-count { font-size: 12px; color: #888; margin-top: 2px; }
.opp .opp-plays { min-height: 34px; margin-top: 4px; }
.rank-badge {
  background: #f5b800; color: #4a3500; border-radius: 8px;
  font-size: 11px; padding: 1px 6px; margin-left: 4px;
}
.pass-tag { color: #999; font-size: 13px; font-style: italic; }

/* 中央墩区 */
#center-area {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin: 4px 0; min-height: 100px;
}
#trick-info { color: #ffe9a8; font-size: 14px; font-weight: bold; min-height: 18px; }
#trick-cards { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
#my-plays { min-height: 24px; display: flex; gap: 3px; justify-content: center; }

/* 扑克牌 */
.card {
  width: 60px; height: 84px; border-radius: 8px;
  background: #fff; border: 1px solid #ccc;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
  position: relative; flex-shrink: 0;
  user-select: none;
}
.card.red { color: #d4232a; }
.card.black { color: #222; }
.card.joker-red { color: #d4232a; }
.card.joker-black { color: #222; }
.card .corner {
  position: absolute; top: 3px; left: 4px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.05;
}
.card .corner .c-rank { font-size: 14px; font-weight: bold; }
.card .corner .c-suit { font-size: 12px; }
.card .pip { font-size: 26px; }
.card.joker-red .corner .c-rank, .card.joker-black .corner .c-rank {
  font-size: 11px; writing-mode: vertical-lr;
}
.card .badge {
  position: absolute; top: 2px; right: 3px;
  font-size: 10px; border-radius: 6px; padding: 0 4px; color: #fff;
}
.card .badge.level { background: #2b7cd3; }
.card .badge.wild { background: #e6339a; }

/* 墩区 / 最近出牌的小牌 */
.card.table-card, .card.mini {
  width: 34px; height: 48px; border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.card.table-card .pip, .card.mini .pip { font-size: 15px; }
.card.table-card .corner .c-rank, .card.mini .corner .c-rank { font-size: 10px; }
.card.table-card .corner .c-suit, .card.mini .corner .c-suit { font-size: 9px; }
.card.table-card .badge, .card.mini .badge { display: none; }
.card.table-card.joker-red .corner .c-rank,
.card.table-card.joker-black .corner .c-rank,
.card.mini.joker-red .corner .c-rank,
.card.mini.joker-black .corner .c-rank { font-size: 8px; }
.mini-plays { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }

/* 手牌区（重叠排列，27 张也放得下） */
#my-hand {
  display: flex; justify-content: center; flex-wrap: nowrap;
  width: 100%; max-width: 940px; padding: 18px 10px 8px;
  min-height: 104px; overflow-x: auto;
}
#my-hand .card { cursor: pointer; margin-left: -34px; transition: transform .12s; }
#my-hand .card:first-child { margin-left: 0; }
#my-hand .card:hover { transform: translateY(-8px); }
#my-hand .card.selected {
  transform: translateY(-14px);
  border-color: #f5b800; box-shadow: 0 6px 14px rgba(245,184,0,.7);
}

#my-info { color: #e8f6ee; font-weight: bold; padding-bottom: 8px; }
#turn-hint { color: #ffe9a8; font-weight: bold; min-height: 22px; font-size: 16px; }

#action-buttons { display: flex; gap: 12px; min-height: 44px; }
#action-buttons button {
  border: none; border-radius: 22px; padding: 10px 26px;
  font-size: 18px; font-weight: bold; cursor: pointer;
}
#btn-play { background: #f5b800; color: #4a3500; }
#btn-play:disabled { background: #9c8b5a; color: #eee; cursor: not-allowed; }
#btn-pass { background: rgba(255,255,255,.85); color: #555; }

/* 弹层 */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.tribute-card {
  background: #fff; border-radius: 18px; padding: 20px 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  text-align: center; max-width: 92vw;
}
.tribute-title { font-weight: bold; color: #444; margin-bottom: 12px; }
#tribute-cards {
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center;
  max-width: 560px;
}
#tribute-cards .card { width: 48px; height: 68px; cursor: pointer; }
#tribute-cards .card:hover { transform: translateY(-6px); }
#tribute-cards .card .pip { font-size: 20px; }

.gameover-card {
  background: #fff; border-radius: 24px; padding: 32px;
  text-align: center; max-width: 92vw;
}
#winner-text { font-size: 24px; font-weight: bold; color: #1e7850; margin-bottom: 14px; }
#scoreboard { list-style: none; margin-bottom: 16px; }
#scoreboard li {
  font-size: 16px; padding: 6px 20px; color: #444;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
#scoreboard li .pts { font-weight: bold; color: #f5a623; font-size: 13px; }

/* toast */
#toast-box {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(20,80,50,.92); color: #fff; border-radius: 14px;
  padding: 8px 18px; font-size: 14px; animation: toast-in .2s;
}
.toast.error { background: #e63946; }
.toast.chat { background: rgba(58,120,200,.92); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ===== 手机端 ===== */
@media (max-width: 768px) {
  .card { width: 44px; height: 62px; border-radius: 6px; }
  .card .pip { font-size: 18px; }
  .card .corner .c-rank { font-size: 11px; }
  .card .corner .c-suit { font-size: 9px; }
  .card.table-card, .card.mini { width: 26px; height: 37px; }
  .card.table-card .pip, .card.mini .pip { font-size: 11px; }
  .card.table-card .corner .c-rank, .card.mini .corner .c-rank { font-size: 8px; }
  #my-hand { min-height: 82px; padding-top: 14px; justify-content: flex-start; }
  #my-hand .card { margin-left: -26px; }
  .opp { min-width: 92px; padding: 6px 8px; }
  #action-buttons button { padding: 10px 16px; font-size: 16px; }
  .lobby-card { padding: 24px 18px; }
}
