:root {
  color-scheme: dark;
  --ink: #f3ead9;
  --muted: #b7aa98;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(26, 22, 19, 0.9);
  --panel-soft: rgba(42, 35, 29, 0.78);
  --felt: #123f37;
  --felt-bright: #1f6a59;
  --gold: #d9a94c;
  --red: #9f3530;
  --green: #397965;
  --violet: #744f91;
  --blue: #406c9f;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 10%, rgba(159, 53, 48, 0.28), transparent 34%),
    radial-gradient(circle at 78% 6%, rgba(57, 121, 101, 0.24), transparent 32%),
    linear-gradient(145deg, #16110f 0%, #211815 42%, #0c1514 100%);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 169, 76, 0.72);
  background: rgba(217, 169, 76, 0.16);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 62% 34%, rgba(217, 169, 76, 0.24), transparent 38%),
    radial-gradient(ellipse at 78% 88%, rgba(116, 79, 145, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(18, 63, 55, 0.16), rgba(18, 17, 16, 0.34)),
    url("./assets/characters-lineup.webp") center 18% / cover no-repeat;
}

.hero__character {
  display: none;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 10, 9, 0.82) 0%, rgba(12, 10, 9, 0.48) 38%, rgba(12, 10, 9, 0.18) 70%),
    linear-gradient(0deg, #16110f 0%, transparent 44%);
}

.hero__content {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 34px;
  align-items: end;
  padding: 80px 0 64px;
}

