:root {
  --bg: #090b10;
  --surface: #111620;
  --surface-2: #151b28;
  --surface-3: #1b2332;
  --line: #29344a;
  --line-soft: #20293b;
  --text: #f3f7ff;
  --muted: #8fa1bd;
  --subtle: #657895;
  --accent: #62d9ee;
  --accent-2: #f6b43d;
  --accent-3: #22c983;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(43, 160, 190, 0.14), transparent 34rem),
    linear-gradient(135deg, #090b10 0%, #0e1017 48%, #07080c 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.theme-gold {
  --accent: #f7bd43;
  --accent-2: #62d9ee;
}

.theme-green {
  --accent: #26d07c;
  --accent-2: #62d9ee;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 420px;
  gap: 56px;
  align-items: center;
  padding: 56px clamp(24px, 7vw, 96px);
}

.brand-block {
  display: grid;
  gap: 20px;
}

.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.gem-logo {
  width: 82px;
  height: 82px;
  border-radius: 24px 24px 36px 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 24%),
    linear-gradient(135deg, #47d5ef 0%, #6576ff 45%, #e879f9 100%);
  box-shadow: 0 0 32px rgba(98, 217, 238, 0.35);
  transform: rotate(45deg);
}

.brand-copy h1,
.page-title h1,
.auth-card h2 {
  margin: 0;
}

.brand-copy h1 {
  font-size: 42px;
  line-height: 1.1;
}

.brand-copy p,
.page-title p,
.auth-card p,
.muted {
  color: var(--muted);
}

.auth-card {
  background: rgba(17, 22, 32, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 80px);
  overflow: auto;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-tabs,
.tabs,
.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d111b;
}

.tab,
.segment {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active,
.segment.active,
.pill.active {
  background: linear-gradient(135deg, var(--accent), #a876f4);
  color: #07111a;
}

.field-stack {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d121d;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(98, 217, 238, 0.12);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn,
.icon-btn {
  min-height: 42px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #a774f1);
  color: #06111a;
  box-shadow: 0 10px 28px rgba(98, 217, 238, 0.18);
}

.secondary-btn {
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.danger-btn {
  background: #c91f2b;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.icon-btn {
  min-width: 42px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(139, 61, 255, 0.16), transparent 32rem),
    linear-gradient(180deg, #04060b 0%, #0a0f1a 44%, #05070c 100%);
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 74px clamp(24px, 6vw, 104px) 76px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(3, 5, 10, 0.56) 0%, rgba(3, 5, 10, 0.24) 48%, rgba(3, 5, 10, 0.48) 100%),
    radial-gradient(circle at 22% 58%, rgba(116, 52, 255, 0.22), transparent 24rem),
    radial-gradient(circle at 74% 34%, rgba(247, 189, 67, 0.14), transparent 20rem),
    var(--hero-image) center / cover no-repeat;
  border-bottom: 1px solid rgba(212, 175, 55, 0.32);
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 15, 0.96));
  pointer-events: none;
}

.landing-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.64fr);
  gap: clamp(34px, 5vw, 78px);
  align-items: center;
  width: min(100%, 1560px);
  margin: 0 auto;
}

.landing-nav {
  position: absolute;
  z-index: 1;
  inset: 20px clamp(20px, 6vw, 88px) auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-nav strong {
  font-size: clamp(18px, 2.2vw, 26px);
  color: #fff7d7;
  text-shadow: 0 0 22px rgba(212, 175, 55, 0.42);
}

.landing-nav div,
.landing-actions,
.landing-final {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-code-preview {
  margin: -6px 0 2px;
  color: #d4af37;
  font-weight: 800;
}

.landing-hero-copy {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: minmax(200px, 0.44fr) minmax(0, 1fr);
  gap: 22px clamp(24px, 3vw, 44px);
  align-items: center;
}

.landing-emblem {
  grid-row: span 2;
  width: clamp(180px, 20vw, 340px);
  justify-self: center;
  filter: drop-shadow(0 0 36px rgba(123, 66, 255, 0.52)) drop-shadow(0 0 20px rgba(212, 175, 55, 0.3));
}

.landing-badge {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(212, 175, 55, 0.46);
  border-radius: 999px;
  background: rgba(9, 12, 18, 0.72);
  color: #ffd978;
  font-weight: 900;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.12);
}

.landing-hero h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(34px, 4.2vw, 70px);
  line-height: 1.04;
  color: #fff6d4;
  font-family: Georgia, "Noto Serif TC", "Microsoft JhengHei", serif;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.42), 0 4px 18px rgba(0, 0, 0, 0.62);
}

.landing-hero h1 span {
  display: block;
  font-size: clamp(54px, 7.2vw, 112px);
  letter-spacing: 0;
  font-style: italic;
  color: #ffe8a6;
}

.landing-hero p {
  margin: 0;
  max-width: 650px;
  color: #e4ecff;
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.8;
}

.landing-proof-list {
  grid-column: 2;
  display: grid;
  gap: 12px;
}

.landing-proof-list p {
  display: grid;
  gap: 2px;
  padding-left: 16px;
  border-left: 2px solid rgba(212, 175, 55, 0.55);
  font-size: 15px;
}

.landing-proof-list strong {
  color: #ffdf8c;
  font-size: 18px;
}

.landing-proof-list span {
  color: #cbd7ea;
}

.landing-login-card {
  position: relative;
  isolation: isolate;
  display: block;
  box-sizing: border-box;
  width: clamp(390px, 30vw, 490px);
  aspect-ratio: 916 / 1415;
  justify-self: center;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(12, 18, 27, 0.68), rgba(3, 8, 14, 0.84)),
    rgba(8, 11, 18, 0.72);
  box-shadow: 0 0 44px rgba(212, 175, 55, 0.18), 0 26px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.landing-card-frame {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.95;
  pointer-events: none;
}

.landing-login-card > * {
  position: relative;
  z-index: 2;
}

.login-crest {
  position: absolute;
  top: 7.8%;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 74px;
  margin: 0;
  background: url("./assets/landing/go_guild_loot_ui_assets/02_logo/go_icon_shield_gem_transparent.png") center / 155% auto no-repeat;
  filter: drop-shadow(0 0 18px rgba(166, 96, 255, 0.52)) drop-shadow(0 0 18px rgba(212, 175, 55, 0.18));
}

.landing-login-card h2,
.landing-login-card p,
.landing-login-card > strong {
  margin: 0;
  text-align: center;
}

.landing-login-card h2 {
  position: absolute;
  top: 18.4%;
  left: 0;
  width: 100%;
  color: #fff2c6;
  font-size: clamp(42px, 4vw, 60px);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  text-shadow: 0 0 22px rgba(212, 175, 55, 0.5);
}

.landing-login-card p {
  position: absolute;
  top: 26.5%;
  left: 0;
  width: 100%;
  color: #cbb77d;
  letter-spacing: 0.08em;
}

.landing-login-card > strong {
  position: absolute;
  top: 32.4%;
  left: 10%;
  width: 80%;
  color: #efe2be;
  font-size: 22px;
  letter-spacing: 0.12em;
}

.landing-login-fields {
  position: absolute;
  inset: 0;
  display: block;
  margin-top: 0;
  gap: 0;
}

.ornate-field {
  position: absolute;
  box-sizing: border-box;
  left: 12.3%;
  width: 75.4%;
  height: 6.45%;
  min-height: 0;
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(3, 8, 14, 0.36);
  color: #f8ead0;
  border-radius: 6px;
  padding-inline: 18px;
  outline: none;
  appearance: none;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.18);
}

.ornate-field:focus {
  border-color: rgba(255, 218, 111, 0.92);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 218, 111, 0.42),
    0 0 14px rgba(212, 175, 55, 0.18);
}

.ornate-field::placeholder {
  color: #948871;
}

.landing-guild-select {
  top: 37.85%;
  background: rgba(3, 8, 14, 0.42);
  text-transform: uppercase;
}

.landing-code-preview {
  position: absolute;
  left: 13.2%;
  top: 44.62%;
  width: 73.6%;
  min-height: 18px;
  color: #f3d686;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.landing-account-input {
  top: 48.15%;
}

.landing-password-input {
  top: 58.45%;
}

.landing-gold-btn {
  position: relative;
  overflow: hidden;
  min-height: 62px;
  margin-top: 0;
  border: 1px solid rgba(255, 226, 161, 0.88);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 247, 199, 0.36), transparent 32%),
    linear-gradient(135deg, #ffe29a 0%, #d89a34 46%, #8a4c08 100%);
  color: #160d05;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
  box-shadow:
    inset 0 0 0 2px rgba(70, 29, 0, 0.22),
    inset 0 -10px 22px rgba(74, 32, 5, 0.18),
    0 0 28px rgba(212, 175, 55, 0.28),
    0 0 18px rgba(139, 61, 255, 0.16);
}

.landing-login-submit {
  position: absolute;
  left: 12.2%;
  top: 69.55%;
  width: 75.6%;
  height: 8.5%;
  min-height: 0;
}

.landing-gold-btn::before {
  content: none;
}

.landing-gold-btn {
  z-index: 0;
}

.landing-gold-btn:not(:disabled) {
  box-shadow: 0 0 28px rgba(212, 175, 55, 0.28), 0 0 18px rgba(139, 61, 255, 0.16);
}

.landing-login-links {
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  bottom: 6.1%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 0;
}

.landing-login-links button {
  min-height: 34px;
  background: transparent;
  color: #d5c39a;
  font-weight: 800;
}

.landing-login-links button + button {
  border-left: 1px solid rgba(212, 175, 55, 0.34);
}

.landing-bottom-nav {
  position: absolute;
  z-index: 2;
  inset: auto clamp(20px, 5vw, 76px) 18px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 64px);
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.42);
}

.landing-bottom-nav a {
  color: #d9c794;
  font-weight: 900;
  text-decoration: none;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.22);
}

.landing-section {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.section-heading span {
  color: var(--accent-2);
  font-weight: 900;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
}

.section-heading p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  line-height: 1.7;
}

.landing-flow-grid,
.landing-feature-grid,
.landing-plan-grid {
  display: grid;
  gap: 14px;
}

.landing-flow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.landing-step,
.landing-feature,
.landing-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 32, 0.82);
  box-shadow: var(--shadow);
}

.landing-step {
  padding: 18px;
}

.landing-step strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #a774f1);
  color: #07111a;
}

.landing-step h3,
.landing-feature h3,
.landing-plan h3 {
  margin: 14px 0 8px;
}

.landing-step p,
.landing-feature p,
.landing-plan p,
.trial-strip span {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.flow-preview {
  margin: 18px 0;
  border: 1px solid rgba(247, 189, 67, 0.32);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(11, 15, 24, 0.78);
}

.flow-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.landing-feature {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0 16px;
  align-items: start;
  padding: 20px;
}

.landing-feature > span {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(247, 189, 67, 0.14);
  font-size: 24px;
}

.landing-feature h3,
.landing-plan h3 {
  margin-top: 0;
}

.contact-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border: 1px solid rgba(247, 189, 67, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 189, 67, 0.16), rgba(167, 116, 241, 0.12)),
    rgba(17, 22, 32, 0.82);
  box-shadow: var(--shadow);
}

.contact-band span {
  color: var(--accent-2);
  font-weight: 900;
}

.contact-band h2 {
  margin: 6px 0;
}

.contact-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.pricing-section {
  padding-bottom: 72px;
}

.trial-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(98, 217, 238, 0.36);
  border-radius: 8px;
  background: rgba(18, 42, 50, 0.66);
}

.trial-strip strong {
  color: #7df0ff;
  font-size: 18px;
}

.landing-plan {
  padding: 26px;
  border-color: rgba(247, 189, 67, 0.38);
}

.landing-plan strong {
  display: block;
  margin: 10px 0;
  color: #ffd268;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: 0;
}

.landing-plan small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 16px;
}

