/* ===========================================================
   神將局 · UI
   =========================================================== */
* { box-sizing: border-box; }

:root {
  --ink: #0a0807;
  --ink2: #12100e;
  --panel: #171311;
  --panel2: #1e1815;
  --gold: #c9a15a;
  --gold2: #e8cf9a;
  --gold3: #f6e7c1;
  --crimson: #b8443c;
  --jade: #7fb08a;
  --violet: #9b7fc0;
  --text: #ece2d3;
  --muted: #9c8875;
  --line: rgba(201, 161, 90, .16);
  --line2: rgba(201, 161, 90, .3);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
}

html, body { margin: 0; height: 100%; }
body {
  background: #0a0807;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(120, 62, 38, .55), transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(60, 40, 24, .35), transparent 70%),
    radial-gradient(ellipse 50% 45% at 0% 80%, rgba(40, 28, 20, .4), transparent 70%),
    linear-gradient(180deg, #100b09 0%, #0a0807 60%, #070505 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px);
}
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(circle at 50% 0%, rgba(201, 161, 90, .06), transparent 55%); }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }
::selection { background: rgba(201, 161, 90, .35); }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line2); border-radius: 10px; padding: 10px 16px; font-size: 14px;
  color: var(--gold2); background: rgba(201, 161, 90, .06);
  transition: transform .12s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
  letter-spacing: .5px;
}
.btn:hover { background: rgba(201, 161, 90, .13); border-color: rgba(232, 207, 154, .5); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  color: #17110b; font-weight: 700;
  background: linear-gradient(180deg, #f0d9a6, #cba45e 55%, #b98e45);
  border-color: #e5c98f; box-shadow: 0 6px 18px rgba(201, 161, 90, .22), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(201, 161, 90, .3); }
.btn.ghost { background: transparent; }
.btn.skill {
  color: var(--gold3); background: linear-gradient(180deg, rgba(155, 127, 192, .22), rgba(90, 64, 120, .25));
  border-color: rgba(155, 127, 192, .5);
}
.btn.skill:hover { background: linear-gradient(180deg, rgba(155, 127, 192, .34), rgba(90, 64, 120, .38)); }
.btn.danger { color: #e08a82; border-color: rgba(184, 68, 60, .45); background: rgba(184, 68, 60, .08); }
.btn.danger:hover { background: rgba(184, 68, 60, .18); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

/* ---------- 通用 ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 11px; color: var(--muted); margin-bottom: 7px;
  letter-spacing: 2.5px; font-weight: 500;
}
input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .32); color: var(--text); font-size: 15px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder { color: rgba(156, 136, 117, .6); }
input:focus { border-color: rgba(232, 207, 154, .6); box-shadow: 0 0 0 3px rgba(201, 161, 90, .1); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.mt { margin-top: 14px; }
.tip { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.7; }

/* ===========================================================
   首页
   =========================================================== */
#screen-home {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.home-wrap {
  position: relative; z-index: 1;
  width: min(1060px, 94vw);
  display: grid; grid-template-columns: 1fr 460px; gap: 48px; align-items: center;
}
.brand { padding: 10px 0 10px 6px; }
.seal {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid rgba(184, 68, 60, .7); border-radius: 8px;
  color: #d97168; font-family: var(--serif); font-size: 24px; font-weight: 700;
  background: rgba(184, 68, 60, .08); box-shadow: inset 0 0 18px rgba(184, 68, 60, .12);
  margin-bottom: 22px;
}
.logo {
  font-family: var(--serif); font-size: clamp(46px, 7vw, 76px); font-weight: 700;
  letter-spacing: .16em; margin: 0; color: var(--gold3);
  text-shadow: 0 0 40px rgba(201, 161, 90, .25), 0 2px 0 rgba(0, 0, 0, .4);
}
.subtitle { color: var(--gold); letter-spacing: .34em; font-size: 12px; margin-top: 14px; }
.brand-note {
  color: var(--muted); font-size: 14px; line-height: 2; margin: 26px 0 22px;
  border-left: 1px solid var(--line2); padding-left: 16px;
}
.brand-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-tags span {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; background: rgba(0, 0, 0, .2);
}

.home-card {
  background: linear-gradient(180deg, rgba(30, 24, 21, .96), rgba(18, 15, 13, .96));
  border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(6px);
}

/* 玩法卡 */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-btn {
  text-align: left; padding: 11px 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--text);
  font-size: 14px; transition: .15s ease; position: relative; overflow: hidden;
}
.mode-btn::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--gold); opacity: 0; transition: opacity .15s ease;
}
.mode-btn small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 3px; letter-spacing: .3px; }
.mode-btn:hover { border-color: rgba(201, 161, 90, .4); background: rgba(201, 161, 90, .06); }
.mode-btn.on { border-color: rgba(232, 207, 154, .65); background: rgba(201, 161, 90, .1); }
.mode-btn.on::after { opacity: 1; }

/* 武将卡 */
.pick-hint { margin-left: 8px; font-size: 11px; letter-spacing: .06em; color: rgba(232,207,154,.85); }
.general-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gen-pick {
  border: 1px solid var(--line); border-radius: 11px; padding: 6px 6px 9px;
  background: rgba(0, 0, 0, .25); text-align: center; cursor: pointer;
  transition: .15s ease; position: relative; overflow: hidden;
}
.gen-pick:hover { border-color: rgba(201, 161, 90, .4); transform: translateY(-1px); }
.gen-pick.on {
  border-color: rgba(232, 207, 154, .75); background: rgba(201, 161, 90, .12);
  box-shadow: 0 0 0 1px rgba(232, 207, 154, .25) inset, 0 8px 20px rgba(0, 0, 0, .35);
}
.gen-pick .gport {
  height: 96px; margin: -8px -6px 8px; border-radius: 8px;
  background-size: cover; background-position: center 24%; background-repeat: no-repeat;
  box-shadow: inset 0 -26px 26px -14px rgba(10, 8, 7, .95);
}
.gen-pick .gname { font-family: var(--serif); font-size: 16px; color: var(--gold3); letter-spacing: 1px; }
.gen-pick .gtitle { font-size: 10.5px; color: var(--muted); margin-top: 4px; letter-spacing: .5px; }
.gen-pick .gskills { font-size: 10px; color: rgba(156, 136, 117, .75); margin-top: 5px; min-height: 12px; }

.home-actions { display: flex; gap: 10px; align-items: stretch; margin-top: 20px; }
.home-actions .btn.primary { flex: 0 0 136px; font-size: 15px; letter-spacing: 2px; }
.join-box { flex: 1; display: flex; gap: 8px; }
.join-box input { flex: 1; text-transform: uppercase; letter-spacing: 4px; text-align: center; font-size: 15px; }
.join-box .btn { flex: 0 0 auto; }

/* ===========================================================
   房间
   =========================================================== */