.hero__copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.producer-credit {
  margin-bottom: 16px;
  text-transform: none;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 640px;
  font-size: clamp(3.9rem, 9vw, 7.8rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.lede {
  max-width: 560px;
  margin: 18px 0 0;
  color: #efe2ce;
  font-size: clamp(1rem, 2.4vw, 1.26rem);
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action {
  min-width: 142px;
  padding: 0 22px;
  border-color: rgba(217, 169, 76, 0.76);
  color: #21150d;
  background: linear-gradient(180deg, #f0c96b, #b97a2d);
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(185, 122, 45, 0.24);
}

.primary-action:hover {
  background: linear-gradient(180deg, #f6d882, #c98631);
}

.primary-action--wide {
  width: 100%;
  margin-top: 16px;
}

.ghost-action {
  min-width: 126px;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.28);
}

.home-modes {
  position: relative;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(217, 169, 76, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 238, 189, 0.08), transparent 24%),
    radial-gradient(circle at 8% 0%, rgba(217, 169, 76, 0.2), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(116, 79, 145, 0.2), transparent 36%),
    rgba(20, 17, 15, 0.78);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.home-modes::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 229, 167, 0.12);
  border-radius: 6px;
  pointer-events: none;
}

.home-modes .section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-modes h2 {
  font-size: 1.42rem;
}

.panel,
.game-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.panel {
  padding: 54px 0 18px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading--small {
  margin-top: 26px;
  margin-bottom: 12px;
}

.section-heading--small h2 {
  font-size: 1.18rem;
}

.intro-panel {
  padding-top: 44px;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.intro-grid article {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-grid strong,
.intro-grid span {
  display: block;
}

.intro-grid span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.character-card,
.mode-card,
.setup-panel,
.table-panel,
.opponent,
.last-play,
.event-feed,
.player-console {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.character-card {
  overflow: hidden;
}

.portrait {
  height: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(217, 169, 76, 0.18), transparent 42%),
    linear-gradient(180deg, #221a17, #0f1513);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  padding: 14px 8px 0;
}

.character-card__body {
  padding: 15px;
}

.character-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.species {
  color: var(--muted);
  font-size: 0.84rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #20150c;
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.character-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.game-layout {
  width: min(1320px, calc(100% - 32px));
  position: relative;
  display: block;
  min-height: 100svh;
  padding: 14px 0;
}

.setup-panel,
.table-panel {
  padding: 12px;
}

.character-draft {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  width: min(1080px, calc(100% - 36px));
  overflow: visible;
  border-color: rgba(240, 201, 107, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(240, 201, 107, 0.2), transparent 46%),
    linear-gradient(180deg, rgba(42, 33, 25, 0.96), rgba(15, 17, 15, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transform: translate(-50%, -50%);
}

.character-draft[hidden] {
  display: none;
}

.character-draft::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(240, 201, 107, 0.42), transparent 38%, rgba(240, 201, 107, 0.22));
  pointer-events: none;
}

.character-draft .section-heading {
  margin-bottom: 14px;
  text-align: center;
}

.character-draft .mini-roster {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mode-list,
.mini-roster {
  display: grid;
  gap: 10px;
}

.mode-list--home {
  position: relative;
  z-index: 1;
  grid-template-columns: 1fr;
  gap: 9px;
}

.mode-card,
.mini-character {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 11px 12px;
  text-align: left;
  background: var(--panel-soft);
}

.mode-list--home .mode-card {
  position: relative;
  min-height: 94px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-content: center;
  align-items: center;
  overflow: hidden;
  padding: 13px 14px;
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(36, 31, 27, 0.86);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-list--home .mode-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.18), transparent 20%),
    linear-gradient(135deg, var(--mode-a, rgba(217, 169, 76, 0.34)), transparent 56%);
  opacity: 0.86;
  pointer-events: none;
}

.mode-list--home .mode-card::after {
  content: attr(data-mark);
  position: absolute;
  right: 12px;
  bottom: -7px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 3.9rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.mode-list--home .mode-card--tutorial {
  --mode-a: rgba(64, 108, 159, 0.4);
}

.mode-list--home .mode-card--ai {
  --mode-a: rgba(57, 121, 101, 0.4);
}

.mode-list--home .mode-card--room {
  --mode-a: rgba(217, 169, 76, 0.5);
}

.mode-list--home .mode-card--classic {
  --mode-a: rgba(159, 53, 48, 0.34);
}

.mode-list--home .mode-card--brawl {
  --mode-a: rgba(116, 79, 145, 0.48);
}

.mode-list--home .mode-card--brawl {
  min-height: 94px;
}

.mode-list--home .mode-card.is-active {
  border-color: rgba(240, 201, 107, 0.98);
  background:
    linear-gradient(145deg, rgba(240, 201, 107, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(39, 31, 22, 0.92);
  box-shadow:
    0 0 0 1px rgba(240, 201, 107, 0.28),
    0 20px 42px rgba(217, 169, 76, 0.18);
}

.mode-card__index,
.mode-card__body,
.mode-card__side {
  position: relative;
  z-index: 1;
}

.mode-card__index {
  width: auto;
  min-height: 0;
  color: rgba(255, 244, 207, 0.9);
  font-size: 0.82rem;
  font-weight: 900;
}

.mode-card__body {
  min-width: 0;
}

.mode-list--home .mode-card strong {
  font-size: 1.16rem;
}

.mode-list--home .mode-card span {
  margin-top: 0;
}

.mode-list--home .mode-card__body > span {
  margin-top: 6px;
  color: #dfd1bd;
  font-size: 0.76rem;
  line-height: 1.38;
}

.mode-card__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 58px;
  margin-top: 0;
}

.mode-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #20150c;
  background: rgba(240, 201, 107, 0.92);
  font-size: 0.74rem;
  font-weight: 900;
}

.mini-character {
  grid-template-columns: 46px minmax(0, 1fr);
  position: relative;
  overflow: hidden;
  min-height: 88px;
}

.character-draft .mini-character {
  min-height: 386px;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: stretch;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(20, 18, 16, 0.86);
}

.character-draft .mini-character.is-active {
  border-color: rgba(240, 201, 107, 0.95);
  background:
    linear-gradient(180deg, rgba(240, 201, 107, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(39, 31, 22, 0.94);
}

.mini-character.is-locked {
  cursor: not-allowed;
}

.mini-character.is-locked:not(.is-active) {
  opacity: 0.46;
}

.mini-character.is-active.is-locked {
  opacity: 1;
  border-color: rgba(240, 201, 107, 0.92);
  background:
    linear-gradient(90deg, rgba(240, 201, 107, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(45, 35, 22, 0.82);
}

.mini-character .mode-pill {
  position: absolute;
  right: 10px;
  bottom: 8px;
  min-width: 42px;
  min-height: 22px;
  padding: 2px 7px;
}

.character-draft .mini-character .mode-pill {
  right: 12px;
  bottom: 12px;
  min-width: 58px;
}

.mini-avatar {
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(217, 169, 76, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.24);
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.75);
}

.character-draft .mini-avatar {
  width: 100%;
  height: 260px;
  margin: 0;
  border-radius: 8px;
  border-color: rgba(217, 169, 76, 0.5);
  background:
    radial-gradient(circle at 50% 18%, rgba(217, 169, 76, 0.22), transparent 54%),
    rgba(0, 0, 0, 0.3);
}

.character-draft .mini-avatar img {
  object-fit: contain;
  object-position: center bottom;
  padding: 8px 4px 0;
  transform: none;
}

.mini-character__body {
  align-self: center;
  min-width: 0;
}

.mini-character__body small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 246, 222, 0.68);
  font-size: 0.82rem;
  line-height: 1.35;
}

.character-draft .mini-character strong {
  font-size: 1.34rem;
}

.character-draft .mini-character span {
  font-size: 0.86rem;
}

.mode-card strong,
.mini-character strong {
  display: block;
  font-size: 0.98rem;
}

.mode-card span,
.mini-character span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.mode-card.is-active,
.mini-character.is-active {
  border-color: rgba(217, 169, 76, 0.9);
  background: rgba(217, 169, 76, 0.14);
}

.result-overlay {
  position: absolute;
  inset: 14px 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 201, 107, 0.2), transparent 42%),
    rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.result-overlay[hidden] {
  display: none;
}

.result-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 54px;
  border: 1px solid rgba(255, 232, 165, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(50, 34, 11, 0.95), rgba(16, 12, 8, 0.96));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.result-card strong {
  color: #ffd567;
  font-size: clamp(4.8rem, 11vw, 9rem);
  font-weight: 900;
  line-height: 0.96;
  text-shadow:
    0 2px 0 #6e3f12,
    0 16px 34px rgba(0, 0, 0, 0.44);
}

.result-card span {
  color: #fff4cf;
  font-size: 1.02rem;
  font-weight: 900;
}

.mode-pill {
  min-width: 48px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.72rem;
  text-align: center;
}

.mode-pill--skill {
  color: #20150c;
  background: var(--gold);
}

.mode-list--home .mode-pill,
.mode-list--home .mode-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
}

.mode-list--home .mode-pill {
  min-width: 46px;
  color: rgba(255, 246, 222, 0.9);
  background: rgba(0, 0, 0, 0.2);
}

.mode-list--home .mode-pill--skill {
  color: #20150c;
  background: rgba(240, 201, 107, 0.92);
}

.mode-list--home .mode-card__cta {
  min-width: 58px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: #24160d;
  background: linear-gradient(180deg, #f1cf74, #c89032);
}

.table-panel {
  min-width: 0;
  height: calc(100svh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(43, 138, 113, 0.58), transparent 52%),
    linear-gradient(145deg, rgba(18, 63, 55, 0.86), rgba(25, 20, 17, 0.96) 58%);
}

.game-layout.is-drafting .table-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.game-layout.is-drafting .table-panel {
  pointer-events: none;
}

.table-header,
.player-console__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.table-header {
  justify-content: flex-start;
}

.table-header > div:first-of-type {
  margin-right: auto;
}

.round-stats,
.console-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-start-action {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 5;
  min-width: 188px;
  min-height: 62px;
  font-size: 1.18rem;
  transform: translate(-50%, -50%);
}

.table-start-action:hover {
  transform: translate(-50%, calc(-50% - 1px));
}

.table-start-action[hidden] {
  display: none;
}

.table-exit-action {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff1d0;
  background: rgba(0, 0, 0, 0.24);
  font-weight: 900;
}

.table-exit-action[hidden] {
  display: none;
}

.table-exit-action:hover {
  border-color: rgba(240, 201, 107, 0.56);
  background: rgba(240, 201, 107, 0.12);
}

.round-stats span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #eadbc4;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.8rem;
}

.table-arena {
  position: relative;
  min-height: 0;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(21, 86, 72, 0.95) 0%, rgba(21, 86, 72, 0.86) 33%, transparent 57%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 10%, transparent 90%, rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 16%, transparent 82%, rgba(0, 0, 0, 0.26)),
    radial-gradient(ellipse at center, rgba(48, 124, 105, 0.78), rgba(14, 48, 45, 0.96) 68%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -70px 110px rgba(0, 0, 0, 0.3);
}

.table-arena::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  pointer-events: none;
}

.table-arena::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 0;
  width: min(930px, calc(100% - 218px));
  height: 430px;
  border: 1px solid rgba(240, 201, 107, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(44, 143, 116, 0.44), rgba(6, 22, 20, 0.18) 62%, rgba(0, 0, 0, 0.26)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent);
  box-shadow:
    inset 0 0 48px rgba(0, 0, 0, 0.34),
    0 18px 54px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.opponent-row {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.opponent {
  position: absolute;
  width: 116px;
  min-height: 96px;
  padding: 6px;
  text-align: center;
  background: rgba(9, 14, 13, 0.74);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.opponent.is-acting {
  border-color: rgba(240, 201, 107, 0.86);
  box-shadow:
    0 0 0 1px rgba(240, 201, 107, 0.24),
    0 14px 28px rgba(0, 0, 0, 0.32);
}

.ai-bubble {
  position: absolute;
  left: 50%;
  top: -40px;
  z-index: 4;
  min-width: 64px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 239, 193, 0.72);
  border-radius: 8px;
  color: #2b1b12;
  background: linear-gradient(180deg, #fff8e7, #e7c77c);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  animation: bubble-pop 0.2s ease-out;
  pointer-events: none;
}

.ai-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(255, 239, 193, 0.72);
  border-bottom: 1px solid rgba(255, 239, 193, 0.72);
  background: #e7c77c;
  transform: translateX(-50%) rotate(45deg);
}

.opponent--top .ai-bubble {
  top: auto;
  bottom: -40px;
}

.opponent--top .ai-bubble::after {
  top: -7px;
  bottom: auto;
  border: 0;
  border-left: 1px solid rgba(255, 239, 193, 0.72);
  border-top: 1px solid rgba(255, 239, 193, 0.72);
  background: #fff8e7;
}

@keyframes bubble-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.opponent--left {
  left: 18px;
  top: 52%;
  transform: translateY(-50%);
}

.opponent--top {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
}

.opponent--right {
  right: 18px;
  top: 52%;
  transform: translateY(-50%);
}

.seat-avatar,
.player-seat .seat-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 6px;
  overflow: hidden;
  border: 2px solid rgba(217, 169, 76, 0.68);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 20%, rgba(217, 169, 76, 0.22), transparent 54%),
    rgba(0, 0, 0, 0.28);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.34);
}

.seat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.55);
  transform-origin: center top;
}

.seat-avatar--player {
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
}

.player-seat .seat-avatar--player {
  width: 68px;
  height: 68px;
}

.opponent strong,
.opponent span {
  display: block;
}

.opponent span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.visible-cards,
.target-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tiny-card {
  min-width: 34px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(30, 24, 20, 0.4);
  border-radius: 6px;
  color: #2b1b12;
  background: linear-gradient(180deg, #fff9ed, #dcc9aa);
  font-size: 0.72rem;
  font-weight: 900;
}

.tiny-card[data-suit="heart"],
.tiny-card[data-suit="diamond"] {
  color: #a52b28;
}

.tiny-card--peeked {
  border-color: rgba(76, 143, 202, 0.82);
  box-shadow: 0 0 0 2px rgba(76, 143, 202, 0.18);
}

.target-cards .tiny-card {
  color: rgba(255, 255, 255, 0.84);
}

.target-player {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 221, 151, 0.52);
  border-radius: 6px;
  color: #fff4cf;
  background: rgba(255, 221, 151, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.target-player:disabled {
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  cursor: not-allowed;
}

.skill-target-panel {
  min-height: 0;
}

.skill-target-panel[hidden] {
  display: none;
}

.skill-target-shell {
  padding: 12px;
  border: 1px solid rgba(240, 201, 107, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 24, 31, 0.92), rgba(11, 13, 17, 0.94)),
    rgba(0, 0, 0, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.28);
}

.skill-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.skill-target-head strong {
  color: #fff2d2;
  font-size: 0.95rem;
}

.skill-target-head span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.skill-target-players {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.skill-target-player {
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f7ead2;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  cursor: pointer;
}

.skill-target-player.is-active {
  border-color: rgba(240, 201, 107, 0.92);
  background: rgba(240, 201, 107, 0.16);
}

.skill-target-player:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.skill-target-player strong,
.skill-target-player small {
  display: block;
}

.skill-target-player small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.skill-target-avatar {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(240, 201, 107, 0.44);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
}

.skill-target-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.42);
  transform-origin: center top;
}

.skill-card-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.skill-choice-card {
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  min-height: 66px;
  border-radius: 7px;
  font-size: 0.84rem;
}

.skill-choice-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.center-table {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(900px, calc(100% - 240px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
  transform: translate(-50%, -50%);
}

.last-play,
.event-feed,
.player-console {
  box-shadow: none;
}

.last-play {
  min-height: clamp(168px, 27svh, 260px);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 18px;
  background:
    radial-gradient(circle, rgba(53, 165, 132, 0.42), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
}

.last-play__label,
.last-play__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.last-play__meta {
  margin-top: 12px;
}

.played-cards {
  min-height: 92px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.event-feed {
  height: 72px;
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
}

.event-feed p {
  margin: 0 0 9px;
  color: #d7cbb9;
  font-size: 0.84rem;
  line-height: 1.45;
}

.player-console {
  margin-top: 10px;
  padding: 8px 12px 10px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(16, 13, 11, 0.72), rgba(6, 6, 5, 0.9)),
    rgba(16, 13, 11, 0.78);
}

.game-layout.has-skill .player-console {
  padding: 10px 18px 12px;
}

.player-console__play-area {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-top: 0;
}

.game-layout.has-skill .player-console__play-area {
  grid-template-columns: minmax(188px, 216px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.player-console__topline {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 10px;
  z-index: 3;
  justify-content: flex-end;
  pointer-events: none;
}

.player-console__title {
  display: none;
}

.game-layout.has-skill .player-console__topline {
  top: 6px;
}

.player-console__topline > *,
.console-actions button {
  pointer-events: auto;
}

.player-rail {
  display: grid;
  gap: 10px;
}

.game-layout.has-skill .player-rail {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  align-content: stretch;
  min-height: 214px;
  padding: 10px;
  border: 1px solid rgba(217, 169, 76, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 238, 184, 0.07), transparent 38%),
    rgba(0, 0, 0, 0.24);
}

.player-seat {
  min-height: 78px;
  display: grid;
  align-content: end;
  justify-items: center;
  padding: 8px;
  border: 1px solid rgba(217, 169, 76, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}

.player-seat strong,
.player-seat span {
  display: block;
}

.player-seat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.game-layout.has-skill .player-seat {
  min-height: 74px;
  grid-template-columns: 62px minmax(0, 1fr);
  column-gap: 10px;
  align-content: center;
  align-items: center;
  justify-items: start;
  padding: 6px;
  border-color: rgba(217, 169, 76, 0.2);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.game-layout.has-skill .player-seat .seat-avatar--player {
  grid-row: span 2;
  width: 58px;
  height: 58px;
  margin: 0;
}

.game-layout.has-skill .player-seat strong {
  align-self: end;
  font-size: 1rem;
  line-height: 1.1;
}

.game-layout.has-skill .player-seat span {
  align-self: start;
  margin-top: 2px;
  font-size: 0.74rem;
}

.hand-zone {
  min-width: 0;
}

.console-actions button {
  min-width: 72px;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 900;
}

.skill-action {
  border-color: rgba(217, 169, 76, 0.54);
  background: rgba(217, 169, 76, 0.12);
}

.sort-action {
  border-color: rgba(75, 219, 121, 0.6);
  color: #073516;
  background: linear-gradient(180deg, #56d987, #168448);
  box-shadow: 0 12px 24px rgba(22, 132, 72, 0.26);
}

.sort-action:hover {
  border-color: rgba(120, 245, 158, 0.86);
  background: linear-gradient(180deg, #6df09d, #209554);
}

.skill-strip {
  display: block;
}

.skill-card {
  min-height: 0;
  padding: 9px 10px;
  border: 1px solid rgba(217, 169, 76, 0.36);
  border-radius: 8px;
  background: rgba(217, 169, 76, 0.1);
}

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

.skill-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.32;
}

.game-layout.has-skill .skill-card {
  min-height: 120px;
  height: 100%;
  display: grid;
  align-content: start;
  padding: 12px;
}

.game-layout.has-skill .skill-card span {
  font-size: 0.72rem;
  line-height: 1.34;
}

.game-layout.has-skill .hand {
  min-height: 178px;
  padding-top: 36px;
}

.hand {
  min-height: 194px;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  margin-top: 0;
  padding: 34px 12px 4px;
  overflow: visible;
}

.hand-stack {
  flex: 0 1 48px;
  min-width: 34px;
  max-width: 62px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  transition: flex-basis 0.16s ease;
}

.hand-stack .card {
  flex: 0 0 auto;
}

.hand-stack .card + .card {
  margin-top: -61px;
}

.card {
  width: 62px;
  height: 88px;
  display: grid;
  align-items: start;
  justify-items: start;
  padding: 8px 7px;
  border: 1px solid rgba(62, 58, 55, 0.34);
  border-radius: 8px;
  color: #171515;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, #fffdf7, #e4e0d7);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.62rem;
  font-weight: 900;
  line-height: 0.92;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -8px 16px rgba(0, 0, 0, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.34);
  cursor: pointer;
}

.card[data-suit="heart"],
.card[data-suit="diamond"] {
  color: #bd1f1f;
}

.card[data-suit="joker"] {
  place-items: stretch;
  padding: 5px;
  overflow: hidden;
  color: #24160d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 0;
}

.card--joker {
  border-color: rgba(32, 22, 16, 0.48);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.56), transparent 30%),
    linear-gradient(180deg, #fff7df, #e5d5b8);
}

.card.card--joker-big {
  color: #4c1713;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 244, 188, 0.8), transparent 31%),
    linear-gradient(135deg, rgba(167, 39, 34, 0.24), transparent 48%),
    linear-gradient(225deg, rgba(40, 112, 88, 0.28), transparent 50%),
    linear-gradient(180deg, #fff5d8, #e2b85d);
}

.card.card--joker-small {
  color: #202329;
  filter: grayscale(0.84);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.76), transparent 32%),
    linear-gradient(135deg, rgba(32, 35, 41, 0.16), transparent 50%),
    linear-gradient(180deg, #f7f7f2, #b9b9b3);
}

.joker-face {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  border-radius: 6px;
}

.joker-face::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 5px;
  opacity: 0.2;
}

.joker-corner {
  position: absolute;
  left: 3px;
  top: 3px;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.joker-mask {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 38px;
  margin-top: 17px;
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(circle at 37% 42%, #fff8dc 0 3px, transparent 4px),
    radial-gradient(circle at 63% 42%, #fff8dc 0 3px, transparent 4px),
    linear-gradient(135deg, currentColor 0 48%, #1f6a59 49% 100%);
  box-shadow:
    inset 0 -7px 10px rgba(0, 0, 0, 0.24),
    0 7px 12px rgba(0, 0, 0, 0.18);
}

.card--joker-small .joker-mask {
  background:
    radial-gradient(circle at 37% 42%, #f8f8f4 0 3px, transparent 4px),
    radial-gradient(circle at 63% 42%, #f8f8f4 0 3px, transparent 4px),
    linear-gradient(135deg, #252932 0 48%, #80858a 49% 100%);
}

.joker-mask::before,
.joker-mask::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 15px;
  height: 20px;
  border-radius: 60% 60% 28% 28%;
  background: currentColor;
}

.joker-mask::before {
  left: -5px;
  transform: rotate(-25deg);
}

.joker-mask::after {
  right: -5px;
  transform: rotate(25deg);
}

.joker-title {
  position: relative;
  z-index: 1;
  align-self: end;
  color: currentColor;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.joker-mark {
  position: relative;
  z-index: 1;
  margin-bottom: 4px;
  color: rgba(28, 22, 17, 0.58);
  font-size: 0.42rem;
  font-weight: 900;
  line-height: 1;
}

.card.is-selected {
  transform: translateY(-14px);
  border-color: rgba(255, 223, 145, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 28px rgba(217, 169, 76, 0.28),
    0 0 0 2px rgba(240, 201, 107, 0.24);
}

.card--wild {
  border-color: rgba(217, 169, 76, 0.92);
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(180deg, #f2d16f, #8a4d1e);
}

.card--revealed {
  box-shadow:
    0 0 0 2px rgba(217, 169, 76, 0.28),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.card--back {
  color: rgba(255, 255, 255, 0.8);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(135deg, transparent 75%, rgba(255, 255, 255, 0.13) 75%) 0 0 / 12px 12px,
    linear-gradient(180deg, #64302d, #251614);
}

.tiny-card--joker {
  width: 42px;
  min-width: 42px;
  padding: 3px;
  color: #4c1713;
}

.tiny-card--joker-small {
  color: #252932;
  filter: grayscale(0.84);
}

.tiny-card--joker .joker-corner {
  font-size: 0.56rem;
}

.tiny-card--joker .joker-mask {
  width: 22px;
  height: 24px;
  margin-top: 8px;
}

.tiny-card--joker .joker-mask::before,
.tiny-card--joker .joker-mask::after {
  top: -5px;
  width: 9px;
  height: 11px;
}

.tiny-card--joker .joker-title {
  font-size: 0.45rem;
}

.tiny-card--joker .joker-mark {
  display: none;
}

@media (max-width: 980px) {
  .character-grid,
  .hero__content,
  .intro-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero__content {
    align-items: start;
    padding-top: 92px;
  }

  .home-modes {
    width: min(100%, 560px);
  }

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

  .character-draft {
    top: 50%;
  }

  .character-draft .mini-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-arena {
    min-height: auto;
    padding: 12px;
  }

  .table-arena::before {
    inset: 10px;
  }

  .opponent-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .opponent,
  .opponent--left,
  .opponent--top,
  .opponent--right {
    position: relative;
    inset: auto;
    width: auto;
    transform: none;
  }

  .center-table {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 12px;
    transform: none;
  }

  .player-console__play-area {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .game-layout.has-skill .player-console__play-area {
    grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
  }

  .hero__stage {
    background-position: 62% 24%;
  }

  .hero__content {
    padding: 64px 0 44px;
  }

  .character-grid,
  .character-draft .mini-roster,
  .opponent-row,
  .player-console__play-area {
    grid-template-columns: 1fr;
  }

  .table-header,
  .player-console__topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .round-stats,
  .console-actions {
    justify-content: flex-start;
  }

  .player-seat {
    min-height: 96px;
    align-content: center;
  }

  .card {
    width: 45px;
    height: 66px;
    padding: 6px 5px;
    font-size: 1.32rem;
  }

  .hand {
    min-height: 236px;
    gap: 5px;
    padding-inline: 2px;
  }

  .hand-stack {
    flex-basis: 47px;
  }

  .hand-stack .card + .card {
    margin-top: -43px;
  }

  .skill-target-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .skill-target-players {
    grid-template-columns: 1fr;
  }

  .character-draft .mini-character {
    min-height: 340px;
    grid-template-columns: 1fr;
  }

  .character-draft .mini-avatar {
    width: 100%;
    height: 220px;
  }

  .character-draft .mini-character .mode-pill {
    display: none;
  }

  .character-draft .mini-character strong {
    font-size: 1.18rem;
  }

  .result-card {
    width: min(92vw, 420px);
    padding: 28px 24px;
  }
}
