/* ============================================================
 * style.css — 欢乐斗地主整站样式（首页 / 规则页 / 游戏页共用）
 * 适配电脑浏览器（≥1000px 宽），经典绿色牌桌风格
 * ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --felt-1: #357a4d;
  --felt-2: #14522e;
  --felt-3: #0a3418;
  --gold-1: #ffd76a;
  --gold-2: #e8a020;
  --ink: #1b2a1f;
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #f2f7f3;
  background: radial-gradient(ellipse at 50% 28%, var(--felt-1), var(--felt-2) 58%, var(--felt-3));
  min-height: 100vh;
}

a { color: #ffe9a8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 通用按钮 ============ */
.btn {
  display: inline-block;
  padding: 10px 26px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(180deg, #4b9e68, #2c6e44);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.btn.gold {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #4a2f00;
  border-color: rgba(255, 255, 255, .5);
}

/* ============ 顶栏（游戏页） ============ */
#topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(0, 0, 0, .28);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
#topbar .logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff6d8, var(--gold-1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
#score-panel { display: flex; gap: 16px; font-size: 13px; }
.score-item { opacity: .85; }
.score-item.me { color: var(--gold-1); font-weight: 700; }
#topbar nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
#topbar nav .btn { padding: 6px 16px; font-size: 13px; }

/* ============ 牌桌（游戏页） ============ */
#table { position: relative; height: calc(100vh - 52px); min-height: 620px; overflow: hidden; }

/* 底牌 + 倍数（顶部中央） */
#bottom-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 5;
}
#bottom-cards { display: flex; gap: 8px; }
#bottom-cards .card.reveal { box-shadow: 0 0 14px rgba(255, 215, 106, .9); }
#mult-panel {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255, 255, 255, .15);
}

/* 座位 */
.seat { position: absolute; z-index: 4; }
#seat-2 { left: 26px; top: 96px; }
#seat-1 { right: 26px; top: 96px; }
.seat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid rgba(255, 255, 255, .14);
}
#seat-2 .seat-info { flex-direction: row-reverse; }
.seat-name { font-weight: 700; font-size: 15px; }
.seat-cards { font-size: 13px; opacity: .8; }
.badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  min-width: 44px;
  text-align: center;
}
.badge:empty { display: none; }
.badge.lord { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); color: #4a2f00; font-weight: 700; }
.badge.farmer { background: rgba(80, 150, 255, .25); color: #bcd8ff; border: 1px solid rgba(140, 190, 255, .4); }

.seat.acting .seat-info {
  border-color: var(--gold-1);
  box-shadow: 0 0 16px rgba(255, 215, 106, .55);
}

/* 出牌展示区 */
.seat-play {
  display: flex;
  align-items: center;
  min-height: 82px;
  margin-top: 10px;
}
#seat-2 .seat-play { justify-content: flex-start; }
#seat-1 .seat-play { justify-content: flex-end; }
.seat-play .card { margin-left: -34px; }
.seat-play .card:first-child { margin-left: 0; }
.pass-bubble {
  padding: 8px 18px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .4);
  border: 1px solid rgba(255, 255, 255, .2);
  font-size: 14px;
  color: #d7e4da;
}

/* 中央消息 */
#center-msg {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  min-width: 320px;
}
#msg-main {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
#msg-sub { margin-top: 8px; font-size: 14px; opacity: .82; min-height: 18px; }

/* 玩家区（底部） */
#seat-0 { position: absolute; left: 50%; transform: translateX(-50%); bottom: 236px; z-index: 4; text-align: center; }
#seat-0 .seat-play { justify-content: center; min-height: 80px; margin-top: 0; }
#seat-0 .seat-info { margin-top: 6px; display: inline-flex; }

/* 操作按钮 */
#actions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 168px;
  display: flex;
  gap: 16px;
  z-index: 6;
  min-height: 44px;
  align-items: center;
}
#actions .btn { min-width: 110px; }

/* 手牌 */
#hand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 26px;
  display: flex;
  justify-content: center;
  padding: 0 10px;
  z-index: 5;
  max-width: 96vw;
}
#hand .card { margin-left: -50px; cursor: pointer; transition: transform .1s; }
#hand .card:first-child { margin-left: 0; }
#hand .card:hover { transform: translateY(-8px); }
#hand .card.sel { transform: translateY(-22px); }