#screen-room { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 18px; }
.room-card {
  position: relative; z-index: 1; width: min(720px, 96vw);
  background: linear-gradient(180deg, rgba(30, 24, 21, .96), rgba(18, 15, 13, .96));
  border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.kicker { font-size: 10.5px; letter-spacing: 4px; color: var(--muted); }
.code {
  font-family: var(--serif); font-size: 46px; letter-spacing: .22em; color: var(--gold3);
  line-height: 1.15; margin-top: 4px; text-shadow: 0 0 26px rgba(201, 161, 90, .25);
}
.room-actions, .room-buttons { display: flex; gap: 8px; }
.player-list { display: grid; gap: 8px; margin: 22px 0; }
.prow {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .22);
  transition: .15s ease;
}
.prow:hover { border-color: rgba(201, 161, 90, .3); }
.prow .pav {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-size: 15px; color: #17110b;
  background: linear-gradient(160deg, #f0d9a6, #c19a56); flex: 0 0 auto;
}
.prow .pbody { flex: 1; min-width: 0; }
.prow .pn { font-size: 14px; color: var(--text); }
.prow .pg { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.prow.empty { border-style: dashed; opacity: .45; background: transparent; }
.prow.empty .pav { background: rgba(201, 161, 90, .1); color: var(--muted); }
.badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line2);
  color: var(--muted); white-space: nowrap;
}
.badge.on { color: var(--jade); border-color: rgba(127, 176, 138, .45); }
.badge.host { color: var(--gold2); border-color: rgba(232, 207, 154, .5); }
.room-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }
.room-tip { font-size: 12.5px; color: var(--muted); }

/* ===========================================================
   对局
   =========================================================== */