.landing-final {
  justify-content: center;
  margin-top: 22px;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell.mahjong-lobby-shell-mode {
  min-height: 100vh;
  background: #02060a;
}

.app-shell.mahjong-lobby-shell-mode .main {
  margin-left: 0;
  padding: 0;
  background: #02060a;
}

.app-shell.mahjong-lobby-shell-mode .topbar {
  display: none;
}

.app-shell.mahjong-table-shell-mode .main {
  padding: 14px 16px 40px;
}

.app-shell.mahjong-table-live-shell-mode {
  background: #02060a;
}

.app-shell.mahjong-table-live-shell-mode .sidebar {
  transform: translateX(-280px);
}

.app-shell.mahjong-table-live-shell-mode .main {
  margin-left: 0;
  padding: 8px;
  background: #02060a;
}

.app-shell.mahjong-table-live-shell-mode .topbar {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 276px;
  background: rgba(9, 12, 18, 0.96);
  border-right: 1px solid var(--line-soft);
  padding: 18px 14px;
  overflow-y: auto;
  z-index: 20;
  transition: transform 160ms ease;
}

.sidebar.closed {
  transform: translateX(-280px);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #46d8ee, #8b5cf6 55%, #f472b6);
  box-shadow: 0 0 22px rgba(98, 217, 238, 0.28);
}

.guild-name {
  font-weight: 900;
}

.guild-sub {
  color: var(--muted);
  font-size: 12px;
}

.nav-group {
  margin-top: 18px;
}

.nav-title {
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
  margin: 0 0 8px;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-item.active {
  background: rgba(38, 208, 124, 0.16);
  color: #dfffea;
  box-shadow: inset 3px 0 0 var(--accent-3);
}

.main {
  min-height: 100vh;
  margin-left: 276px;
  padding: 22px 28px 56px;
  min-width: 0;
  max-width: 100%;
}

.main.full {
  margin-left: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title h1 {
  font-size: 28px;
  line-height: 1.2;
}

.page-title p {
  margin: 4px 0 0;
}

.balance-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.balance-chip {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 900;
}

.content {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.panel {
  background: rgba(17, 22, 32, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel h2,
.panel h3 {
  margin: 0;
}

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

.stat {
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat span {
  color: var(--muted);
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  color: var(--accent);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar .input {
  max-width: 360px;
}

.ticker {
  display: flex;
  gap: 14px;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  color: var(--accent-2);
  font-weight: 800;
}

.ticker span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.webhook-status {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 14px;
  margin-top: 14px;
}

.webhook-status > div,
.webhook-hint {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 18, 29, 0.76);
  padding: 14px;
}

.webhook-status > div {
  display: grid;
  gap: 8px;
}

.masked-webhook {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-left: 8px;
  overflow: hidden;
  color: var(--accent);
  font-family: Consolas, "Microsoft JhengHei", monospace;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.webhook-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.webhook-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.webhook-hint strong {
  color: var(--text);
  font-family: Consolas, "Microsoft JhengHei", monospace;
}

.webhook-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.webhook-actions button:disabled,
.panel-header button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.empty-state {
  min-height: 148px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.auction-card {
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auction-card h3 {
  color: var(--accent-2);
  font-size: 22px;
}

.auction-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.auction-info span,
.auction-foot {
  color: var(--muted);
}

.auction-info strong {
  text-align: right;
}

.auction-info .price {
  color: var(--accent-2);
}

.auction-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(98, 217, 238, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.badge.red {
  background: rgba(239, 68, 68, 0.14);
  color: #ff9090;
}

.badge.green {
  background: rgba(34, 201, 131, 0.14);
  color: #7df0b5;
}

.badge.gold {
  background: rgba(255, 190, 58, 0.16);
  color: var(--accent-2);
}

.progress {
  display: inline-flex;
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.progress span {
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), #ffa914);
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
  z-index: 40;
}

.modal {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal.large {
  width: min(760px, 100%);
}

.modal-head,
.modal-body,
.modal-foot {
  padding: 18px 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin: 0;
}

.modal-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

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

.radio-card {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: var(--muted);
  font-weight: 900;
}

.radio-card.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(98, 217, 238, 0.12);
}

.alert {
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.1);
  color: #ffb4b4;
  border-radius: 8px;
  padding: 14px;
}

.notice {
  border: 1px solid rgba(98, 217, 238, 0.36);
  background: rgba(98, 217, 238, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.toast-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.46);
  z-index: 60;
}

.toast-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #161b24;
  padding: 22px;
  box-shadow: var(--shadow);
}

.toast-card h3 {
  margin: 0 0 10px;
}

.toast-card p {
  margin: 0 0 18px;
}

.theme-options {
  display: grid;
  gap: 12px;
}

.theme-option {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px 0 0;
  background: var(--surface);
}

.theme-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(98, 217, 238, 0.08);
}

.theme-bar {
  width: 6px;
  height: 100%;
  border-radius: 8px 0 0 8px;
  background: var(--accent);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.chat-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  min-width: 0;
}

.chat-box {
  min-height: 420px;
  display: grid;
  align-content: space-between;
  min-width: 0;
}

.chat-bubble {
  width: fit-content;
  max-width: 640px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface-3);
  overflow-wrap: anywhere;
}

.user-bubble {
  margin-left: auto;
  background: rgba(98, 217, 238, 0.12);
  border-color: rgba(98, 217, 238, 0.36);
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
}

.game-pad {
  display: grid;
  gap: 16px;
}

.number-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.digit {
  width: 58px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  font-size: 32px;
  font-weight: 900;
}

.slot-cabinet {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(246, 180, 61, 0.08), transparent 34%),
    rgba(17, 22, 32, 0.92);
}

.slot-machine {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 22px 18px 18px;
  border: 1px solid rgba(246, 180, 61, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 212, 101, 0.12), rgba(99, 75, 24, 0.06)),
    #0d121c;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.36), 0 0 26px rgba(246, 180, 61, 0.16);
}

.slot-top-light,
.slot-glow-line {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffd86b, #62d9ee, #b66dff, transparent);
  opacity: 0.85;
}

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

.slot-reel {
  min-height: 106px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(98, 217, 238, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(98, 217, 238, 0.16), transparent 65%),
    var(--surface-3);
  box-shadow: inset 0 -18px 30px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.slot-symbol {
  grid-area: 1 / 1;
  font-size: clamp(38px, 7vw, 58px);
  font-weight: 900;
  text-shadow: 0 0 18px rgba(98, 217, 238, 0.45);
  z-index: 2;
}

.slot-ghost {
  grid-area: 1 / 1;
  font-size: 28px;
  opacity: 0;
  filter: blur(1px);
}

.slot-machine.spinning .slot-reel {
  animation: slotFrame 920ms cubic-bezier(0.22, 0.9, 0.22, 1.12) both;
  animation-delay: var(--delay);
}

.slot-machine.spinning .slot-symbol {
  animation: slotSymbol 920ms cubic-bezier(0.22, 0.9, 0.22, 1.12) both;
  animation-delay: var(--delay);
}

.slot-machine.spinning .slot-ghost {
  animation: slotGhost 760ms linear both;
  animation-delay: var(--delay);
}

.dice-board {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 4vw, 34px);
  padding: 22px;
  margin: 12px auto 8px;
  border: 1px solid rgba(246, 180, 61, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(246, 180, 61, 0.14), transparent 64%),
    linear-gradient(180deg, rgba(10, 15, 24, 0.95), rgba(14, 18, 28, 0.74));
}

.dice-cube {
  position: relative;
  width: clamp(70px, 9vw, 90px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.9), transparent 16%),
    linear-gradient(145deg, #f7f8fb, #9099a8 54%, #4b5362);
  color: #111827;
  box-shadow:
    inset -10px -10px 18px rgba(0, 0, 0, 0.2),
    inset 8px 8px 14px rgba(255, 255, 255, 0.48),
    0 18px 32px rgba(0, 0, 0, 0.38);
  transform: perspective(480px) rotateX(12deg) rotateZ(-2deg);
  transform-style: preserve-3d;
  overflow: hidden;
}

.dice-cube::before {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(122, 132, 146, 0.96), rgba(69, 78, 92, 0.98));
  z-index: 3;
  opacity: 0;
}

.dice-face-grid {
  width: 66%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
}

.dice-face-grid i {
  display: block;
  border-radius: 999px;
}

.dice-face-grid i.on {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.35), transparent 18%),
    #2e3340;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.38);
}

.dice-board.rolling .dice-cube {
  animation: diceRoll 1350ms cubic-bezier(0.17, 0.84, 0.44, 1) both;
  animation-delay: var(--delay);
}

.dice-board.revealing .dice-cube::before {
  animation: diceCoverReveal 1550ms ease both;
  animation-delay: var(--delay);
}

.dice-result-line {
  margin: 0 0 14px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.dice-board.revealing + .dice-result-line {
  animation: resultFadeIn 1900ms ease both;
}

.game-casino-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.game-casino-head h2 {
  margin: 0;
}

.game-casino-head strong {
  min-width: 130px;
  padding: 10px 14px;
  border: 1px solid rgba(246, 180, 61, 0.3);
  border-radius: 8px;
  background: rgba(246, 180, 61, 0.08);
  color: var(--muted);
  text-align: right;
}

.game-casino-head strong span {
  color: var(--accent-2);
  font-size: 22px;
}

.game-online-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 12px 0;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(98, 217, 238, 0.08);
  color: #b9dcff;
  font-weight: 800;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4fe08a;
  box-shadow: 0 0 14px rgba(79, 224, 138, 0.72);
}

.casino-online-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(98, 217, 238, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 217, 238, 0.08), rgba(246, 180, 61, 0.05)),
    rgba(255, 255, 255, 0.035);
}

.casino-online-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.casino-online-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.casino-online-head span,
.casino-online-head em,
.casino-online-event,
.casino-room-card span,
.casino-online-seat span {
  color: var(--muted);
  font-style: normal;
}

.casino-online-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.casino-online-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.casino-online-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

.casino-online-seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.casino-online-seat {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(139, 160, 198, 0.22);
  border-radius: 8px;
  background: rgba(5, 11, 20, 0.42);
}

.casino-online-seat strong {
  overflow: hidden;
  color: #e8f4ff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.casino-online-seat.own {
  border-color: rgba(98, 217, 238, 0.52);
  background: rgba(98, 217, 238, 0.1);
}

.casino-online-seat.banker {
  border-color: rgba(246, 180, 61, 0.55);
  background: rgba(246, 180, 61, 0.12);
}

.casino-online-seat.empty {
  border-style: dashed;
  opacity: 0.72;
}

.casino-online-event {
  padding: 10px 12px;
  border: 1px solid rgba(246, 180, 61, 0.18);
  border-radius: 8px;
  background: rgba(246, 180, 61, 0.06);
  font-weight: 800;
}

.casino-room-list {
  display: grid;
  gap: 8px;
}

.casino-room-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(139, 160, 198, 0.18);
  border-radius: 8px;
  background: rgba(5, 11, 20, 0.34);
}

.casino-room-card > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.casino-room-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-banker-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 180px) minmax(140px, 190px) minmax(170px, 240px);
  align-items: center;
  gap: 14px;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.game-banker-panel span {
  min-width: 0;
  color: var(--text);
  font-weight: 900;
}

.test-banker-toggle {
  min-height: 44px;
  border-color: rgba(251, 191, 36, 0.32);
}

.test-banker-toggle.active {
  color: #ffd36a;
  border-color: rgba(251, 191, 36, 0.72);
  background: rgba(251, 191, 36, 0.14);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.12);
}

.casino-banker-console .test-banker-toggle {
  width: 100%;
}

.casino-join-btn {
  min-height: 44px;
}

.casino-join-btn.joined {
  color: #63e6be;
  border-color: rgba(99, 230, 190, 0.5);
  background: rgba(99, 230, 190, 0.1);
}

.casino-banker-console .casino-join-btn {
  width: 100%;
}

.dice-waiting {
  margin: 8px 0 0;
  text-align: center;
  color: #b9dcff;
  font-weight: 900;
}

.dice-history {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 900;
}

.dice-history-pill {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(98, 217, 238, 0.25);
  background: rgba(44, 92, 160, 0.24);
  color: #b9dcff;
}

.dice-history-pill.big {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.16);
  color: #ffb5b5;
}

.game-bet-panel {
  display: grid;
  gap: 14px;
}

.quick-bet-control {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  align-items: center;
}

.quick-chip-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(80px, 1fr));
  gap: 10px;
}

.bet-input-label.full {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.warning-line {
  margin: 0;
  text-align: center;
  color: #ffbe3a;
  font-weight: 900;
}

.game-info-panel {
  margin-top: 16px;
}

.profit-board {
  display: grid;
  gap: 0;
}

.game-empty-records {
  min-height: 118px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed rgba(137, 168, 214, 0.28);
  border-radius: 8px;
  background: rgba(7, 13, 24, 0.46);
  text-align: center;
}

.game-empty-records strong {
  color: var(--text);
  font-weight: 950;
}

.game-empty-records span {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profit-board .game-empty-records,
.recent-board .game-empty-records,
.dice-road-scroll .game-empty-records {
  width: 100%;
}

.dice-road-scroll .game-empty-records {
  min-height: 156px;
}

.profit-row,
.recent-row,
.odds-board div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(70px, auto) minmax(80px, auto);
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}

.profit-row:last-child,
.recent-row:last-child,
.odds-board div:last-child {
  border-bottom: 0;
}

.profit-row small,
.odds-board span {
  color: var(--muted);
}

.gain {
  color: #37f29a;
}

.loss {
  color: #ff6377;
}

.odds-board {
  display: grid;
}

.odds-board div {
  grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(80px, auto);
}

.odds-board b {
  color: var(--accent-2);
}

.casino-page {
  --casino-gold: #fec93d;
  --casino-gold-2: #f59e0b;
  --casino-felt: #10221d;
  --casino-edge: rgba(254, 201, 61, 0.34);
}

.casino-dice-page.chat-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 18px;
}

.casino-dice-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.casino-dice-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(520px, 1.2fr);
  gap: 16px;
  align-items: stretch;
}

.casino-title-lockup {
  min-width: 0;
  min-height: 128px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--casino-edge);
  border-radius: 8px;
  background:
    radial-gradient(circle at 24px 18px, rgba(254, 201, 61, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(38, 40, 51, 0.96), rgba(11, 14, 20, 0.94));
  box-shadow: inset 0 0 46px rgba(254, 201, 61, 0.05), 0 18px 42px rgba(0, 0, 0, 0.26);
}

.casino-title-lockup img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 18px rgba(254, 201, 61, 0.42));
}

.casino-title-lockup > div {
  min-width: 0;
}

.casino-title-lockup h2 {
  margin: 0;
  color: #fff6dc;
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(254, 201, 61, 0.42);
}

.casino-title-lockup p,
.casino-hud-card span,
.casino-hud-card small {
  margin: 4px 0 0;
  color: #a9bfde;
}

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

