:root {
  color-scheme: dark;
  --ink: #fff7df;
  --muted: #cbbf9d;
  --gold: #ffd36a;
  --gold-deep: #a66b18;
  --jade: #0f7a5f;
  --jade-deep: #073d36;
  --wine: #8f2637;
  --crimson: #e63e44;
  --blue: #2f6edb;
  --panel: rgba(32, 22, 16, 0.78);
  --line: rgba(255, 211, 106, 0.22);
  --card: #fff9ec;
  --black-card: #202027;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 8, 5, 0.12), rgba(8, 22, 20, 0.2)),
    url("/assets/arena-bg.png") center / cover fixed,
    radial-gradient(circle at 50% 16%, rgba(255, 211, 106, 0.22), transparent 28%),
    radial-gradient(circle at 10% 80%, rgba(143, 38, 55, 0.26), transparent 28%),
    linear-gradient(135deg, #24120c 0%, #08362f 46%, #1d1826 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 211, 106, 0.08) 42%, transparent 48% 100%),
    radial-gradient(circle at 50% 55%, transparent 0 32%, rgba(0, 0, 0, 0.32) 78%);
  mix-blend-mode: screen;
  animation: arenaLightSweep 8s ease-in-out infinite;
}

body.bomb-mode {
  --gold: #ffe17a;
  --crimson: #ff533d;
}

body.bomb-mode .room-badge::after {
  content: " · Bomb";
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid rgba(255, 211, 106, 0.35);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(89, 55, 23, 0.92), rgba(58, 32, 17, 0.92));
  padding: 10px 15px;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 10px 24px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
  border-color: rgba(255, 211, 106, 0.8);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.primary {
  color: #2a1607;
  background: linear-gradient(180deg, #ffe58b, #d89524);
  border-color: rgba(255, 239, 172, 0.9);
  font-weight: 800;
}

input,
select {
  min-width: 0;
  border: 1px solid rgba(255, 211, 106, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(14, 10, 9, 0.62);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(255, 211, 106, 0.82);
}

select {
  appearance: none;
}

.app-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(38, 24, 13, 0.86), rgba(10, 50, 45, 0.76));
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  letter-spacing: 0;
  line-height: 1;
}

h2 {
  font-size: 36px;
  letter-spacing: 0;
}

.room-badge {
  display: inline-flex;
  width: max-content;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #301700;
  background: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

#roomMeta {
  color: var(--muted);
  margin-top: 5px;
}

.room-tools {
  width: min(560px, 50vw);
  display: flex;
  gap: 8px;
}

.room-tools input {
  flex: 1;
}

.gate {
  min-height: 72vh;
  display: grid;
  place-content: center;
}

.gate-stage {
  width: min(760px, calc(100vw - 36px));
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  border: 1px solid rgba(255, 211, 106, 0.34);
  border-radius: 8px;
  padding: 36px;
  background:
    linear-gradient(135deg, rgba(255, 211, 106, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(47, 30, 18, 0.92), rgba(9, 54, 46, 0.9));
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 114px;
  height: 114px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 211, 106, 0.68);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle, rgba(255, 211, 106, 0.22), rgba(80, 27, 22, 0.34));
  font-size: 30px;
  box-shadow: inset 0 0 28px rgba(255, 211, 106, 0.16), 0 18px 38px rgba(0, 0, 0, 0.34);
}

.mode-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr) minmax(170px, 0.8fr) auto;
  align-items: center;
  gap: 12px;
}

.mode-row label {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.mode-row label > span {
  white-space: nowrap;
}

.skin-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.avatar-pickers {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}

.player-avatar-pickers {
  grid-template-columns: 1fr;
}

.avatar-pickers section {
  display: grid;
  gap: 8px;
}

.avatar-pickers section > span,
.settings-panel > span {
  color: var(--muted);
  font-weight: 800;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.player-options {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.avatar-option {
  min-width: 0;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 0;
  background: linear-gradient(180deg, rgba(255, 211, 106, 0.12), rgba(0, 0, 0, 0.28));
  overflow: hidden;
}

.avatar-option.selected {
  border-color: rgba(255, 226, 139, 0.95);
  box-shadow: inset 0 0 0 2px rgba(255, 211, 106, 0.64), 0 0 24px rgba(255, 211, 106, 0.26);
}

.avatar-options.compact {
  grid-template-columns: repeat(6, 28px);
  justify-content: end;
  gap: 5px;
}

.avatar-option.small {
  width: 28px;
  height: 38px;
  border-radius: 6px;
}

.avatar-option.small .face-card {
  width: 28px;
  height: 38px;
  border: 0;
  border-radius: 6px;
}

.skin-row label,
.settings-panel {
  display: grid;
  grid-template-columns: auto minmax(92px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.recorder-choice {
  grid-template-columns: auto auto !important;
  justify-content: end;
  white-space: nowrap;
}

.recorder-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.join-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto auto;
  gap: 10px;
}

#gateHint {
  min-height: 24px;
  color: var(--gold);
}

.game {
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 14px;
}

.side-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(58, 36, 19, 0.85), rgba(16, 42, 38, 0.82));
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel-head,
.scoreline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.panel-head.compact {
  margin-bottom: 8px;
}

.panel-head strong,
.scoreline strong {
  color: var(--gold);
}

.players {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.player {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(255, 211, 106, 0.16);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.player.is-turn,
.opponent.is-turn {
  border-color: rgba(255, 211, 106, 0.92);
  animation: seatPulse 1.2s ease-in-out infinite;
}

.seat-avatar-wrap {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
}

.thinking-dots {
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.65);
  animation: thinkingDot 0.96s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

.seat-play-pile {
  width: 120px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 18px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.3));
}

.player .seat-play-pile {
  width: 86px;
  min-height: 38px;
  padding-left: 12px;
}

.seat-play-pile.empty {
  opacity: 0;
}

.seat-play-pile .card {
  width: 31px;
  height: 45px;
  min-width: 31px;
  padding: 3px;
  margin-left: -16px;
  border-radius: 6px;
  font-size: 11px;
  transform: translateY(0) rotate(calc((var(--i) - 2) * 2deg));
}

.player .seat-play-pile .card {
  width: 24px;
  height: 35px;
  min-width: 24px;
  margin-left: -13px;
  font-size: 9px;
}

.seat-play-pile.drop-in .card {
  animation: seatCardDrop 0.46s cubic-bezier(0.2, 0.8, 0.22, 1) both;
  animation-delay: calc(var(--i) * 32ms);
}

.avatar {
  position: relative;
  width: 66px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 211, 106, 0.28);
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 211, 106, 0.22), transparent 38%),
    linear-gradient(180deg, #4d3b2a, #201915);
  overflow: hidden;
}