#screen-game { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: rgba(14, 11, 9, .8); backdrop-filter: blur(8px);
}
.topbar .phase { font-family: var(--serif); color: var(--gold3); font-size: 15px; letter-spacing: 1px; }
.topbar .room-label { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.topbar .spacer { flex: 1; }

.stage { flex: 1; display: flex; min-height: 0; }
.table-area { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px 18px 10px; gap: 12px; }
.table-deco {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(560px, 80%); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(201, 161, 90, .08);
  box-shadow: inset 0 0 120px rgba(120, 62, 38, .16), 0 0 0 40px rgba(201, 161, 90, .015);
  pointer-events: none;
}
.table-deco::after {
  content: "神"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: 120px; color: rgba(201, 161, 90, .045);
}

.table-stage { position: relative; flex: 1; min-height: 260px; }
.table-stage .seat { position: absolute; width: 208px; transition: left .35s ease, top .35s ease, transform .2s ease; }

.seat {
  position: relative; border-radius: 14px; padding: 10px 12px;
  background: linear-gradient(180deg, rgba(34, 28, 22, .92) 0%, rgba(18, 15, 12, .96) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.seat.turn {
  border-color: rgba(232, 207, 154, .7);
  box-shadow: 0 0 0 1px rgba(232, 207, 154, .28), 0 0 30px rgba(201, 161, 90, .16), 0 12px 28px rgba(0, 0, 0, .4);
}
.seat.dead { opacity: .4; filter: grayscale(.75); }
.seat.clickable { cursor: crosshair; border-color: rgba(184, 68, 60, .65); box-shadow: 0 0 0 1px rgba(184, 68, 60, .3), 0 0 22px rgba(184, 68, 60, .14); }
.seat.clickable:hover { transform: translateY(-2px); }
.seat-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 1px solid rgba(232, 207, 154, .5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.seat .seat-id { min-width: 0; flex: 1; }
.seat .sn { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .sg { font-size: 11.5px; color: var(--gold); margin-top: 2px; letter-spacing: .5px; }
.role { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); flex: 0 0 auto; }
.role.lord { color: #ffd98a; border-color: rgba(232, 207, 154, .55); background: rgba(232, 207, 154, .1); }
.role.loyal { color: var(--jade); border-color: rgba(127, 176, 138, .5); }
.role.rebel { color: #e08a82; border-color: rgba(184, 68, 60, .55); background: rgba(184, 68, 60, .1); }
.role.spy { color: var(--violet); border-color: rgba(155, 127, 192, .55); }
.role.teamA { color: #8fb8e0; border-color: rgba(120, 160, 210, .55); }
.role.teamB { color: #e08a82; border-color: rgba(184, 68, 60, .55); }
.role.landlord { color: #ffc46b; border-color: rgba(255, 176, 80, .55); background: rgba(255, 176, 80, .08); }
.role.farmer { color: var(--jade); border-color: rgba(127, 176, 138, .5); }
.role.duel { color: var(--muted); }

.hprow { display: flex; align-items: center; gap: 4px; margin-top: 9px; flex-wrap: wrap; }
.orb { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(184, 68, 60, .7); display: inline-block; }
.orb.on { background: radial-gradient(circle at 35% 30%, #ff8f7d, #b8443c); border-color: #d97168; box-shadow: 0 0 6px rgba(184, 68, 60, .55); }
.hptext { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.seat .meta { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: .3px; }
.seat .marks { font-size: 11px; color: var(--jade); margin-top: 4px; }
.turn-tag {
  position: absolute; right: 10px; bottom: 9px; font-size: 10px; letter-spacing: 2px;
  color: var(--gold3); background: rgba(201, 161, 90, .14); border: 1px solid rgba(201, 161, 90, .4);
  padding: 2px 7px; border-radius: 999px; animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.equips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.eq {
  font-size: 10.5px; border: 1px solid var(--line2); border-radius: 6px;
  padding: 1.5px 6px; color: #d6bb8b; background: rgba(201, 161, 90, .05);
}
.eq.judge { border-color: rgba(184, 68, 60, .5); color: #e0a08a; background: rgba(184, 68, 60, .07); }

/* 我的区域 */
.my-area {
  margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px;
  background: linear-gradient(180deg, transparent, rgba(10, 8, 7, .5));
}
.my-area.my-turn { border-top-color: rgba(232, 207, 154, .55); background: linear-gradient(180deg, rgba(201, 161, 90, .08), rgba(10, 8, 7, .5)); }
.my-info { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.my-info .me-avatar { width: 44px; height: 44px; border-radius: 10px; }
.me-block { display: flex; flex-direction: column; line-height: 1.3; }
.my-info .me-name { font-family: var(--serif); font-size: 16px; color: var(--gold3); letter-spacing: 1px; }
.my-info .me-sub { color: var(--muted); font-size: 12px; }
.skill-chip {
  border: 1px solid rgba(155, 127, 192, .35); border-radius: 6px; padding: 1.5px 7px;
  color: #c3aee0; font-size: 11.5px; background: rgba(155, 127, 192, .08); cursor: help;
}
.hand { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; align-items: flex-end; margin-top: 10px; min-height: 118px; padding-bottom: 8px; padding-top: 6px; }

/* 牌面：仿三国杀纸牌 */
.card {
  width: 78px; height: 110px; border-radius: 6px; position: relative; padding: 6px 7px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .75), transparent 62%),
    repeating-linear-gradient(92deg, rgba(120, 95, 60, .045) 0 1px, transparent 1px 3px),
    linear-gradient(168deg, #fcf6e6, #efe2c8 62%, #e3d1af);
  color: #2a1c12; cursor: pointer; user-select: none;
  border: 1px solid #b99a68;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 251, 240, .9), inset 0 0 0 4px rgba(160, 130, 80, .26);
  transition: transform .13s ease, box-shadow .13s ease;
  flex: 0 0 auto;
}
.card::before {
  content: attr(data-mark); position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-9deg);
  font-family: var(--serif); font-size: 52px; font-weight: 700; color: #7a4a2a; opacity: .07; pointer-events: none;
}
.card .c-frame { position: absolute; inset: 4px; border: 1px solid rgba(150, 120, 70, .32); border-radius: 3px; pointer-events: none; }
.hand-hint { display: none; font-size: 12.5px; color: #e8cf9a; letter-spacing: .04em; padding: 4px 2px 6px; text-align: center; }
.hand-hint.on { display: block; }
#prompt-bar.attention { border-color: rgba(232, 207, 154, .5); background: linear-gradient(180deg, rgba(201, 161, 90, .12), rgba(10, 8, 7, .6)); }
.hand.locked { position: relative; }
.hand.locked .card { opacity: .3; filter: grayscale(.55); pointer-events: none; }
#prompt-bar.attention { border-top-color: rgba(232, 207, 154, .55); background: linear-gradient(180deg, rgba(201, 161, 90, .12), rgba(10, 8, 7, .55)); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 -1px 0 rgba(232,207,154,.25) inset; } 50% { box-shadow: 0 -1px 0 rgba(232,207,154,.7) inset, 0 -18px 40px -22px rgba(232,207,154,.35); } }
.card.dim { opacity: .38; filter: grayscale(.6); cursor: not-allowed; }
.card.dim:hover { transform: none; }
.seat.legal { box-shadow: 0 0 0 2px rgba(232, 207, 154, .75), 0 18px 36px rgba(0, 0, 0, .6); cursor: pointer; }
.card:hover { transform: translateY(-7px); box-shadow: 0 14px 22px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 251, 240, .95), inset 0 0 0 4px rgba(160, 130, 80, .3); }
.card.sel { transform: translateY(-12px); box-shadow: 0 0 0 2px #e8cf9a, 0 16px 26px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(255, 251, 240, .95); }
.card .c-corner { position: absolute; left: 7px; top: 6px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card .c-suit { font-size: 15px; }
.card .c-num { font-size: 11px; font-weight: 700; margin-top: 2px; letter-spacing: .5px; }
.card .c-slot {
  position: absolute; right: 7px; top: 6px; width: 17px; height: 17px; display: grid; place-items: center;
  border: 1px solid rgba(90, 70, 40, .35); border-radius: 3px; font-family: var(--serif); font-size: 10px; color: rgba(90, 70, 40, .8);
}
.card .c-label {
  position: absolute; left: 2px; right: 2px; top: 45%; transform: translateY(-50%); text-align: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 2px; line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}
.card .c-label.long { font-size: 14px; letter-spacing: 1px; line-height: 1.15; }
.card .c-type {
  position: absolute; left: 0; right: 0; bottom: 7px; text-align: center;
  font-size: 9px; letter-spacing: 3px; color: rgba(90, 70, 40, .62);
}
.card .c-type::before { content: ''; display: block; width: 30px; height: 1px; margin: 0 auto 4px; background: rgba(120, 95, 60, .3); }
.card.red { color: #a8271c; }
.card.k-sha { background-color: #fbf0e6; }
.card.k-shan { background-color: #eef1f4; }
.card.k-tao { background-color: #fbeef0; }
.card.k-trick { background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .7), transparent 62%), repeating-linear-gradient(92deg, rgba(120, 95, 60, .045) 0 1px, transparent 1px 3px), linear-gradient(168deg, #f9f1e4, #ecdcc6 62%, #ddc9ad); }
.card.k-equip { background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .7), transparent 62%), repeating-linear-gradient(92deg, rgba(120, 95, 60, .045) 0 1px, transparent 1px 3px), linear-gradient(168deg, #f4f5ea, #e4e6d5 62%, #d3d8c2); }
.card.k-sha::before, .card.k-shan::before, .card.k-tao::before, .card.k-jiu::before { content: ''; }
.card.k-sha .c-label { color: #a8271c; }
.card.k-shan .c-label { color: #1f5f86; }
.card.k-tao .c-label { color: #b03560; }
.card.k-jiu .c-label { color: #7a4a22; }
.card.k-trick .c-label { color: #4b2f60; }
.card.k-equip .c-label { color: #3c5232; }
.card.mini { width: 48px; height: 68px; padding: 4px; }
.card.mini::before { font-size: 30px; }
.card.mini .c-label { font-size: 12px; top: 46%; }
.card.mini .c-label.long { font-size: 9px; }
.card.mini .c-suit { font-size: 10px; }
.card.mini .c-num { font-size: 8px; }
.card.mini .c-slot { display: none; }
.card.mini .c-type { display: none; }

.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; min-height: 40px; }

/* 提示条 */
.prompt-bar {
  border-top: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(38, 27, 20, .96), rgba(18, 13, 11, .98));
  padding: 12px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 -14px 34px rgba(0, 0, 0, .4);
}
.prompt-bar .ptext { font-family: var(--serif); color: var(--gold3); font-size: 14.5px; letter-spacing: .5px; margin-right: 6px; }
.prompt-bar .btn { border-radius: 999px; }

/* 战报 */
.side-log-wrap {
  width: 268px; border-left: 1px solid var(--line); display: flex; flex-direction: column;
  background: rgba(12, 9, 8, .72); backdrop-filter: blur(4px);
}
.side-title {
  font-family: var(--serif); font-size: 12px; letter-spacing: 6px; color: var(--gold);
  padding: 12px 14px 8px; border-bottom: 1px solid var(--line);
}
.side-log { flex: 1; overflow-y: auto; padding: 10px 14px 16px; font-size: 13px; color: #c6b39d; line-height: 1.72; }
.side-log div { margin-bottom: 5px; word-break: break-all; animation: fadein .25s ease; }
.side-log .hl { color: var(--gold2); }
.side-log::-webkit-scrollbar { width: 6px; }
.side-log::-webkit-scrollbar-thumb { background: rgba(201, 161, 90, .22); border-radius: 99px; }
@keyframes fadein { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* toast */
#toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%) translateY(-8px);
  background: rgba(46, 26, 21, .96); border: 1px solid rgba(200, 120, 100, .45);
  color: #ffd6c9; padding: 10px 18px; border-radius: 12px; font-size: 13px;
  opacity: 0; transition: .22s ease; pointer-events: none; z-index: 99;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===========================================================
   响应式
   =========================================================== */
@media (max-width: 980px) {
  .home-wrap { grid-template-columns: 1fr; gap: 26px; justify-items: center; }
  .brand { text-align: center; padding: 0; }
  .seal { margin: 0 auto 16px; }
  .brand-note { border-left: none; padding-left: 0; }
  .brand-tags { justify-content: center; }
  .home-card { width: min(520px, 94vw); }
}
@media (max-width: 899px) {
  .table-stage { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 10px; padding: 6px 0; overflow-y: auto; }
  .table-stage .seat { position: relative !important; left: auto !important; top: auto !important; transform: none !important; width: calc(50% - 5px); min-width: 0; }
}
@media (max-height: 860px) {
  #screen-home { padding: 26px 20px; align-items: flex-start; }
  .logo { font-size: 66px; }
  .brand-note { margin: 14px 0; }
  .gen-preview { width: 148px; margin-top: 18px; }
  .home-skills { max-height: 168px; overflow-y: auto; }
}
@media (max-height: 700px) {
  #screen-home { padding: 16px; }
  .logo { font-size: 52px; }
  .subtitle { margin-top: 10px; }
  .gen-preview { display: none; }
  .brand-tags { margin-top: 12px; }
}
@media (max-width: 520px) {
  .card { width: 52px; height: 76px; padding: 4px; }
  .card .c-corner { left: 5px; top: 5px; }
  .card .c-suit { font-size: 12px; }
  .card .c-num { font-size: 9px; margin-top: 1px; }
  .card .c-label { font-size: 13px; letter-spacing: 0; top: 56%; }
  .card .c-label.long { font-size: 10px; letter-spacing: 0; }
  .card .c-type { font-size: 7px; letter-spacing: 1px; bottom: 4px; }
  .card .c-type::before { width: 18px; margin-bottom: 2px; }
  .card .c-slot { width: 13px; height: 13px; font-size: 8px; right: 4px; top: 4px; }
}
@media (max-width: 860px) {
  .side-log-wrap { display: none; }
  .table-area { padding: 10px 12px 6px; }
  .card { width: 56px; height: 82px; }
  .card .c-label { top: 28px; font-size: 13px; }
  .hand { gap: 5px; max-height: 200px; overflow-y: auto; }
}
@media (max-width: 520px) {
  .pick-hint { margin-left: 8px; font-size: 11px; letter-spacing: .06em; color: rgba(232,207,154,.85); }
.general-grid { grid-template-columns: repeat(2, 1fr); }
  .home-actions { flex-direction: column; }
  .home-actions .btn.primary { flex: none; width: 100%; }
  .code { font-size: 38px; }
  .room-head { flex-direction: column; }
  .card { width: 50px; height: 74px; padding: 4px; }
  .card .c-label { top: 25px; font-size: 12px; }
  .card .c-type { display: none; }
}

/* 入场 */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.home-card, .room-card { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.brand { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 装备牌插图 */
.card .c-art { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); width: 44px; height: 44px; color: rgba(96, 74, 40, .55); pointer-events: none; }
.card .c-art svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card.k-equip .c-label { top: 34%; font-size: 12px; letter-spacing: 1px; text-shadow: none; }
.card.k-equip .c-art { top: 63%; width: 40px; height: 40px; }
.card.mini .c-art { display: none; }

/* 首页武将牌预览 + 灯箱 */
.gen-preview {
  margin-top: 24px; width: 172px; border-radius: 16px; overflow: hidden; cursor: zoom-in;
  border: 1px solid rgba(201, 161, 90, .35);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 240, 210, .04);
  transform: perspective(900px) rotateY(7deg); transition: transform .3s ease, box-shadow .3s ease;
}
.gen-preview:hover { transform: perspective(900px) rotateY(0deg) translateY(-4px); box-shadow: 0 30px 60px rgba(0, 0, 0, .65); }
.gen-preview img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.gen-preview-cap { padding: 10px 12px 12px; font-family: var(--serif); font-size: 15px; color: #e8d9bf; text-align: center; letter-spacing: .06em; background: rgba(12, 10, 8, .96); border-top: 1px solid rgba(201, 161, 90, .22); }
.gen-preview-cap.flash { animation: capflash .5s ease; }
@keyframes capflash { 0% { background: rgba(201,161,90,.28); } 100% { background: rgba(12,10,8,.96); } }
.gen-preview-cap small { display: block; font-family: inherit; font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: .1em; }

.zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; cursor: zoom-out; background: rgba(6, 4, 3, .88); backdrop-filter: blur(6px); }
.zoom.hidden { display: none; }
.zoom img { max-height: 92vh; max-width: min(92vw, 720px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .75), 0 0 0 1px rgba(232, 207, 154, .35); }

/* 环形座位：自己固定在正下方 */
.seat.me { border-color: rgba(232, 207, 154, .7); box-shadow: 0 0 0 1px rgba(232, 207, 154, .28), 0 18px 36px rgba(0, 0, 0, .6); }
.seat-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.seat-skills .skill-chip { font-size: 9.5px; line-height: 1.5; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(201, 161, 90, .3); color: var(--gold3); background: rgba(201, 161, 90, .08); white-space: nowrap; }
.my-area .my-info { display: none; }
.table-deco::before {
  content: ''; position: absolute; inset: 5%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 72%, rgba(232, 207, 154, .10) 80%, rgba(232, 207, 154, .02) 88%, transparent 92%);
  animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 899px) {
  .table-deco::before { display: none; }
  .seat-skills { display: none; }
}

/* 武将技能说明面板 */
.home-skills { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; padding-right: 4px; }
.home-skill b { display: block; font-size: 13px; color: #e8cf9a; letter-spacing: .08em; margin-bottom: 2px; }
.home-skill p { margin: 0; font-size: 12px; line-height: 1.65; color: #b9a68f; }
.gmodal { position: fixed; inset: 0; background: rgba(5, 4, 3, .86); backdrop-filter: blur(6px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gmodal.hidden { display: none; }
.gm-box { display: grid; grid-template-columns: minmax(240px, 420px) minmax(280px, 1fr); gap: 22px; max-width: 980px; width: 100%; max-height: 88vh; align-items: center; }
.gm-box > img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.65); }
.gm-side { max-height: 82vh; overflow: auto; padding-right: 6px; }
.gm-name { font-family: var(--serif); font-size: 26px; color: #f1e2c4; letter-spacing: .06em; }
.gm-sub { font-size: 12px; color: #a08a70; margin: 4px 0 14px; letter-spacing: .1em; }
.gm-skill { padding: 10px 0; border-top: 1px solid rgba(201,161,90,.16); }
.gm-skill b { display: block; font-size: 14px; color: #e8cf9a; letter-spacing: .1em; margin-bottom: 4px; }
.gm-skill p { margin: 0; font-size: 12.5px; line-height: 1.75; color: #c4b39c; }
.seat.pickable { box-shadow: 0 0 0 2px rgba(120, 200, 255, .6), 0 16px 34px rgba(0,0,0,.6); cursor: pointer; }
@media (max-width: 900px) {
  .seat, .my-area, .panel { box-shadow: none; }
  .table-deco { display: none; }
  .gm-box { grid-template-columns: 1fr; max-height: 92vh; overflow: auto; }
  .gm-box > img { max-height: 46vh; }
  .home-skills { max-height: none; }
}

.home-skill.off b, .gm-skill.off b { color: #8a7a66; }
.home-skill.off p, .gm-skill.off p { color: #7d6f5d; }

.bot-gen { margin-left: 8px; appearance: none; -webkit-appearance: none; background-color: rgba(20,16,12,.9); color: #d8c3a0; border: 1px solid rgba(201,161,90,.35); border-radius: 8px; padding: 5px 26px 5px 10px; font-size: 12px; font-family: inherit; cursor: pointer; letter-spacing: .04em;
  background-image: linear-gradient(45deg, transparent 50%, #c9a15a 50%), linear-gradient(135deg, #c9a15a 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.bot-gen:focus { outline: none; border-color: rgba(232,207,154,.7); }
.bot-gen:hover { border-color: rgba(232,207,154,.7); }

/* 排行榜 */
.brand-lb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
@media (min-width: 1180px) { .brand-lb { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.brand-lb .btn { font-size: 12px; padding: 7px 6px; }
.lbmodal { position: fixed; inset: 0; background: rgba(6,5,4,.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 60; }
.lbmodal.hidden { display: none; }
.lb-box { width: min(760px, 92vw); max-height: 78vh; overflow: auto; background: linear-gradient(180deg, rgba(28,23,18,.98), rgba(14,11,9,.98)); border: 1px solid rgba(201,161,90,.3); border-radius: 18px; padding: 22px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.lb-sub { color: var(--muted); font-size: 12px; margin-top: 6px; letter-spacing: .06em; }
.lb-row { display: grid; grid-template-columns: 40px 1.6fr 1fr .8fr .9fr; gap: 10px; padding: 9px 6px; font-size: 13px; color: #e6d9c4; border-bottom: 1px solid rgba(201,161,90,.08); align-items: center; }
.lb-row.lb-th { color: var(--muted); font-size: 11px; letter-spacing: .12em; border-bottom-color: rgba(201,161,90,.2); }
.lb-name { font-family: var(--serif); font-size: 15px; }
.lb-ip { color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.lb-empty { color: var(--muted); font-size: 13px; padding: 22px 6px; text-align: center; }

.app-ver { position: fixed; right: 10px; bottom: 8px; z-index: 5; font-size: 10px; letter-spacing: .1em; color: rgba(214, 190, 150, .8); pointer-events: none; }

.table-feed {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: none; flex-direction: column; gap: 3px; align-items: center;
  padding: 8px 14px; border-radius: 10px; background: rgba(12, 9, 7, .62);
  border: 1px solid rgba(201, 161, 90, .18);
  pointer-events: none; z-index: 2; max-width: 46%;
}
.table-feed.on { display: flex; }
.table-feed .feed-row { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; color: #d3c1aa; white-space: nowrap; }
.table-feed .fr-who { color: #b3a28d; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.table-feed .fr-t { color: #7a6a58; }
.table-feed .fr-card { font-family: var(--serif); color: #e8cf9a; }
.table-feed .fr-card i { font-style: normal; margin-right: 2px; }
.table-feed .fr-card i.red { color: #e06a5a; }
.table-feed .fr-card i.black { color: #cfd4d8; }
.table-feed .feed-row:last-child .fr-card { color: #f3ddb0; }

body.urgent #prompt-bar { border-color: rgba(232, 207, 154, .75); box-shadow: 0 0 0 1px rgba(232,207,154,.28) inset, 0 0 22px rgba(201,161,90,.22); animation: urgentPulse 1.1s ease-in-out infinite; }
@keyframes urgentPulse { 0%,100% { box-shadow: 0 0 0 1px rgba(232,207,154,.2) inset; } 50% { box-shadow: 0 0 0 2px rgba(232,207,154,.5) inset, 0 0 26px rgba(201,161,90,.3); } }

/* ---- 快速匹配 / 邀请 / 牌桌聊天 ---- */
.match-overlay[hidden], .invite-bar[hidden] { display: none !important; }
.match-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(6, 5, 4, .72); }
.match-card { min-width: 300px; padding: 26px 30px; border-radius: 16px; border: 1px solid rgba(201, 161, 90, .35); background: linear-gradient(180deg, rgba(28, 23, 18, .98), rgba(14, 11, 9, .98)); text-align: center; }
.match-spin { width: 26px; height: 26px; margin: 0 auto 14px; border-radius: 50%; border: 2px solid rgba(201, 161, 90, .25); border-top-color: #e8cf9a; animation: mspin 1s linear infinite; }
@keyframes mspin { to { transform: rotate(360deg); } }
.match-title { font-family: var(--serif); font-size: 18px; color: var(--gold3); letter-spacing: .08em; }
.match-sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.match-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.invite-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(24, 19, 15, .96); border: 1px solid rgba(201, 161, 90, .45); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); font-size: 13px; color: #e8dcc8; }
.chat-box { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.chat-box input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: #e6d8c2; font-size: 12px; font-family: inherit; }
.chat-box input:focus { outline: none; border-color: rgba(232, 207, 154, .55); }
.chat-sep { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(201, 161, 90, .2); color: #7d6a5a; font-size: 11px; letter-spacing: .1em; }
.chat-line { color: #cbb99f; font-size: 12px; margin-top: 4px; }
.chat-line b { color: #e8cf9a; font-weight: 600; }
.seat-acts { display: flex; gap: 6px; margin-top: 6px; opacity: .55; transition: opacity .15s; }
.seat:hover .seat-acts { opacity: 1; }
.sact { font-size: 10px; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(201, 161, 90, .3); background: rgba(0, 0, 0, .3); color: #b9a184; cursor: pointer; font-family: inherit; }
.sact:hover { color: #f0d9a6; border-color: rgba(232, 207, 154, .6); }

.lb-sec { font-family: var(--serif); font-size: 14px; color: var(--gold3); letter-spacing: .1em; margin: 4px 0 8px; }
.lb-body .lb-row, .lb-body .lb-empty { padding: 6px 2px; }
.lb-body .lb-head { display: grid; grid-template-columns: 30px 1.4fr .8fr .8fr .7fr; gap: 6px; font-size: 11px; color: var(--muted); padding: 4px 2px; border-bottom: 1px solid var(--line); }
.lb-body .lb-row { display: grid; grid-template-columns: 30px 1.4fr .8fr .8fr .7fr; gap: 6px; font-size: 13px; color: #d8c3a0; }

.mode-btn.soon { opacity: .45; cursor: not-allowed; position: relative; }
.mode-btn.soon:hover { border-color: var(--line); }
.mode-btn .soon-tag { position: absolute; right: 8px; top: 8px; font-size: 9px; letter-spacing: .08em; color: #b08a5e; border: 1px solid rgba(176,138,94,.4); border-radius: 4px; padding: 1px 4px; }

/* 标记 */
.marks { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mark { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; letter-spacing: .04em; }
.mark span { font-size: 9px; opacity: .85; }
.mark-b { color: #ffd9a0; background: linear-gradient(135deg, rgba(160,40,30,.85), rgba(90,20,16,.9)); border: 1px solid rgba(255,180,120,.55); box-shadow: 0 0 8px rgba(190,60,40,.45); font-family: var(--serif); font-weight: 700; font-size: 11px; }
.mark-de { color: #cfe9d6; background: rgba(40,90,60,.6); border: 1px solid rgba(120,200,150,.4); }
.mark-ren { color: #ffe9b8; background: rgba(120,90,30,.55); border: 1px solid rgba(230,190,110,.45); }
.mark-yin { color: #e3cdf0; background: rgba(80,45,100,.6); border: 1px solid rgba(180,140,220,.4); }
.mark-chain { color: #a9c7e0; background: rgba(40,60,90,.6); border: 1px solid rgba(120,170,220,.4); }

/* 技能演出 */
#skill-cast { position: fixed; inset: auto 0 42vh 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; z-index: 60; opacity: 0; }
#skill-cast.play { animation: castFade 1.35s ease forwards; }
.cast-inner { text-align: center; transform: translateY(6px); }
.cast-seal { width: 44px; height: 44px; margin: 0 auto 8px; border: 2px solid rgba(232,207,154,.85); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 30px; color: #f0e0b8; text-shadow: 0 0 18px rgba(255,200,120,.8); background: rgba(60,10,8,.55); }
.cast-name { font-family: var(--serif); font-size: 36px; letter-spacing: 10px; color: #f6e6c0; text-shadow: 0 0 26px rgba(255,190,110,.85), 0 4px 18px rgba(0,0,0,.8); }
.cast-line { margin-top: 8px; font-size: 12px; color: rgba(232,207,154,.75); letter-spacing: .08em; }
@keyframes castFade {
  0% { opacity: 0; transform: scale(1.06); }
  12% { opacity: 1; }
  74% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

.hl-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid rgba(201,161,90,.12); cursor: pointer; }
.hl-row:hover { background: rgba(201,161,90,.06); }
.hl-rank { width: 22px; text-align: center; font-family: var(--serif); font-size: 18px; color: #c9a15a; }
.hl-main { flex: 1; min-width: 0; }
.hl-title { font-size: 13px; color: #e0d3bb; }
.hl-reason { font-size: 11.5px; color: #9c8875; margin-top: 3px; }
.hl-time { font-size: 11px; color: #7d6a5a; }

.ann-bar { position: relative; z-index: 3; width: 100%; box-sizing: border-box; margin: 0 auto; max-width: 1120px; padding: 9px 16px; font-size: 13px; line-height: 1.55; color: #ecd7a6; background: linear-gradient(90deg, rgba(201,161,90,.16), rgba(201,161,90,.04)); border-bottom: 1px solid rgba(201,161,90,.25); letter-spacing: .03em; }
.ann-bar::before { content: '公告'; font-size: 10px; border: 1px solid rgba(232,207,154,.6); border-radius: 4px; padding: 1px 5px; margin-right: 8px; color: #f0e0b8; }
.adminbar { border: 1px solid rgba(201,161,90,.3); border-radius: 12px; padding: 14px; margin-bottom: 16px; background: rgba(201,161,90,.05); display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.adminbar .kicker { width: 100%; }
.adminbar textarea { flex: 1; min-width: 260px; min-height: 54px; background: rgba(0,0,0,.35); color: #e8dcc8; border: 1px solid rgba(201,161,90,.3); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; }

.talk-strip { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 14px; padding: 8px 16px; font-size: 12.5px; line-height: 1.5; color: #d3c1aa; background: rgba(20,16,12,.55); border-bottom: 1px solid rgba(201,161,90,.14); overflow: hidden; }
.talk-strip .talk-kicker { flex: none; font-size: 10px; letter-spacing: .12em; color: #e8cf9a; border: 1px solid rgba(232,207,154,.45); border-radius: 4px; padding: 1px 6px; }
.talk-strip .talk-item { color: #b9a992; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.talk-strip .talk-item b { color: #d98d7c; font-weight: 400; margin-right: 6px; }
.talk-strip .talk-item:hover { color: #e8dcc8; }
.talk-strip .talk-more { margin-left: auto; flex: none; color: #c9a15a; text-decoration: none; }

.result-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(6,5,4,.72); backdrop-filter: blur(3px); }
.result-overlay[hidden] { display: none !important; }
.res-card { width: min(420px, 86vw); border: 1px solid rgba(201,161,90,.4); border-radius: 18px; padding: 34px 28px 26px; text-align: center; background: radial-gradient(120% 100% at 50% 0%, rgba(201,161,90,.14), rgba(14,11,9,.98)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.res-kicker { font-size: 11px; letter-spacing: .5em; color: rgba(232,207,154,.7); }
.res-title { font-family: var(--serif); font-size: 44px; color: #f0e0b8; letter-spacing: .2em; margin: 8px 0 4px; }
.res-sub { font-size: 13px; color: #b9a992; letter-spacing: .08em; }
.res-actions { margin-top: 22px; }

.brand-lb .btn { width: 100%; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; text-align: center; white-space: nowrap; }

.avatar.gen { display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, rgba(201,161,90,.35), rgba(40,28,18,.9)); color: #f0e2c6; font-family: var(--serif); font-size: 16px; }


/* ===== 手机端对局：战报抽屉 + 手牌横滑 + 轻量渲染 ===== */
#btn-log { display: none; }
.side-close { display: none; margin-left: auto; background: none; border: 1px solid rgba(201,161,90,.35); color: var(--gold3); border-radius: 8px; font-size: 11px; padding: 2px 8px; font-family: inherit; }
@media (max-width: 860px) {
  #btn-log { display: inline-flex; }
  .side-close { display: inline-flex; }
  .side-log-wrap.open {
    display: flex; position: fixed; z-index: 80; right: 0; top: 0; bottom: 0; width: min(88vw, 380px);
    background: linear-gradient(180deg, rgba(20,16,12,.99), rgba(10,8,7,.99));
    border-left: 1px solid rgba(201,161,90,.3); box-shadow: -20px 0 50px rgba(0,0,0,.6);
  }
  .side-log-wrap.open .side-log { font-size: 13px; }
  .hand { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: 10px; }
  .hand::-webkit-scrollbar { display: none; }
  .hand .card { flex: 0 0 auto; }
  .table-feed { top: auto; bottom: 6px; max-width: 92%; padding: 5px 10px; }
  .table-feed .feed-row { font-size: 11px; }
  .seat { contain: content; }
  .table-stage { align-content: center; }
  .side-log { contain: content; }
}
@media (max-width: 520px) {
  .table-feed { display: none !important; }
}

@media (max-width: 520px) {
  .topbar { font-size: 12px; gap: 6px; white-space: nowrap; overflow-x: auto; padding: 8px 10px; }
  .topbar .btn { padding: 4px 8px; font-size: 11px; }
  .topbar #g-deck { display: none; }
  .phase { white-space: nowrap; }
}

@media (max-width: 860px) {
  .prompt-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .my-area { padding-bottom: 2px; }
  #screen-game { height: 100dvh; }
}

@media (max-width: 860px) {
  .table-stage { align-content: flex-start !important; overflow-y: auto; padding-bottom: 4px; }
  .prompt-bar { flex-wrap: wrap; row-gap: 6px; }
  .prompt-bar .btn { padding: 6px 12px; font-size: 13px; }
}
@media (max-width: 430px) {
  .topbar { font-size: 11px; gap: 4px; }
  .topbar .btn { padding: 3px 7px; font-size: 10.5px; }
  .topbar #g-room { display: none; }
  .seat { padding: 8px 10px; border-radius: 11px; }
  .seat .sname { font-size: 13px; }
  .seat .smeta { font-size: 11px; }
  .hand .card { transform-origin: bottom center; }
}

@media (max-width: 860px) {
  .prompt-bar { max-height: 38vh; overflow-y: auto; }
}

.seat .equips { padding-right: 54px; }
.seat .turn-tag { right: 8px; bottom: 7px; }

.seat.dying { animation: dyingPulse 1.1s ease-in-out infinite; }
@keyframes dyingPulse { 0%,100% { box-shadow: 0 0 0 1px rgba(200,60,50,.35), 0 8px 22px rgba(0,0,0,.45); } 50% { box-shadow: 0 0 14px 2px rgba(220,70,55,.65), 0 8px 22px rgba(0,0,0,.45); } }
.flag-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 10px; color: #d9b071; border: 1px solid rgba(217,176,113,.45); background: rgba(217,176,113,.08); }
.flag-tag.off { color: #c98080; border-color: rgba(200,100,100,.45); background: rgba(200,100,100,.08); }
.res-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 14px 0 18px; font-size: 12.5px; color: var(--muted); }
.res-stats b { color: var(--gold3); font-size: 15px; margin-left: 4px; }
.res-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.cardshow { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%) scale(.82); opacity: 0; pointer-events: none; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .18s ease, transform .18s ease; }
.cardshow.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cardshow::before { content: ''; position: absolute; left: 50%; top: 50%; width: 380px; height: 380px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(0,0,0,.55), rgba(0,0,0,0) 70%); z-index: -1; }
.cardshow .cs-who { font-size: 12px; letter-spacing: .1em; color: #d8c3a0; background: rgba(10,8,7,.72); border: 1px solid rgba(201,161,90,.3); border-radius: 999px; padding: 3px 12px; }
.cardshow .cs-body .card { width: 132px; height: 190px; box-shadow: 0 18px 40px rgba(0,0,0,.65), 0 0 0 1px rgba(232,207,154,.35); }
.cardshow .cs-body .card .c-label { font-size: 30px; }
@media (max-width: 860px) { .cardshow .cs-body .card { width: 104px; height: 148px; } .cardshow { top: 42%; } }

html, body { height: 100%; }
body { min-height: 100dvh; overscroll-behavior: none; }
#screen-game { height: 100dvh; }
.gm-close { position: fixed; right: 18px; top: max(14px, env(safe-area-inset-top)); z-index: 61; border: 1px solid rgba(232,207,154,.55); background: rgba(20,16,12,.9); color: var(--gold3); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-family: inherit; cursor: pointer; }
.gm-close:active { background: rgba(201,161,90,.25); }
@media (max-width: 860px) {
  .gmodal { padding: 56px 12px 20px; align-items: flex-start; }
  .gm-box { max-height: calc(100dvh - 90px); overflow: auto; }
}

body[data-screen="room"] .ann-bar, body[data-screen="room"] .talk-strip,
body[data-screen="game"] .ann-bar, body[data-screen="game"] .talk-strip { display: none !important; }

.turn-clock { font-size: 12px; letter-spacing: .06em; color: #c9a15a; padding: 2px 8px; border: 1px solid rgba(201,161,90,.3); border-radius: 999px; }
.turn-clock.urgent { color: #e06a5a; border-color: rgba(224,106,90,.55); animation: clockPulse 1s infinite; }
@keyframes clockPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: rgba(120, 40, 30, .92); color: #f6e6cf; font-size: 12.5px; letter-spacing: .04em; padding: 6px 12px; text-align: center; }
body.net-down .topbar { margin-top: 26px; }

/* 房间选将 */
.room-pick { margin: 16px 0 6px; }
.room-pick .general-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.room-pick .gen-pick { position: relative; padding: 5px 5px 8px; }
.room-pick .gen-pick .gport { height: 72px; margin: -6px -5px 6px; }
.room-pick .gen-pick .gname { font-size: 14px; }
.room-pick .gen-pick .gtitle { font-size: 9.5px; }
.room-pick .gen-pick .gskills { font-size: 9px; }
.gen-pick.taken { opacity: .38; filter: grayscale(.4); cursor: not-allowed; }
.gen-pick .taken-tag { position: absolute; top: 5px; right: 5px; font-size: 9px; color: #0d0a08; background: rgba(232,207,154,.85); border-radius: 4px; padding: 1px 4px; }
@media (max-width: 520px) {
  .room-pick .general-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 移动端首屏收敛：让核心操作（创建/匹配）尽量落在第一屏 */
@media (max-width: 560px) {
  #screen-home { padding: 18px 16px 22px; align-items: flex-start; }
  .seal { width: 38px; height: 38px; margin: 0 auto 10px; font-size: 20px; }
  .logo { font-size: 46px; letter-spacing: .12em; }
  .subtitle { margin-top: 10px; font-size: 11px; letter-spacing: .26em; }
  .brand-note { font-size: 13px; line-height: 1.75; margin: 14px 0; }
  .brand-tags { gap: 6px; }
  .brand-tags span { font-size: 10.5px; padding: 4px 10px; }
  .brand { min-width: 0; }
  .brand-lb {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; margin-top: 12px; width: 100%; max-width: 100%;
  }
  .brand-lb .btn {
    width: 100%; min-width: 0; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; padding: 7px 4px; font-size: 11.5px; letter-spacing: 0;
  }
  .home-card { margin-top: 2px; }
  .home-card { padding: 20px 16px 18px; }
  .field { margin-bottom: 12px; }
  .mode-grid { gap: 7px; }
  .mode-btn { padding: 9px 10px; }
  .home-actions { margin-top: 14px; }
  .brand-lb { margin-top: 8px; }
  .tip { font-size: 12.5px; line-height: 1.7; }
  .ann-bar { font-size: 12.5px; padding: 8px 14px; }
}

/* 战报：按回合分组 */
.side-log .log-turn-h {
  margin: 12px 0 6px; padding-top: 9px; color: var(--gold2); font-size: 11.5px;
  letter-spacing: .14em; border-top: 1px solid rgba(201,161,90,.2);
}
.side-log .log-turn-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.side-log .log-line { color: #c6b39d; }

/* 牌桌焦点：刚打的牌 + 判定结果 */
.table-feed { padding: 12px 16px 10px; gap: 8px; max-width: 52%; min-width: 210px; }
.table-feed.has-judge { border-color: rgba(232, 207, 154, .34); background: rgba(14, 10, 8, .74); }
.feed-main { display: flex; align-items: center; gap: 14px; }
.table-feed .feed-card { transform: scale(1.06); transform-origin: center; animation: feedIn .22s ease-out; }
.table-feed .feed-card:hover { transform: scale(1.06); box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 0 0 3px rgba(255, 251, 240, .9), inset 0 0 0 4px rgba(160, 130, 80, .26); }
@keyframes feedIn { from { opacity: 0; transform: scale(.92) translateY(4px); } to { opacity: 1; transform: scale(1.06); } }
.feed-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fm-who { display: flex; align-items: baseline; gap: 8px; }
.fm-name { font-family: var(--serif); font-size: 15px; color: var(--gold3); letter-spacing: .04em; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-kind { font-size: 11px; letter-spacing: .16em; color: #a4927c; }
.fm-judge { font-size: 12.5px; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(201,161,90,.28); }
.fm-judge b { font-family: var(--serif); font-size: 14px; margin-right: 4px; }
.fm-judge.red { color: #e07a68; border-color: rgba(184,68,60,.45); background: rgba(184,68,60,.1); }
.fm-judge.black { color: #c8cdd2; border-color: rgba(200,205,210,.28); background: rgba(200,205,210,.07); }
.feed-recent { display: flex; flex-direction: column; gap: 2px; width: 100%; padding-top: 8px; border-top: 1px solid rgba(201,161,90,.14); }
.feed-recent .feed-row { font-size: 11.5px; opacity: .78; }
.table-feed .fr-card i.red, .feed-recent .fr-card i.red { color: #ee907e; }
.log-judge-line { color: #d3c4ad; }
.jd-chip { display: inline-block; min-width: 36px; text-align: center; padding: 0 5px; margin: 0 4px 0 2px;
  border-radius: 4px; font-weight: 700; font-size: 12px; line-height: 18px; letter-spacing: .3px; }
.jd-chip.red { color: #f2a493; background: rgba(190,64,52,.20); border: 1px solid rgba(190,64,52,.40); }
.jd-chip.black { color: #cfc6b6; background: rgba(118,108,92,.20); border: 1px solid rgba(118,108,92,.40); }
.jd-ok, .jd-bad { display: inline-block; padding: 0 5px; border-radius: 4px; font-weight: 600; font-size: 12px; line-height: 18px; }
.jd-ok { color: #9ad68f; background: rgba(92,150,80,.18); border: 1px solid rgba(92,150,80,.38); }
.jd-bad { color: #e79b8a; background: rgba(180,80,60,.18); border: 1px solid rgba(180,80,60,.38); }

/* 牌堆与摸牌动画 */
.deck-pile { position: absolute; right: 16px; top: 14px; width: 52px; height: 72px; z-index: 3; pointer-events: none; }
.deck-pile .dp-stack { position: absolute; inset: 0; border-radius: 9px;
  background:
    repeating-linear-gradient(135deg, rgba(201,161,90,.16) 0 2px, rgba(0,0,0,0) 2px 9px),
    linear-gradient(160deg, #2b1612, #150c0a 65%);
  border: 1px solid rgba(201,161,90,.42);
  box-shadow: 3px 3px 0 -1px #24120f, 6px 6px 0 -2px #1b0e0b, 0 10px 22px rgba(0,0,0,.6), inset 0 0 0 3px rgba(232,207,154,.07); }
.deck-pile .dp-stack::before, .deck-pile .dp-stack::after {
  content: ''; position: absolute; inset: 5px; border-radius: 5px; border: 1px solid rgba(201,161,90,.28); }
.deck-pile .dp-stack::after { inset: 9px; border-color: rgba(201,161,90,.16); }
.deck-pile b { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font-size: 11px; font-weight: 400; letter-spacing: .08em; color: #9c8875; }
.drawfx { position: absolute; width: 40px; height: 56px; border-radius: 8px; z-index: 6; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 85% at 50% 0%, #40231b, #1a0f0c 62%);
  border: 1px solid rgba(232,207,154,.5);
  box-shadow: 0 10px 24px rgba(0,0,0,.6), 0 0 12px rgba(232,207,154,.12), 0 0 0 1px rgba(0,0,0,.4) inset; }
.drawfx::after { content: '神'; font-family: var(--serif); font-size: 21px; color: rgba(232,207,154,.45); }
@media (max-width: 860px) {
  .deck-pile { width: 40px; height: 56px; right: 10px; top: 8px; }
  .deck-pile b { display: none; }
  .drawfx { width: 36px; height: 50px; }
}

.hand.pulse { animation: handPulse .45s ease; }
@keyframes handPulse {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.18); }
  100% { filter: brightness(1); }
}

.drawchip { position: absolute; z-index: 7; pointer-events: none; font-size: 12px; letter-spacing: .06em;
  color: #e8cf9a; background: rgba(20,14,10,.82); border: 1px solid rgba(201,161,90,.45);
  border-radius: 999px; padding: 2px 8px; opacity: 0; }

.hand-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hand-head .btn.xs { padding: 3px 10px; font-size: 11.5px; }

.resume-btn { margin-top: 10px; width: 100%; justify-content: center; }

@media (max-width: 560px) {
  .deck-pile { top: auto; bottom: 6px; right: 10px; width: 38px; height: 52px; }
  .deck-pile b { bottom: -15px; font-size: 10px; }
}

@media (max-width: 560px) {
  .prompt-bar { display: flex; flex-wrap: wrap; gap: 6px; }
  .prompt-bar .btn { flex: 1 1 calc(50% - 6px); text-align: center; padding: 7px 8px; font-size: 12px; line-height: 1.35; }
  .prompt-bar .ptext { flex: 1 1 100%; font-size: 13px; }
}