.casino-hud-card {
  container-type: inline-size;
  min-width: 0;
  min-height: 128px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(137, 168, 214, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(29, 34, 47, 0.98), rgba(13, 17, 26, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.casino-hud-card.accent {
  border-color: var(--casino-edge);
  background:
    radial-gradient(circle at top right, rgba(254, 201, 61, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(45, 39, 23, 0.94), rgba(16, 18, 24, 0.98));
}

.casino-hud-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--casino-gold);
  font-size: clamp(24px, 2.2vw, 36px);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@supports (font-size: 1cqi) {
  .casino-hud-card strong {
    font-size: clamp(24px, 21cqi, 38px);
  }
}

.casino-table-shell {
  padding: 14px;
  border: 1px solid rgba(254, 201, 61, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(26, 28, 34, 0.96), rgba(11, 13, 19, 0.98));
}

.casino-table-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.casino-table-topline .game-online-strip {
  margin: 0;
  flex: 1;
}

.casino-table-tag {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(254, 201, 61, 0.28);
  border-radius: 999px;
  background: rgba(254, 201, 61, 0.08);
  color: #ffd66a;
  font-weight: 900;
}

.casino-table-felt {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  min-height: 330px;
  padding: 22px;
  border: 1px solid rgba(254, 201, 61, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(5, 8, 10, 0.66), rgba(5, 8, 10, 0.1), rgba(5, 8, 10, 0.66)),
    url("./assets/loot-share-system/casino/table-felt.svg") center / cover no-repeat,
    var(--casino-felt);
  overflow: hidden;
  box-shadow: inset 0 0 74px rgba(0, 0, 0, 0.56);
}

.casino-table-felt::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(254, 201, 61, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.casino-banker-console {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(254, 201, 61, 0.28);
  border-radius: 8px;
  background: rgba(5, 9, 14, 0.68);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.34);
}

.casino-banker-console span {
  display: block;
  color: #9eb4d6;
  font-weight: 800;
}

.casino-banker-console strong {
  display: block;
  margin-top: 8px;
  color: #fff3c2;
  font-size: 24px;
}

.casino-gold-btn,
.casino-action-btn {
  min-height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd36a, #f5a30b);
  color: #120e05;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.24);
}

.casino-gold-btn:hover,
.casino-action-btn:hover,
.casino-chip:hover,
.casino-choice:hover {
  filter: brightness(1.08);
}

.dice-stage-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
}

.dice-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c9d9f2;
  font-weight: 900;
}

.dice-stage-heading b {
  color: #ffd66a;
}

.casino-dice-board {
  position: relative;
  min-height: 176px;
  margin: 0;
  padding: 30px clamp(18px, 4vw, 56px);
  border-color: rgba(254, 201, 61, 0.35);
  background:
    radial-gradient(circle at center, rgba(254, 201, 61, 0.24), transparent 54%),
    linear-gradient(180deg, rgba(5, 9, 14, 0.78), rgba(13, 17, 25, 0.88));
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.46);
}

.dice-cup-mark {
  position: absolute;
  left: 18px;
  top: 16px;
  width: 46px;
  height: 46px;
  opacity: 0.72;
  filter: drop-shadow(0 0 14px rgba(254, 201, 61, 0.34));
}

.casino-die {
  width: clamp(64px, 7vw, 88px);
}

.casino-status-overlay {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(137, 168, 214, 0.24);
  border-radius: 8px;
  background: rgba(9, 13, 20, 0.72);
}

.casino-status-overlay strong {
  color: #fff7db;
  font-size: 18px;
}

.casino-status-overlay span {
  color: #a9bfde;
}

.casino-status-overlay.win {
  border-color: rgba(34, 201, 131, 0.42);
  box-shadow: inset 4px 0 0 rgba(34, 201, 131, 0.72);
}

.casino-status-overlay.lose {
  border-color: rgba(239, 68, 68, 0.38);
  box-shadow: inset 4px 0 0 rgba(239, 68, 68, 0.68);
}

.casino-status-overlay.waiting {
  border-color: rgba(254, 201, 61, 0.44);
  box-shadow: inset 4px 0 0 rgba(254, 201, 61, 0.76);
}

.casino-dice-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.casino-dice-grid.secondary {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
}

.casino-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(137, 168, 214, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 27, 38, 0.98), rgba(13, 17, 26, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.casino-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.casino-section-head span {
  color: #7890b4;
  font-size: 12px;
  font-weight: 900;
}

.casino-section-head h3 {
  margin: 2px 0 0;
  color: #fff6dc;
}

.casino-section-head b {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(254, 201, 61, 0.12);
  color: #ffd66a;
}

.casino-bet-zone {
  display: grid;
  gap: 14px;
}

.casino-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.casino-choice {
  min-height: 86px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid rgba(137, 168, 214, 0.26);
  border-radius: 8px;
  background: #111827;
  color: #c8dcfb;
  text-align: center;
}

.casino-choice span {
  color: var(--casino-gold);
  font-size: 22px;
}

.casino-choice strong {
  color: #ffffff;
}

.casino-choice small {
  color: #8fa1bd;
}

.casino-choice.active {
  border-color: var(--casino-gold);
  background: linear-gradient(180deg, rgba(254, 201, 61, 0.2), rgba(254, 201, 61, 0.07));
  box-shadow: inset 0 0 0 1px rgba(254, 201, 61, 0.18), 0 0 20px rgba(254, 201, 61, 0.12);
}

.casino-chip-bar {
  display: grid;
  gap: 8px;
  color: #9eb4d6;
  font-weight: 900;
}

.casino-chip-bar > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.casino-chip {
  min-height: 44px;
  border: 1px solid rgba(254, 201, 61, 0.4);
  border-radius: 999px;
  background: rgba(254, 201, 61, 0.12);
  color: #ffdc79;
  font-weight: 950;
}

.casino-chip.ghost {
  border-color: rgba(137, 168, 214, 0.28);
  background: rgba(137, 168, 214, 0.08);
  color: #b9cced;
}

.casino-amount-field {
  display: grid;
  gap: 8px;
  color: #c9d9f2;
  font-weight: 900;
}

.casino-amount-field .input {
  min-height: 52px;
  border-color: rgba(254, 201, 61, 0.34);
  color: var(--casino-gold);
  font-size: 22px;
  font-weight: 950;
}

.casino-action-btn {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 64px;
}

.casino-action-btn small {
  color: rgba(18, 14, 5, 0.74);
  font-weight: 900;
}

.casino-action-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45) brightness(0.7);
  box-shadow: none;
}

.casino-helper-text {
  margin: 0;
  color: #9eb4d6;
  text-align: center;
  font-weight: 800;
}

.casino-road-zone {
  display: grid;
  align-content: start;
  gap: 14px;
}

.dice-road-scroll {
  min-height: 190px;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  border: 1px dashed rgba(137, 168, 214, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(254, 201, 61, 0.08), transparent 68%),
    rgba(7, 11, 17, 0.72);
}

.dice-road-bead {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(254, 201, 61, 0.28);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.26), transparent 28%),
    rgba(254, 201, 61, 0.11);
  color: #fff6d6;
  font-weight: 950;
  line-height: 1;
}

.dice-road-bead small {
  color: #ffdc79;
  font-size: 10px;
}

.dice-road-bead.big {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.14);
}

.dice-road-bead.small {
  border-color: rgba(98, 217, 238, 0.38);
  background: rgba(98, 217, 238, 0.12);
}

.dice-road-bead.triple {
  border-color: rgba(34, 201, 131, 0.42);
  background: rgba(34, 201, 131, 0.14);
}

.dice-last-summary {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: rgba(254, 201, 61, 0.08);
  color: #9eb4d6;
}

.dice-last-summary strong {
  color: #ffd66a;
}

.casino-odds div {
  min-height: 42px;
  border-color: rgba(137, 168, 214, 0.12);
}

.casino-odds strong {
  color: #f3f7ff;
}

.casino-chat-shell {
  min-width: 0;
  position: sticky;
  top: 14px;
}

.casino-chat-shell .chat-box {
  min-height: min(760px, calc(100vh - 40px));
  border: 1px solid rgba(254, 201, 61, 0.24);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(26, 28, 34, 0.98), rgba(12, 14, 20, 0.98));
}

@media (max-width: 1700px) {
  .casino-dice-page.chat-layout {
    grid-template-columns: 1fr;
  }

  .casino-chat-shell {
    position: static;
  }

  .casino-chat-shell .chat-box {
    min-height: 360px;
  }
}

@media (max-width: 1500px) {
  .casino-dice-hero {
    grid-template-columns: 1fr;
  }

  .casino-chat-shell {
    position: static;
  }

  .casino-chat-shell .chat-box {
    min-height: 360px;
  }
}

.ranking-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.recent-board h4 {
  margin: 0 0 10px;
}

.recent-row {
  grid-template-columns: minmax(0, 1fr) minmax(70px, auto);
}

.rule-panel summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--accent-2);
}

.rule-lines {
  margin-top: 12px;
  color: #b9dcff;
  line-height: 1.8;
}

.rule-lines p {
  margin: 0 0 8px;
}

.disabled-game-panel {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  border-color: rgba(246, 180, 61, 0.34);
  background:
    linear-gradient(180deg, rgba(246, 180, 61, 0.08), transparent 42%),
    rgba(17, 22, 32, 0.92);
}

.disabled-game-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(246, 180, 61, 0.36);
  border-radius: 8px;
  background: rgba(246, 180, 61, 0.12);
  font-size: 38px;
}

.niuniu-table {
  overflow: hidden;
}

.bet-control {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(137, 168, 214, 0.24);
  border-radius: 8px;
  background: rgba(10, 18, 33, 0.72);
}

.bet-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bet-control-head h3 {
  margin: 0;
}

.bet-input-label {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--text);
  font-weight: 800;
}

.niuniu-hands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.inline-bet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.inline-bet .input {
  width: 96px;
}

.mahjong-timer-options {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(246, 180, 61, 0.24);
  border-radius: 999px;
  background: rgba(7, 14, 25, 0.72);
}

.mahjong-timer-options span {
  padding-inline: 4px;
  color: #9fc4e8;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mahjong-timer-button {
  min-width: 40px;
  padding: 7px 10px;
  border: 1px solid rgba(98, 217, 238, 0.18);
  border-radius: 999px;
  color: #d8ecff;
  font-weight: 1000;
  background: rgba(12, 24, 40, 0.84);
  cursor: pointer;
}

.mahjong-timer-button.active {
  border-color: rgba(246, 180, 61, 0.76);
  color: #120b02;
  background: linear-gradient(135deg, #ffd36b, #ffad18);
  box-shadow: 0 0 18px rgba(246, 180, 61, 0.24);
}

.mahjong-turn-countdown {
  min-width: 42px;
  padding: 7px 9px;
  border-radius: 999px;
  color: #ffd36b;
  font-size: 13px;
  font-style: normal;
  font-weight: 1000;
  text-align: center;
  background: rgba(246, 180, 61, 0.1);
}

.mahjong-turn-countdown.is-urgent {
  color: #fff;
  background: rgba(248, 74, 89, 0.86);
  animation: mahjongTimerPulse 0.8s ease-in-out infinite alternate;
}

@keyframes mahjongTimerPulse {
  from { box-shadow: 0 0 0 rgba(248, 74, 89, 0); }
  to { box-shadow: 0 0 18px rgba(248, 74, 89, 0.52); }
}

.mahjong-layout .chat-box {
  min-height: 260px;
}

.mahjong-layout {
  grid-template-columns: minmax(0, 1fr);
}

.mahjong-page {
  overflow: hidden;
}

.mahjong-page-live {
  padding: 8px;
  overflow: visible;
  border-color: rgba(246, 180, 61, 0.28);
  background: rgba(6, 10, 16, 0.96);
}

.mahjong-page-live .mahjong-table-entrybar,
.mahjong-page-live .mahjong-online-panel,
.mahjong-page-live .mahjong-mode-panel {
  display: none;
}

.mahjong-lobby-page {
  border-color: rgba(246, 180, 61, 0.42);
  background:
    linear-gradient(180deg, rgba(5, 12, 20, 0.72), rgba(5, 9, 15, 0.9)),
    url("./mj-ui-layered-assets/backgrounds/lobby_bg_desktop.png") center / cover no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(246, 180, 61, 0.1),
    inset 0 0 80px rgba(246, 180, 61, 0.08),
    0 22px 70px rgba(0, 0, 0, 0.3);
}

.mahjong-page > .stats-grid {
  gap: 10px;
}

.mahjong-page > .stats-grid .stat {
  min-height: 66px;
  padding: 12px 16px;
}

.mahjong-page > .stats-grid .stat strong {
  margin-top: 6px;
  font-size: 24px;
}

.mahjong-lobby-hero,
.mahjong-score-picker,
.mahjong-lobby-toolbar,
.mahjong-table-entrybar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(246, 180, 61, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(8, 17, 31, 0.9), rgba(28, 22, 32, 0.82));
}

.mahjong-lobby-hero {
  min-height: 120px;
  background:
    radial-gradient(circle at 12% 50%, rgba(246, 180, 61, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(9, 18, 30, 0.96), rgba(13, 14, 22, 0.86));
  box-shadow: inset 0 0 34px rgba(246, 180, 61, 0.06);
}

.mahjong-lobby-hero span,
.mahjong-score-picker span,
.mahjong-lobby-toolbar span,
.mahjong-table-entrybar span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mahjong-lobby-hero h2 {
  margin: 4px 0;
  color: #fff7cf;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(246, 180, 61, 0.36);
}

.mahjong-lobby-hero p {
  margin: 0;
  color: #b9d6ff;
}

.mahjong-lobby-summary {
  min-width: 240px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 217, 238, 0.24);
  border-radius: 8px;
  background: rgba(4, 14, 24, 0.78);
}

.mahjong-lobby-summary strong,
.mahjong-score-picker strong,
.mahjong-lobby-toolbar strong,
.mahjong-table-entrybar strong {
  display: block;
  color: #fff;
  font-size: 18px;
}

.mahjong-score-picker {
  grid-template-columns: minmax(190px, 0.38fr) minmax(0, 1fr);
}

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

.mahjong-score-option {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(133, 159, 196, 0.32);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.78);
  color: #dceafe;
  text-align: left;
  cursor: pointer;
}

.mahjong-score-option strong,
.mahjong-score-option span {
  display: block;
}

.mahjong-score-option strong {
  color: #fff7cf;
  font-size: 18px;
}

.mahjong-score-option.active {
  border-color: rgba(246, 180, 61, 0.9);
  background: linear-gradient(135deg, rgba(246, 180, 61, 0.32), rgba(167, 116, 241, 0.18));
  box-shadow: 0 0 18px rgba(246, 180, 61, 0.16);
}