.avatar.landlord,
.avatar.farmer {
  background:
    linear-gradient(180deg, rgba(255, 239, 172, 0.14), transparent 34%),
    radial-gradient(circle at 50% 22%, rgba(255, 211, 106, 0.22), transparent 42%),
    linear-gradient(180deg, #382318, #141716 72%);
}

.avatar.landlord .person,
.avatar.farmer .person,
.player-avatar .person {
  opacity: 0;
}

.player-portrait {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
  display: block;
  filter: saturate(1.05) contrast(1.05);
  transform: scale(1.02);
  transform-origin: 50% 50%;
}

.player-avatar.skin-guard .player-portrait {
  object-position: 52% 24%;
}

.player-avatar.skin-maiden .player-portrait {
  object-position: 50% 22%;
}

.player-avatar.skin-ranger .player-portrait,
.player-avatar.skin-wanderer .player-portrait {
  object-position: 50% 20%;
}

.avatar-option.small .player-portrait {
  object-position: 50% 24%;
}

.avatar.landlord::before,
.avatar.farmer::before {
  content: "";
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 13%;
  width: 52%;
  height: 42%;
  transform: translateX(-50%);
  border-radius: 46% 46% 44% 44%;
  background:
    radial-gradient(circle at 34% 44%, #27140b 0 3%, transparent 4%),
    radial-gradient(circle at 66% 44%, #27140b 0 3%, transparent 4%),
    linear-gradient(90deg, transparent 28%, rgba(112, 47, 20, 0.22) 29% 34%, transparent 35%),
    linear-gradient(180deg, #f2c08a 0%, #c7834c 72%, #7a3f25 100%);
  box-shadow: inset 0 -5px 8px rgba(84, 37, 18, 0.28), 0 8px 14px rgba(0, 0, 0, 0.24);
}

.avatar.landlord::after,
.avatar.farmer::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1px;
  width: 86%;
  height: 50%;
  transform: translateX(-50%);
  clip-path: polygon(18% 22%, 34% 3%, 66% 3%, 82% 22%, 96% 100%, 4% 100%);
}

.avatar.landlord::after {
  background:
    linear-gradient(90deg, transparent 0 39%, rgba(255, 236, 169, 0.92) 40% 60%, transparent 61%),
    radial-gradient(circle at 50% 6%, #fff1b0 0 12%, transparent 13%),
    linear-gradient(135deg, #e7b65a, #8a241c 44%, #35120f 100%);
  box-shadow: inset 0 0 18px rgba(255, 211, 106, 0.28);
}

.avatar.landlord .avatar-role::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -55px;
  width: 44px;
  height: 24px;
  transform: translateX(-50%);
  clip-path: polygon(0 100%, 12% 28%, 30% 64%, 50% 0, 70% 64%, 88% 28%, 100% 100%);
  background: linear-gradient(180deg, #fff1a7, #d59020 72%, #81440d);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.avatar.farmer::before {
  top: 20%;
  width: 48%;
  height: 38%;
  background:
    radial-gradient(circle at 35% 46%, #24150c 0 3%, transparent 4%),
    radial-gradient(circle at 65% 46%, #24150c 0 3%, transparent 4%),
    linear-gradient(180deg, #ecc08f, #b77445 78%);
}

.avatar.farmer::after {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(234, 226, 185, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #46a36b, #185d49 56%, #102923);
}

.avatar.farmer .avatar-role::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -58px;
  width: 56px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50% 50% 10% 10%;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(120, 78, 32, 0.36) 9% 13%, transparent 14% 100%),
    linear-gradient(180deg, #e6c784, #8b6b32);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.26);
}

.skin-festival.landlord::after {
  background:
    linear-gradient(90deg, transparent 0 39%, rgba(255, 223, 142, 0.92) 40% 60%, transparent 61%),
    radial-gradient(circle at 50% 6%, #ffe6a3 0 12%, transparent 13%),
    linear-gradient(135deg, #ffd37a, #b6202e 48%, #411019 100%);
}

.skin-neon.landlord::after {
  background:
    linear-gradient(90deg, transparent 0 39%, rgba(221, 214, 255, 0.92) 40% 60%, transparent 61%),
    radial-gradient(circle at 50% 6%, #efe9ff 0 12%, transparent 13%),
    linear-gradient(135deg, #756fb4, #302d58 58%, #121426 100%);
}

.skin-festival.farmer::after {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(255, 238, 180, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #d7aa4d, #8f5d18 58%, #35250c);
}

.skin-neon.farmer::after {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(209, 244, 255, 0.86) 39% 61%, transparent 62%),
    linear-gradient(135deg, #75d7ff, #195a8b 58%, #0f2839);
}

.avatar.landlord::before,
.avatar.farmer::before,
.avatar.landlord::after,
.avatar.farmer::after,
.avatar.landlord .avatar-role::before,
.avatar.farmer .avatar-role::before {
  display: none;
}

.face-card {
  width: 100%;
  height: 100%;
  border: 0;
}

.figure {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 0;
  width: 82px;
  height: 108px;
  --figure-scale: 0.86;
  transform: translateX(-50%) scale(var(--figure-scale));
  transform-origin: 50% 100%;
  animation: portraitBreathe 3.2s ease-in-out infinite;
}

.opponent .figure {
  --figure-scale: 1.04;
}

.face-card .figure {
  --figure-scale: 0.9;
}

.avatar-option.small .figure {
  --figure-scale: 0.62;
}

.figure i {
  position: absolute;
  display: block;
}

.figure-bg {
  inset: 8px 4px 0;
  border-radius: 50% 50% 12px 12px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 236, 169, 0.32), transparent 30%),
    linear-gradient(180deg, rgba(82, 44, 22, 0.54), rgba(0, 0, 0, 0.08));
}

.figure-body {
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 46px;
  clip-path: polygon(10% 100%, 24% 22%, 38% 6%, 62% 6%, 76% 22%, 90% 100%);
  background:
    linear-gradient(90deg, transparent 0 40%, rgba(255, 238, 178, 0.82) 41% 59%, transparent 60%),
    linear-gradient(135deg, #e0a441, #8a241c 52%, #2b100f);
}

.figure-neck {
  left: 50%;
  bottom: 39px;
  width: 20px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #d49461, #9a5a34);
}

.figure-face {
  left: 50%;
  top: 28px;
  width: 36px;
  height: 42px;
  transform: translateX(-50%);
  border-radius: 45% 45% 48% 48%;
  background:
    radial-gradient(circle at 35% 45%, #25140d 0 2px, transparent 3px),
    radial-gradient(circle at 65% 45%, #25140d 0 2px, transparent 3px),
    linear-gradient(180deg, #f2c391, #be7b47 78%, #7e3f24);
  box-shadow: inset 0 -6px 8px rgba(77, 33, 14, 0.22);
}

.figure-hair {
  left: 50%;
  top: 20px;
  width: 42px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 44% 44% 18% 18%;
  background: linear-gradient(180deg, #241613, #0f0b0b);
}

.figure-hat {
  left: 50%;
  top: 10px;
  width: 58px;
  height: 28px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #fff0a8, #c07a1d 72%, #71350d);
  clip-path: polygon(0 100%, 14% 38%, 32% 68%, 50% 0, 68% 68%, 86% 38%, 100% 100%);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34));
}

.figure-mark {
  left: 50%;
  top: 73px;
  width: 30px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 238, 178, 0.78);
}

.figure.farmer .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(236, 229, 191, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #4aa975, #1a5a46 56%, #102922);
}

.figure.farmer .figure-hat {
  top: 16px;
  width: 68px;
  height: 24px;
  border-radius: 50% 50% 14% 14%;
  clip-path: none;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(112, 74, 30, 0.34) 9% 13%, transparent 14% 100%),
    linear-gradient(180deg, #e7c985, #8f6c31);
}

.figure.farmer .figure-hair {
  top: 25px;
  height: 24px;
}

.figure.farmer .figure-face {
  top: 33px;
}

.figure.farmer .figure-mark {
  background: rgba(230, 245, 224, 0.72);
}

.figure.player .figure-hat {
  top: 15px;
  width: 44px;
  height: 22px;
  border-radius: 14px 14px 6px 6px;
  clip-path: none;
  background: linear-gradient(180deg, #2e2520, #111010);
}

.figure.player .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(239, 232, 202, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #6b8fa2, #2f4858 58%, #111b22);
}

.figure.player.skin-scholar .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(244, 238, 213, 0.86) 39% 61%, transparent 62%),
    linear-gradient(135deg, #7b9fb0, #315565 58%, #14232a);
}

.figure.player.skin-scholar .figure-hat {
  width: 36px;
  background: linear-gradient(180deg, #dfd0ab, #5b4a36 72%, #1c1714);
}

.figure.player.skin-guard .figure-body {
  background:
    linear-gradient(90deg, transparent 0 40%, rgba(231, 208, 161, 0.8) 41% 59%, transparent 60%),
    linear-gradient(135deg, #9d493d, #3b2638 58%, #11121c);
}

.figure.player.skin-guard .figure-hat {
  width: 52px;
  height: 26px;
  clip-path: polygon(8% 78%, 28% 20%, 50% 0, 72% 20%, 92% 78%, 72% 100%, 28% 100%);
  background: linear-gradient(180deg, #f0d389, #8a3d2c 72%, #241218);
}

.figure.player.skin-maiden .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(255, 235, 230, 0.78) 39% 61%, transparent 62%),
    linear-gradient(135deg, #d68a9a, #6e3554 58%, #241121);
}

.figure.player.skin-maiden .figure-hat {
  width: 50px;
  height: 18px;
  top: 20px;
  border-radius: 50% 50% 20% 20%;
  background:
    radial-gradient(circle at 20% 10%, #ffdcd2 0 12%, transparent 13%),
    radial-gradient(circle at 80% 10%, #ffdcd2 0 12%, transparent 13%),
    linear-gradient(180deg, #3a1f24, #111010);
}

.figure.player.skin-ranger .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(226, 239, 212, 0.76) 39% 61%, transparent 62%),
    linear-gradient(135deg, #4d8765, #203f34 58%, #101815);
}

.figure.player.skin-ranger .figure-hat {
  width: 66px;
  height: 20px;
  top: 18px;
  border-radius: 50% 50% 18% 18%;
  background: linear-gradient(180deg, #c7b076, #4f4024);
}

.figure.player.skin-minister .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(236, 229, 191, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #4f6c8d, #263852 58%, #121722);
}

.figure.player.skin-minister .figure-hat {
  width: 62px;
  height: 24px;
  clip-path: polygon(0 72%, 20% 36%, 50% 0, 80% 36%, 100% 72%, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #d8c994, #344059 74%, #11151f);
}

.figure.player.skin-wanderer .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(238, 226, 198, 0.72) 39% 61%, transparent 62%),
    linear-gradient(135deg, #9c8357, #4b3c28 58%, #18140e);
}

.figure.player.skin-wanderer .figure-hat {
  width: 70px;
  height: 23px;
  top: 18px;
  border-radius: 50% 50% 12% 12%;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(76, 51, 22, 0.32) 11% 15%, transparent 16% 100%),
    linear-gradient(180deg, #e1c98f, #75582c);
}

.figure.skin-festival.landlord .figure-body {
  background:
    linear-gradient(90deg, transparent 0 40%, rgba(255, 222, 142, 0.86) 41% 59%, transparent 60%),
    linear-gradient(135deg, #f4c85d, #b71f32 54%, #3a1018);
}

.figure.skin-festival.landlord .figure-hat {
  background: linear-gradient(180deg, #fff0a8, #d92f32 72%, #7b1019);
}

.figure.skin-neon.landlord .figure-body {
  background:
    linear-gradient(90deg, transparent 0 40%, rgba(222, 218, 255, 0.82) 41% 59%, transparent 60%),
    linear-gradient(135deg, #7b73b7, #302d58 56%, #121426);
}

.figure.skin-neon.landlord .figure-hat {
  background: linear-gradient(180deg, #f1edff, #60589e 72%, #282449);
}

.figure.skin-jade.landlord .figure-body {
  background:
    linear-gradient(90deg, transparent 0 40%, rgba(235, 255, 224, 0.84) 41% 59%, transparent 60%),
    linear-gradient(135deg, #b8d879, #197060 56%, #0d2826);
}

.figure.skin-jade.landlord .figure-hat {
  background: linear-gradient(180deg, #f2ffce, #4e9d72 72%, #163d35);
}

.figure.skin-festival.farmer .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(255, 238, 180, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #d7aa4d, #8f5d18 58%, #35250c);
}

.figure.skin-neon.farmer .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(209, 244, 255, 0.86) 39% 61%, transparent 62%),
    linear-gradient(135deg, #75d7ff, #195a8b 58%, #0f2839);
}

.figure.skin-wheat.farmer .figure-body {
  background:
    linear-gradient(90deg, transparent 0 38%, rgba(254, 240, 190, 0.82) 39% 61%, transparent 62%),
    linear-gradient(135deg, #caa15c, #6b6d38 58%, #20230f);
}

.figure.skin-wheat.farmer .figure-hat {
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(95, 65, 31, 0.38) 9% 13%, transparent 14% 100%),
    linear-gradient(180deg, #f1db9f, #9c7838);
}

.portrait-avatar {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 211, 106, 0.22), transparent 46%),
    linear-gradient(180deg, rgba(34, 24, 18, 0.62), rgba(7, 15, 14, 0.95));
}

.portrait-avatar::before,
.portrait-avatar::after {
  display: none;
}

.portrait-avatar .avatar-role::before {
  display: none;
}

.portrait-avatar .person {
  opacity: 0;
}

.role-portrait {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  pointer-events: none;
  user-select: none;
  filter: saturate(1.08) contrast(1.05);
  transform-origin: 50% 50%;
  animation: rolePortraitBreathe 3.2s ease-in-out infinite;
}

.portrait-avatar.landlord .role-portrait {
  object-position: 50% 17%;
}

.portrait-avatar.farmer .role-portrait {
  object-position: 50% 14%;
}

.skin-festival.portrait-avatar .role-portrait {
  filter: saturate(1.16) contrast(1.06) sepia(0.08);
}

.skin-neon.portrait-avatar .role-portrait {
  filter: saturate(1.08) contrast(1.08) hue-rotate(10deg);
}

.person {
  position: absolute;
  inset: 3px 5px 8px;
  transform-origin: 50% 100%;
  animation: personBreathe 2.4s ease-in-out infinite;
}

.head {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(180deg, #f5c58f, #b97845);
  box-shadow: inset 0 -4px rgba(116, 61, 29, 0.2);
  z-index: 3;
}

.hat {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 44px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 18px 18px 7px 7px;
  background: linear-gradient(180deg, #3f4f6e, #17223e);
  z-index: 4;
}

.hat::before {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -4px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 211, 106, 0.9);
}

.landlord .hat {
  height: 20px;
  background: linear-gradient(180deg, #ffd36a, #9d341d);
  animation: crownBob 1.8s ease-in-out infinite;
}

.landlord .hat::after {
  content: "";
  position: absolute;
  left: 7px;
  top: -8px;
  width: 30px;
  height: 12px;
  background:
    linear-gradient(135deg, transparent 25%, #ffe58b 25% 50%, transparent 50%) 0 0 / 10px 12px repeat-x;
}

.farmer .hat {
  background: linear-gradient(180deg, #8fcf74, #1c6d47);
}

.ai .hat {
  background: linear-gradient(180deg, #8bd6ff, #3157c7);
}

.eye {
  position: absolute;
  top: 13px;
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: #27140b;
  animation: blink 4.4s infinite;
}

.eye.left {
  left: 9px;
}

.eye.right {
  right: 9px;
}

.brow {
  position: absolute;
  top: 9px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: rgba(57, 25, 8, 0.78);
}

.brow.left {
  left: 6px;
  transform: rotate(-10deg);
}

.brow.right {
  right: 6px;
  transform: rotate(10deg);
}

.mouth {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 12px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid #6c271a;
  border-radius: 50%;
}

.collar {
  position: absolute;
  left: 50%;
  top: 45px;
  width: 30px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px 999px 4px 4px;
  background: rgba(255, 249, 236, 0.72);
  z-index: 2;
}

.body {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 42px;
  height: 28px;
  transform: translateX(-50%);
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, #324f96, #172652);
  z-index: 1;
}

.landlord .body {
  background: linear-gradient(180deg, #d7a33f, #7b2719);
}

.farmer .body {
  background: linear-gradient(180deg, #46a36b, #165d47);
}

.ai .body {
  background: linear-gradient(180deg, #4da0ff, #1f3d95);
}

.skin-festival.landlord .hat,
.skin-festival.landlord .body {
  background: linear-gradient(180deg, #ffdf8e, #b6202e);
}

.skin-neon.landlord .hat,
.skin-neon.landlord .body {
  background: linear-gradient(180deg, #e4d7ff, #34305f);
}

.skin-festival.farmer .hat,
.skin-festival.farmer .body {
  background: linear-gradient(180deg, #f1c86b, #8f5d18);
}

.skin-festival.farmer .prop {
  background: linear-gradient(180deg, #f6dc88, #d19923);
}

.skin-neon.farmer .hat,
.skin-neon.farmer .body {
  background: linear-gradient(180deg, #75d7ff, #195a8b);
}

.skin-neon.farmer .prop {
  background: linear-gradient(180deg, #baf3ff, #2e7fad);
}

.arm {
  position: absolute;
  bottom: 13px;
  width: 9px;
  height: 26px;
  border-radius: 999px;
  background: #c18452;
  transform-origin: top center;
  z-index: 2;
}

.arm.left {
  left: 4px;
  transform: rotate(24deg);
}

.arm.right {
  right: 4px;
  transform: rotate(-18deg);
  animation: waveHand 1.9s ease-in-out infinite;
}

.prop {
  position: absolute;
  right: -1px;
  bottom: 20px;
  width: 18px;
  height: 23px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(180deg, #b52d3d, #641723);
  transform: rotate(-14deg);
  animation: propSway 1.8s ease-in-out infinite;
  z-index: 5;
}

.farmer .prop {
  width: 5px;
  height: 31px;
  right: 3px;
  bottom: 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2d39b, #865f2c);
}

.farmer .prop::before {
  content: "";
  position: absolute;
  left: -8px;
  top: -3px;
  width: 20px;
  height: 6px;
  border-radius: 999px;
  background: #c59b55;
}

.ai .prop {
  border-radius: 50%;
  background: radial-gradient(circle, #d9fbff, #3ba4ff 60%, #153d9d);
}

.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  z-index: 6;
  animation: sparkle 2.1s ease-in-out infinite;
}

.spark.one {
  right: 4px;
  top: 12px;
}

.spark.two {
  left: 4px;
  top: 23px;
  animation-delay: 0.8s;
}

.avatar-role {
  position: absolute;
  z-index: 8;
  bottom: 4px;
  border-radius: 999px;
  padding: 1px 7px;
  color: #241200;
  background: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.player-body {
  min-width: 0;
}

.player-top,
.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.cards-left {
  min-width: 32px;
  border-radius: 999px;
  padding: 2px 8px;
  text-align: center;
  color: #2f1700;
  background: var(--gold);
  font-weight: 900;
}

.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  color: #221100;
  background: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.player-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.wide {
  width: 100%;
  margin-bottom: 14px;
}

.settings-panel {
  grid-template-columns: auto 1fr 1fr;
  margin-bottom: 10px;
}

.recorder-in-game {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.18);
  font-weight: 800;
}

.recorder-in-game input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.mode-chip {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 211, 106, 0.26);
  border-radius: 8px;
  padding: 9px 10px;
  text-align: center;
  color: #2f1700;
  background: linear-gradient(180deg, #ffe58b, #bc7923);
  font-weight: 900;
}

.table {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(300px, 1fr) auto auto auto;
  gap: 12px;
  border: 2px solid rgba(255, 211, 106, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(rgba(14, 15, 12, 0.1), rgba(8, 20, 18, 0.2)),
    radial-gradient(ellipse at 50% 54%, transparent 0 38%, rgba(5, 13, 12, 0.34) 78%),
    url("/assets/table-arena-v2.png") center 56% / cover,
    linear-gradient(135deg, #3c2115, #123b35);
  box-shadow: inset 0 0 0 8px rgba(45, 19, 9, 0.6), inset 0 0 0 12px rgba(255, 211, 106, 0.18), var(--shadow);
  padding: 16px;
  overflow: hidden;
}

.table::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 24%, transparent 74%, rgba(0, 0, 0, 0.26)),
    radial-gradient(ellipse at 50% 56%, rgba(255, 211, 106, 0.08), transparent 32%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.opponents {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.opponent {
  min-height: 122px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 211, 106, 0.2);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.opponent .avatar {
  width: 94px;
  height: 126px;
  box-shadow: inset 0 0 28px rgba(255, 211, 106, 0.13), 0 14px 28px rgba(0, 0, 0, 0.28);
}

.opponent .seat-avatar-wrap {
  width: 132px;
}

.opponent .role-portrait {
  inset: 0;
  width: 100%;
  height: 100%;
}

.opponent .portrait-avatar.landlord .role-portrait {
  object-position: 50% 15%;
}

.opponent .portrait-avatar.farmer .role-portrait {
  object-position: 50% 12%;
}

.opponent .avatar.landlord .avatar-role::before,
.opponent .avatar.farmer .avatar-role::before {
  top: -74px;
  scale: 1.28;
}

.opponent .avatar-role {
  bottom: 7px;
}

.opponent-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.opponent-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opponent-info span {
  color: var(--muted);
  font-size: 13px;
}

.card-stack {
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--gold);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14) 25%, transparent 25%) 0 0 / 9px 9px,
    linear-gradient(180deg, #9f2d37, #5f1722);
  box-shadow: 6px 4px 0 rgba(255, 249, 236, 0.72), 10px 8px 0 rgba(255, 249, 236, 0.48);
  font-weight: 900;
}

.center-zone {
  position: relative;
  z-index: 1;
  min-height: 300px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
}

.timer-dial {
  position: absolute;
  right: 18px;
  top: 12px;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
}

.timer-dial svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.timer-track,
.timer-ring {
  fill: none;
  stroke-width: 7;
}

.timer-track {
  stroke: rgba(255, 255, 255, 0.14);
}

.timer-ring {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
  transition: stroke-dashoffset 0.22s linear, stroke 0.2s ease;
}

.timer-dial strong {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 20px;
}

.timer-dial.urgent .timer-ring {
  stroke: var(--crimson);
}

.timer-dial.urgent {
  animation: urgentBeat 0.6s ease-in-out infinite;
}

.bottom-cards,
.last-play {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
}

.bottom-cards > span,
.last-play > span {
  border-radius: 999px;
  padding: 3px 12px;
  color: #2a1704;
  background: linear-gradient(180deg, #ffe58b, #c8811c);
  font-weight: 900;
}

.mini-cards,
.played-cards {
  min-height: 78px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.played-cards {
  min-width: min(520px, 100%);
}

.play-title {
  width: 100%;
  text-align: center;
  color: var(--gold);
}

.level-chip {
  border-radius: 999px;
  padding: 9px 14px;
  color: #2a1704;
  background: linear-gradient(180deg, #ffe58b, #c8811c);
  font-weight: 900;
}

.bid-panel,
.actionbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.bid-countdown {
  min-width: 54px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 211, 106, 0.48);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.34);
  font-weight: 900;
  box-shadow: inset 0 0 18px rgba(255, 211, 106, 0.12);
}

.bid-panel button,
.actionbar button {
  min-width: 112px;
}

.hint-tray {
  position: relative;
  z-index: 2;
  min-height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 211, 106, 0.32);
  box-shadow: 0 0 0 rgba(255, 211, 106, 0);
}

.hint-dot.active {
  background: var(--gold);
}

.hint-dot.pulse {
  animation: hintPulse 0.54s ease both;
}

.hand-rail {
  position: relative;
  z-index: 1;
  min-height: 174px;
  display: grid;
  align-items: end;
  border-radius: 8px;
  padding: 18px 14px 8px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 211, 106, 0.18), transparent 58%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24));
  overflow: visible;
}

.hand {
  --card-step: 34px;
  min-height: 144px;
  display: flex;
  align-items: end;
  justify-content: center;
  flex-wrap: nowrap;
  padding: 38px 28px 6px;
  overflow: visible;
  touch-action: none;
}

.card {
  width: 66px;
  height: 96px;
  position: relative;
  border: 1px solid rgba(78, 34, 14, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 211, 106, 0.12), transparent 32%),
    var(--card);
  color: var(--black-card);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 7px;
  user-select: none;
  transform-origin: center bottom;
}

.card.red {
  color: var(--crimson);
}

.card.wild {
  box-shadow: 0 0 0 3px rgba(255, 211, 106, 0.86), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.hand .card {
  flex: 0 0 66px;
  cursor: pointer;
  z-index: calc(var(--i) + 1);
  margin-left: calc(var(--card-step) - 66px);
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.18s ease, filter 0.18s ease;
  will-change: transform;
}

.hand .card:first-child {
  margin-left: 0;
}

.hand .card:hover {
  transform: translateY(-18px) scale(1.035);
}

.hand .card.selected {
  transform: translateY(-34px) scale(1.06);
  box-shadow: 0 0 0 3px var(--gold), 0 18px 30px rgba(0, 0, 0, 0.34);
  filter: brightness(1.04);
  z-index: calc(var(--i) + 80);
}

.hand .card.planned {
  transform: translateY(-34px) scale(1.08);
  box-shadow: 0 0 0 3px #8ee7ff, 0 0 28px rgba(142, 231, 255, 0.42), 0 18px 30px rgba(0, 0, 0, 0.34);
}

.hand .card.dimmed {
  opacity: 0.46;
  transform: translateY(4px) scale(0.96);
}

.hand .card.hint-flash {
  animation: hintCardFlash 0.54s ease both;
}

.hand .card.auto-picked {
  animation: autoPickPulse 0.52s ease both;
}

.card-rank {
  font-size: 18px;
  font-weight: 900;
}

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

.card-foot {
  justify-self: end;
  font-size: 15px;
}

.card.back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%) 0 0 / 12px 12px,
    radial-gradient(circle, rgba(255, 211, 106, 0.2), transparent 44%),
    linear-gradient(180deg, #a92e3d, #5d1722);
  color: #fff;
}

.deal-card {
  animation: dealIn 0.58s cubic-bezier(0.16, 0.84, 0.32, 1.2) both;
  animation-delay: calc(var(--i) * 30ms);
}

.fly-in {
  animation: throwToPile 0.46s cubic-bezier(0.2, 0.9, 0.16, 1.08) both;
  animation-delay: calc(var(--i) * 42ms);
}

.pile-burst {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pile-burst::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(255, 236, 169, 0.6), rgba(255, 93, 56, 0.28) 36%, transparent 70%);
  opacity: 0;
}

.pile-burst::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background:
    conic-gradient(from 20deg, transparent 0 8%, rgba(255, 235, 151, 0.9) 9% 11%, transparent 12% 21%, rgba(255, 88, 55, 0.72) 22% 25%, transparent 26% 100%),
    radial-gradient(circle, rgba(255, 240, 165, 0.75), rgba(255, 73, 43, 0.34) 34%, transparent 64%);
  filter: blur(0.2px);
}

.pile-burst.fx-bomb::before,
.pile-burst.fx-rocket::before {
  animation: pileShock 0.72s ease both;
}

.pile-burst.fx-bomb::after,
.pile-burst.fx-rocket::after {
  animation: sparkRing 0.76s ease both;
}

body.bomb-mode .pile-burst.fx-bomb::before,
body.bomb-mode .pile-burst.fx-rocket::before {
  animation: pileShock 0.88s ease both, bombModeFlash 0.88s ease both;
}

body.bomb-mode .pile-burst.fx-bomb::after,
body.bomb-mode .pile-burst.fx-rocket::after {
  animation: sparkRing 0.92s ease both, bombModeFlash 0.92s ease both;
}

.pile-burst.fx-straight .card {
  animation-name: throwStraight;
}

.pile-burst.fx-chain .card {
  animation-name: throwChain;
}

.pile-burst.fx-bomb .card,
.pile-burst.fx-rocket .card {
  animation-name: throwBomb;
  box-shadow: 0 0 0 2px rgba(255, 228, 139, 0.75), 0 0 28px rgba(255, 85, 48, 0.36), 0 14px 26px rgba(0, 0, 0, 0.34);
}

.pile-burst.fx-airplane .card {
  animation-name: throwAirplane;
}

.pop-in {
  animation: popIn 0.3s ease both;
}

.history-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recorder {
  border: 1px solid rgba(255, 211, 106, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.table-recorder {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(620px, 100%);
  justify-self: center;
  padding: 7px 10px;
  background:
    linear-gradient(180deg, rgba(53, 29, 14, 0.8), rgba(12, 33, 30, 0.72));
  box-shadow: inset 0 0 20px rgba(255, 211, 106, 0.08);
}

.table-recorder .panel-head {
  min-width: 72px;
  display: grid;
  gap: 2px;
}

.recorder-grid {
  display: grid;
  gap: 3px;
}

.recorder-row {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 2px;
}

.recorder-row span,
.recorder-row strong {
  min-width: 0;
  min-height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #2a1704;
  background: linear-gradient(180deg, #fff0b8, #c88725);
  font-weight: 900;
  line-height: 1;
}

.recorder-row span {
  font-size: 11px;
}

.recorder-row strong {
  font-size: 15px;
}

.recorder-row .empty {
  opacity: 0.38;
  filter: grayscale(0.7);
}

.history {
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.history li {
  border-bottom: 1px solid rgba(255, 211, 106, 0.12);
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.fx-layer {
  position: fixed;
  left: 50%;
  top: 42%;
  z-index: 40;
  pointer-events: none;
  width: 360px;
  height: 240px;
  transform: translate(-50%, -50%) scale(0.78);
  opacity: 0;
  display: grid;
  place-items: center;
}

.fx-layer.show {
  animation: visualFxIn 0.98s ease both;
}

.fx-layer span,
.fx-layer i {
  position: absolute;
  display: block;
}

.fx-ribbon {
  width: 300px;
  height: 66px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent, rgba(142, 255, 210, 0.68), rgba(255, 234, 139, 0.58), transparent);
  filter: blur(8px);
  transform: rotate(-8deg);
  animation: ribbonSweep 0.92s ease both;
}

.fx-mini-card {
  width: 34px;
  height: 48px;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff8df, #e6c375);
  box-shadow: 0 0 16px rgba(142, 255, 210, 0.36);
  transform: translateX(calc((var(--i) - 3) * 42px)) translateY(calc((var(--i) - 3) * -2px)) rotate(calc((var(--i) - 3) * 5deg));
  animation: straightCardFan 0.86s ease both;
  animation-delay: calc(var(--i) * 32ms);
}

.fx-thread {
  width: 300px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(142, 217, 255, 0.8), transparent);
  filter: blur(2px);
  animation: chainThread 0.94s ease both;
}

.fx-link {
  width: 52px;
  height: 36px;
  border: 5px solid rgba(142, 217, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(92, 188, 255, 0.48);
  transform: translateX(calc((var(--i) - 2.5) * 48px)) rotate(calc((var(--i) - 2.5) * -10deg));
  animation: chainLink 0.9s ease both;
  animation-delay: calc(var(--i) * 38ms);
}

.fx-core {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff3a9 0 18%, #ff844d 35%, rgba(170, 28, 16, 0.72) 58%, transparent 70%);
  filter: blur(0.5px);
  animation: bombCore 0.9s ease both;
}

.fx-ring {
  border-radius: 50%;
  border: 4px solid rgba(255, 225, 122, 0.82);
  box-shadow: 0 0 32px rgba(255, 83, 61, 0.72);
  animation: bombRing 0.94s ease both;
}

.fx-ring.r1 {
  width: 110px;
  height: 110px;
}

.fx-ring.r2 {
  width: 180px;
  height: 180px;
  animation-delay: 80ms;
}

.fx-spark {
  width: 8px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a7, #ff573d, transparent);
  transform-origin: 50% 110px;
  transform: rotate(calc(var(--i) * 25.7deg)) translateY(-100px);
  animation: sparkShoot 0.9s ease both;
  animation-delay: calc(var(--i) * 12ms);
}

.fx-plane {
  width: 138px;
  height: 62px;
  clip-path: polygon(0 48%, 42% 34%, 50% 0, 62% 34%, 100% 48%, 62% 62%, 50% 100%, 42% 62%);
  background: linear-gradient(90deg, rgba(228, 210, 255, 0.2), #d8c0ff, #8f77ff);
  filter: drop-shadow(0 0 24px rgba(196, 142, 255, 0.78));
  animation: planeDash 0.96s ease both;
}

.fx-wing {
  width: 190px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(216, 192, 255, 0.58), transparent);
  filter: blur(7px);
  animation: wingTrail 0.96s ease both;
}

.fx-wing.left {
  transform: translateY(-34px) rotate(-14deg);
}

.fx-wing.right {
  transform: translateY(34px) rotate(14deg);
}

.fx-cloud {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(216, 192, 255, 0.72);
  transform: translateX(calc((var(--i) - 4) * 38px)) translateY(calc(var(--y) * 21px));
  filter: blur(2px);
  animation: cloudFade 0.96s ease both;
  animation-delay: calc(var(--i) * 28ms);
}

.fx-trio {
  width: 130px;
  height: 86px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 50%, rgba(255, 234, 139, 0.85) 0 15%, transparent 16%),
    radial-gradient(circle at 50% 38%, rgba(255, 234, 139, 0.95) 0 17%, transparent 18%),
    radial-gradient(circle at 72% 50%, rgba(255, 234, 139, 0.85) 0 15%, transparent 16%);
  filter: drop-shadow(0 0 24px rgba(255, 211, 106, 0.62));
  animation: trioRise 0.88s ease both;
}

.fx-side {
  width: 64px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8df, #d99b39);
  box-shadow: 0 0 18px rgba(255, 211, 106, 0.42);
  animation: sideWing 0.88s ease both;
}

.fx-side.left {
  transform: translateX(-112px) rotate(-18deg);
}

.fx-side.right {
  transform: translateX(112px) rotate(18deg);
}

.fx-orbit {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffe58b;
  transform: rotate(calc(var(--i) * 72deg)) translateX(92px);
  animation: orbitPop 0.88s ease both;
}

.fx-sweep {
  width: 240px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 106, 0.7), transparent);
  filter: blur(6px);
  animation: ribbonSweep 0.75s ease both;
}

body.bomb-mode .table:has(.pile-burst.fx-bomb),
body.bomb-mode .table:has(.pile-burst.fx-rocket) {
  animation: tableShake 0.48s ease both;
}

.settlement {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 211, 106, 0.18), rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.settlement.show {
  opacity: 1;
}

.settlement-card {
  width: min(420px, calc(100vw - 36px));
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 2px solid rgba(255, 211, 106, 0.74);
  border-radius: 8px;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 211, 106, 0.32), transparent 42%),
    linear-gradient(180deg, #4a2916, #102f2b);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 0 38px rgba(255, 211, 106, 0.12);
  animation: settlementIn 0.52s cubic-bezier(0.18, 0.88, 0.3, 1.18) both;
}

.settlement-side {
  border-radius: 999px;
  padding: 4px 14px;
  color: #2a1704;
  background: var(--gold);
  font-weight: 900;
}

.settlement-card strong {
  font-size: 42px;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(67, 26, 6, 0.82);
}

.settlement-card p {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 211, 106, 0.48);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(28, 18, 12, 0.94);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sgs-game .actionbar,
.sgs-game .hint-tray,
.sgs-game .hand-rail {
  display: none;
}

.sgs-game .opponents,
.sgs-game .bottom-cards,
.sgs-game .last-play {
  display: none;
}

.sgs-game .center-zone {
  min-height: 88px;
  margin-bottom: 8px;
}

.sgs-panel {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(236, 200, 128, 0.32);
  background:
    linear-gradient(135deg, rgba(36, 21, 16, 0.78), rgba(16, 24, 28, 0.78)),
    radial-gradient(circle at 50% 0%, rgba(214, 164, 77, 0.18), transparent 48%);
  box-shadow: inset 0 0 30px rgba(255, 220, 150, 0.08), 0 18px 48px rgba(0, 0, 0, 0.32);
  border-radius: 8px;
}

.sgs-select-head,
.sgs-hand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffe7b5;
}

.sgs-select-head strong,
.sgs-hand-head strong {
  font-size: 18px;
}

.sgs-select-head span {
  color: rgba(255, 239, 205, 0.74);
  font-size: 13px;
}

.sgs-hero-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
}

.sgs-hero-card {
  display: grid;
  grid-template-rows: 152px auto auto auto 1fr;
  gap: 6px;
  min-height: 328px;
  padding: 8px;
  border: 1px solid rgba(231, 187, 103, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(69, 44, 28, 0.94), rgba(26, 21, 20, 0.96));
  color: #ffe9bc;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.sgs-hero-card:disabled {
  cursor: default;
}

.sgs-hero-card.selectable:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 218, 137, 0.86);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34), 0 0 22px rgba(224, 164, 66, 0.22);
}

.sgs-hero-card > img {
  width: 100%;
  height: 152px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 226, 157, 0.25);
}

.sgs-hero-name {
  font-size: 18px;
  font-weight: 800;
}

.sgs-hero-meta,
.sgs-skill-text,
.sgs-card-text {
  color: rgba(255, 240, 210, 0.76);
  font-size: 12px;
  line-height: 1.35;
}

.sgs-skill-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 7px;
  color: #fff2cb;
  font-size: 13px;
}

.sgs-skill-row img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

.sgs-duel-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.sgs-player-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(236, 200, 128, 0.3);
  border-radius: 8px;
  background: rgba(16, 19, 20, 0.72);
}

.sgs-player-card.is-turn {
  border-color: rgba(255, 220, 137, 0.92);
  box-shadow: 0 0 24px rgba(232, 168, 62, 0.22);
}

.sgs-player-art {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid rgba(255, 224, 150, 0.36);
}

.sgs-player-info {
  display: grid;
  gap: 6px;
  color: #ffe9ba;
}

.sgs-player-info strong {
  font-size: 22px;
}

.sgs-player-info small {
  color: rgba(255, 240, 210, 0.72);
  min-height: 18px;
}

.sgs-hp {
  display: flex;
  gap: 4px;
}

.sgs-hp i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 160, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.sgs-hp i.full {
  background: radial-gradient(circle at 35% 32%, #fff5cc, #d84231 58%, #671913);
}

.sgs-hand-head button {
  height: 34px;
  padding: 0 14px;
}

.sgs-hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.sgs-hand-card {
  display: grid;
  grid-template-rows: 178px auto auto 1fr;
  gap: 5px;
  min-height: 292px;
  padding: 7px;
  border: 1px solid rgba(229, 190, 111, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(52, 39, 29, 0.96), rgba(21, 20, 18, 0.98));
  color: #ffe9ba;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease;
}

.sgs-hand-card:disabled {
  opacity: 0.62;
  cursor: default;
}

.sgs-hand-card.playable:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 217, 136, 0.88);
}

.sgs-hand-card img {
  width: 100%;
  height: 178px;
  object-fit: cover;
  border-radius: 6px;
}

.sgs-card-name {
  font-size: 16px;
  font-weight: 800;
}

.sgs-card-meta {
  color: #efc978;
  font-size: 12px;
}

.sgs-log {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(236, 200, 128, 0.18);
  color: rgba(255, 238, 204, 0.72);
  font-size: 12px;
}

.sgs-avatar .role-portrait {
  object-position: center 18%;
}

@media (max-width: 980px) {
  .sgs-hero-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .sgs-duel-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sgs-hero-grid,
  .sgs-hand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sgs-player-card {
    grid-template-columns: 96px 1fr;
  }

  .sgs-player-art {
    width: 96px;
    height: 96px;
  }
}

.is-hidden {
  display: none !important;
}

@keyframes seatPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 211, 106, 0);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 211, 106, 0.42);
  }
}

@keyframes arenaLightSweep {
  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-8%);
  }
  50% {
    opacity: 0.9;
    transform: translateX(8%);
  }
}

@keyframes personBreathe {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-2px) scaleY(1.025);
  }
}

@keyframes portraitBreathe {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(var(--figure-scale, 1));
  }
  50% {
    transform: translateX(-50%) translateY(-2px) scale(calc(var(--figure-scale, 1) * 1.015));
  }
}

@keyframes rolePortraitBreathe {
  0%,
  100% {
    transform: translateY(0) scale(1.02);
  }
  50% {
    transform: translateY(-1px) scale(1.035);
  }
}

@keyframes blink {
  0%,
  46%,
  50%,
  100% {
    transform: scaleY(1);
  }
  48% {
    transform: scaleY(0.12);
  }
}

@keyframes waveHand {
  0%,
  100% {
    transform: rotate(-18deg);
  }
  50% {
    transform: rotate(-44deg) translateY(-2px);
  }
}

@keyframes propSway {
  0%,
  100% {
    transform: rotate(-14deg);
  }
  50% {
    transform: rotate(8deg) translateY(-2px);
  }
}

@keyframes crownBob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-2px);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0;
    transform: translateY(4px) scale(0.5);
  }
  45% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
}

@keyframes dealIn {
  0% {
    opacity: 0;
    transform: translateY(-160px) translateX(60px) rotate(14deg) scale(0.72);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0) scale(1);
  }
}

@keyframes flyToTable {
  0% {
    opacity: 0;
    transform: translateY(80px) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes throwToPile {
  0% {
    opacity: 0;
    transform: translateY(140px) translateX(calc((var(--i) - 2) * 14px)) rotate(-18deg) scale(0.86);
  }
  72% {
    opacity: 1;
    transform: translateY(-8px) translateX(0) rotate(5deg) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(calc((var(--i) - 2) * 2deg)) scale(1);
  }
}

@keyframes throwStraight {
  0% {
    opacity: 0;
    transform: translateX(-160px) translateY(70px) rotate(-22deg) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(calc((var(--i) - 2) * 3deg)) scale(1);
  }
}

@keyframes throwChain {
  0% {
    opacity: 0;
    transform: translateY(110px) scale(0.76) rotate(18deg);
  }
  50% {
    opacity: 1;
    transform: translateY(-20px) scale(1.08) rotate(-6deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(calc((var(--i) - 2) * -2deg));
  }
}

@keyframes throwBomb {
  0% {
    opacity: 0;
    transform: translateY(120px) scale(0.66) rotate(28deg);
    filter: brightness(1);
  }
  62% {
    opacity: 1;
    transform: translateY(-16px) scale(1.16) rotate(-10deg);
    filter: brightness(1.35);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(calc((var(--i) - 2) * 4deg));
    filter: brightness(1);
  }
}

@keyframes throwAirplane {
  0% {
    opacity: 0;
    transform: translateX(-210px) translateY(40px) rotate(-32deg) scale(0.78);
  }
  50% {
    opacity: 1;
    transform: translateX(24px) translateY(-30px) rotate(8deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(calc((var(--i) - 3) * 3deg)) scale(1);
  }
}

@keyframes pileShock {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.6);
  }
}

@keyframes sparkRing {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18) rotate(0deg);
    filter: brightness(1);
  }
  34% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.82) rotate(24deg);
    filter: brightness(1.4);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45) rotate(72deg);
    filter: brightness(1);
  }
}

@keyframes bombModeFlash {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 83, 61, 0);
  }
  45% {
    box-shadow: 0 0 90px rgba(255, 83, 61, 0.8);
  }
}

@keyframes tableShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-4px, 2px);
  }
  40% {
    transform: translate(5px, -2px);
  }
  60% {
    transform: translate(-3px, -1px);
  }
  80% {
    transform: translate(3px, 1px);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes thinkingDot {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.88);
  }
  48% {
    opacity: 1;
    transform: translateY(-4px) scale(1.08);
  }
}

@keyframes thinkingPulse {
  0%,
  100% {
    opacity: 0.48;
  }
  50% {
    opacity: 1;
  }
}

@keyframes seatCardDrop {
  from {
    opacity: 0;
    transform: translate(24px, -30px) rotate(10deg) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(calc((var(--i) - 2) * 2deg)) scale(1);
  }
}

@keyframes visualFxIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.03);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56%) scale(1.14);
  }
}

