:root {
  --felt: #1a5c3a;
  --felt-deep: #0d3a24;
  --felt-edge: #0a2818;
  --wood: #5a3a22;
  --wood-light: #8b6340;
  --gold: #e0b84a;
  --gold-dim: #a8842e;
  --paper: #f3e6c8;
  --ink: #1a120c;
  --lacquer: #9b1b1b;
  --lacquer-deep: #5c0e0e;
  --card-face: #fff8e8;
  --shadow: rgba(0, 0, 0, 0.45);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #1f2a22 0%, #0a100c 70%);
}

button,
input,
select {
  font: inherit;
}

/* —— Home —— */
.home-sgs {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 1.2rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.home-table-glow {
  position: absolute;
  width: min(90vw, 720px);
  height: min(50vw, 380px);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(26, 92, 58, 0.55), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}

.brand {
  position: relative;
  text-align: center;
  z-index: 1;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: 0.22em;
  color: var(--paper);
  text-shadow: 0 4px 0 #3a220f, 0 12px 30px var(--shadow);
}

.brand p {
  margin: 0.5rem 0 0;
  color: var(--gold);
  letter-spacing: 0.4em;
  font-size: 0.95rem;
}

.home-panel.carved,
.lobby.carved {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 1.35rem 1.4rem 1.5rem;
  background: linear-gradient(180deg, #f0e0bc, #ddc89a);
  border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 2px var(--gold-dim), 0 18px 40px var(--shadow);
  display: grid;
  gap: 0.8rem;
}

.home-panel label,
.lobby label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.home-panel input,
.home-panel select,
.lobby input,
.lobby select,
.text-input {
  padding: 0.5rem 0.65rem;
  border: 1px solid #8a6a40;
  background: #fff9eb;
}

.hero-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #5a4633;
  line-height: 1.45;
}

.home-actions,
.join-row,
.dialog-actions,
.dock-actions,
.eq-pick {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.join-row input {
  flex: 1;
}

.btn {
  border: 2px solid #6b4a2a;
  background: linear-gradient(180deg, #f6e7c4, #d8bf8c);
  color: var(--ink);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 0 #4a3018;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, #c43a3a, #8c1a1a);
  border-color: #5a1010;
  color: #ffe8c8;
  box-shadow: 0 2px 0 #3a0808;
}

.btn.ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(243, 230, 200, 0.35);
  box-shadow: none;
}

.btn.end-phase {
  background: linear-gradient(180deg, #3d6b52, #1f4030);
  border-color: #0f281c;
  color: #e8f5ec;
}

.btn.option {
  min-width: 7rem;
}

.error {
  color: var(--lacquer);
  margin: 0;
}

/* —— Table shell —— */
.sgs-table {
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0b1510;
  overflow: hidden;
}

.sgs-table.damage-flash {
  animation: hurt 0.45s ease;
}

.table-chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: linear-gradient(180deg, #3a2818, #24180e);
  border-bottom: 2px solid var(--gold-dim);
  color: var(--paper);
}

.chrome-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chrome-left b {
  letter-spacing: 0.15em;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.dot.on {
  background: #6dcea0;
  box-shadow: 0 0 8px #6dcea0;
}

.dot.off {
  background: #a35;
}

.room-code,
.round {
  opacity: 0.85;
  font-size: 0.9rem;
}

.felt {
  position: relative;
  margin: 0.45rem 1rem 0.25rem;
  border-radius: 48% / 18%;
  min-height: 0;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.06), transparent 45%),
    radial-gradient(ellipse at center, #217a4a 0%, var(--felt) 45%, var(--felt-deep) 100%);
  border: 10px solid var(--wood);
  box-shadow:
    inset 0 0 0 3px var(--gold-dim),
    inset 0 0 80px rgba(0, 0, 0, 0.35),
    0 20px 50px var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0.65rem 1.2rem 0.55rem;
  overflow: hidden;
}

.general-seat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  color: var(--paper);
}

.general-seat.opponent {
  justify-items: center;
  grid-template-columns: auto auto 1fr;
}

.opponent-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.2rem;
  flex-wrap: wrap;
  min-height: 0;
}

.felt-1v2 .general-seat.opponent {
  flex: 1 1 280px;
  max-width: 420px;
}

.felt-1v2 .general-seat.opponent .portrait-frame {
  width: 7rem;
}

.felt-1v2 .general-seat.opponent .portrait-art {
  height: 7.8rem;
}

.mode-badge {
  position: absolute;
  top: -0.2rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

.btn.primary.alt {
  background: linear-gradient(180deg, #8b2e2e, #5c1818);
}

.general-seat.self {
  align-self: end;
  z-index: 2;
}

.general-seat.self .portrait {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: end;
  text-align: left;
  min-width: 0;
}

.general-seat.self .seat-meta {
  display: grid;
  gap: 0.2rem;
  align-content: end;
  padding-bottom: 0.15rem;
}

.general-seat.hurt {
  animation: hurt 0.45s ease;
}

.general-seat.dead {
  filter: grayscale(0.75);
  opacity: 0.65;
}

.equip-rail {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.eq-slot {
  min-width: 3.6rem;
  min-height: 3.2rem;
}

.eq-empty {
  display: grid;
  place-items: center;
  min-height: 3.2rem;
  border: 1px dashed rgba(224, 184, 74, 0.35);
  color: rgba(243, 230, 200, 0.45);
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.15);
}

.portrait {
  text-align: center;
  min-width: 7.5rem;
}

.portrait-frame {
  position: relative;
  width: 8.2rem;
  margin: 0 auto;
  border: 3px solid var(--gold-dim);
  background: #1a1008;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.portrait-art {
  position: relative;
  height: 9.2rem;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.portrait-art.has-photo {
  place-items: center;
}

.portrait-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.portrait-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.portrait-banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.28rem 0.2rem;
  text-align: center;
  letter-spacing: 0.18em;
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(10, 8, 4, 0.82);
  border-top: 1px solid;
}

.portrait-name {
  display: none;
}

.hp-peaches {
  position: absolute;
  left: 0.28rem;
  top: 0.35rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
}

.peach {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1px solid #7a1010;
}

.peach.full {
  background: radial-gradient(circle at 35% 30%, #ff7a7a, #c01818 70%);
  box-shadow: 0 0 6px rgba(192, 24, 24, 0.55);
}

.peach.empty {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(243, 230, 200, 0.35);
}

.seat-meta {
  margin-top: 0.3rem;
}

.seat-nick {
  font-size: 0.78rem;
  opacity: 0.75;
}

.hp-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffb4b4;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px #000;
}

.skill-tag {
  margin-top: 0.25rem;
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid rgba(224, 184, 74, 0.5);
  color: var(--gold);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.45);
  max-width: 8.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mark-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.chip {
  font-size: 0.7rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgba(224, 184, 74, 0.45);
  color: var(--gold);
}

.opp-hands {
  position: relative;
  min-height: 5rem;
  min-width: 10rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0.25rem;
  padding-right: 3.2rem;
}

.hand-count-badge {
  position: absolute;
  right: 0;
  top: 0;
  background: var(--lacquer);
  color: #ffe8c8;
  border: 1px solid var(--gold-dim);
  min-width: 1.4rem;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.15rem 0.35rem;
  white-space: nowrap;
}

.center-well {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.pile {
  width: 4.4rem;
  height: 5.8rem;
  border-radius: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--paper);
  border: 2px solid rgba(224, 184, 74, 0.35);
  writing-mode: horizontal-tb;
  padding: 0.3rem;
}

.pile b {
  font-size: 1.15rem;
  color: var(--gold);
}

.pile.deck {
  background: linear-gradient(145deg, #6b1d1d, #3d1010);
}

.pile.discard {
  background: rgba(0, 0, 0, 0.28);
}

.winner-banner,
.toast {
  position: absolute;
  color: var(--gold);
  letter-spacing: 0.2em;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--gold-dim);
}

/* —— Cards —— */
.sgs-card {
  position: relative;
  width: 5.6rem;
  height: 8rem;
  border: 2px solid #5a4030;
  border-radius: 0.4rem;
  background: linear-gradient(165deg, #fffdf5, var(--card-face));
  padding: 0.35rem 0.3rem 0.4rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
  color: var(--ink);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.sgs-card.compact {
  width: 3.6rem;
  height: 5rem;
  font-size: 0.72rem;
  padding: 0.2rem;
}

.sgs-card:hover:not(:disabled) {
  transform: translateY(-14px) scale(1.04) !important;
  z-index: 5;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45);
}

.sgs-card.selected {
  outline: 3px solid var(--gold);
  transform: translateY(-18px) !important;
  z-index: 6;
}

.sgs-card.dimmed,
.sgs-card:disabled {
  filter: grayscale(0.5) brightness(0.75);
  cursor: not-allowed;
}

.sgs-card.red {
  color: #b01616;
}

.sgs-card.black {
  color: #1a120c;
}

.sgs-card.back {
  background: linear-gradient(145deg, #7a2222, #3a0e0e 55%, #5a1818);
  color: #e8d7b8;
  display: grid;
  place-items: center;
  border-color: #4a1818;
}

.back-mark {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(224, 184, 74, 0.55);
  border-radius: 50%;
  display: grid;
  place-items: center;
  letter-spacing: 0.1em;
}

.corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-size: 0.78rem;
  z-index: 2;
}

.corner.tl {
  top: 0.25rem;
  left: 0.3rem;
}

.corner.br {
  right: 0.3rem;
  bottom: 0.25rem;
  transform: rotate(180deg);
}

.sgs-card.is-disabled {
  filter: grayscale(0.5) brightness(0.75);
  cursor: not-allowed;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 0;
  padding: 1.1rem 0.15rem 0.85rem;
}

.cname {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  max-height: 4.6rem;
  overflow: hidden;
}

.sgs-card.long-name .cname {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.sgs-card.compact .cname {
  font-size: 0.72rem;
  max-height: 2.6rem;
  letter-spacing: 0.04em;
}

.ctype {
  text-align: center;
  font-size: 0.68rem;
  opacity: 0.75;
  writing-mode: horizontal-tb;
  flex-shrink: 0;
  padding: 0.08rem 0.35rem;
  border: 1px solid rgba(90, 64, 48, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.sgs-card.compact .ctype {
  font-size: 0.58rem;
  padding: 0.02rem 0.2rem;
}

.sgs-card.compact .card-body {
  padding: 0.7rem 0.05rem 0.55rem;
  gap: 0.2rem;
}

/* —— Action dock / dialogs —— */
.action-dock {
  position: relative;
  z-index: 8;
  flex-shrink: 0;
  padding: 0.4rem 0.75rem 0.55rem;
  background: linear-gradient(180deg, rgba(26, 18, 10, 0.55), rgba(18, 12, 8, 0.96));
  border-top: 2px solid var(--gold-dim);
}

.dock-tip {
  color: var(--paper);
  text-align: center;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  text-shadow: 0 1px 2px #000;
}

.dock-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: end;
  min-height: 8.4rem;
}

.skill-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  min-width: 3.6rem;
  max-width: 4.4rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(224, 184, 74, 0.35);
  border-radius: 0.35rem;
  flex-shrink: 0;
}

.skill-rail-title {
  color: var(--gold);
  font-size: 0.72rem;
  text-align: center;
  letter-spacing: 0.2em;
  opacity: 0.85;
}

.skill-row {
  display: none;
}

.skill-seal {
  min-width: 0;
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.25rem;
  border: 2px solid #8c1a1a;
  background: radial-gradient(circle at 30% 25%, #d64545, #8c1a1a 70%);
  color: #ffe8c8;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 2px 0 #4a0c0c;
  font-size: 0.88rem;
  line-height: 1.15;
}

.skill-seal.alt {
  background: radial-gradient(circle at 30% 25%, #4a7a5a, #1f4030 70%);
  border-color: #0f281c;
}

.skill-seal.on {
  outline: 2px solid var(--gold);
}

.hand-stage {
  position: relative;
  min-height: 8.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.45rem;
  margin: 0;
  padding: 0.5rem 0.4rem 0.15rem;
  max-width: 100%;
  overflow-x: auto;
  z-index: 1;
}

.hand-stage.flat {
  min-height: auto;
}

.hand-stage .sgs-card {
  position: relative;
  flex: 0 0 auto;
}

.hand-stage .sgs-card:hover:not(:disabled) {
  transform: translateY(-12px) scale(1.05);
  z-index: 3;
}

.dock-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 0.45rem;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 20;
}

.sgs-dialog {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, #f0e0bc, #ddc89a);
  border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 2px var(--gold-dim), 0 20px 40px var(--shadow);
  padding: 1rem 1.1rem;
}

.sgs-dialog.wide {
  width: min(720px, 94vw);
}

.sgs-dialog p {
  margin: 0 0 0.75rem;
}

.dialog-actions.wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.home-panel.wide-home {
  width: min(720px, 100%);
}

.home-hero-preview {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.home-hero-img {
  width: 7.5rem;
  height: 10rem;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--wood);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
}

.home-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.hero-pick {
  display: grid;
  gap: 0.75rem;
}

.hero-pick.compact {
  margin: 0.35rem 0 0.85rem;
}

.home-hero-meta strong {
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

.home-hero-meta .hero-hp {
  color: #6b4a2a;
  font-size: 0.9rem;
}

.skill-block {
  margin-top: 0.2rem;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 248, 234, 0.85);
  border: 1px solid #c4a46a;
  border-left: 3px solid var(--lacquer);
}

.skill-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #8b1e1e;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.skill-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #4a3728;
  line-height: 1.5;
}

.hero-gallery {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.hero-gallery.compact {
  margin: 0;
}

.hero-chip {
  flex: 0 0 auto;
  width: 4.6rem;
  padding: 0.25rem;
  border: 1px solid #8a6a40;
  background: #fff8ea;
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
  justify-items: center;
}

.hero-chip img {
  width: 3.6rem;
  height: 4.6rem;
  object-fit: cover;
  object-position: center top;
}

.hero-chip .chip-name {
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-chip .chip-skill {
  font-size: 0.62rem;
  color: #8b1e1e;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-chip.on {
  outline: 2px solid var(--lacquer);
  background: #ffe7c8;
}

.chrome-right {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.phase-chip {
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(224, 184, 74, 0.45);
  color: var(--gold);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.25);
}

.lobby-code {
  margin: 0.2rem 0 0.8rem;
}

.lobby-seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.lobby-seat-card {
  background: rgba(255, 248, 234, 0.7);
  border: 1px solid #8a6a40;
  padding: 0.65rem;
  display: grid;
  gap: 0.25rem;
}

.lobby-seat-name {
  font-size: 0.78rem;
  opacity: 0.7;
}

.lobby-seat-hero {
  color: #8b1e1e;
  font-weight: 700;
}

.lobby-ready {
  font-size: 0.8rem;
  opacity: 0.65;
}

.lobby-ready.yes {
  color: #1f6b3a;
  opacity: 1;
  font-weight: 700;
}

.log-rail {
  position: fixed;
  right: 0.5rem;
  top: 3.2rem;
  width: min(260px, 32vw);
  max-height: 50vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 4;
  pointer-events: auto;
}

.log-rail.closed {
  width: auto;
  max-height: none;
  background: transparent;
}

.log-rail.closed .log-head {
  display: none;
}

.log-rail.open {
  background: rgba(10, 12, 10, 0.72);
  border: 1px solid rgba(224, 184, 74, 0.3);
  padding: 0.45rem;
}

.log-head {
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  margin-bottom: 0.2rem;
}

.log-item {
  background: rgba(0, 0, 0, 0.45);
  color: #f0e2c6;
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
  border-left: 2px solid var(--gold);
}

.toast-float {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 30;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--gold-dim);
  padding: 0.55rem 1rem;
  letter-spacing: 0.08em;
  animation: rise 0.25s ease both;
  pointer-events: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.lobby {
  margin: 1rem auto;
  max-width: 720px;
}

.waiting {
  color: var(--paper);
  text-align: center;
  padding: 4rem;
  grid-column: 1 / -1;
}

@keyframes hurt {
  0%,
  100% {
    filter: none;
  }
  35% {
    filter: hue-rotate(-25deg) brightness(1.25);
  }
  55% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

@media (max-width: 860px) {
  .felt {
    border-radius: 1.2rem;
    min-height: auto;
  }

  .log-rail {
    position: static;
    width: 100%;
    max-height: 100px;
    margin: 0.4rem;
  }

  .dock-main {
    grid-template-columns: 3.2rem 1fr;
    gap: 0.4rem;
  }

  .skill-rail {
    min-width: 3rem;
    max-width: 3.2rem;
    padding: 0.25rem;
  }

  .skill-seal {
    font-size: 0.78rem;
    min-height: 1.75rem;
    padding: 0.25rem 0.1rem;
  }

  .general-seat.opponent {
    grid-template-columns: auto 1fr;
  }

  .opp-hands {
    grid-column: 1 / -1;
  }

  .sgs-card {
    width: 4.6rem;
    height: 6.4rem;
  }
}

/* Browser single-player shell: local saves, recovery, and small-screen play. */
:root { color-scheme: light; }
button, input { touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f4c851; outline-offset: 3px; }
button { -webkit-tap-highlight-color: transparent; }
.home-sgs { width: 100%; min-height: 100svh; }
.home-panel.wide-home { width: min(760px, calc(100vw - 4rem)); min-width: 0; }
.brand .brand-eyebrow { margin-bottom: 0.65rem; font-size: 0.72rem; letter-spacing: 0.2em; color: #bcae8d; }
.hero-pick, .hero-gallery, .dock-main { min-width: 0; }
.hero-gallery { padding: 0.3rem 0.25rem 0.5rem; scrollbar-color: #a8842e #e2d0a9; }
.gallery-hint { text-align: right; font-size: 0.72rem; color: #775e44; margin-top: -0.65rem; }
.match-config { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; }
.match-config label { min-width: 0; font-weight: 700; color: #4d3824; }
.match-config select { width: 100%; min-height: 44px; font-weight: 400; border-radius: 3px; }
.config-hint { margin: -0.15rem 0 0; color: #70583f; font-size: 0.76rem; line-height: 1.55; }
.config-summary { padding: 0.75rem 0.85rem; margin: 0 0 1rem; list-style: none; background: #e6d2a9; border-left: 3px solid #a8842e; font-size: 0.88rem; line-height: 1.7; }
.config-summary li + li { margin-top: 0.2rem; }
.home-actions { justify-content: center; }
.home-actions .btn { min-height: 44px; }
.local-note { margin: 0; text-align: center; font-size: 0.76rem; color: #6b563d; }
.continue-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; padding: 0.8rem; border: 1px solid #688664; background: #e3e7cf; }
.continue-strip > div { display: grid; gap: 0.2rem; margin-right: auto; }
.continue-strip strong { color: #24442b; }
.continue-strip span { font-size: 0.75rem; color: #53624b; }
.continue-btn { background: linear-gradient(#3d6b52, #1f4030); border-color: #1b3d26; color: #f7f3d7; }
.text-button { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0.35rem; font-size: 0.75rem; min-height: 36px; }
.sgs-table { min-height: 100svh; height: 100svh; max-height: none; }
.table-chrome { position: relative; z-index: 25; gap: 0.75rem; }
.chrome-left, .chrome-right { flex-wrap: wrap; }
.chrome-right { justify-content: flex-end; }
.chrome-right .btn { min-height: 38px; }
.felt { height: auto; margin-bottom: 0.5rem; }
.table-status { text-align: center; display: grid; gap: 0.4rem; color: #efe1ba; }
.table-status > span { letter-spacing: 0.1em; }
.table-status small { color: #c4caae; font-size: 0.67rem; }
.prompt-controls { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
.prompt-controls:disabled .action-dock, .prompt-controls:disabled .sgs-dialog { opacity: 0.7; }
.dock-main { min-height: 0; }
.hand-stage { flex-wrap: nowrap; justify-content: safe center; padding-top: 1.25rem; padding-bottom: 0.5rem; }
.skill-rail { align-self: stretch; justify-content: center; }
.skill-seal { min-height: 42px; }
.dock-tip { line-height: 1.45; }
.dock-actions .btn { min-height: 42px; }
.sgs-card { user-select: none; }
.general-seat .sgs-card:not(.back) { cursor: default; }
.general-seat .sgs-card:hover { transform: none !important; }
.modal-mask { padding: 1rem; }
.sgs-dialog { max-height: calc(100svh - 7rem); overflow: auto; overscroll-behavior: contain; }
.sgs-dialog h2 { margin: 0 0 0.8rem; font-size: 1.2rem; }
.sgs-dialog p, .help-dialog li { line-height: 1.65; }
.sgs-dialog .btn { min-height: 44px; }
.sgs-dialog form { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.sgs-dialog input { min-width: 0; flex: 1; }
.help-dialog ol { padding-left: 1.4rem; margin-top: 0; }
.help-dialog li { margin-bottom: 0.45rem; }
.help-dialog p { font-size: 0.82rem; color: #604b33; }
.menu-mask { z-index: 55; }
.end-dock, .thinking-dock { display: flex; justify-content: center; align-items: center; gap: 0.8rem; flex-wrap: wrap; color: #f3e6c8; padding: 1rem; min-height: 85px; background: #1a120c; border-top: 2px solid var(--gold-dim); }
.end-dock strong { color: var(--gold); }
.error-notice { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; padding: 0.8rem; border: 1px solid #ae3b2f; color: #591911; background: #ffead7; font-size: 0.85rem; line-height: 1.5; }
.error-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.error-actions .btn { font-size: 0.75rem; padding: 0.35rem 0.65rem; }
.sgs-table > .error-notice { position: fixed; z-index: 60; top: 4.5rem; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 1.5rem)); box-shadow: 0 8px 30px #0008; }
.log-rail.open { z-index: 35; top: 4rem; width: min(340px, calc(100vw - 1rem)); max-height: calc(100svh - 9rem); background: #101a13f5; }
.log-head { display: flex; justify-content: space-between; align-items: center; }
.log-item { font-size: 0.8rem; line-height: 1.6; white-space: pre-wrap; }

@media (max-height: 850px) and (min-width: 861px) {
  .portrait-frame { width: 6.8rem; }
  .portrait-art { height: 7.4rem; }
  .felt-1v2 .general-seat.opponent .portrait-frame { width: 6rem; }
  .felt-1v2 .general-seat.opponent .portrait-art { height: 6.4rem; }
  .general-seat.self .portrait-frame { width: 5.8rem; }
  .general-seat.self .portrait-art { height: 6.2rem; }
  .general-seat.self .equip-rail { flex-direction: row; align-items: end; }
  .eq-slot { min-width: 2.8rem; min-height: 2.3rem; }
  .eq-empty { min-height: 2.3rem; }
  .general-seat.opponent .equip-rail { display: grid; grid-template-columns: repeat(2, auto); }
  .general-seat .sgs-card.compact { width: 2.8rem; height: 3.9rem; }
  .general-seat .sgs-card.compact .ctype { display: none; }
  .pile { height: 4.3rem; width: 3.3rem; }
  .sgs-card { width: 5rem; height: 7rem; }
  .hand-stage { min-height: 0; }
}

@media (max-width: 860px) {
  .home-sgs { padding: 1.3rem 0.75rem; }
  .home-panel.wide-home { width: min(720px, calc(100vw - 1.5rem)); padding: 1rem; }
  .brand h1 { font-size: 2.7rem; letter-spacing: 0.14em; }
  .home-hero-preview { grid-template-columns: 6.2rem 1fr; gap: 0.7rem; }
  .home-hero-img { width: 6.2rem; height: 8.8rem; }
  .skill-desc { font-size: 0.8rem; }
  .sgs-table { height: auto; min-height: 100svh; overflow: visible; grid-template-rows: auto minmax(360px, 1fr) auto; }
  .table-chrome { flex-wrap: wrap; padding: 0.45rem 0.65rem; gap: 0.35rem; }
  .chrome-left { gap: 0.45rem; width: 100%; }
  .chrome-left b { font-size: 0.95rem; }
  .chrome-right { width: 100%; }
  .chrome-right .btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; min-height: 36px; }
  .round { font-size: 0.78rem; }
  .phase-chip { font-size: 0.72rem; margin-left: auto; }
  .felt { margin: 0.45rem; padding: 0.7rem 0.55rem; border-width: 5px; min-height: 380px; grid-template-rows: auto minmax(65px, 1fr) auto; gap: 0.5rem; }
  .opponent-row { flex-wrap: nowrap; gap: 0.5rem; }
  .general-seat.opponent, .felt-1v2 .general-seat.opponent { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 0.3rem; flex: 1 1 0; max-width: 230px; min-width: 0; }
  .general-seat.opponent .portrait { grid-row: 1; }
  .general-seat.opponent .equip-rail { grid-row: 2; }
  .portrait { min-width: 0; }
  .portrait-frame, .felt-1v2 .general-seat.opponent .portrait-frame { width: 5.5rem; border-width: 2px; }
  .portrait-art, .felt-1v2 .general-seat.opponent .portrait-art { height: 6.1rem; }
  .portrait-banner { font-size: 0.78rem; padding: 0.18rem; }
  .seat-meta { margin-top: 0.2rem; }
  .seat-nick { font-size: 0.7rem; }
  .hp-text { font-size: 0.75rem; }
  .skill-tag { font-size: 0.7rem; margin-top: 0.15rem; padding: 0.1rem 0.35rem; }
  .mark-row { margin-top: 0.15rem; gap: 0.15rem; }
  .equip-rail { flex-direction: row; gap: 0.2rem; }
  .eq-slot { min-width: 1.8rem; width: 1.9rem; min-height: 2.5rem; }
  .eq-empty { min-height: 2.5rem; font-size: 0.58rem; }
  .general-seat .sgs-card.compact { width: 1.9rem; height: 2.7rem; padding: 0.1rem; border-width: 1px; }
  .general-seat .sgs-card.compact .corner { font-size: 0.47rem; }
  .general-seat .sgs-card.compact .corner.tl { top: 0.1rem; left: 0.1rem; }
  .general-seat .sgs-card.compact .corner.br, .general-seat .sgs-card.compact .ctype { display: none; }
  .general-seat .sgs-card.compact .card-body { padding: 0.3rem 0 0; }
  .general-seat .sgs-card.compact .cname { font-size: 0.58rem; max-height: 2.2rem; }
  .opp-hands { min-height: 0; min-width: 0; padding: 0; }
  .opp-hands .sgs-card { display: none; }
  .hand-count-badge { position: static; font-size: 0.65rem; padding: 0.08rem 0.3rem; }
  .general-seat.self { gap: 0.4rem; grid-template-columns: auto 1fr; align-items: end; }
  .general-seat.self .portrait { grid-template-columns: auto 1fr; }
  .general-seat.self .portrait-frame { width: 4.2rem; }
  .general-seat.self .portrait-art { height: 4.7rem; }
  .general-seat.self .skill-tag { max-width: 100%; }
  .general-seat.self .mark-row { justify-content: flex-start; }
  .pile { width: 2.6rem; height: 3.5rem; font-size: 0.65rem; }
  .pile b { font-size: 1rem; }
  .center-well { gap: 0.6rem; }
  .table-status > span { font-size: 0.85rem; }
  .table-status small { font-size: 0.57rem; }
  .action-dock { padding: 0.45rem 0.45rem max(0.65rem, env(safe-area-inset-bottom)); }
  .dock-tip { font-size: 0.78rem; margin-bottom: 0; }
  .dock-main { grid-template-columns: 3rem minmax(0, 1fr); gap: 0.35rem; }
  .skill-rail { padding: 0.2rem; min-width: 3rem; max-width: 3rem; }
  .skill-seal { min-height: 44px; font-size: 0.7rem; }
  .hand-stage { min-height: 0; justify-content: flex-start; padding: 1.1rem 0.35rem 0.35rem; gap: 0.35rem; }
  .sgs-card { width: 4.4rem; height: 6.3rem; }
  .sgs-card.selected { transform: translateY(-10px) !important; }
  .sgs-card:hover:not(:disabled) { transform: none !important; }
  .sgs-card.selected:hover:not(:disabled) { transform: translateY(-10px) !important; }
  .dock-actions { margin-top: 0.45rem; }
  .dock-actions .btn { min-height: 44px; font-size: 0.85rem; }
  .log-rail.open { position: fixed; top: 6.4rem; right: 0.4rem; margin: 0; max-height: 55svh; }
  .sgs-table > .error-notice { top: 6.4rem; }
  .sgs-dialog { padding: 1rem; }
  .end-dock strong { width: 100%; text-align: center; }
}

@media (max-width: 370px) {
  .brand h1 { font-size: 2.3rem; }
  .home-panel.wide-home { padding: 0.75rem; }
  .home-hero-preview { grid-template-columns: 4.5rem 1fr; gap: 0.5rem; }
  .home-hero-img { width: 4.5rem; height: 7rem; }
  .skill-block { padding: 0.35rem; }
  .home-hero-meta strong { font-size: 1.1rem; }
  .skill-name { font-size: 0.8rem; }
  .general-seat.self .equip-rail { display: grid; grid-template-columns: repeat(2, auto); }
  .table-status small { max-width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Independent equipment actions: never counted or hotkey-routed as hero skills. */
.equipment-action-rail { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .45rem .8rem; margin: .4rem 0 .65rem; padding: .65rem; border: 1px solid #b69c5655; border-radius: .5rem; background: #182e27; }
.equipment-action-rail h3 { flex: 0 0 auto; margin: .5rem 0 0; font-size: .78rem; color: #e1c987; }
.equipment-action-control { display: flex; flex: 1 1 16rem; gap: .65rem; align-items: flex-start; min-width: 0; }
.equipment-action-button { display: flex; flex: 0 0 auto; align-items: center; gap: .3rem; min-height: 44px; padding: .2rem .55rem; border-color: #8fba9d; }
.equipment-action-button .card-art { width: 2.5rem; height: 2.25rem; }
.equipment-action-button:disabled { opacity: .6; cursor: not-allowed; }
.equipment-action-button:focus-visible, .equipment-action-copy summary:focus-visible { outline: 3px solid #f0d88c; outline-offset: 3px; }
.equipment-action-control[data-equipment-active="true"] .equipment-action-button { border-color: #ddc574; background: #486044; }
.equipment-action-copy { min-width: 0; color: #d4d6bc; font-size: .72rem; line-height: 1.6; overflow-wrap: anywhere; }
.equipment-action-copy summary { color: #eed798; cursor: pointer; min-height: 30px; padding-top: .15rem; }
.equipment-action-copy p { margin: .2rem 0; }
.skip-play-badge { border: 1px solid #bd8874; border-radius: 4px; padding: .2rem .35rem; color: #f0cfaa; background: #542d29; font-size: .7rem; }
.converted-card-source { color: #e7cb8f; }
.rescue-context strong { color: #f4c2a4; }
.multi-response-context strong { color: #f0d589; }
@media (max-width: 600px) {
  .equipment-action-rail { gap: .3rem; padding: .5rem; }
  .equipment-action-rail h3 { flex-basis: 100%; margin: 0; }
  .equipment-action-control { gap: .45rem; flex-wrap: wrap; }
  .equipment-action-copy { flex: 1 1 10rem; }
}

/* Fourth source packet: public causal record, never hidden hand/location data. */
.liuye-damage-record { margin: 7px 2px; border: 1px solid #ab945855; border-radius: 6px; background: #203a32; color: #e7d9b5; font-size: 12px; }
.liuye-damage-record > summary { cursor: pointer; padding: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.liuye-damage-record > summary span { margin-left: 6px; color: #b9cfbf; }
.liuye-damage-record > div { padding: 0 10px 10px; line-height: 1.65; }
.liuye-damage-record p { margin: 7px 0; }
.liuye-damage-record small { color: #c1c9ad; overflow-wrap: anywhere; }
.liuye-record-card { display: flex; align-items: center; gap: 6px; }
.liuye-record-card .card-art { width: 65px; height: 58px; flex-shrink: 0; }
.liuye-damage-record summary:focus-visible { outline: 2px solid #e5cd8f; outline-offset: 2px; border-radius: 5px; }
.fourth-skill-context { text-align: left; }
.fourth-skill-context strong { display: block; }
.fourth-skill-context p { line-height: 1.65; }

/* Fifth packet: deliberate death decision, readable mobile prompts and real shortcuts. */
.fifth-skill-context { border-inline-start: 3px solid #aebea0; padding: 12px 14px; margin: 12px 0 16px; background: #141c18; color: #e5eadc; text-align: left; }
.fifth-skill-context strong { display: block; color: #f3e2bd; font-size: 1rem; line-height: 1.5; }
.fifth-skill-context p, .fifth-skill-context small { line-height: 1.7; overflow-wrap: anywhere; }
.fifth-skill-context.is-irreversible { border-color: #ef9b80; background: #38211e; }
.fifth-skill-context.is-irreversible strong { color: #ffd3ba; }
.btn.death-confirm { background: #743c30; border-color: #e9a28c; color: #fff4ed; white-space: normal; }
.skill-shortcut { font: 11px/1.1 system-ui,sans-serif; border: 1px solid currentColor; border-radius: 3px; padding: 2px 4px; opacity: .85; }
@media(max-width: 560px) { .fifth-skill-context { padding: 10px; } .sgs-dialog:has(.fifth-skill-context) .dialog-actions { flex-wrap: wrap; } .sgs-dialog:has(.fifth-skill-context) .dialog-actions .btn { min-height: 44px; flex: 1 1 130px; } }

/* 用间 keeps its action outside both the hand face and equipment E controls. */
.gift-mark { position: absolute; top: .22rem; right: .24rem; z-index: 2; display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border: 1px solid #8d653c; border-radius: .22rem; background: #ece2be; color: #725333; font-size: .64rem; line-height: 1; font-weight: 700; pointer-events: none; }
.sgs-card.compact .gift-mark { width: .75rem; height: .75rem; top: .12rem; right: .12rem; font-size: .48rem; }
.gift-action-rail { margin: .35rem 0 .6rem; padding: .55rem .65rem; border: 1px solid #bb9b5b66; border-radius: .5rem; background: #293126; color: #e7ddba; }
.gift-action-heading { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .4rem; }
.gift-action-heading h3 { margin: 0; font-size: .82rem; color: #efd18e; }
.gift-action-heading > span { font-size: .7rem; color: #c8c9ae; }
.gift-action-list { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.gift-action-control { display: flex; flex: 1 1 12rem; min-width: 0; flex-direction: column; align-items: flex-start; gap: .25rem; }
.gift-action-button { display: flex; gap: .35rem; align-items: center; min-height: 44px; max-width: 100%; padding: .2rem .55rem; border-color: #bfa66a; text-align: left; }
.gift-action-button .card-art { width: 2.4rem; height: 2.15rem; flex: 0 0 auto; }
.gift-action-button small { display: block; margin-top: .12rem; font-size: .65rem; font-weight: 400; color: #d4d3b4; }
.gift-action-button:disabled { opacity: .55; cursor: not-allowed; }
.gift-action-button:focus-visible, .gift-rules summary:focus-visible { outline: 3px solid #f0d88c; outline-offset: 3px; }
.gift-action-reason, .gift-rules { font-size: .7rem; line-height: 1.55; overflow-wrap: anywhere; }
.gift-rules summary { display: flex; align-items: center; min-height: 36px; cursor: pointer; color: #efd18e; }
.gift-rules p { margin: .2rem 0 .4rem; }
.poison-warning { color: #e4c49b; }
.youjian-context { border-color: #a68b54; }
.equipment-gift-rule { color: #ead39c; }
@media (max-width: 600px) {
  .gift-action-rail { padding: .45rem; }
  .gift-action-control { flex-basis: 10rem; }
  .gift-action-heading { gap: .25rem .5rem; }
}

/* Selected-source followup: wrapping native controls preserve small-screen interaction. */
.sgs-followup-choices .dialog-actions > section { display:flex; flex-direction:column; align-items:center; gap:.35rem; min-width:0; max-width:100%; }
.sgs-followup-choices button { min-height:44px; white-space:normal; overflow-wrap:anywhere; }
.sgs-followup-hidden-card { display:grid; place-items:center; min-height:58px; min-width:64px; border:1px solid #81745c; border-radius:5px; background:repeating-linear-gradient(45deg,#28343e,#28343e 5px,#34434d 5px,#34434d 7px); font-size:.75rem; }
.sgs-followup-context,.sgs-followup-status { min-width:0; overflow-wrap:anywhere; }
.sgs-followup-public-pile,.sgs-followup-public-reveal { max-width:100%; font-size:.78rem; overflow-wrap:anywhere; }
.sgs-followup-public-pile summary,.sgs-followup-public-reveal summary { cursor:pointer; min-height:32px; }
.sgs-followup-status ul { padding-left:1.3em; }
@media(max-width:520px) { .sgs-followup-choices .dialog-actions > section { flex:1 1 130px; } }

/* Modern published YXS: full target / resource / final-function choices. */
.yxs-modern-status{border-color:#a9915b;background:linear-gradient(130deg,#142c28,#202c34);padding:.65rem;line-height:1.6}
.yxs-modern-status p{margin:.3rem 0}.yxs-modern-status small{color:#d1d4bd}
.yxs-modern-quotas{display:flex;flex-wrap:wrap;gap:.3rem;margin:.45rem 0}
.yxs-modern-quotas span{border:1px solid #71887a;border-radius:5px;padding:.15rem .4rem;background:#193a30;font-size:.78rem;color:#e2ecd5}
.yxs-modern-quotas [data-used="true"]{border-color:#857657;background:#382f26;color:#e2c090}
.yxs-modern-choices .dialog-actions{align-items:stretch;gap:.65rem}
.yxs-modern-choices section{display:flex;flex:1 1 180px;flex-direction:column;gap:.35rem;min-width:0}
.yxs-modern-choices .btn{min-height:48px;white-space:normal;line-height:1.5;overflow-wrap:anywhere}
.yxs-modern-choices small{display:block;color:#cbd8bd;line-height:1.5;padding:0 .2rem}
.yxs-modern-choices button:focus-visible{outline:3px solid #f3d397;outline-offset:3px}
.yxs-modern-context{border-left-color:#c8a76e}.yxs-modern-context small{display:block}
.yxs-modern-policy-guide li{margin:.55rem 0;line-height:1.6}
@media(max-width:600px){.yxs-modern-choices section{flex-basis:100%}.yxs-modern-quotas span{flex:1 1 40%;text-align:center}.yxs-modern-status{font-size:.8rem}}
/* Zhang Fen: public ledger, explicit pre-match derived faces, touch-safe choices. */
.zhangfen-face-setup{margin:14px 0;padding:12px 16px;border:1px solid #9da789;border-radius:10px;background:#ece9dc;color:#293d35}
.zhangfen-face-setup summary,.zhangfen-equipment-guide>summary{cursor:pointer;min-height:32px;font-weight:700}
.zhangfen-face-setup p,.zhangfen-card-rules p,.zhangfen-policy-guide li{line-height:1.65;overflow-wrap:anywhere}
.zhangfen-face-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.zhangfen-face-fields fieldset{display:flex;gap:12px;min-width:0;margin:0;padding:12px;border:1px solid #a8ac91;border-radius:8px}
.zhangfen-face-fields legend{padding:0 5px;font-weight:700}
.zhangfen-face-fields label{display:grid;gap:5px;flex:1;min-width:0}
.zhangfen-face-fields select{min-height:44px;width:100%;color:#243d32;background:#fffdf2;border:1px solid #788675;border-radius:5px;font:inherit;padding:5px}
.zhangfen-face-setup summary:focus-visible,.zhangfen-face-fields select:focus-visible,.zhangfen-choices button:focus-visible{outline:3px solid #487665;outline-offset:3px}
.zhangfen-status{color:#e1e8c8;font-size:.8rem;line-height:1.5;overflow-wrap:anywhere}
.zhangfen-status p{margin:4px 0}
.zhangfen-vehicle-state{padding:8px 10px;margin-top:6px;border:1px solid #8b9d78;border-radius:6px;line-height:1.55;overflow-wrap:anywhere}
.zhangfen-vehicle-state p{margin:5px 0}
.equipment-slot__details .zhangfen-vehicle-state{color:inherit;background:#f2efdf}
.zhangfen-choices .dialog-actions{align-items:stretch;gap:10px}
.zhangfen-choices section{display:flex;flex:1 1 150px;min-width:0;flex-direction:column;align-items:center;gap:6px}
.zhangfen-choices button{width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.zhangfen-choices button:disabled{cursor:default}
.zhangfen-context{color:#263b32;line-height:1.65}
.zhangfen-context [data-zhangfen-manufacture],.zhangfen-context [data-zhangfen-attack-offer]{padding:8px 10px;background:#e1e7d6;border-radius:5px;font-weight:700}
.zhangfen-guide-grid{display:grid;gap:14px}
.zhangfen-card-rules{min-width:0}
.zhangfen-equipment-guide .derived-guide-art{min-width:120px}
@media(max-width:600px){.zhangfen-face-fields{grid-template-columns:1fr}.zhangfen-face-setup{padding:10px}.zhangfen-equipment-guide .derived-guide-entry{display:flex;flex-direction:column}.zhangfen-equipment-guide .derived-guide-art{max-width:180px}.zhangfen-status{font-size:.75rem}}