.mahjong-lobby-toolbar {
  border-color: rgba(98, 217, 238, 0.22);
  background: linear-gradient(135deg, rgba(6, 21, 32, 0.86), rgba(13, 15, 24, 0.84));
}

.mahjong-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mahjong-room-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid rgba(246, 180, 61, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 22, 25, 0.86), rgba(5, 11, 18, 0.96)),
    url("./mj-ui-layered-assets/frames/room_card_desktop_available.png") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 28px rgba(246, 180, 61, 0.08);
}

.mahjong-room-card.active {
  border-color: rgba(246, 180, 61, 0.78);
  box-shadow: inset 0 0 0 1px rgba(246, 180, 61, 0.12), 0 14px 34px rgba(0, 0, 0, 0.2);
}

.mahjong-room-card.playing {
  border-color: rgba(67, 156, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(8, 22, 38, 0.86), rgba(5, 11, 18, 0.96)),
    url("./mj-ui-layered-assets/frames/room_card_desktop_playing.png") center / 100% 100% no-repeat;
}

.mahjong-room-card.full {
  border-color: rgba(255, 105, 83, 0.72);
  background:
    linear-gradient(180deg, rgba(31, 15, 15, 0.86), rgba(8, 10, 17, 0.96)),
    url("./mj-ui-layered-assets/frames/room_card_desktop_full.png") center / 100% 100% no-repeat;
}

.mahjong-room-card.waiting {
  background:
    linear-gradient(180deg, rgba(29, 20, 10, 0.82), rgba(8, 12, 20, 0.96)),
    url("./mj-ui-layered-assets/frames/room_card_desktop_waiting.png") center / 100% 100% no-repeat;
}

.mahjong-room-card-head {
  display: grid;
  gap: 8px;
}

.mahjong-room-card-head strong {
  color: #fff;
  font-size: 18px;
}

.mahjong-room-card-head em {
  width: max-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(98, 217, 238, 0.12);
  color: #62d9ee;
  font-style: normal;
  font-weight: 900;
}

.mahjong-score-badge,
.mahjong-score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(246, 180, 61, 0.56);
  border-radius: 999px;
  background: rgba(246, 180, 61, 0.14);
  color: #ffd36b;
  font-weight: 900;
}

.mahjong-room-card p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mahjong-lobby-seats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mahjong-lobby-seat {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px dashed rgba(133, 159, 196, 0.32);
  border-radius: 8px;
  background: rgba(4, 12, 22, 0.82);
  color: #7f95b7;
  font-weight: 900;
}

.mahjong-lobby-seat.filled {
  border-style: solid;
  border-color: rgba(246, 180, 61, 0.62);
  background: linear-gradient(135deg, rgba(246, 180, 61, 0.24), rgba(8, 17, 31, 0.84));
  color: #fff7cf;
}

.mahjong-lobby-seat.ai {
  border-color: rgba(167, 116, 241, 0.5);
  color: #d4c2ff;
}

.mahjong-room-card-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.mahjong-room-card-foot span {
  color: var(--muted);
  font-size: 13px;
}

.mahjong-lobby-stage {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(251, 197, 91, 0.08), transparent 34rem),
    #02060a;
}

.mj-lobby-canvas {
  --mj-gold: #f4c361;
  --mj-gold-2: #a97522;
  --mj-text: #fff1c7;
  --mj-blue: #9dd2ff;
  width: 100%;
  min-height: 100vh;
  padding: 24px 34px 30px;
  color: var(--mj-text);
  background:
    linear-gradient(180deg, rgba(2, 7, 11, 0.16), rgba(2, 7, 11, 0.82)),
    url("./mj-ui-layered-assets/backgrounds/lobby_bg_desktop.png") center top / cover no-repeat;
  border: 1px solid rgba(244, 195, 97, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 177, 0.12),
    inset 0 0 84px rgba(214, 142, 31, 0.12);
}

.mj-lobby-header {
  display: grid;
  grid-template-columns: 230px 82px minmax(280px, 1fr) 380px 400px 120px;
  gap: 14px;
  align-items: center;
  min-height: 110px;
  padding: 16px 24px;
  background: url("./mj-ui-layered-assets/frames/top_header_bar.png") center / 100% 100% no-repeat;
}

.mj-nav-back,
.mj-menu-button,
.mj-small-button,
.mj-room-action,
.mj-rate-option,
.mj-quick-join,
.mj-create-room {
  position: relative;
  isolation: isolate;
  min-height: 44px;
  color: var(--mj-text);
  font-weight: 900;
}

.mj-nav-back,
.mj-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 68px;
  padding: 0 20px;
  background: url("./mj-ui-layered-assets/buttons/nav_back_button_bg.png") center / 100% 100% no-repeat;
}

.mj-menu-button {
  min-height: 72px;
  padding: 0 12px;
  flex-direction: column;
  gap: 5px;
  background-image: url("./mj-ui-layered-assets/buttons/menu_button_bg.png");
}

.mj-nav-back img {
  width: 38px;
  height: 38px;
}

.mj-menu-button img {
  width: 34px;
  height: 25px;
}

.mj-title-crest {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(244, 195, 97, 0.55));
}

.mj-lobby-header h2 {
  margin: 0;
  color: #ffe8a9;
  font-family: Georgia, "Times New Roman", "Microsoft JhengHei", serif;
  font-size: 46px;
  line-height: 1.04;
  text-shadow: 0 0 18px rgba(244, 195, 97, 0.6);
}

.mj-lobby-header p {
  margin: 6px 0 0;
  color: #d3c3a0;
  font-size: 19px;
  font-weight: 700;
}

.mj-header-chip {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 18px;
  border: 1px solid rgba(244, 195, 97, 0.46);
  background: linear-gradient(180deg, rgba(14, 24, 31, 0.9), rgba(5, 12, 18, 0.9));
  box-shadow: inset 0 0 20px rgba(244, 195, 97, 0.08);
}

.mj-header-chip span {
  color: #f3c46f;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 900;
}

.mj-header-chip img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.mj-header-chip strong {
  min-width: 0;
  color: #fff8d9;
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mj-rate-selector {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 136px;
  margin-top: 14px;
  padding: 20px 34px;
  background: url("./mj-ui-layered-assets/frames/rate_selector_frame.png") center / 100% 100% no-repeat;
}

.mj-rate-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mj-rate-heading img {
  width: 58px;
  height: 58px;
}

.mj-rate-heading strong {
  display: block;
  color: #ffe8a9;
  font-size: 30px;
  font-weight: 950;
}

.mj-rate-heading span {
  display: block;
  margin-top: 5px;
  color: #d6bf88;
  font-weight: 800;
}

.mj-rate-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.mj-rate-option {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 88px;
  padding: 14px 22px;
  text-align: center;
  background: url("./mj-ui-layered-assets/frames/rate_option_normal.png") center / 100% 100% no-repeat;
}

.mj-rate-option strong {
  color: #fff7df;
  font-family: Georgia, "Times New Roman", "Microsoft JhengHei", serif;
  font-size: 32px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.58);
}

.mj-rate-option span {
  color: #e3d2af;
  font-size: 15px;
}

.mj-rate-option img {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
}

.mj-rate-option.active {
  color: #fff;
  background-image: url("./mj-ui-layered-assets/frames/rate_option_selected.png");
  filter: drop-shadow(0 0 16px rgba(244, 195, 97, 0.44));
}

.mj-room-board {
  margin-top: 22px;
  padding: 0 6px 6px;
}

.mj-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  margin-bottom: 14px;
}

.mj-board-head strong {
  display: block;
  color: #ffe8a9;
  font-size: 24px;
}

.mj-board-head span {
  color: #b9c8de;
  font-size: 14px;
}

.mj-small-button {
  min-width: 118px;
  padding: 0 16px;
  background: url("./mj-ui-layered-assets/buttons/button_primary.png") center / 100% 100% no-repeat;
}

.mj-room-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 18px;
}

.mj-room-empty {
  grid-column: 1 / -1;
}

.mj-room-empty .empty-state {
  min-height: 176px;
  border-color: rgba(244, 195, 97, 0.38);
  background: rgba(5, 11, 19, 0.62);
}

.mj-room-card {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 118px;
  grid-template-rows: auto 78px;
  gap: 12px 14px;
  min-height: 206px;
  padding: 24px 22px 16px;
  background: url("./mj-ui-layered-assets/frames/room_card_desktop_available.png") center / 100% 100% no-repeat;
}

.mj-room-card.status-waiting {
  background-image: url("./mj-ui-layered-assets/frames/room_card_desktop_waiting.png");
}

.mj-room-card.status-playing {
  background-image: url("./mj-ui-layered-assets/frames/room_card_desktop_playing.png");
}

.mj-room-card.status-full {
  background-image: url("./mj-ui-layered-assets/frames/room_card_desktop_full.png");
}

.mj-room-card.active {
  filter: drop-shadow(0 0 16px rgba(244, 195, 97, 0.5));
}

.mj-room-emblem {
  grid-row: 1 / span 2;
  width: 72px;
  height: 72px;
  object-fit: contain;
  align-self: start;
  filter: drop-shadow(0 0 15px rgba(244, 195, 97, 0.32));
}

.mj-room-copy {
  min-width: 0;
}

.mj-room-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mj-room-title-row strong {
  min-width: 0;
  color: #fff3cf;
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(244, 195, 97, 0.24);
}

.mj-room-copy > span {
  display: block;
  margin-top: 8px;
  color: #dec492;
  font-size: 15px;
  font-weight: 800;
}

.mj-room-occupancy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff3cf;
  white-space: nowrap;
  font-weight: 900;
}

.mj-room-occupancy img {
  width: 22px;
  height: 22px;
}

.mj-room-actions {
  display: grid;
  gap: 8px;
  align-content: end;
  justify-items: stretch;
}

.mj-status-chip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  background: url("./mj-ui-layered-assets/frames/status_chip_available.png") center / 100% 100% no-repeat;
  color: #eaffcf;
  font-size: 14px;
  font-weight: 900;
}

.mj-status-chip.status-waiting {
  background-image: url("./mj-ui-layered-assets/frames/status_chip_waiting.png");
  color: #fff0aa;
}

.mj-status-chip.status-playing {
  background-image: url("./mj-ui-layered-assets/frames/status_chip_playing.png");
  color: #d3e9ff;
}

.mj-status-chip.status-full {
  background-image: url("./mj-ui-layered-assets/frames/status_chip_full.png");
  color: #ffd8d0;
}

.mj-room-action {
  min-height: 48px;
  padding: 0 12px;
  background: url("./mj-ui-layered-assets/buttons/button_primary.png") center / 100% 100% no-repeat;
}

.mj-room-action.selected {
  background-image: url("./mj-ui-layered-assets/buttons/button_gold.png");
  color: #1b1205;
}

.mj-room-action:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  background-image: url("./mj-ui-layered-assets/buttons/button_disabled.png");
}

.mj-room-seats {
  grid-column: 2 / span 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-self: end;
}