@keyframes ribbonSweep {
  0% {
    opacity: 0;
    transform: translateX(-80px) rotate(-10deg) scaleX(0.4);
  }
  42% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(60px) rotate(-8deg) scaleX(1.18);
  }
}

@keyframes straightCardFan {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(70px) rotate(-24deg) scale(0.72);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes chainThread {
  0%,
  100% {
    opacity: 0;
    transform: scaleX(0.2);
  }
  45% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes chainLink {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(45deg) scale(0.35);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(calc((var(--i) - 2.5) * 48px)) rotate(calc((var(--i) - 2.5) * -10deg)) scale(1.08);
  }
}

@keyframes bombCore {
  0% {
    opacity: 0;
    transform: scale(0.2);
    filter: brightness(1);
  }
  35% {
    opacity: 1;
    transform: scale(1.2);
    filter: brightness(1.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
    filter: brightness(1);
  }
}

@keyframes bombRing {
  0% {
    opacity: 0;
    transform: scale(0.15);
  }
  38% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes sparkShoot {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 25.7deg)) translateY(0) scaleY(0.3);
  }
  36% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 25.7deg)) translateY(-126px) scaleY(1);
  }
}

@keyframes planeDash {
  0% {
    opacity: 0;
    transform: translateX(-170px) translateY(40px) rotate(-16deg) scale(0.7);
  }
  42% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translateX(170px) translateY(-40px) rotate(16deg) scale(0.9);
  }
}