/* ============ 牌面 ============ */
.card {
  position: relative;
  width: 82px;
  height: 116px;
  border-radius: 9px;
  background: linear-gradient(160deg, #ffffff, #eef1ee);
  border: 1px solid #b9c0b9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  color: #20261f;
  flex-shrink: 0;
  user-select: none;
}
.card .corner {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}
.card .center {
  position: absolute;
  bottom: 10px;
  right: 8px;
  font-size: 34px;
  opacity: .9;
}
.card.red { color: #c9302c; }
.card.jk-small .jk, .card.jk-big .jk {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2px;
}
.card.jk-big { color: #c9302c; }
.card.jk-small { color: #20261f; }

.card.sm { width: 54px; height: 76px; border-radius: 6px; }
.card.sm .corner { top: 3px; left: 4px; font-size: 12px; }
.card.sm .center { bottom: 5px; right: 5px; font-size: 20px; }
.card.sm.jk-small .jk, .card.sm.jk-big .jk { font-size: 13px; letter-spacing: 0; }

.card.back {
  background:
    repeating-linear-gradient(45deg, #2f5fa8 0 6px, #27508f 6px 12px);
  border-color: #1d3d70;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .18), 0 2px 6px rgba(0, 0, 0, .4);
}

/* ============ 结果弹窗 ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 18, 8, .66);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.overlay.show { display: flex; }
.modal {
  width: 380px;
  max-width: 92vw;
  background: linear-gradient(170deg, #f7fbf6, #e3ecdf);
  color: var(--ink);
  border-radius: 16px;
  padding: 26px 28px 22px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: scale(.86); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { font-size: 24px; margin-bottom: 12px; letter-spacing: 2px; }
.modal .m-row { font-size: 14px; opacity: .75; margin-bottom: 12px; }
.modal .r {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .65);
  margin-bottom: 7px;
  font-size: 15px;
}
.modal .r b { font-size: 17px; }
.modal .r.win b { color: #1e8e3e; }
.modal .r.lose b { color: #c5221f; }
.modal .r .total { font-size: 12px; opacity: .6; }
.modal-btns { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* ============ 首页 ============ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  position: relative;
  overflow: hidden;
}
.hero .hero-cards { display: flex; margin-bottom: 6px; }
.hero .hero-cards .card { margin-left: -46px; transform: rotate(var(--r, 0deg)); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.hero .hero-cards .card:first-child { margin-left: 0; }
.hero h1 {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 10px;
  background: linear-gradient(180deg, #fff8e0, var(--gold-1) 55%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}
.hero p.sub { font-size: 18px; letter-spacing: 4px; opacity: .9; }
.hero p.intro {
  max-width: 560px;
  font-size: 15px;
  line-height: 1.9;
  opacity: .82;
  padding: 0 20px;
}
.hero .btns { display: flex; gap: 20px; margin-top: 8px; }
.hero .btn { font-size: 18px; padding: 13px 38px; }
.hero footer { position: absolute; bottom: 22px; font-size: 12px; opacity: .5; letter-spacing: 1px; }

/* ============ 规则页 ============ */
.article {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 26px 70px;
}
.article h1 {
  text-align: center;
  font-size: 34px;
  letter-spacing: 6px;
  margin-bottom: 6px;
  color: #ffe9a8;
}
.article .back-home { text-align: center; margin-bottom: 26px; font-size: 14px; }
.article h2 {
  margin: 34px 0 14px;
  font-size: 21px;
  color: var(--gold-1);
  border-left: 5px solid var(--gold-2);
  padding-left: 12px;
}
.article p, .article li { font-size: 15px; line-height: 1.95; opacity: .92; }
.article ul { padding-left: 22px; }
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 6px;
  font-size: 14px;
  background: rgba(0, 0, 0, .22);
  border-radius: 10px;
  overflow: hidden;
}
.article th, .article td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); text-align: left; }
.article th { background: rgba(0, 0, 0, .3); color: #ffe9a8; letter-spacing: 1px; }
.article tr:last-child td { border-bottom: none; }
.article .card-demo { color: #ffd76a; font-weight: 700; letter-spacing: 1px; }

/* ============ 中小屏简单适配 ============ */
@media (max-width: 1100px) {
  #seat-2 { left: 10px; }
  #seat-1 { right: 10px; }
  #hand .card { margin-left: -56px; }
}