.mj-room-seat {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.mj-room-seat img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.mj-room-seat em {
  max-width: 100%;
  color: #d3c0a0;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mj-room-seat.filled em,
.mj-room-seat.own em {
  color: #fff4d0;
}

.mj-lobby-footer {
  display: grid;
  grid-template-columns: 390px 570px minmax(460px, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.mj-info-panel {
  min-height: 190px;
  padding: 24px 28px;
  background: url("./mj-ui-layered-assets/frames/legend_panel.png") center / 100% 100% no-repeat;
}

.mj-state-panel {
  background-image: url("./mj-ui-layered-assets/frames/state_legend_panel.png");
}

.mj-info-panel h3 {
  margin: 0 0 14px;
  color: #ffe8a9;
  font-size: 20px;
  text-align: center;
}

.mj-info-panel p {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  color: #d7c6a9;
  font-size: 14px;
  line-height: 1.45;
}

.mj-info-panel p > span:first-child {
  width: 18px;
  height: 18px;
  background: url("./mj-ui-layered-assets/icons/icon_layer_stack.png") center / contain no-repeat;
}

.mj-state-panel p {
  grid-template-columns: 18px 82px minmax(0, 1fr);
}

.mj-state-panel b {
  color: #fff1c7;
}

.mj-state-panel span {
  color: #d7c6a9;
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #6ae07f;
  box-shadow: 0 0 12px currentColor;
}

.dot.waiting { background: #ffcb42; }
.dot.playing { background: #78bfff; }
.dot.full { background: #f05545; }

.mj-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.mj-quick-join,
.mj-create-room {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 16px;
  min-height: 138px;
  padding: 24px 30px;
  text-align: left;
}

.mj-quick-join {
  background: url("./mj-ui-layered-assets/buttons/button_purple_large.png") center / 100% 100% no-repeat;
}

.mj-create-room {
  background: url("./mj-ui-layered-assets/buttons/button_gold_large.png") center / 100% 100% no-repeat;
}

.mj-quick-join img,
.mj-create-room img {
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  object-fit: contain;
  align-self: center;
}

.mj-quick-join strong,
.mj-create-room strong {
  color: #fff5cd;
  font-size: 28px;
  line-height: 1.1;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.5);
}

.mj-quick-join span,
.mj-create-room span {
  color: #f3dfb2;
  font-size: 14px;
  font-weight: 800;
}

.mj-lobby-tip {
  grid-column: 1 / -1;
  margin: 0;
  color: #d5c59d;
  text-align: right;
  font-weight: 800;
}

@media (max-width: 1500px) {
  .mj-lobby-canvas {
    padding: 18px 20px 24px;
  }

  .mj-lobby-header {
    grid-template-columns: 190px 64px minmax(240px, 1fr) 230px 260px 100px;
    padding: 14px 18px;
  }

  .mj-lobby-header h2 {
    font-size: 34px;
  }

  .mj-lobby-header p {
    font-size: 15px;
  }

  .mj-header-chip {
    grid-template-columns: auto 30px minmax(0, 1fr);
  }

  .mj-header-chip span {
    font-size: 14px;
  }

  .mj-header-chip strong {
    font-size: 17px;
  }

  .mj-rate-selector {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .mj-rate-option strong {
    font-size: 26px;
  }

  .mj-room-card {
    grid-template-columns: 58px minmax(0, 1fr) 100px;
    padding: 20px 18px 14px;
  }

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

  .mj-room-emblem {
    width: 58px;
    height: 58px;
  }

  .mj-room-title-row strong {
    font-size: 19px;
  }

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

  .mj-quick-actions {
    grid-column: 1 / -1;
  }

  .mj-quick-join strong,
  .mj-create-room strong {
    font-size: 22px;
  }
}

@media (max-width: 1180px) {
  .mj-lobby-header {
    grid-template-columns: auto 58px minmax(0, 1fr) auto;
  }

  .mj-header-chip {
    display: none;
  }

  .mj-rate-selector,
  .mj-lobby-footer {
    grid-template-columns: 1fr;
  }

  .mj-rate-options,
  .mj-room-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mj-quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .mj-lobby-canvas {
    padding: 12px;
    border: 0;
    background:
      linear-gradient(180deg, rgba(2, 7, 11, 0.24), rgba(2, 7, 11, 0.9)),
      url("./mj-ui-layered-assets/backgrounds/lobby_bg_mobile.png") center top / cover no-repeat;
  }

  .mj-lobby-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: 0;
  }

  .mj-title-crest {
    display: none;
  }

  .mj-nav-back,
  .mj-menu-button {
    min-height: 56px;
  }

  .mj-rate-selector {
    padding: 16px;
    background: rgba(5, 14, 22, 0.88);
    border: 1px solid rgba(244, 195, 97, 0.46);
  }

  .mj-rate-heading strong {
    font-size: 22px;
  }

  .mj-rate-options,
  .mj-room-grid,
  .mj-quick-actions {
    grid-template-columns: 1fr;
  }

  .mj-room-card {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    background-image: url("./mj-ui-layered-assets/frames/room_card_mobile.png");
  }

  .mj-room-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .mj-room-seats {
    grid-column: 1 / -1;
  }

  .mj-board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mj-small-button,
  .mj-room-action,
  .mj-rate-option,
  .mj-quick-join,
  .mj-create-room {
    min-height: 52px;
  }

  .mj-lobby-tip {
    text-align: left;
  }
}

.mahjong-table-entrybar {
  grid-template-columns: auto minmax(0, 1fr);
  border-color: rgba(98, 217, 238, 0.22);
  background: linear-gradient(135deg, rgba(4, 20, 28, 0.86), rgba(13, 15, 24, 0.84));
}

.mahjong-online-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.8fr) auto;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid rgba(98, 217, 238, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(5, 22, 31, 0.82), rgba(19, 20, 32, 0.78));
}

.mahjong-online-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.mahjong-online-summary strong {
  color: #fff7cf;
  font-size: 16px;
}

.mahjong-online-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mahjong-room-name {
  display: inline-block;
  color: #ffd36b;
  font-weight: 800;
}

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

.mahjong-online-seat {
  min-width: 0;
  padding: 9px 10px;
  border: 1px dashed rgba(133, 159, 196, 0.34);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.64);
}

.mahjong-online-seat.filled {
  border-style: solid;
  border-color: rgba(98, 217, 238, 0.38);
}

.mahjong-online-seat.own {
  border-color: rgba(246, 180, 61, 0.72);
  box-shadow: inset 0 0 0 1px rgba(246, 180, 61, 0.18);
}

.mahjong-online-seat.ai {
  border-color: rgba(167, 116, 241, 0.36);
}

.mahjong-online-seat span,
.mahjong-online-seat em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mahjong-online-seat strong {
  display: block;
  margin: 4px 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mahjong-seat-tools {
  display: flex;
  min-height: 24px;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.mahjong-seat-tools small {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(246, 180, 61, 0.48);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(246, 180, 61, 0.12);
  color: #ffd36b;
  font-size: 11px;
  font-weight: 800;
}

.mini-btn {
  border: 1px solid rgba(98, 217, 238, 0.44);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(8, 28, 48, 0.78);
  color: #bfefff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mini-btn.danger {
  border-color: rgba(255, 96, 96, 0.58);
  color: #ff9b9b;
}

.mini-btn:hover {
  filter: brightness(1.12);
}

.mahjong-online-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.mahjong-mode-panel,
.mahjong-session-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(246, 180, 61, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(8, 17, 31, 0.84), rgba(20, 20, 32, 0.78));
}

.mahjong-mode-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.52fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mahjong-mode-panel strong,
.mahjong-session-main strong {
  color: #fff7cf;
  font-size: 15px;
}

.mahjong-mode-panel span,
.mahjong-session-main span,
.mahjong-session-main em,
.mahjong-seat-draw span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

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

.mahjong-mode-button {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(133, 159, 196, 0.34);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.72);
  color: #dceafe;
  text-align: left;
  cursor: pointer;
}

.mahjong-mode-button strong,
.mahjong-mode-button span {
  display: block;
}

.mahjong-mode-button strong {
  color: #fff;
}

.mahjong-mode-button.active {
  border-color: rgba(246, 180, 61, 0.88);
  background: linear-gradient(135deg, rgba(246, 180, 61, 0.2), rgba(167, 116, 241, 0.14));
  box-shadow: inset 0 0 0 1px rgba(246, 180, 61, 0.12);
}

.mahjong-mode-button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.mahjong-session-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 0.45fr)) minmax(240px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.mahjong-session-main {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(133, 159, 196, 0.24);
  border-radius: 8px;
  background: rgba(3, 9, 18, 0.42);
}

.mahjong-seat-draw {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(98, 217, 238, 0.22);
  border-radius: 8px;
  background: rgba(4, 20, 26, 0.44);
}

.mahjong-seat-draw > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mahjong-seat-draw b {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(133, 159, 196, 0.28);
  border-radius: 999px;
  background: rgba(9, 17, 31, 0.8);
  color: #dceafe;
  font-size: 12px;
}

.mahjong-seat-draw b.dealer {
  border-color: rgba(246, 180, 61, 0.78);
  color: #ffd36b;
  box-shadow: 0 0 14px rgba(246, 180, 61, 0.16);
}

.mahjong-table {
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding-inline: 10px;
}

.mahjong-table-live {
  margin-top: 0;
  padding: 8px;
  overflow: visible;
}

.mahjong-table-live > .panel-header {
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(246, 180, 61, 0.2);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(4, 12, 20, 0.8), rgba(18, 16, 27, 0.64));
}

.mahjong-table-live > .panel-header h3 {
  font-size: 16px;
}

.mahjong-table-live > .panel-header p,
.mahjong-table-live .inline-bet,
.mahjong-table-live .mahjong-timer-options {
  display: none;
}

.mahjong-table-live .toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mahjong-table-live .toolbar > button {
  min-height: 38px;
  padding-inline: 12px;
}

.mahjong-table-live .toolbar [data-action="mahjong-fill-ai"],
.mahjong-table-live .toolbar [data-action="mahjong-invite-seat"] {
  display: none;
}

.mahjong-board {
  position: relative;
  width: min(100%, 1280px);
  min-width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
  margin: 8px auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 180, 61, 0.32);
  border-radius: 8px;
  background: #04070d;
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, 0.56),
    0 28px 70px rgba(0, 0, 0, 0.34);
}

.mahjong-page-live .mahjong-board {
  width: min(100%, calc((100vh - 106px) * 16 / 9), 1600px);
  min-width: 0;
  margin-top: 0;
}

.mahjong-table-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.mahjong-board.is-idle .mahjong-table-bg {
  filter: brightness(0.72) saturate(0.92);
}

.mahjong-board.is-live::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 51%, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.18) 64%),
    linear-gradient(180deg, rgba(2, 6, 14, 0.08), rgba(2, 6, 14, 0.14));
  pointer-events: none;
}

.mahjong-board-info {
  position: absolute;
  top: 2%;
  z-index: 6;
  width: 24%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  pointer-events: none;
}

.mahjong-board-info.left {
  left: 2.4%;
}

.mahjong-board-info.right {
  right: 2.4%;
}

.mahjong-board-info > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(246, 180, 61, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(2, 12, 22, 0.74), rgba(2, 8, 15, 0.42));
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(3px);
}

.mahjong-board-info span,
.mahjong-board-info em {
  display: block;
  overflow: hidden;
  color: #9fc4e8;
  font-size: clamp(10px, 0.82vw, 12px);
  font-style: normal;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mahjong-board-info strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #ffd36b;
  font-size: clamp(12px, 1.08vw, 16px);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(246, 180, 61, 0.25);
}

.mahjong-board-seatdraw {
  grid-column: 1 / -1;
}

.mahjong-board-room {
  grid-column: 1 / -1;
}

.mahjong-board-seatdraw > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  max-height: 48px;
  overflow: hidden;
}

.mahjong-board-seatdraw b {
  max-width: 100%;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid rgba(98, 217, 238, 0.24);
  border-radius: 999px;
  color: #d8ecff;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(10, 22, 38, 0.82);
}

.mahjong-board-seatdraw b.dealer {
  border-color: rgba(246, 180, 61, 0.72);
  color: #ffd36b;
  background: rgba(246, 180, 61, 0.14);
}

.mahjong-seat {
  position: absolute;
  z-index: 4;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  overflow: visible;
  border: 1px solid rgba(98, 217, 238, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(3, 10, 19, 0.46), rgba(5, 13, 22, 0.22));
  backdrop-filter: blur(1px);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.14);
}

.mahjong-seat.left {
  left: 4.8%;
  top: 25.5%;
  width: 17.6%;
  height: 35%;
  min-height: 0;
  overflow: visible;
}

.mahjong-seat.top {
  left: 27.5%;
  top: 4%;
  width: 45%;
  height: 23%;
  min-height: 0;
  overflow: visible;
}

.mahjong-seat.right {
  right: 4.8%;
  top: 25.5%;
  width: 17.6%;
  height: 35%;
  min-height: 0;
  overflow: visible;
}

.mahjong-seat.human {
  z-index: 8;
  left: 7%;
  right: 7%;
  bottom: 4%;
  width: auto;
  height: 32%;
  min-height: 0;
  max-height: none;
  overflow: visible;
  display: block;
  padding: 8px 12px 10px;
  border-color: rgba(246, 180, 61, 0.48);
  background: linear-gradient(180deg, rgba(4, 11, 21, 0.68), rgba(4, 10, 18, 0.44));
  backdrop-filter: blur(2px);
}

.mahjong-character {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.mahjong-seat-avatar {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.82;
  filter:
    brightness(1.14) contrast(1.08) saturate(1.08)
    drop-shadow(0 18px 24px rgba(0, 0, 0, 0.68))
    drop-shadow(0 0 28px rgba(126, 87, 255, 0.34));
}

.mahjong-character.left {
  left: 2.7%;
  top: 45%;
  width: clamp(135px, 14vw, 215px);
  transform: translateY(-50%);
}

.mahjong-character.right {
  right: 2.7%;
  top: 45%;
  width: clamp(135px, 14vw, 215px);
  transform: translateY(-50%);
}

.mahjong-character.top {
  left: 50%;
  top: 1%;
  width: clamp(150px, 13vw, 215px);
  transform: translateX(-50%);
}

.mahjong-seat-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 52px;
  overflow: hidden;
  color: #fff7cf;
}

.mahjong-seat-nameplate {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.78;
}

.mahjong-seat-head strong {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  color: #fff7cf;
  font-weight: 1000;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(246, 180, 61, 0.42);
}

.mahjong-seat-head span {
  position: absolute;
  right: 12px;
  top: 50%;
  z-index: 1;
  padding: 3px 8px;
  border: 1px solid rgba(98, 217, 238, 0.28);
  border-radius: 999px;
  color: #7defff;
  font-size: 11px;
  font-weight: 1000;
  background: rgba(5, 18, 28, 0.7);
  transform: translateY(-50%);
}

.mahjong-seat.human .mahjong-seat-head {
  position: absolute;
  left: 12px;
  top: 8px;
  width: min(260px, 34%);
  min-width: 190px;
  align-self: flex-start;
}

.mahjong-seat-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mahjong-seat.top .mahjong-seat-content {
  align-items: center;
}

.mahjong-seat.left .mahjong-seat-content,
.mahjong-seat.right .mahjong-seat-content {
  align-items: flex-start;
}