@keyframes wingTrail {
  0%,
  100% {
    opacity: 0;
    transform: scaleX(0.2);
  }
  44% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes cloudFade {
  0% {
    opacity: 0;
    transform: translateX(-120px) scale(0.4);
  }
  45% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translateX(120px) scale(1.4);
  }
}

@keyframes trioRise {
  0% {
    opacity: 0;
    transform: translateY(54px) scale(0.45);
  }
  46% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translateY(-24px) scale(1);
  }
}

@keyframes sideWing {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(60px) rotate(0deg) scale(0.6);
  }
  48% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes orbitPop {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 72deg)) translateX(12px) scale(0.5);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 72deg + 90deg)) translateX(112px) scale(1);
  }
}

@keyframes urgentBeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes hintPulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 rgba(255, 211, 106, 0);
  }
  50% {
    transform: scale(1.45);
    box-shadow: 0 0 18px rgba(255, 211, 106, 0.8);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes hintCardFlash {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}

@keyframes autoPickPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  38% {
    filter: brightness(1.22);
    box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(255, 211, 106, 0.56), 0 18px 30px rgba(0, 0, 0, 0.34);
  }
}

@keyframes settlementIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.84);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1180px) {
  .game {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .history-panel {
    grid-column: 1 / -1;
    min-height: 210px;
  }

  .recorder-grid {
    grid-template-columns: repeat(8, minmax(32px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .room-tools {
    width: 100%;
    flex-direction: column;
  }

  .mode-row,
  .skin-row,
  .join-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .mode-row label,
  .recorder-choice {
    grid-template-columns: 1fr !important;
    justify-content: stretch;
  }

  .game {
    grid-template-columns: 1fr;
  }

  .table {
    min-height: 650px;
    padding: 10px;
  }

  .opponents {
    grid-template-columns: 1fr;
  }

  .opponent {
    grid-template-columns: 96px minmax(0, 1fr) 42px;
  }

  .opponent .avatar {
    width: 78px;
    height: 100px;
  }

  .opponent .seat-avatar-wrap {
    width: 96px;
  }

  .table-recorder {
    grid-template-columns: 1fr;
  }

  .recorder-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .timer-dial {
    right: 8px;
    top: 8px;
    width: 68px;
    height: 68px;
  }

  .card {
    width: 48px;
    height: 72px;
    padding: 5px;
  }

  .card-rank {
    font-size: 14px;
  }

  .card-suit {
    font-size: 21px;
  }

  .card-foot {
    font-size: 12px;
  }

  .hand {
    --card-step: 24px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 18px;
    scrollbar-width: none;
  }

  .hand::-webkit-scrollbar {
    display: none;
  }

  .hand .card {
    flex-basis: 48px;
    margin-left: calc(var(--card-step) - 48px);
  }

  .fx-layer {
    font-size: 32px;
  }
}

.sgs-table {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 0.86fr) minmax(250px, 1.12fr) minmax(190px, 0.86fr);
  gap: 10px;
  align-items: stretch;
  min-height: 246px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 8px;
}

.sgs-seat-area {
  display: flex;
}

.sgs-target-line {
  position: absolute;
  z-index: 8;
  inset: 18px 18px auto auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 220, 150, 0.34);
  border-radius: 999px;
  background: rgba(14, 17, 16, 0.68);
  color: #ffe5a2;
  font-size: 12px;
  pointer-events: none;
}

.sgs-target-line i {
  width: 92px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffe5a2, transparent);
  box-shadow: 0 0 16px rgba(255, 218, 126, 0.72);
  animation: sgsTargetBeam 960ms ease-in-out infinite;
}

.sgs-opponent-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: start;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.sgs-seat-button {
  width: 100%;
  padding: 0;
  border: 1px solid rgba(224, 185, 104, 0.18);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.sgs-seat-button:hover:not(:disabled),
.sgs-seat-button.selected-target {
  transform: translateY(-1px);
  border-color: rgba(255, 217, 135, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 217, 135, 0.22), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.sgs-seat-button:disabled {
  cursor: default;
}

.sgs-player-card.dead {
  filter: grayscale(0.8);
  opacity: 0.54;
}

.sgs-thinking-text {
  display: inline-block;
  margin-left: 6px;
  color: #ffe2a0;
  font-size: 11px;
  font-style: normal;
  animation: thinkingPulse 920ms ease-in-out infinite;
}

@media (max-width: 980px) {
  .sgs-table {
    grid-template-columns: 1fr;
  }

  .sgs-opponent-list {
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    max-height: none;
    overflow: visible;
  }
}

.sgs-center-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 246px;
  padding: 14px;
  border: 1px solid rgba(224, 185, 104, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 33, 32, 0.86), rgba(30, 20, 18, 0.88)),
    radial-gradient(circle at 50% 48%, rgba(225, 164, 68, 0.16), transparent 54%);
  overflow: hidden;
}

.sgs-center-stage::before {
  content: "";
  position: absolute;
  inset: 22px 28px;
  border: 1px solid rgba(255, 220, 150, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.sgs-zone-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sgs-zone-card {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid rgba(236, 203, 132, 0.28);
  border-radius: 7px;
  background: rgba(12, 14, 14, 0.54);
  color: #f8d999;
}

.sgs-zone-card span {
  font-size: 12px;
  color: rgba(255, 239, 205, 0.68);
}

.sgs-zone-card strong {
  font-size: 22px;
}

.sgs-zone-card.discard {
  background: rgba(45, 24, 20, 0.58);
}

.sgs-event-orb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-height: 112px;
  border-radius: 8px;
  color: #fff1c9;
  text-align: center;
}

.sgs-event-orb span {
  font-size: 12px;
  color: rgba(255, 239, 205, 0.68);
}

.sgs-event-orb strong {
  font-size: 30px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.sgs-event-orb em {
  max-width: 240px;
  color: rgba(255, 239, 205, 0.76);
  font-size: 12px;
  font-style: normal;
}

.sgs-judge-lane {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto repeat(3, 32px);
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: rgba(255, 239, 205, 0.66);
  font-size: 12px;
}

.sgs-judge-lane i {
  height: 44px;
  border: 1px dashed rgba(236, 203, 132, 0.35);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.sgs-judge-lane i.filled {
  border-style: solid;
  background: rgba(74, 42, 24, 0.78);
}

.sgs-judge-lane img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sgs-table.event-attack .sgs-event-orb {
  animation: sgsSlashFlash 760ms ease both;
}

.sgs-table.event-fire .sgs-event-orb {
  animation: sgsFireBurst 960ms ease both;
}

.sgs-table.event-thunder .sgs-event-orb {
  animation: sgsThunderCrack 920ms steps(2, end) both;
}

.sgs-table.event-duel .sgs-event-orb {
  animation: sgsDuelClash 1050ms ease both;
}

.sgs-table.event-mass .sgs-event-orb {
  animation: sgsMassWave 980ms ease both;
}

.sgs-table.event-damage .sgs-event-orb {
  animation: sgsDamagePulse 840ms ease both;
}

.sgs-table.event-heal .sgs-event-orb {
  animation: sgsHealGlow 900ms ease both;
}

.sgs-table.event-save .sgs-event-orb {
  animation: sgsSaveRise 1050ms ease both;
}

.sgs-table.event-response .sgs-event-orb,
.sgs-table.event-response-ok .sgs-event-orb {
  animation: sgsResponseSpin 780ms ease both;
}

.sgs-table.event-equip .sgs-event-orb,
.sgs-table.event-skill .sgs-event-orb,
.sgs-table.event-judge .sgs-event-orb,
.sgs-table.event-discard .sgs-event-orb,
.sgs-table.event-tactic .sgs-event-orb {
  animation: sgsTacticSweep 900ms ease both;
}

.sgs-table.event-steal .sgs-event-orb {
  animation: sgsStealHook 1150ms cubic-bezier(0.16, 0.86, 0.2, 1) both;
}

.sgs-table.event-break .sgs-event-orb,
.sgs-table.event-borrow .sgs-event-orb,
.sgs-table.event-delay .sgs-event-orb {
  animation: sgsBreakImpact 1120ms cubic-bezier(0.18, 0.9, 0.18, 1) both;
}

.sgs-ultimate-cut {
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  overflow: hidden;
  animation: sgsCutScene 1320ms ease both;
}

.sgs-cut-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82), transparent 20% 80%, rgba(0, 0, 0, 0.82)),
    radial-gradient(circle at 50% 50%, rgba(255, 225, 148, 0.08), rgba(0, 0, 0, 0.68) 62%);
}

.sgs-cut-title {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: min(520px, 78vw);
  padding: 18px 36px;
  border-top: 1px solid rgba(255, 232, 170, 0.64);
  border-bottom: 1px solid rgba(255, 232, 170, 0.64);
  background:
    linear-gradient(90deg, transparent, rgba(28, 17, 10, 0.92) 18% 82%, transparent),
    linear-gradient(180deg, rgba(255, 235, 177, 0.09), rgba(255, 235, 177, 0));
  transform: skewX(-8deg);
  animation: sgsCutTitleIn 1120ms cubic-bezier(0.18, 0.86, 0.2, 1) both;
}

.sgs-cut-title > * {
  transform: skewX(8deg);
}

.sgs-cut-title span {
  color: #ffe5a2;
  font-size: 13px;
  font-weight: 900;
}

.sgs-cut-title strong {
  color: #fff4d1;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.72), 0 0 24px rgba(255, 207, 102, 0.42);
}

.sgs-cut-title em {
  min-height: 16px;
  color: rgba(255, 242, 203, 0.72);
  font-size: 13px;
  font-style: normal;
}

.sgs-cut-symbol {
  position: absolute;
  z-index: 2;
  right: 11%;
  top: 13%;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 230, 156, 0.42);
  border-radius: 50%;
  color: rgba(255, 237, 180, 0.82);
  font-size: 58px;
  font-weight: 900;
  background: radial-gradient(circle, rgba(255, 224, 147, 0.16), rgba(0, 0, 0, 0.12) 62%, transparent 64%);
  box-shadow: inset 0 0 28px rgba(255, 230, 164, 0.12), 0 0 36px rgba(255, 209, 110, 0.12);
  animation: sgsCutSeal 1240ms ease both;
}

.sgs-cut-lanes,
.sgs-cut-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sgs-cut-lanes i {
  position: absolute;
  top: calc(11% + var(--i) * 11%);
  left: -16%;
  width: 132%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 226, 150, 0.6), transparent);
  transform: rotate(-8deg) translateX(-28%);
  animation: sgsCutLane 900ms ease both;
  animation-delay: calc(var(--i) * 26ms);
}

.sgs-cut-particles b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff2bd, rgba(255, 117, 58, 0));
  transform: rotate(calc(var(--i) * 20deg)) translateY(-52px);
  transform-origin: 50% 94px;
  animation: sgsCutParticle 1100ms ease both;
  animation-delay: calc(var(--i) * 14ms);
}

.sgs-ultimate-cut.steal .sgs-cut-vignette {
  background:
    linear-gradient(120deg, rgba(0, 0, 0, 0.86), rgba(17, 53, 49, 0.52), rgba(0, 0, 0, 0.78)),
    repeating-linear-gradient(-18deg, transparent 0 22px, rgba(119, 255, 220, 0.09) 23px 25px);
}

.sgs-ultimate-cut.steal .sgs-cut-symbol {
  color: #9fffe2;
  border-color: rgba(121, 255, 224, 0.5);
  animation-name: sgsHookSeal;
}