.mahjong-seat.top .mahjong-back-row {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.mahjong-seat.left .mahjong-back-row,
.mahjong-seat.right .mahjong-back-row {
  justify-content: flex-start;
  max-width: 100%;
}

.mahjong-seat.left .mahjong-back,
.mahjong-seat.right .mahjong-back {
  width: clamp(14px, 1.45vw, 20px);
  height: clamp(20px, 2.05vw, 29px);
}

.mahjong-seat.top .mahjong-back {
  width: clamp(15px, 1.45vw, 21px);
  height: clamp(21px, 2.05vw, 30px);
}

.mahjong-seat-discards,
.mahjong-river,
.mahjong-hand-main {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.mahjong-seat-discards {
  min-height: 34px;
  padding-top: 4px;
  border-top: 1px solid rgba(137, 168, 214, 0.12);
}

.mahjong-seat.left .mahjong-seat-discards,
.mahjong-seat.right .mahjong-seat-discards {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  max-width: 100%;
  max-height: 116px;
  overflow: hidden;
}

.mahjong-seat.top .mahjong-seat-discards {
  justify-content: center;
  max-height: none;
  overflow: visible;
}

.mahjong-seat.left p.muted,
.mahjong-seat.right p.muted,
.mahjong-seat.top p.muted,
.mahjong-center-copy p {
  margin: 0;
  line-height: 1.35;
}

.mahjong-seat.left p.muted,
.mahjong-seat.right p.muted {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mahjong-seat.human > .mahjong-seat-discards {
  display: none;
}

.mahjong-center {
  position: absolute;
  left: 27.5%;
  top: 32%;
  z-index: 3;
  width: 45%;
  height: 27%;
  min-height: 0;
  overflow: visible;
  display: grid;
  place-items: center;
  text-align: center;
}

.mahjong-center-frame {
  position: absolute;
  inset: -10% -14%;
  z-index: 0;
  width: 128%;
  height: 122%;
  object-fit: fill;
  opacity: 0.58;
  pointer-events: none;
}

.mahjong-center-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(1, 18, 24, 0.58), rgba(1, 8, 14, 0.34) 68%, transparent);
}

.mahjong-wind {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  border: 1px solid rgba(246, 180, 61, 0.58);
  border-radius: 999px;
  color: #ffd36b;
  font-weight: 1000;
  background: rgba(246, 180, 61, 0.13);
  box-shadow: 0 0 28px rgba(246, 180, 61, 0.18);
}

.mahjong-center-countdown {
  display: grid;
  place-items: center;
  gap: 2px;
  width: clamp(56px, 5vw, 74px);
  aspect-ratio: 1;
  margin: 1px 0;
  border: 3px solid rgba(255, 211, 107, 0.9);
  border-radius: 999px;
  color: #fff7d6;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 66, 66, 0.98) 0 42%, rgba(172, 14, 35, 0.95) 43% 72%, rgba(78, 8, 18, 0.96) 100%);
  box-shadow:
    0 0 0 7px rgba(246, 180, 61, 0.12),
    0 0 26px rgba(246, 180, 61, 0.58),
    inset 0 3px 9px rgba(255, 255, 255, 0.22);
  animation: mahjongCountdownBeat 0.82s ease-in-out infinite alternate;
}

.mahjong-center-countdown span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  color: rgba(255, 247, 214, 0.82);
}

.mahjong-center-countdown strong {
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 1000;
  line-height: 0.88;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.42);
}

.mahjong-center-countdown strong.is-urgent {
  color: #ffffff;
  animation: mahjongCountdownUrgent 0.34s ease-in-out infinite alternate;
}

.mahjong-advice {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(98, 217, 238, 0.25);
  border-radius: 8px;
  color: #bfeeff;
  background: rgba(5, 18, 28, 0.68);
  max-height: none;
  overflow: visible;
}

.mahjong-flower-event {
  margin: 0;
  color: #ffd36b;
  font-weight: 900;
}

.mahjong-river {
  justify-content: center;
  width: 100%;
  min-height: 52px;
  max-height: none;
  overflow: visible;
  flex-wrap: nowrap;
  padding: 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.mahjong-human-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mahjong-seat.human .mahjong-human-side {
  position: absolute;
  left: 16px;
  top: 45px;
  bottom: 12px;
  z-index: 2;
  width: 170px;
  max-width: 170px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: flex-start;
  align-items: stretch;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 180, 61, 0.45) transparent;
}

.mahjong-hand {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 70px;
  padding: 8px 10px;
  border: 1px solid rgba(98, 217, 238, 0.22);
  border-radius: 8px;
  background: rgba(0, 10, 18, 0.5);
}

.mahjong-seat.human .mahjong-hand {
  position: absolute;
  left: 192px;
  right: 14px;
  top: 58px;
  min-height: 72px;
  max-height: 86px;
  overflow: hidden;
}

.mahjong-hand-main {
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mahjong-drawn-slot {
  width: 66px;
  min-height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding-left: 12px;
  border-left: 1px solid rgba(246, 180, 61, 0.36);
}

.mahjong-drawn-slot.filled {
  filter: drop-shadow(0 0 18px rgba(246, 180, 61, 0.48));
}

.mahjong-drawn-empty {
  width: 48px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(246, 180, 61, 0.5);
  border-radius: 7px;
  color: rgba(255, 247, 207, 0.58);
  font-size: 12px;
  font-weight: 900;
  writing-mode: vertical-rl;
}

.mahjong-hand.compact {
  min-height: auto;
  margin-top: 10px;
  padding: 8px;
}

.mahjong-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mahjong-seat.human .mahjong-actions {
  position: absolute;
  left: 192px;
  right: auto;
  bottom: 14px;
  z-index: 14;
  width: calc(100% - 284px);
  min-width: 420px;
  min-height: 50px;
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  padding: 0 4px;
}

.mahjong-seat.human .mahjong-tile {
  width: clamp(30px, 3.15vw, 45px);
  height: clamp(42px, 4.35vw, 63px);
}

.mahjong-seat.human .mahjong-tile.small {
  width: clamp(24px, 2.2vw, 33px);
  height: clamp(34px, 3.05vw, 46px);
}

.mahjong-seat.human .mahjong-hand-main {
  gap: 4px;
}

.mahjong-seat.human .mahjong-claim-wheel {
  gap: 7px;
  width: max-content;
  max-width: 100%;
  flex-wrap: nowrap;
}

.mahjong-claim-wheel,
.mahjong-chi-options {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mahjong-action-button {
  position: relative;
  width: clamp(40px, 3.5vw, 52px);
  height: clamp(40px, 3.5vw, 52px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  filter: grayscale(0.15) opacity(0.72);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.mahjong-seat.human .mahjong-action-button {
  width: clamp(36px, 3.1vw, 46px);
  height: clamp(36px, 3.1vw, 46px);
  flex: 0 0 auto;
}

.mahjong-action-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.mahjong-action-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mahjong-action-button.active {
  cursor: pointer;
  filter: drop-shadow(0 0 14px rgba(246, 180, 61, 0.34));
}

.mahjong-action-button.active:hover {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 0 18px rgba(191, 116, 255, 0.5));
}

.mahjong-action-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.95) opacity(0.42);
}

.mahjong-effect {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  animation: mahjongEffectFade 3.4s ease-out forwards;
}

.mahjong-effect::before,
.mahjong-effect::after,
.mahjong-effect-ring {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mahjong-effect::before {
  width: 62%;
  aspect-ratio: 1;
  background:
    radial-gradient(circle, rgba(255, 240, 185, 0.34), rgba(191, 116, 255, 0.18) 38%, transparent 68%),
    conic-gradient(from 25deg, transparent, rgba(246, 180, 61, 0.48), transparent, rgba(98, 217, 238, 0.34), transparent);
  filter: blur(2px);
  animation: mahjongEffectSpin 2.8s linear forwards;
}

.mahjong-effect::after {
  width: 38%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 211, 107, 0.72);
  box-shadow:
    0 0 32px rgba(246, 180, 61, 0.38),
    inset 0 0 26px rgba(191, 116, 255, 0.28);
  animation: mahjongEffectRing 1.8s ease-out forwards;
}

.mahjong-effect-ring {
  width: 28%;
  aspect-ratio: 1;
  border: 1px solid rgba(98, 217, 238, 0.58);
  box-shadow: 0 0 22px rgba(98, 217, 238, 0.28);
  animation: mahjongEffectRing 2.2s 0.15s ease-out forwards;
}

.mahjong-effect-card {
  position: relative;
  z-index: 2;
  min-width: min(560px, 72%);
  max-width: 80%;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 32px;
  border: 1px solid rgba(246, 180, 61, 0.74);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(8, 12, 20, 0.92), rgba(43, 24, 62, 0.82)),
    radial-gradient(circle at center, rgba(246, 180, 61, 0.18), transparent 70%);
  box-shadow:
    0 0 36px rgba(246, 180, 61, 0.32),
    0 0 68px rgba(126, 87, 255, 0.24),
    inset 0 0 28px rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: mahjongEffectPop 3.1s ease-out forwards;
}

.mahjong-effect-card span {
  color: #ffe8a6;
  font-size: clamp(64px, 9.5vw, 136px);
  font-weight: 1000;
  line-height: 0.98;
  text-shadow:
    0 0 12px rgba(255, 223, 140, 0.72),
    0 0 30px rgba(246, 180, 61, 0.5),
    0 0 54px rgba(191, 116, 255, 0.42);
}

.mahjong-effect-card strong {
  max-width: 100%;
  color: #dff8ff;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mahjong-effect-peng .mahjong-effect-card span,
.mahjong-effect-chi .mahjong-effect-card span,
.mahjong-effect-gang .mahjong-effect-card span {
  font-size: clamp(28px, 3vw, 44px);
}

.mahjong-effect-peng,
.mahjong-effect-chi,
.mahjong-effect-gang {
  animation-duration: 2s;
}

.mahjong-effect-peng::before,
.mahjong-effect-chi::before,
.mahjong-effect-gang::before {
  width: 24%;
  opacity: 0.64;
}

.mahjong-effect-peng::after,
.mahjong-effect-chi::after,
.mahjong-effect-gang::after {
  width: 15%;
}

.mahjong-effect-peng .mahjong-effect-ring,
.mahjong-effect-chi .mahjong-effect-ring,
.mahjong-effect-gang .mahjong-effect-ring {
  width: 11%;
}

.mahjong-effect-peng .mahjong-effect-card,
.mahjong-effect-chi .mahjong-effect-card,
.mahjong-effect-gang .mahjong-effect-card {
  min-width: min(238px, 34%);
  max-width: 36%;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow:
    0 0 24px rgba(246, 180, 61, 0.24),
    0 0 38px rgba(126, 87, 255, 0.18),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.mahjong-effect-peng .mahjong-effect-card strong,
.mahjong-effect-chi .mahjong-effect-card strong,
.mahjong-effect-gang .mahjong-effect-card strong {
  font-size: clamp(12px, 1.1vw, 14px);
}

.mahjong-effect-gang .mahjong-effect-card {
  border-color: rgba(191, 116, 255, 0.82);
  box-shadow:
    0 0 24px rgba(191, 116, 255, 0.26),
    0 0 38px rgba(246, 180, 61, 0.18);
}

.mahjong-effect i {
  position: absolute;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #ffd36b;
  box-shadow: 0 0 14px rgba(246, 180, 61, 0.86);
  animation: mahjongSparkle 2.3s ease-out forwards;
}

.mahjong-effect i:nth-of-type(1) { left: 28%; top: 36%; animation-delay: 0.08s; }
.mahjong-effect i:nth-of-type(2) { left: 67%; top: 34%; animation-delay: 0.18s; }
.mahjong-effect i:nth-of-type(3) { left: 35%; top: 63%; animation-delay: 0.28s; }
.mahjong-effect i:nth-of-type(4) { left: 72%; top: 58%; animation-delay: 0.38s; }

.mahjong-melds {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.mahjong-meld {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(246, 180, 61, 0.26);
  border-radius: 8px;
  background: rgba(2, 9, 17, 0.58);
}

.mahjong-meld > span {
  color: #ffd36b;
  font-size: 12px;
  font-weight: 900;
}

.mahjong-meld > div {
  display: flex;
  gap: 3px;
}

.mahjong-flowers {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(246, 180, 61, 0.26);
  border-radius: 8px;
  background: rgba(2, 9, 17, 0.58);
}

.mahjong-flowers > span {
  flex: 0 0 auto;
  color: #ffd36b;
  font-size: 12px;
  font-weight: 1000;
}

.mahjong-flowers > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mahjong-seat.human .mahjong-melds {
  width: 100%;
  gap: 5px;
}

.mahjong-seat.human .mahjong-flowers,
.mahjong-seat.human .mahjong-meld {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
  gap: 4px;
  padding: 3px 5px;
}

.mahjong-seat.human .mahjong-flowers > div,
.mahjong-seat.human .mahjong-meld > div {
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.mahjong-seat.human .mahjong-flowers > span,
.mahjong-seat.human .mahjong-meld > span {
  min-width: 18px;
  font-size: 11px;
}

.mahjong-seat.human .mahjong-human-side .mahjong-tile.small {
  width: clamp(18px, 1.48vw, 23px);
  height: clamp(25px, 2.08vw, 33px);
}

.mahjong-tile {
  position: relative;
  width: 52px;
  height: 73px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 5px 6px 8px;
  border: 1px solid #f4e7c8;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(180deg, #fff9e8 0%, #f5e7c4 72%, #d8c194 100%);
  color: #111827;
  font-weight: 900;
  box-shadow:
    inset 0 -5px 0 rgba(5, 118, 89, 0.45),
    inset 0 -8px 0 rgba(17, 147, 112, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.mahjong-tile.image-backed {
  padding: 0;
  border: 1px solid #f4e7c8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(180deg, #fffdf3 0%, #f4e7c6 72%, #d6be8f 100%);
  box-shadow:
    inset 0 -5px 0 rgba(5, 118, 89, 0.42),
    inset 0 -8px 0 rgba(17, 147, 112, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.mahjong-tile::after {
  content: "";
  position: absolute;
  inset: auto 5px 3px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d8f72, #37d0a3);
  opacity: 0.82;
}

.mahjong-tile.image-backed::after {
  display: block;
}

.mahjong-tile-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.32));
}

.mahjong-tile.suit-f .mahjong-tile-image {
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.32)) drop-shadow(0 0 9px rgba(246, 180, 61, 0.28));
}

.mahjong-tile-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 5px 6px 8px;
  opacity: 0;
}

.mahjong-tile.image-missing {
  border: 1px solid #f4e7c8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(180deg, #fff9e8 0%, #f5e7c4 72%, #d8c194 100%);
  box-shadow:
    inset 0 -5px 0 rgba(5, 118, 89, 0.45),
    inset 0 -8px 0 rgba(17, 147, 112, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.mahjong-tile.image-missing::after {
  display: block;
}

.mahjong-tile.image-missing .mahjong-tile-fallback {
  opacity: 1;
}

.mahjong-tile span {
  font-size: 23px;
  line-height: 1;
}

.mahjong-tile em {
  font-size: 11px;
  font-style: normal;
  color: rgba(17, 24, 39, 0.58);
}

.mahjong-number,
.mahjong-honor {
  font-size: 31px;
  line-height: 1;
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}

.mahjong-tile.red .mahjong-number,
.mahjong-tile.red .mahjong-honor {
  color: #d21f3c;
}

.mahjong-tile.green .mahjong-honor {
  color: #14835d;
}

.mahjong-pips,
.mahjong-sticks {
  width: 33px;
  min-height: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  gap: 2px;
}

.mahjong-pips i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ffffff, #0b7ad8 42%, #073f7d 100%);
  box-shadow: 0 0 0 1px rgba(4, 47, 94, 0.25);
}

.mahjong-sticks i {
  width: 6px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #42e59c, #0d8f63);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.mahjong-tile.drawn {
  transform: translateY(-4px);
}

.mahjong-tile.drawn .mahjong-tile-image {
  filter:
    drop-shadow(0 0 10px rgba(255, 211, 107, 0.58))
    drop-shadow(0 12px 18px rgba(246, 180, 61, 0.34));
}

.mahjong-tile.small {
  width: 38px;
  height: 53px;
  padding: 4px 4px 6px;
  border-radius: 5px;
}

.mahjong-tile.small .mahjong-number,
.mahjong-tile.small .mahjong-honor {
  font-size: 19px;
}

.mahjong-tile.small em {
  display: none;
}

.mahjong-tile.small .mahjong-pips,
.mahjong-tile.small .mahjong-sticks {
  width: 25px;
  min-height: 30px;
  gap: 1px;
}

.mahjong-tile.small .mahjong-pips i {
  width: 6px;
  height: 6px;
}

.mahjong-tile.small .mahjong-sticks i {
  width: 4px;
  height: 10px;
}

.mahjong-board .mahjong-tile {
  width: clamp(34px, 3.3vw, 50px);
  height: clamp(48px, 4.55vw, 70px);
}

.mahjong-board .mahjong-tile.small {
  width: clamp(22px, 2.05vw, 33px);
  height: clamp(31px, 2.9vw, 46px);
}

.mahjong-center .mahjong-river {
  gap: clamp(4px, 0.52vw, 7px);
  min-height: clamp(58px, 5.6vw, 82px);
}

.mahjong-center .mahjong-river .mahjong-tile {
  flex: 0 0 auto;
  width: clamp(42px, 3.7vw, 56px);
  height: clamp(59px, 5.15vw, 78px);
}

.mahjong-tile.clickable {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mahjong-tile.clickable:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 24px rgba(246, 180, 61, 0.26);
}

.mahjong-tile.latest-discard {
  z-index: 5;
  overflow: visible;
  border-color: #ffd36b;
  box-shadow:
    0 0 0 2px rgba(255, 211, 107, 0.78),
    0 0 18px rgba(246, 180, 61, 0.7),
    0 0 34px rgba(126, 87, 255, 0.36),
    inset 0 -5px 0 rgba(5, 118, 89, 0.45),
    inset 0 -8px 0 rgba(17, 147, 112, 0.22);
  animation: mahjongLatestDiscardPulse 1.45s ease-in-out infinite;
}

.mahjong-tile.latest-discard::before {
  content: "";
  position: absolute;
  inset: -9px;
  z-index: 1;
  border: 2px solid rgba(255, 211, 107, 0.76);
  border-radius: 13px;
  background:
    radial-gradient(circle, rgba(255, 211, 107, 0.3), rgba(126, 87, 255, 0.16) 54%, transparent 74%);
  pointer-events: none;
  animation: mahjongLatestDiscardAura 1.45s ease-in-out infinite;
}

.mahjong-tile.latest-discard .mahjong-tile-image {
  filter:
    drop-shadow(0 0 10px rgba(255, 211, 107, 0.92))
    drop-shadow(0 10px 16px rgba(0, 0, 0, 0.34));
}

.mahjong-back-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.mahjong-back {
  width: clamp(16px, 1.75vw, 24px);
  height: clamp(23px, 2.45vw, 34px);
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.mahjong-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28));
}

.mahjong-start {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 2;
  width: min(440px, 78%);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 0;
  margin-top: 0;
  padding: 26px;
  border: 1px solid rgba(246, 180, 61, 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(5, 12, 22, 0.94), rgba(7, 18, 28, 0.84));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.mahjong-start-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(34, 201, 131, 0.12);
  font-size: 44px;
}

.mahjong-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(246, 180, 61, 0.34);
  border-radius: 8px;
  background: rgba(246, 180, 61, 0.08);
}