.sgs-ultimate-cut.steal .sgs-cut-lanes i {
  height: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(155, 255, 228, 0.9) 0 12px, transparent 13px 20px),
    linear-gradient(90deg, transparent, rgba(155, 255, 228, 0.82), transparent);
  animation-name: sgsHookLine;
}

.sgs-ultimate-cut.break .sgs-cut-vignette,
.sgs-ultimate-cut.borrow .sgs-cut-vignette {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 222, 150, 0.16), rgba(0, 0, 0, 0.78) 62%),
    repeating-linear-gradient(90deg, rgba(140, 85, 40, 0.18) 0 18px, rgba(0, 0, 0, 0.08) 19px 28px);
}

.sgs-ultimate-cut.break .sgs-cut-symbol,
.sgs-ultimate-cut.borrow .sgs-cut-symbol {
  color: #ffe0a0;
  animation-name: sgsBreakSeal;
}

.sgs-ultimate-cut.fire .sgs-cut-vignette {
  background: radial-gradient(circle at 50% 58%, rgba(255, 99, 42, 0.42), rgba(69, 12, 8, 0.82) 58%, rgba(0, 0, 0, 0.82));
}

.sgs-ultimate-cut.fire .sgs-cut-particles b {
  width: 12px;
  height: 46px;
  background: linear-gradient(180deg, #fff3a8, #ff7438 48%, rgba(144, 20, 12, 0));
  animation-name: sgsFlameParticle;
}

.sgs-ultimate-cut.thunder .sgs-cut-vignette {
  background:
    linear-gradient(135deg, rgba(13, 21, 56, 0.86), rgba(0, 0, 0, 0.78)),
    repeating-linear-gradient(105deg, transparent 0 34px, rgba(136, 220, 255, 0.16) 35px 38px);
}

.sgs-ultimate-cut.thunder .sgs-cut-lanes i,
.sgs-ultimate-cut.thunder .sgs-cut-particles b {
  background: linear-gradient(180deg, #f2feff, #73daff 48%, rgba(49, 84, 255, 0));
  animation-timing-function: steps(2, end);
}

.sgs-ultimate-cut.duel .sgs-cut-symbol,
.sgs-ultimate-cut.impact .sgs-cut-symbol {
  animation-name: sgsDuelSeal;
}

.sgs-ultimate-cut.mass .sgs-cut-particles b {
  width: 3px;
  height: 58px;
  background: linear-gradient(180deg, #fff0b2, #d8a34f 60%, rgba(82, 45, 20, 0));
  animation-name: sgsArrowRain;
}

.sgs-ultimate-cut.heal .sgs-cut-vignette {
  background: radial-gradient(circle at 50% 52%, rgba(111, 235, 157, 0.24), rgba(5, 45, 35, 0.78) 62%, rgba(0, 0, 0, 0.72));
}

.sgs-ultimate-cut.heal .sgs-cut-symbol,
.sgs-ultimate-cut.response-ok .sgs-cut-symbol {
  color: #baffc8;
  border-color: rgba(147, 255, 181, 0.52);
}

.sgs-ultimate-cut.delay .sgs-cut-symbol {
  color: #d8b0ff;
  border-color: rgba(216, 176, 255, 0.54);
  animation-name: sgsDelaySeal;
}

.sgs-ultimate-cut.equip .sgs-cut-symbol {
  animation-name: sgsForgeSeal;
}

.sgs-ultimate-cut.skill .sgs-cut-vignette {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 218, 112, 0.28), rgba(34, 19, 9, 0.8) 62%, rgba(0, 0, 0, 0.84)),
    linear-gradient(90deg, rgba(112, 54, 20, 0.42), transparent, rgba(20, 80, 70, 0.34));
}

.sgs-ultimate-cut.skill .sgs-cut-symbol {
  color: #ffe594;
  border-color: rgba(255, 222, 135, 0.6);
  animation-name: sgsSkillSeal;
}

.sgs-event-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.sgs-event-visual i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 244, 184, 0.9), rgba(226, 72, 42, 0));
  transform: rotate(calc(var(--i) * 36deg)) translateY(-68px);
  transform-origin: 50% 84px;
  opacity: 0.25;
}

.event-fire .sgs-event-visual i {
  background: linear-gradient(180deg, #fff2ad, #ff713d 52%, rgba(180, 25, 20, 0));
  animation: sgsParticleOut 820ms ease both;
}

.event-thunder .sgs-event-visual i {
  width: 3px;
  height: 54px;
  background: linear-gradient(180deg, #e9fbff, #74d8ff 48%, rgba(28, 80, 255, 0));
  animation: sgsParticleOut 620ms steps(2, end) both;
}

.event-duel .sgs-event-visual i,
.event-attack .sgs-event-visual i {
  background: linear-gradient(180deg, #fff5c7, #d8ac63 48%, rgba(90, 53, 24, 0));
  animation: sgsBladeOut 760ms ease both;
}

.event-save .sgs-event-visual i,
.event-heal .sgs-event-visual i {
  background: linear-gradient(180deg, #f7ffd4, #65e0a5 58%, rgba(33, 128, 84, 0));
  animation: sgsParticleOut 1100ms ease both;
}

.event-response .sgs-event-visual i,
.event-response-ok .sgs-event-visual i {
  background: linear-gradient(180deg, #f9f2d0, #9fd4ff 60%, rgba(62, 100, 176, 0));
  animation: sgsResponseParticle 820ms ease both;
}

.sgs-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: stretch;
  margin: 10px 0;
}

.sgs-skill-buttons {
  display: flex;
  gap: 8px;
  min-height: 48px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
}

.sgs-skill-button {
  position: relative;
  display: grid;
  grid-template-columns: auto;
  gap: 2px;
  min-width: 210px;
  max-width: 280px;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 218, 137, 0.45);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 214, 118, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(88, 53, 24, 0.95), rgba(42, 29, 22, 0.96));
  color: #ffe7b2;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  isolation: isolate;
  overflow: hidden;
}

.sgs-skill-button::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 7px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0a8, #d28a22 48%, #7fdcff);
  box-shadow: 0 0 14px rgba(255, 216, 122, 0.4);
}

.sgs-skill-button strong {
  font-size: 14px;
  line-height: 1.15;
}

.sgs-skill-button:hover {
  border-color: rgba(255, 228, 154, 0.9);
  box-shadow: 0 0 20px rgba(226, 167, 70, 0.22);
}

.sgs-skill-button.active {
  border-color: rgba(139, 222, 255, 0.92);
  box-shadow: 0 0 22px rgba(92, 188, 255, 0.28);
}

.sgs-skill-button span,
.sgs-skill-empty {
  color: rgba(255, 239, 205, 0.72);
  font-size: 12px;
  line-height: 1.25;
}

.sgs-skill-button span {
  display: -webkit-box;
  min-height: 30px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sgs-skill-empty {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
}

.sgs-command-row > button {
  min-width: 104px;
}

.sgs-icon-button {
  min-width: 44px !important;
  width: 44px;
  padding: 0;
  border-color: rgba(235, 198, 119, 0.5);
  background: rgba(41, 29, 22, 0.82);
}

.sgs-icon-button.on {
  color: #20180f;
  background: linear-gradient(180deg, #ffe3a5, #c68c37);
}

.sgs-response-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(132, 199, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(24, 42, 53, 0.9), rgba(52, 38, 25, 0.82)),
    radial-gradient(circle at 22% 50%, rgba(115, 190, 255, 0.24), transparent 42%);
  box-shadow: inset 0 0 22px rgba(145, 211, 255, 0.08), 0 12px 34px rgba(0, 0, 0, 0.22);
  color: #fff0c9;
  animation: sgsPanelIn 240ms ease both;
}

.sgs-response-panel strong,
.sgs-response-panel span {
  display: block;
}

.sgs-response-panel span {
  margin-top: 4px;
  color: rgba(255, 239, 205, 0.72);
  font-size: 13px;
}

.sgs-response-panel.my-response {
  border-color: rgba(255, 226, 142, 0.72);
  box-shadow: inset 0 0 22px rgba(255, 221, 147, 0.1), 0 0 28px rgba(234, 178, 72, 0.22);
  animation: sgsResponseUrgent 1050ms ease-in-out infinite;
}

.sgs-skill-draft {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(142, 216, 255, 0.42);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(18, 37, 48, 0.9), rgba(48, 35, 24, 0.86));
  color: #fff0c9;
  box-shadow: inset 0 0 20px rgba(133, 211, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.22);
}

.sgs-skill-draft strong,
.sgs-skill-draft span {
  display: block;
}

.sgs-skill-draft span {
  margin-top: 3px;
  color: rgba(255, 239, 205, 0.72);
  font-size: 13px;
}

.sgs-skill-draft > b {
  min-width: 46px;
  color: #8fe1ff;
  text-align: center;
}

.sgs-sort-buttons {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.sgs-sort-buttons button {
  min-width: 42px;
  padding: 4px 8px;
  border: 1px solid rgba(236, 203, 132, 0.28);
  border-radius: 999px;
  background: rgba(10, 12, 12, 0.48);
  color: rgba(255, 239, 205, 0.72);
  font-size: 12px;
}

.sgs-sort-buttons button.active {
  border-color: rgba(255, 222, 148, 0.72);
  color: #ffe6a8;
  background: rgba(116, 71, 28, 0.5);
}

.sgs-panel .sgs-player-card {
  position: relative;
  width: 100%;
  min-height: 226px;
  grid-template-columns: 112px minmax(0, 1fr);
  overflow: hidden;
}

.sgs-panel .sgs-player-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 174, 0.06);
}

.sgs-panel .sgs-player-card.is-turn::after {
  box-shadow: inset 0 0 0 1px rgba(255, 230, 155, 0.5), 0 0 22px rgba(235, 179, 76, 0.3);
}

.sgs-panel .sgs-player-art {
  width: 112px;
  height: 188px;
  object-position: center top;
}

.sgs-equipment-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sgs-equip-slot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 50px;
  border: 1px solid rgba(234, 196, 116, 0.32);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 235, 190, 0.62);
  overflow: hidden;
}

.sgs-equip-slot.filled {
  border-color: rgba(255, 220, 145, 0.72);
  box-shadow: 0 0 14px rgba(220, 164, 72, 0.18);
}