.mahjong-end-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background:
    radial-gradient(circle at 50% 40%, rgba(246, 180, 61, 0.22), transparent 34%),
    radial-gradient(circle at 50% 64%, rgba(131, 61, 255, 0.16), transparent 42%),
    rgba(1, 5, 12, 0.82);
  backdrop-filter: blur(7px) saturate(1.16);
}

.mahjong-end-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 205, 84, 0.76);
  border-radius: 18px;
  padding: clamp(18px, 3vw, 30px);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 92, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(42, 5, 7, 0.98), rgba(58, 3, 7, 0.96) 58%, rgba(16, 8, 18, 0.98)),
    var(--surface);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.64),
    0 0 44px rgba(246, 180, 61, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.mahjong-end-scoreboard {
  position: relative;
}

.mahjong-end-ribbon {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 7px 18px;
  border: 1px solid rgba(255, 225, 128, 0.68);
  border-radius: 999px;
  color: #fff3c5;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(135deg, rgba(246, 180, 61, 0.32), rgba(138, 54, 211, 0.18));
  box-shadow: 0 0 24px rgba(246, 180, 61, 0.26);
}

.mahjong-end-head {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.mahjong-end-head span {
  color: #ffe7a5;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  text-shadow: 0 0 18px rgba(246, 180, 61, 0.7);
}

.mahjong-end-head strong {
  color: #ffffff;
  font-size: clamp(18px, 2.1vw, 26px);
}

.mahjong-end-head em,
.mahjong-end-status {
  color: var(--muted);
  font-style: normal;
}

.mahjong-end-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.mahjong-end-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 205, 84, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 205, 84, 0.05), rgba(3, 9, 20, 0.5)),
    rgba(3, 9, 20, 0.52);
}

.mahjong-end-summary small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mahjong-end-summary strong {
  display: block;
  overflow: hidden;
  color: #ffe074;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mahjong-end-detail {
  margin: 16px 0 0;
  color: #fff6d5;
  text-align: center;
  font-weight: 800;
}

.mahjong-end-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 20px 0;
  padding: 12px;
  border: 1px solid rgba(255, 205, 84, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 205, 84, 0.06), transparent),
    rgba(0, 0, 0, 0.26);
}

.mahjong-end-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.mahjong-end-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(3, 9, 20, 0.48);
}

.mahjong-end-row.winner {
  border-color: rgba(246, 180, 61, 0.62);
  background: rgba(246, 180, 61, 0.12);
}

.mahjong-end-row span {
  color: #ffd76a;
  font-size: 12px;
}

.mahjong-end-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mahjong-end-row em {
  font-style: normal;
  font-weight: 900;
}

.mahjong-end-row em.gain {
  color: #34f09b;
}

.mahjong-end-row em.loss {
  color: #ff6b78;
}

.mahjong-end-row em.even {
  color: var(--muted);
}

.mahjong-end-status {
  margin-top: 18px;
  text-align: center;
}

.mahjong-end-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 12px;
  margin-top: 20px;
}

.mahjong-end-actions button {
  min-height: 56px;
  border-radius: 10px;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    filter 0.16s ease;
}

.mahjong-end-actions .mahjong-end-primary {
  position: relative;
  border: 1px solid rgba(255, 236, 156, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 245, 171, 0.98), rgba(255, 190, 62, 0.98) 48%, rgba(184, 111, 21, 0.98)),
    #f6b43d;
  color: #190f04;
  font-size: 17px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
  box-shadow:
    0 14px 36px rgba(246, 180, 61, 0.34),
    0 0 0 1px rgba(255, 236, 156, 0.22) inset,
    0 -8px 22px rgba(130, 61, 255, 0.18) inset;
}

.mahjong-end-actions .mahjong-end-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 18px 44px rgba(246, 180, 61, 0.46),
    0 0 28px rgba(255, 217, 107, 0.26),
    0 0 0 1px rgba(255, 236, 156, 0.28) inset,
    0 -8px 22px rgba(130, 61, 255, 0.2) inset;
}

.mahjong-end-actions .mahjong-end-primary:active:not(:disabled) {
  transform: translateY(0);
}

.mahjong-end-actions .mahjong-end-primary:disabled {
  border-color: rgba(255, 205, 84, 0.3);
  background: linear-gradient(180deg, rgba(83, 72, 43, 0.72), rgba(48, 38, 28, 0.72));
  color: rgba(255, 231, 165, 0.66);
  box-shadow: none;
  cursor: wait;
}

.mahjong-end-actions .mahjong-end-ghost {
  border: 1px solid rgba(139, 160, 198, 0.3);
  background:
    linear-gradient(180deg, rgba(22, 32, 55, 0.92), rgba(11, 17, 31, 0.94)),
    rgba(15, 25, 44, 0.9);
  color: #d8e6ff;
}

.mahjong-end-actions .mahjong-end-ghost:hover {
  border-color: rgba(255, 205, 84, 0.36);
  color: #fff6d5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

@media (max-width: 680px) {
  .mahjong-end-summary,
  .mahjong-end-actions {
    grid-template-columns: 1fr;
  }
}

.hand-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.hand-panel.win {
  border-color: rgba(34, 201, 131, 0.46);
  box-shadow: inset 0 0 0 1px rgba(34, 201, 131, 0.08);
}

.hand-panel.lose {
  border-color: rgba(239, 68, 68, 0.46);
}

.hand-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(32px, 1fr));
  gap: 6px;
  align-items: center;
}

.playing-card {
  position: relative;
  width: min(100%, 52px);
  aspect-ratio: 0.72;
  display: grid;
  align-content: space-between;
  justify-items: start;
  justify-self: center;
  padding: 7px;
  border: 1px solid #dce6f7;
  border-radius: 7px;
  background: linear-gradient(160deg, #ffffff, #dce8fb);
  color: #0c1728;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  transform-style: preserve-3d;
}

.playing-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(98, 217, 238, 0.28), transparent 26%),
    repeating-linear-gradient(45deg, #182235 0 8px, #243149 8px 16px);
  box-shadow: inset 0 0 0 2px rgba(246, 180, 61, 0.26);
  opacity: 0;
  z-index: 4;
}

.hand-panel.revealing .playing-card {
  animation: cardDealReveal 1650ms ease both;
}

.hand-panel.revealing .playing-card:nth-child(1) { animation-delay: 0ms; }
.hand-panel.revealing .playing-card:nth-child(2) { animation-delay: 90ms; }
.hand-panel.revealing .playing-card:nth-child(3) { animation-delay: 180ms; }
.hand-panel.revealing .playing-card:nth-child(4) { animation-delay: 270ms; }
.hand-panel.revealing .playing-card:nth-child(5) { animation-delay: 360ms; }

.hand-panel.revealing .playing-card::before {
  animation: cardBackReveal 1550ms ease both;
}

.hand-panel.revealing p strong {
  animation: resultFadeIn 2050ms ease both;
}

.playing-card.red {
  color: #d21f3c;
}

.card-back-only {
  background: #111827;
}

.card-back-only::before {
  opacity: 1;
}

.card-rank {
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1;
}

.card-suit {
  justify-self: end;
  font-size: clamp(16px, 2.2vw, 22px);
  line-height: 1;
}

.thirteen-table {
  overflow: hidden;
}

.thirteen-shuffle {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 330px;
  margin-top: 16px;
  border: 1px solid rgba(246, 180, 61, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(246, 180, 61, 0.16), transparent 58%),
    rgba(11, 15, 24, 0.72);
  overflow: hidden;
}

.shuffle-table {
  position: relative;
  width: min(100%, 430px);
  height: 170px;
}

.shuffle-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  aspect-ratio: 0.72;
  border-radius: 7px;
  border: 1px solid rgba(246, 180, 61, 0.5);
  background:
    linear-gradient(135deg, rgba(98, 217, 238, 0.28), transparent 26%),
    repeating-linear-gradient(45deg, #182235 0 8px, #243149 8px 16px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%) rotate(calc((var(--i) - 6) * 6deg));
  animation: shuffleDeal 1150ms ease-in-out infinite;
  animation-delay: calc(var(--i) * 42ms);
}

.thirteen-empty {
  display: grid;
  gap: 14px;
  place-items: center;
  padding: 22px;
  margin-top: 16px;
  border: 1px dashed rgba(98, 217, 238, 0.25);
  border-radius: 8px;
  background: rgba(11, 15, 24, 0.66);
}

.thirteen-preview {
  width: min(100%, 620px);
  grid-template-columns: repeat(auto-fit, minmax(42px, 52px));
  justify-content: center;
  justify-items: center;
}

.thirteen-arrange {
  display: grid;
  gap: 14px;
}

.thirteen-lanes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.thirteen-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(246, 180, 61, 0.36);
  border-radius: 8px;
  background: rgba(246, 180, 61, 0.1);
  color: #ffd268;
}

.thirteen-summary span {
  color: var(--muted);
}

.thirteen-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.thirteen-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.thirteen-lane {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(11, 15, 24, 0.52);
}

.thirteen-lane.win {
  border-color: rgba(34, 201, 131, 0.5);
  box-shadow: inset 0 0 0 1px rgba(34, 201, 131, 0.08);
}

.thirteen-lane.lose {
  border-color: rgba(239, 68, 68, 0.5);
}

.thirteen-lane.tie {
  border-color: rgba(246, 180, 61, 0.42);
}

.thirteen-lane-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--accent);
}

.draft-lane {
  min-height: 150px;
}

.draft-lane .card-row,
.thirteen-side .card-row {
  grid-template-columns: repeat(auto-fit, minmax(42px, 52px));
  justify-content: start;
  justify-items: center;
}

.thirteen-empty > .muted,
.thirteen-preview > .muted,
.draft-lane .muted {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
  white-space: normal;
}

.draft-lane.active {
  border-color: rgba(246, 180, 61, 0.62);
  box-shadow: inset 0 0 0 1px rgba(246, 180, 61, 0.12), 0 0 18px rgba(246, 180, 61, 0.12);
}

.card-button {
  position: relative;
  width: clamp(42px, 8vw, 52px);
  aspect-ratio: 0.72;
  display: grid;
  align-content: space-between;
  justify-items: start;
  justify-self: center;
  padding: 7px;
  border: 1px solid #dce6f7;
  border-radius: 7px;
  background: linear-gradient(160deg, #ffffff, #dce8fb);
  color: #0c1728;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.card-button.red {
  color: #d21f3c;
}

.card-button.assigned {
  border-color: rgba(246, 180, 61, 0.85);
}

.card-button em {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.86);
  color: var(--accent);
  font-style: normal;
  font-size: 11px;
}

@keyframes shuffleDeal {
  0% {
    transform: translate(-50%, -50%) rotate(calc((var(--i) - 6) * 5deg));
  }
  34% {
    transform: translate(calc(-50% + (var(--i) - 6) * 18px), calc(-50% + ((var(--i) % 3) - 1) * 18px)) rotate(calc((var(--i) - 6) * 11deg));
  }
  68% {
    transform: translate(calc(-50% - (var(--i) - 6) * 12px), calc(-50% + (1 - (var(--i) % 3)) * 14px)) rotate(calc((6 - var(--i)) * 9deg));
  }
  100% {
    transform: translate(-50%, -50%) rotate(calc((var(--i) - 6) * 5deg));
  }
}

@keyframes slotFrame {
  0% { transform: translateY(-12px); filter: brightness(1.55) blur(1px); }
  56% { transform: translateY(10px); filter: brightness(1.2) blur(0.5px); }
  78% { transform: translateY(-4px); }
  100% { transform: translateY(0); filter: brightness(1) blur(0); }
}

@keyframes slotSymbol {
  0% { transform: translateY(-92px) scale(0.84); opacity: 0; }
  34% { opacity: 0.25; }
  62% { transform: translateY(18px) scale(1.08); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes slotGhost {
  0% { transform: translateY(-68px); opacity: 0.55; }
  50% { transform: translateY(0); opacity: 0.35; }
  100% { transform: translateY(72px); opacity: 0; }
}

@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) translateY(-18px); filter: blur(1px); }
  42% { transform: rotateX(220deg) rotateY(160deg) translateY(8px); }
  72% { transform: rotateX(360deg) rotateY(280deg) translateY(-4px); }
  100% { transform: rotateX(360deg) rotateY(360deg) translateY(0); filter: blur(0); }
}

@keyframes diceCoverReveal {
  0%, 54% { opacity: 1; transform: scale(1); }
  76% { opacity: 0.7; transform: scale(0.92) rotate(8deg); }
  100% { opacity: 0; transform: scale(0.78) rotate(18deg); }
}

@keyframes cardDealReveal {
  0% { transform: translateY(12px) rotateY(0deg) scale(0.94); }
  46% { transform: translateY(4px) rotateY(88deg) scale(0.98); }
  78% { transform: translateY(0) rotateY(0deg) scale(1.02); }
  100% { transform: translateY(0) rotateY(0deg) scale(1); }
}

@keyframes cardBackReveal {
  0%, 52% { opacity: 1; transform: rotateY(0deg); }
  74% { opacity: 0.85; transform: rotateY(88deg); }
  100% { opacity: 0; transform: rotateY(92deg); }
}

@keyframes resultFadeIn {
  0%, 72% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes mahjongEffectFade {
  0% { opacity: 0; }
  8% { opacity: 1; }
  76% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes mahjongEffectPop {
  0% { transform: translateY(16px) scale(0.82); opacity: 0; filter: blur(3px); }
  16% { transform: translateY(0) scale(1.08); opacity: 1; filter: blur(0); }
  34% { transform: translateY(0) scale(1); opacity: 1; }
  78% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-8px) scale(0.96); opacity: 0; }
}

@keyframes mahjongEffectRing {
  0% { transform: translate(-50%, -50%) scale(0.46); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.85); opacity: 0; }
}

@keyframes mahjongEffectSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.72); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(280deg) scale(1.08); opacity: 0; }
}

@keyframes mahjongSparkle {
  0% { transform: translateY(24px) scale(0.3) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-72px) scale(1.15) rotate(135deg); opacity: 0; }
}

@keyframes mahjongLatestDiscardPulse {
  0%, 100% {
    filter: brightness(1);
    transform: translateY(-2px) scale(1.04);
  }
  50% {
    filter: brightness(1.22);
    transform: translateY(-7px) scale(1.09);
  }
}

@keyframes mahjongLatestDiscardAura {
  0%, 100% {
    opacity: 0.5;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.13);
  }
}

@keyframes mahjongCountdownBeat {
  from {
    transform: scale(0.98);
  }
  to {
    transform: scale(1.05);
  }
}

@keyframes mahjongCountdownUrgent {
  from {
    transform: scale(0.94);
  }
  to {
    transform: scale(1.16);
  }
}

@media (max-width: 1280px) {
  .landing-hero {
    padding-inline: clamp(28px, 4vw, 52px);
  }

  .landing-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: clamp(26px, 3vw, 40px);
  }

  .landing-login-card {
    width: min(36vw, 420px);
  }
}

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

  .landing-hero {
    min-height: auto;
    padding-top: 92px;
  }

  .landing-hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .landing-hero-copy {
    grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
  }

  .landing-login-card {
    width: min(92vw, 500px);
    min-height: 0;
  }

  .landing-flow-grid,
  .landing-feature-grid,
  .landing-plan-grid {
    grid-template-columns: 1fr 1fr;
  }

  .main {
    margin-left: 0;
    padding: 18px;
    width: 100%;
    max-width: 100vw;
  }

  .sidebar {
    transform: translateX(-280px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .stats-grid,
  .grid-2,
  .grid-3,
  .niuniu-hands,
  .thirteen-board,
  .thirteen-lanes,
  .chat-layout {
    grid-template-columns: 1fr !important;
  }

  .mahjong-board {
    aspect-ratio: auto;
    min-height: 940px;
  }

  .mahjong-board-info {
    display: none;
  }

  .mahjong-lobby-hero,
  .mahjong-score-picker,
  .mahjong-lobby-toolbar,
  .mahjong-table-entrybar {
    grid-template-columns: 1fr;
  }

  .mahjong-lobby-summary {
    min-width: 0;
  }

  .mahjong-lobby-page {
    background:
      linear-gradient(180deg, rgba(5, 12, 20, 0.82), rgba(5, 9, 15, 0.94)),
      url("./mj-ui-layered-assets/backgrounds/lobby_bg_mobile.png") top center / cover no-repeat;
  }

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

  .mahjong-room-grid {
    grid-template-columns: 1fr;
  }

  .mahjong-room-card {
    min-height: 0;
  }

  .mahjong-room-card-foot {
    grid-template-columns: 1fr;
  }

  .mahjong-room-card-foot > button {
    width: 100%;
  }

  .mahjong-online-panel {
    grid-template-columns: 1fr;
  }

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

  .mahjong-online-actions {
    justify-content: stretch;
  }

  .mahjong-online-actions > button {
    flex: 1 1 150px;
  }

  .mahjong-seat.top {
    left: 5%;
    top: 3%;
    width: 90%;
    min-height: 142px;
  }

  .mahjong-seat.left {
    left: 4%;
    top: 21%;
    width: 44%;
    min-height: 210px;
  }

  .mahjong-seat.right {
    right: 4%;
    top: 21%;
    width: 44%;
    min-height: 210px;
  }

  .mahjong-center {
    left: 7%;
    top: 46%;
    width: 86%;
    min-height: 160px;
  }

  .mahjong-seat.human {
    left: 4%;
    right: 4%;
    bottom: 3%;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }

  .mahjong-seat.human .mahjong-hand {
    left: 14px;
    right: 14px;
    top: 86px;
  }

  .mahjong-seat.human .mahjong-actions {
    left: 14px;
    right: 14px;
    width: auto;
    min-width: 0;
    bottom: 12px;
    justify-content: center;
  }

  .mahjong-seat.human .mahjong-claim-wheel {
    justify-content: center;
    flex-wrap: wrap;
  }

  .mahjong-seat.human .mahjong-human-side {
    left: 14px;
    right: 14px;
    top: 47px;
    width: auto;
    max-width: none;
  }

  .mahjong-character.left,
  .mahjong-character.right {
    width: 180px;
    opacity: 0.48;
  }

  .mahjong-character.top {
    width: 160px;
    opacity: 0.45;
  }

  .mahjong-tile {
    width: 44px;
    height: 62px;
  }

  .mahjong-tile.small {
    width: 30px;
    height: 42px;
  }

  .mahjong-drawn-slot {
    width: 72px;
    min-height: 70px;
  }

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

  .casino-dice-page.chat-layout,
  .casino-dice-hero,
  .casino-dice-grid,
  .casino-dice-grid.secondary,
  .casino-table-felt {
    grid-template-columns: 1fr;
  }

  .casino-chat-shell {
    position: static;
  }

  .casino-chat-shell .chat-box {
    min-height: 360px;
  }

  .casino-table-topline,
  .dice-last-summary {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .casino-table-tag {
    justify-content: center;
    width: 100%;
  }

  .game-banker-panel,
  .casino-banker-console {
    grid-template-columns: 1fr;
  }

  .casino-online-head,
  .casino-room-card {
    grid-template-columns: 1fr;
  }

  .casino-online-actions {
    justify-content: stretch;
  }

  .casino-online-actions button,
  .casino-room-card button {
    width: 100%;
  }

  .casino-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .casino-chip-bar > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
  }

  .balance-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding: 24px 16px;
  }

  .landing-hero {
    min-height: auto;
    padding: 94px 18px 92px;
    background:
      linear-gradient(180deg, rgba(5, 8, 13, 0.9) 0%, rgba(5, 8, 13, 0.74) 64%, rgba(5, 8, 13, 0.5) 100%),
      var(--hero-image) center / cover no-repeat;
  }

  .landing-nav {
    inset: 16px 18px auto;
    align-items: flex-start;
  }

  .landing-nav div {
    justify-content: flex-end;
  }

  .landing-hero-copy {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .landing-emblem {
    grid-row: auto;
    width: min(64vw, 260px);
  }

  .landing-proof-list {
    grid-column: auto;
  }

  .landing-login-card {
    width: min(94vw, 430px);
    min-height: 0;
    margin: 18px auto 34px;
    padding: 0;
  }

  .landing-bottom-nav {
    inset: auto 18px 16px;
    gap: 14px 24px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .landing-section {
    width: calc(100% - 28px);
    padding: 42px 0;
  }

  .landing-flow-grid,
  .landing-feature-grid,
  .landing-plan-grid,
  .trial-strip,
  .webhook-status,
  .webhook-actions {
    grid-template-columns: 1fr;
  }

  .trial-strip {
    display: grid;
  }

  .webhook-hint {
    display: grid;
  }

  .landing-feature {
    grid-template-columns: 40px 1fr;
  }

  .landing-feature > span {
    width: 40px;
    height: 40px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .brand-copy h1 {
    font-size: 32px;
  }

  .modal-foot,
  .radio-grid,
  .list-row {
    grid-template-columns: 1fr;
  }

  .toolbar .input {
    max-width: none;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .panel-header,
  .auction-foot {
    align-items: stretch;
  }

  .topbar,
  .panel-header,
  .toolbar,
  .auction-foot,
  .number-row {
    flex-wrap: wrap;
  }

  .status-tabs,
  .tabs {
    grid-template-columns: 1fr 1fr !important;
  }

  .balance-chip,
  .status-tabs .tab,
  .tabs .tab,
  .casino-choice,
  .casino-chip,
  .pill,
  .secondary-btn,
  .primary-btn,
  .danger-btn,
  .ghost-btn {
    min-width: 0;
  }

  .digit {
    width: clamp(44px, 14vw, 58px);
    height: clamp(54px, 18vw, 70px);
    font-size: clamp(22px, 8vw, 32px);
  }

  .casino-dice-hero,
  .casino-hud-grid,
  .casino-table-felt,
  .casino-banker-console,
  .casino-choice-grid,
  .casino-chip-bar > div {
    grid-template-columns: 1fr;
  }

  .casino-title-lockup {
    min-height: 104px;
    padding: 16px;
  }

  .casino-title-lockup img {
    width: 46px;
    height: 46px;
  }

  .casino-hud-card {
    min-height: 92px;
    padding: 14px;
  }

  .casino-table-shell,
  .casino-table-felt,
  .casino-panel {
    padding: 12px;
  }

  .casino-dice-board {
    min-height: 146px;
    gap: 12px;
    padding: 24px 10px;
  }

  .dice-cup-mark {
    width: 34px;
    height: 34px;
  }

  .casino-die {
    width: clamp(56px, 22vw, 76px);
  }

  .casino-choice {
    min-height: 76px;
  }

  .casino-chip,
  .casino-action-btn,
  .casino-gold-btn {
    min-height: 52px;
  }

  .casino-action-btn {
    min-height: 68px;
  }

  .dice-road-scroll {
    min-height: 88px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .dice-road-bead {
    flex: 0 0 44px;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 920px) {
  .mahjong-mode-panel,
  .mahjong-session-panel {
    grid-template-columns: 1fr;
  }

  .mahjong-mode-options {
    grid-template-columns: 1fr;
  }

  .mahjong-score-options {
    grid-template-columns: 1fr;
  }
}