.sgs-equip-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sgs-panel .sgs-hand-grid {
  display: flex;
  gap: 0;
  min-height: 320px;
  padding: 10px 8px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sgs-panel .sgs-hand-card {
  position: relative;
  flex: 0 0 146px;
  margin-left: -28px;
  grid-template-rows: 182px auto auto 1fr;
  min-height: 304px;
  border-width: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  backface-visibility: hidden;
  will-change: transform, box-shadow;
  transition: transform 150ms cubic-bezier(0.2, 0.86, 0.2, 1), border-color 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.sgs-panel .sgs-hand-card:first-child {
  margin-left: 0;
}

.sgs-panel .sgs-hand-card:hover {
  z-index: 6;
  transform: translateY(-8px);
}

.sgs-panel .sgs-hand-card.response-card {
  z-index: 7;
  border-color: rgba(136, 220, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(168, 227, 255, 0.34), 0 12px 32px rgba(56, 169, 232, 0.28);
  animation: sgsResponseCardPulse 1200ms ease-in-out infinite;
}

.sgs-panel .sgs-hand-card.skill-pick-card,
.sgs-panel .sgs-hand-card.discard-pick-card {
  border-color: rgba(139, 222, 255, 0.82);
}

.sgs-panel .sgs-hand-card.selected {
  z-index: 8;
  transform: translateY(-18px);
  border-color: rgba(255, 234, 157, 0.98);
  box-shadow: 0 0 0 2px rgba(255, 225, 126, 0.4), 0 18px 42px rgba(238, 180, 67, 0.38);
}

.sgs-panel .sgs-hand-card.blocked {
  filter: grayscale(0.45) brightness(0.82);
}

.sgs-card-reason {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(31, 14, 12, 0.78);
  color: #ffd1ba;
  font-size: 11px;
  font-style: normal;
}

.sgs-hand-card.basic-card {
  border-color: rgba(220, 67, 48, 0.72);
}

.sgs-hand-card.tactic-card {
  border-color: rgba(78, 154, 228, 0.72);
}

.sgs-hand-card.equip-card {
  border-color: rgba(222, 177, 76, 0.84);
}

.sgs-hand-card.delay-card {
  border-color: rgba(151, 83, 221, 0.78);
}

.sgs-suit-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 25px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(11, 12, 12, 0.72);
  color: #111;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.sgs-suit-mark.red {
  color: #ff5b49;
}

.sgs-suit-mark.black {
  color: #d9dde4;
}

.low-fx .sgs-ultimate-cut,
.low-fx .sgs-cut-particles,
.low-fx .sgs-cut-lanes {
  display: none;
}

@keyframes sgsSlashFlash {
  0% {
    filter: brightness(1);
    box-shadow: inset -80px 0 0 rgba(255, 255, 255, 0);
  }
  36% {
    filter: brightness(1.5);
    box-shadow: inset -18px 0 0 rgba(255, 242, 205, 0.6), 0 0 34px rgba(255, 82, 42, 0.34);
  }
  100% {
    filter: brightness(1);
    box-shadow: none;
  }
}

@keyframes sgsTargetBeam {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleX(0.78);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes sgsResponseUrgent {
  0%,
  100% {
    box-shadow: inset 0 0 22px rgba(255, 221, 147, 0.1), 0 0 20px rgba(234, 178, 72, 0.16);
  }
  50% {
    box-shadow: inset 0 0 24px rgba(255, 221, 147, 0.18), 0 0 34px rgba(234, 178, 72, 0.34);
  }
}

@keyframes sgsDamagePulse {
  0%,
  100% {
    transform: scale(1);
  }
  32% {
    transform: scale(1.08);
    color: #ffb39d;
    text-shadow: 0 0 22px rgba(255, 65, 36, 0.78);
  }
}

@keyframes sgsHealGlow {
  0% {
    box-shadow: 0 0 0 rgba(84, 224, 132, 0);
  }
  45% {
    box-shadow: 0 0 38px rgba(84, 224, 132, 0.38);
    color: #d7ffd1;
  }
  100% {
    box-shadow: 0 0 0 rgba(84, 224, 132, 0);
  }
}

@keyframes sgsTacticSweep {
  0% {
    opacity: 0.68;
    transform: translateY(10px);
  }
  42% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 30px rgba(102, 176, 255, 0.28);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sgsFireBurst {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255, 90, 40, 0);
  }
  42% {
    filter: brightness(1.45) saturate(1.35);
    box-shadow: 0 0 46px rgba(255, 93, 37, 0.58);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes sgsThunderCrack {
  0%, 100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  35% {
    filter: brightness(1.8);
    transform: translateY(-2px) skewX(-2deg);
  }
  65% {
    filter: brightness(1.35);
    transform: translateY(2px) skewX(2deg);
  }
}

@keyframes sgsDuelClash {
  0%, 100% {
    transform: scale(1);
  }
  34% {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 0 0 36px rgba(255, 231, 163, 0.28);
  }
  56% {
    transform: scale(1.04) rotate(1deg);
  }
}

@keyframes sgsMassWave {
  0% {
    box-shadow: inset 0 0 0 rgba(220, 174, 84, 0);
  }
  45% {
    box-shadow: inset 0 0 56px rgba(220, 174, 84, 0.28), 0 0 34px rgba(127, 177, 208, 0.18);
  }
  100% {
    box-shadow: inset 0 0 0 rgba(220, 174, 84, 0);
  }
}

@keyframes sgsSaveRise {
  0% {
    transform: translateY(8px) scale(0.98);
    filter: brightness(0.92);
  }
  48% {
    transform: translateY(-4px) scale(1.04);
    filter: brightness(1.3);
    box-shadow: 0 0 44px rgba(115, 225, 152, 0.38);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes sgsResponseSpin {
  0% {
    transform: rotate(-2deg) scale(0.98);
  }
  50% {
    transform: rotate(2deg) scale(1.035);
    box-shadow: 0 0 34px rgba(151, 211, 255, 0.3);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes sgsParticleOut {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 36deg)) translateY(-28px) scaleY(0.3);
  }
  36% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 36deg)) translateY(-92px) scaleY(1);
  }
}

@keyframes sgsBladeOut {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 36deg)) translateY(-20px) scaleY(0.4);
  }
  42% {
    opacity: 0.85;
    transform: rotate(calc(var(--i) * 36deg + 16deg)) translateY(-84px) scaleY(1.1);
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 36deg + 28deg)) translateY(-98px) scaleY(0.8);
  }
}

@keyframes sgsResponseParticle {
  0%, 100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 36deg)) translateY(-62px) scale(0.7);
  }
  45% {
    opacity: 0.72;
    transform: rotate(calc(var(--i) * 36deg + 24deg)) translateY(-74px) scale(1);
  }
}

@keyframes sgsPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sgsResponseCardPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(168, 227, 255, 0.28), 0 12px 32px rgba(56, 169, 232, 0.2);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(230, 247, 255, 0.72), 0 16px 42px rgba(91, 194, 255, 0.4);
  }
}

@keyframes sgsCutScene {
  0% { opacity: 0; transform: scale(1.04); }
  9%, 76% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.995); }
}

@keyframes sgsCutTitleIn {
  0% { opacity: 0; transform: translateX(-36%) skewX(-8deg) scale(0.94); filter: blur(2px); }
  22% { opacity: 1; transform: translateX(3%) skewX(-8deg) scale(1.03); filter: blur(0); }
  44%, 82% { opacity: 1; transform: translateX(0) skewX(-8deg) scale(1); }
  100% { opacity: 0; transform: translateX(18%) skewX(-8deg) scale(0.98); }
}

@keyframes sgsCutSeal {
  0% { opacity: 0; transform: rotate(-24deg) scale(0.3); }
  28% { opacity: 0.92; transform: rotate(8deg) scale(1.08); }
  72% { opacity: 0.82; transform: rotate(0) scale(1); }
  100% { opacity: 0; transform: rotate(18deg) scale(1.22); }
}

@keyframes sgsCutLane {
  0% { opacity: 0; transform: rotate(-8deg) translateX(-42%); }
  30%, 68% { opacity: 0.78; }
  100% { opacity: 0; transform: rotate(-8deg) translateX(34%); }
}

@keyframes sgsCutParticle {
  0% { opacity: 0; transform: rotate(calc(var(--i) * 20deg)) translateY(-20px) scaleY(0.2); }
  36% { opacity: 0.92; }
  100% { opacity: 0; transform: rotate(calc(var(--i) * 20deg + 18deg)) translateY(-118px) scaleY(1.1); }
}

@keyframes sgsHookSeal {
  0% { opacity: 0; transform: translateX(80px) rotate(18deg) scale(0.5); }
  36% { opacity: 1; transform: translateX(-18px) rotate(-8deg) scale(1.08); }
  70% { transform: translateX(0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translateX(-90px) rotate(-18deg) scale(0.96); }
}

@keyframes sgsHookLine {
  0% { opacity: 0; transform: rotate(-12deg) translateX(36%); }
  32%, 64% { opacity: 0.9; }
  100% { opacity: 0; transform: rotate(-12deg) translateX(-42%); }
}

@keyframes sgsBreakSeal {
  0% { opacity: 0; transform: scale(1.35) rotate(0); filter: brightness(1); }
  30% { opacity: 1; transform: scale(0.92) rotate(-8deg); filter: brightness(1.45); }
  54% { transform: scale(1.08) rotate(8deg); }
  100% { opacity: 0; transform: scale(1.42) rotate(18deg); }
}

@keyframes sgsFlameParticle {
  0% { opacity: 0; transform: rotate(calc(var(--i) * 20deg)) translateY(10px) scaleY(0.2); }
  42% { opacity: 1; transform: rotate(calc(var(--i) * 20deg - 12deg)) translateY(-96px) scaleY(1.28); }
  100% { opacity: 0; transform: rotate(calc(var(--i) * 20deg + 18deg)) translateY(-150px) scaleY(0.7); }
}

@keyframes sgsDuelSeal {
  0% { opacity: 0; transform: translateX(-70px) rotate(-28deg) scale(0.7); }
  28% { opacity: 1; transform: translateX(18px) rotate(12deg) scale(1.08); }
  48% { transform: translateX(-10px) rotate(-8deg) scale(1.02); }
  100% { opacity: 0; transform: translateX(90px) rotate(24deg) scale(1.12); }
}

@keyframes sgsArrowRain {
  0% { opacity: 0; transform: rotate(62deg) translate(-120px, -120px) scaleY(0.4); }
  30%, 64% { opacity: 0.9; }
  100% { opacity: 0; transform: rotate(62deg) translate(130px, 130px) scaleY(1.15); }
}

@keyframes sgsDelaySeal {
  0% { opacity: 0; transform: rotate(-90deg) scale(0.4); }
  36%, 72% { opacity: 0.88; transform: rotate(0) scale(1); }
  100% { opacity: 0; transform: rotate(90deg) scale(1.2); }
}

@keyframes sgsForgeSeal {
  0% { opacity: 0; transform: scale(0.65); box-shadow: 0 0 0 rgba(255, 211, 106, 0); }
  40% { opacity: 1; transform: scale(1.08); box-shadow: 0 0 46px rgba(255, 211, 106, 0.42); }
  100% { opacity: 0; transform: scale(1.24); }
}

@keyframes sgsSkillSeal {
  0% { opacity: 0; transform: scale(0.35) rotate(-180deg); }
  34%, 70% { opacity: 0.96; transform: scale(1.08) rotate(0); }
  100% { opacity: 0; transform: scale(1.35) rotate(90deg); }
}

@keyframes sgsStealHook {
  0% { transform: translateX(18px) scale(0.98); box-shadow: 0 0 0 rgba(105, 255, 220, 0); }
  36% { transform: translateX(-12px) scale(1.04); box-shadow: 0 0 40px rgba(105, 255, 220, 0.28); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes sgsBreakImpact {
  0%, 100% { transform: translateX(0) rotate(0); }
  22% { transform: translateX(-8px) rotate(-1deg); }
  34% { transform: translateX(9px) rotate(1deg); box-shadow: 0 0 38px rgba(255, 206, 120, 0.34); }
  48% { transform: translateX(-4px) rotate(-0.5deg); }
}

@media (max-width: 980px) {
  .sgs-table {
    grid-template-columns: 1fr;
  }

  .sgs-panel .sgs-player-card {
    min-height: 190px;
  }
}

@media (max-width: 640px) {
  .sgs-command-row {
    grid-template-columns: 1fr;
  }

  .sgs-skill-draft,
  .sgs-response-panel {
    grid-template-columns: 1fr;
  }

  .sgs-panel .sgs-hand-card {
    flex-basis: 132px;
    margin-left: -34px;
  }
}
