:root {
  --bg0: #05070c;
  --bg1: #09111d;
  --panel: rgba(12, 19, 31, 0.72);
  --panel2: rgba(18, 28, 43, 0.86);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f4f8ff;
  --soft: #9baac1;
  --emerald: #35e4a2;
  --cyan: #54dcff;
  --gold: #f4c85b;
  --violet: #a478ff;
  --danger: #ff5570;
  --card-w: 108px;
  --ui-scale: 1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --theme-aura:
    radial-gradient(circle at 16% 12%, rgba(53, 228, 162, 0.16), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(84, 220, 255, 0.14), transparent 24%),
    radial-gradient(circle at 56% 92%, rgba(244, 200, 91, 0.1), transparent 28%);
  --table-edge: rgba(244, 200, 91, 0.26);
  --button-glow: rgba(53, 228, 162, 0.22);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body,
.game-app,
.table-arena,
.battle-zone,
.hand-zone,
.hand-card,
.table-card,
.deck-pile,
button,
a {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--theme-aura), linear-gradient(145deg, var(--bg0), var(--bg1) 52%, #06120f);
  overflow-x: hidden;
  font-size: calc(15px * var(--ui-scale));
}

body {
  min-height: 100vh;
  transition: background 0.22s ease, color 0.22s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.38;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255,255,255,0.05) 44%, transparent 54%),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08), transparent 38%);
  mix-blend-mode: screen;
}

body[data-theme="light"] {
  --bg0: #f3f7fb;
  --bg1: #dfeaf4;
  --panel: rgba(255, 255, 255, 0.78);
  --panel2: rgba(255, 255, 255, 0.9);
  --line: rgba(13, 31, 49, 0.14);
  --text: #102033;
  --soft: #526172;
  --emerald: #14875c;
  --cyan: #147ca3;
  --gold: #b7791f;
  --button-glow: rgba(20, 124, 163, 0.18);
  --theme-aura:
    radial-gradient(circle at 12% 12%, rgba(20, 135, 92, 0.16), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(20, 124, 163, 0.18), transparent 28%),
    radial-gradient(circle at 56% 88%, rgba(183, 121, 31, 0.12), transparent 30%);
  background: linear-gradient(145deg, #f8fbff, #dcebf7 54%, #e9f6ef);
}

body[data-theme="dark"] {
  --bg0: #05070c;
  --bg1: #101827;
  --emerald: #2bd995;
  --cyan: #6dd8ff;
  --gold: #f6c45d;
}

body[data-theme="emerald"],
body[data-theme="emerald_night"] {
  --bg0: #03100c;
  --bg1: #09251d;
  --panel: rgba(9, 26, 21, 0.76);
  --panel2: rgba(14, 38, 30, 0.9);
  --emerald: #35e4a2;
  --cyan: #56d8c7;
  --gold: #f4c85b;
  --violet: #82e7bb;
  --theme-aura:
    radial-gradient(circle at 18% 16%, rgba(53, 228, 162, 0.2), transparent 27%),
    radial-gradient(circle at 82% 8%, rgba(244, 200, 91, 0.13), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(17, 87, 62, 0.45), transparent 44%);
}

body[data-theme="cyber"],
body[data-theme="cyber_neon"] {
  --bg0: #020617;
  --bg1: #071a33;
  --emerald: #58f5d3;
  --cyan: #38bdf8;
  --gold: #a78bfa;
  --violet: #c084fc;
  --button-glow: rgba(56, 189, 248, 0.26);
  --theme-aura:
    linear-gradient(90deg, rgba(56,189,248,0.08) 1px, transparent 1px) 0 0/46px 46px,
    linear-gradient(0deg, rgba(192,132,252,0.06) 1px, transparent 1px) 0 0/46px 46px,
    radial-gradient(circle at 82% 14%, rgba(192,132,252,0.23), transparent 26%),
    radial-gradient(circle at 18% 18%, rgba(56,189,248,0.22), transparent 28%);
}

body[data-theme="neon"],
body[data-theme="retro_arcade"] {
  --bg0: #09030f;
  --bg1: #150922;
  --emerald: #4ade80;
  --cyan: #22d3ee;
  --gold: #f472b6;
  --violet: #c084fc;
  --theme-aura:
    radial-gradient(circle at 18% 16%, rgba(34,211,238,0.24), transparent 28%),
    radial-gradient(circle at 78% 12%, rgba(244,114,182,0.22), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,0.035) 50%, transparent 50%) 0 0/100% 5px;
}

body[data-theme="classic"],
body[data-theme="classic_casino"] {
  --bg0: #0d1410;
  --bg1: #16251d;
  --emerald: #2e8f60;
  --cyan: #8ac7cf;
  --gold: #d8b15f;
  --theme-aura:
    radial-gradient(circle at 20% 16%, rgba(216,177,95,0.16), transparent 30%),
    radial-gradient(circle at 80% 8%, rgba(46,143,96,0.16), transparent 28%),
    linear-gradient(135deg, rgba(92,55,20,0.24), transparent 48%);
}

body[data-theme="royal_gold"] {
  --bg0: #080704;
  --bg1: #1b1306;
  --panel: rgba(20, 16, 10, 0.8);
  --panel2: rgba(32, 23, 9, 0.92);
  --emerald: #e0b84d;
  --cyan: #fff0a8;
  --gold: #ffd166;
  --violet: #b7791f;
  --button-glow: rgba(255, 209, 102, 0.28);
  --theme-aura:
    radial-gradient(circle at 20% 12%, rgba(255,209,102,0.2), transparent 26%),
    radial-gradient(circle at 78% 15%, rgba(255,240,168,0.15), transparent 25%),
    linear-gradient(145deg, rgba(64,42,10,0.4), transparent 50%);
}

body[data-theme="frost_ice"] {
  --bg0: #05111f;
  --bg1: #102c43;
  --panel: rgba(12, 34, 52, 0.68);
  --panel2: rgba(18, 50, 75, 0.86);
  --emerald: #a7f3ff;
  --cyan: #65d8ff;
  --gold: #d7f5ff;
  --violet: #b7d8ff;
  --button-glow: rgba(101, 216, 255, 0.26);
  --theme-aura:
    radial-gradient(circle at 16% 14%, rgba(167,243,255,0.24), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(183,216,255,0.18), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 42%);
}

body[data-theme="retro_arcade"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.16) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

button, input, select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input, select {
  width: 100%;
  min-height: 42px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

select option {
  color: #f4f8ff;
  background: #101827;
}

select option:checked,
select option:hover {
  color: #06110d;
  background: #35e4a2;
}

input:focus, select:focus {
  border-color: rgba(84, 220, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(84, 220, 255, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 0.86rem;
}

.hidden { display: none !important; }

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.62;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(135%);
}

.loading-screen, .auth-scene {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
}

.loading-screen {
  background:
    radial-gradient(circle at center, rgba(25, 44, 64, 0.65), rgba(3, 5, 8, 0.92)),
    url("../../../assets/textures/dark-table.svg") center/cover;
}

.loading-camera {
  width: min(960px, 94vw);
  display: grid;
  grid-template-columns: minmax(260px, 460px) 1fr;
  align-items: center;
  gap: min(8vw, 90px);
  animation: cameraFloat 5s ease-in-out infinite;
}

@keyframes cameraFloat {
  50% { transform: translateY(-10px) scale(1.01); }
}

.brand-orbit {
  height: 360px;
  position: relative;
  perspective: 900px;
}

.brand-orbit img {
  position: absolute;
  width: 165px;
  border-radius: 12px;
  filter: drop-shadow(0 28px 42px rgba(0, 0, 0, 0.58));
  animation: orbitCard 4.8s ease-in-out infinite;
}

.brand-orbit img:nth-child(1) { left: 44%; top: 74px; transform: rotate(-12deg); }
.brand-orbit img:nth-child(2) { left: 19%; top: 112px; animation-delay: 0.22s; }
.brand-orbit img:nth-child(3) { left: 59%; top: 128px; animation-delay: 0.44s; }

@keyframes orbitCard {
  50% { translate: 0 -18px; filter: drop-shadow(0 38px 50px rgba(53, 228, 162, 0.24)); }
}

.loading-copy h1, .auth-showcase h1 {
  margin: 12px 0 8px;
  font-size: clamp(2.8rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.loading-copy p, .auth-showcase p {
  max-width: 560px;
  margin: 0 0 20px;
  color: var(--soft);
  font-size: 1.05rem;
}

.version-chip, .vip-badge, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #06110d;
  background: linear-gradient(135deg, var(--gold), var(--emerald));
  font-weight: 900;
  font-size: 0.78rem;
}

.loading-progress {
  height: 8px;
  width: min(520px, 76vw);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loading-progress i {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--emerald), var(--gold));
  box-shadow: 0 0 22px rgba(84, 220, 255, 0.55);
  transition: width 0.4s ease;
}

#serverStatus {
  display: block;
  margin-top: 10px;
  color: var(--emerald);
}

.auth-scene {
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 460px);
  gap: min(7vw, 86px);
  background:
    linear-gradient(90deg, rgba(3, 6, 10, 0.86), rgba(3, 6, 10, 0.28)),
    url("../../../assets/textures/dark-table.svg") center/cover;
}

.logo-mark {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #06110d;
  background: linear-gradient(135deg, var(--gold), var(--emerald), var(--cyan));
  font-weight: 1000;
  box-shadow: 0 0 42px rgba(84, 220, 255, 0.32);
}

.showcase-table {
  height: 220px;
  display: flex;
  align-items: center;
}

.showcase-table img {
  width: 132px;
  margin-right: -42px;
  border-radius: 10px;
  filter: drop-shadow(0 28px 36px rgba(0, 0, 0, 0.52));
  transform: rotate(var(--r, 0deg));
}

.showcase-table img:nth-child(1) { --r: -14deg; }
.showcase-table img:nth-child(2) { --r: 4deg; }
.showcase-table img:nth-child(3) { --r: 18deg; }

.auth-card {
  width: min(460px, 94vw);
  border-radius: 14px;
  padding: 22px;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-status span {
  color: var(--emerald);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.segmented button, .scene-tabs button, .icon-pill {
  color: var(--text);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
}

.segmented button {
  min-height: 38px;
}

.segmented button.active, .scene-tabs button.active {
  color: #07110e;
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  font-weight: 900;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.primary-cta, .secondary-cta, .ghost-cta, .danger-cta, .link-cta {
  --btn-h: 40px;
  min-width: 0;
  max-width: 100%;
  min-height: var(--btn-h);
  border-radius: var(--btn-radius, 8px);
  padding: 0 clamp(11px, 1.1vw, 16px);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  font-weight: 850;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  contain: paint;
}

.primary-cta {
  color: #06110d;
  background: linear-gradient(135deg, var(--emerald), var(--gold));
  font-weight: 900;
  box-shadow: 0 16px 28px var(--button-glow);
}

.secondary-cta {
  background: rgba(84, 220, 255, 0.16);
  border: 1px solid rgba(84, 220, 255, 0.28);
}

.ghost-cta, .link-cta {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.link-cta {
  min-height: 30px;
  color: var(--soft);
  background: transparent;
  border: 0;
}

.danger-cta {
  background: rgba(255, 85, 112, 0.2);
  border: 1px solid rgba(255, 85, 112, 0.4);
}

.primary-cta.compact, .secondary-cta.compact, .ghost-cta.compact, .danger-cta.compact {
  --btn-h: 34px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.primary-cta.wide, .secondary-cta.wide, .ghost-cta.wide {
  width: 100%;
}

body[data-theme="classic_casino"] {
  --btn-radius: 7px;
}

body[data-theme="classic_casino"] .primary-cta,
body[data-theme="classic_casino"] .meta-tabs button.active {
  background: linear-gradient(135deg, #f2c85d, #287b55);
  box-shadow: 0 0 0 1px rgba(242, 200, 93, .4), 0 16px 34px rgba(242, 200, 93, .16);
}

body[data-theme="cyber_neon"] .primary-cta,
body[data-theme="cyber_neon"] .meta-tabs button.active {
  background: linear-gradient(135deg, #38bdf8, #c084fc);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .46), 0 0 32px rgba(56, 189, 248, .26);
}

body[data-theme="royal_gold"] .primary-cta,
body[data-theme="royal_gold"] .meta-tabs button.active {
  background: linear-gradient(135deg, #fff0a8, #ffd166 45%, #7a4b12);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, .55), 0 18px 36px rgba(255, 209, 102, .18);
}

body[data-theme="frost_ice"] .primary-cta,
body[data-theme="frost_ice"] .meta-tabs button.active {
  background: linear-gradient(135deg, #e6fbff, #65d8ff);
  box-shadow: 0 0 0 1px rgba(167, 243, 255, .45), 0 0 34px rgba(101, 216, 255, .22);
}

body[data-theme="retro_arcade"] .primary-cta,
body[data-theme="retro_arcade"] .meta-tabs button.active {
  background: linear-gradient(135deg, #22d3ee, #f472b6);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, .52), 0 0 30px rgba(244, 114, 182, .24);
}

.primary-cta:hover, .secondary-cta:hover, .ghost-cta:hover, .danger-cta:hover, .icon-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.primary-cta:active, .secondary-cta:active, .ghost-cta:active, .danger-cta:active, .icon-pill:active {
  transform: translateY(1px) scale(0.99);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35);
  transform: none !important;
}

.game-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: 76px minmax(0, 1fr) 178px;
  grid-template-areas:
    "top top"
    "scene rail"
    "dock rail";
  gap: 14px;
  padding: 14px;
}

.top-hud {
  grid-area: top;
  display: grid;
  grid-template-columns: auto minmax(240px, 330px) auto 1fr auto;
  align-items: center;
  gap: 16px;
  border-radius: 12px;
  padding: 0 14px;
}

.portal-back {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 1000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.player-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-ring {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06110d;
  font-weight: 1000;
  background: conic-gradient(from 180deg, var(--gold), var(--emerald), var(--cyan), var(--violet), var(--gold));
  box-shadow: 0 0 28px rgba(84, 220, 255, 0.24);
  position: relative;
  overflow: visible;
}

.avatar-ring img,
.avatar-ring span {
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  display: grid;
  place-items: center;
  border-radius: inherit;
}

.avatar-ring img {
  object-fit: cover;
  background: #07111d;
}

body.is-premium .player-card-mini .avatar-ring,
.premium-seat .avatar-ring {
  background: conic-gradient(from 180deg, #fff1a8, #f4c85b, #35e4a2, #54dcff, #fff1a8);
  box-shadow: 0 0 0 2px rgba(244, 200, 91, 0.72), 0 0 42px rgba(244, 200, 91, 0.42);
  animation: premiumFrame 3s linear infinite;
}

body.is-premium #topNickname {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(244, 200, 91, 0.5);
}

.vip-badge.active {
  color: #06110d;
  background: linear-gradient(135deg, #fff1a8, var(--gold), var(--emerald));
  box-shadow: 0 0 30px rgba(244, 200, 91, 0.28);
}

@keyframes premiumFrame {
  to { filter: hue-rotate(18deg); }
}

body[data-frame="cyan"] .avatar-ring,
body[data-frame="cyan"] .big-avatar {
  box-shadow: 0 0 0 2px rgba(84, 220, 255, 0.5), 0 0 34px rgba(84, 220, 255, 0.38);
}

body[data-frame="gold"] .avatar-ring,
body[data-frame="gold"] .big-avatar {
  background: conic-gradient(from 180deg, #fff1a8, #f4c85b, #b7791f, #fff1a8);
  box-shadow: 0 0 0 2px rgba(244, 200, 91, 0.58), 0 0 40px rgba(244, 200, 91, 0.36);
}

body[data-frame="hexagon"] .avatar-ring,
.frame-hexagon .avatar-frame-layer {
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

body[data-frame="crystal"] .avatar-ring,
.frame-crystal .avatar-frame-layer {
  clip-path: polygon(50% 0, 90% 14%, 100% 50%, 82% 92%, 50% 100%, 18% 92%, 0 50%, 10% 14%);
}

body[data-frame="cyber"] .avatar-ring,
body[data-frame="lightning"] .avatar-ring,
.frame-cyber .avatar-frame-layer,
.frame-lightning .avatar-frame-layer {
  box-shadow: 0 0 0 2px rgba(56,189,248,.58), 0 0 34px rgba(56,189,248,.44);
}

body[data-frame="royal"] .avatar-ring,
.frame-royal .avatar-frame-layer {
  box-shadow: 0 0 0 2px rgba(255,209,102,.74), 0 0 42px rgba(255,209,102,.45);
}

body[data-frame="fire"] .avatar-ring,
.frame-fire .avatar-frame-layer {
  box-shadow: 0 0 0 2px rgba(255,115,64,.7), 0 0 42px rgba(255,85,112,.46);
}

body[data-frame="neon"] .avatar-ring,
.frame-neon .avatar-frame-layer {
  animation: premiumFrame 2.4s linear infinite;
  box-shadow: 0 0 0 2px rgba(84,220,255,.68), 0 0 44px rgba(164,120,255,.46);
}

.xp-line {
  width: 180px;
  height: 6px;
  overflow: hidden;
  margin: 5px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.xp-line i {
  display: block;
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
}

.top-hud small, .soft {
  color: var(--soft);
}

.wallet-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wallet-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scene-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.scene-tabs button {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.hud-actions {
  display: flex;
  gap: 8px;
}

.icon-pill {
  min-height: 38px;
  padding: 0 12px;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-pill.danger {
  border-color: rgba(255, 85, 112, 0.32);
}

.scene {
  grid-area: scene;
  min-width: 0;
  min-height: 0;
  display: none;
}

.scene.active {
  display: grid;
}

.right-rail {
  grid-area: rail;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  padding: 14px;
}

.bottom-dock {
  grid-area: dock;
  min-height: 0;
  border-radius: 12px;
  padding: 12px;
}

.hub-scene {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr);
  gap: 14px;
}

.hero-panel {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 16px;
  padding: clamp(20px, 4vw, 42px);
  background:
    linear-gradient(90deg, rgba(6, 11, 18, 0.82), rgba(6, 11, 18, 0.22)),
    url("../../../assets/textures/dark-table.svg") center/cover;
  border: 1px solid rgba(244, 200, 91, 0.18);
}

.hero-panel h2 {
  margin: 12px 0 12px;
  max-width: 720px;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-panel p {
  max-width: 560px;
  color: var(--soft);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.floating-cards {
  position: absolute;
  right: 4%;
  bottom: -18px;
  width: 330px;
  height: 320px;
  pointer-events: none;
}

.floating-cards img {
  position: absolute;
  width: 132px;
  border-radius: 10px;
  filter: drop-shadow(0 26px 32px rgba(0, 0, 0, 0.45));
}

.floating-cards img:nth-child(1) { left: 0; top: 74px; rotate: -14deg; }
.floating-cards img:nth-child(2) { left: 92px; top: 22px; rotate: 5deg; }
.floating-cards img:nth-child(3) { left: 186px; top: 88px; rotate: 17deg; }

.hub-grid, .feature-grid, .shop-grid, .achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}

.mode-card, .mini-card, .room-card, .profile-panel, .setting-panel, .shop-item, .achievement-item, .leader-item {
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  border: 1px solid var(--line);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

.meta-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tabs button {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 184px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-tabs button.active {
  color: #06110d;
  background: linear-gradient(135deg, var(--gold), var(--emerald));
  font-weight: 900;
}

.catalog-card {
  min-height: 220px;
  display: grid;
  gap: 10px;
  align-content: space-between;
  padding: 14px;
}

.catalog-preview {
  min-height: 104px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.16), transparent 44%),
    linear-gradient(135deg, rgba(84,220,255,0.15), rgba(53,228,162,0.1));
  border: 1px solid rgba(255,255,255,0.1);
}

.catalog-preview img {
  width: 70px;
  border-radius: 7px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 18px 22px rgba(0,0,0,0.38));
}

.catalog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-actions button {
  flex: 1 1 118px;
  min-width: min(118px, 100%);
  max-width: 100%;
}

.leader-row, .notification-row, .tournament-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.065);
  border: 1px solid rgba(255,255,255,0.08);
}

.mode-card {
  min-height: 138px;
  display: grid;
  align-content: space-between;
  padding: 16px;
  text-align: left;
}

.mode-card b {
  display: block;
  font-size: 1.05rem;
}

.mode-card span {
  color: var(--soft);
  font-size: 0.86rem;
}

.side-stack {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
}

.daily-card, .event-card {
  padding: 16px;
  border-radius: 12px;
}

.lobby-scene {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.lobby-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(120px, 170px)) auto;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
}

.rooms-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
}

.room-card {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(5, minmax(92px, auto)) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.room-card h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.room-card small {
  color: var(--soft);
}

.room-stat {
  color: var(--soft);
  font-size: 0.84rem;
}

.room-stat b {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
}

.table-scene {
  grid-template-rows: minmax(520px, 1fr) auto auto;
  gap: 12px;
}

.table-arena {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at center, rgba(53, 228, 162, 0.16), transparent 42%),
    url("../../../assets/textures/felt.svg"),
    linear-gradient(145deg, #123b2d, #081410 78%);
  border: 1px solid rgba(244, 200, 91, 0.26);
  box-shadow: inset 0 35px 95px rgba(255, 255, 255, 0.05), inset 0 -60px 120px rgba(0, 0, 0, 0.52), 0 28px 80px rgba(0, 0, 0, 0.36);
  contain: layout paint;
}

body[data-table="classic"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(53, 228, 162, 0.1), transparent 44%), url("../../../assets/textures/felt.svg"), linear-gradient(145deg, #17432f, #0b1711 78%);
}

body[data-table="emerald"] .table-arena,
body[data-theme="emerald_night"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(53, 228, 162, 0.18), transparent 43%), url("../../../assets/textures/felt.svg"), linear-gradient(145deg, #104532, #06110e 78%);
}

body[data-table="poker"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(244, 200, 91, 0.14), transparent 45%), url("../../../assets/textures/felt.svg"), linear-gradient(145deg, #173c31, #07110e 78%);
}

body[data-table="cyber"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(84, 220, 255, 0.22), transparent 43%), linear-gradient(135deg, rgba(84,220,255,0.09) 25%, transparent 25%) 0 0/26px 26px, linear-gradient(145deg, #08152a, #020713 78%);
}

body[data-theme="cyber_neon"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(84, 220, 255, 0.24), transparent 43%), linear-gradient(90deg, rgba(84,220,255,0.12) 1px, transparent 1px) 0 0/30px 30px, linear-gradient(0deg, rgba(164,120,255,0.1) 1px, transparent 1px) 0 0/30px 30px, linear-gradient(145deg, #07152a, #020713 78%);
}

body[data-table="royal"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(244, 200, 91, 0.25), transparent 44%), url("../../../assets/textures/dark-table.svg"), linear-gradient(145deg, #33240a, #0b0905 78%);
}

body[data-theme="royal_gold"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.29), transparent 44%), url("../../../assets/textures/dark-table.svg"), linear-gradient(145deg, #3a2708, #080604 78%);
  border-color: rgba(255, 209, 102, 0.42);
}

body[data-table="dark"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(164, 120, 255, 0.14), transparent 44%), linear-gradient(145deg, #111827, #030712 78%);
}

body[data-theme="frost_ice"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(167, 243, 255, 0.25), transparent 43%), linear-gradient(135deg, rgba(255,255,255,0.08) 25%, transparent 25%) 0 0/38px 38px, linear-gradient(145deg, #10334d, #05111f 78%);
  border-color: rgba(167, 243, 255, 0.36);
}

body[data-theme="retro_arcade"] .table-arena {
  background: radial-gradient(ellipse at center, rgba(244, 114, 182, 0.22), transparent 43%), linear-gradient(90deg, rgba(34,211,238,0.11) 1px, transparent 1px) 0 0/34px 34px, linear-gradient(145deg, #180824, #07030d 78%);
  border-color: rgba(244, 114, 182, 0.34);
}

.table-arena::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 200, 91, 0.18), transparent 58%);
  filter: blur(12px);
  animation: feltPulse 5s ease-in-out infinite;
}

@keyframes feltPulse {
  50% { opacity: 0.52; scale: 1.04; }
}

.seats-layer {
  position: absolute;
  inset: 0;
}

.seat {
  position: absolute;
  width: min(220px, 29vw);
  min-height: 72px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(4, 8, 12, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: visible;
  contain: layout style;
}

.seat.attacker { border-color: rgba(244, 200, 91, 0.58); box-shadow: 0 0 28px rgba(244, 200, 91, 0.16); }
.seat.defender { border-color: rgba(255, 85, 112, 0.58); box-shadow: 0 0 28px rgba(255, 85, 112, 0.16); }
.seat.offline { opacity: 0.55; }

.seat-0 { left: 50%; bottom: 16px; transform: translateX(-50%); }
.seat-1 { right: 18px; bottom: 28%; }
.seat-2 { right: 11%; top: 18px; }
.seat-3 { left: 50%; top: 16px; transform: translateX(-50%); }
.seat-4 { left: 11%; top: 18px; }
.seat-5 { left: 18px; bottom: 28%; }

.seat-name {
  min-width: 0;
  overflow: hidden;
}

.seat-name b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-name small {
  color: var(--soft);
}

.cards-left {
  min-width: 34px;
  color: var(--gold);
  font-weight: 1000;
  text-align: center;
}

.opponent-hand {
  grid-column: 1 / -1;
  position: relative;
  height: 36px;
  display: block;
  margin: 2px 0 -4px;
  pointer-events: none;
  contain: layout paint;
}

.opponent-hand i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  aspect-ratio: 0.714;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.34);
  transform: translateX(calc(-50% + var(--x))) rotate(var(--r));
  transform-origin: bottom center;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.opponent-hand.active i {
  filter: drop-shadow(0 0 8px rgba(244, 200, 91, 0.44));
}

.deck-zone {
  position: absolute;
  left: 6%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}

.deck-pile, .trump-card, .hand-card, .table-card {
  width: var(--card-w);
  aspect-ratio: 0.714;
}

.deck-pile {
  position: relative;
  perspective: 560px;
  transform-style: preserve-3d;
}

.deck-stack {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.deck-layer {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background-size: cover;
  background-position: center;
  opacity: var(--opacity);
  transform: translate3d(var(--shift), calc(var(--shift) * -0.72), 0) rotate(-1.5deg);
  box-shadow:
    0 18px 32px rgba(0, 0, 0, 0.42),
    inset -4px -2px 0 rgba(0, 0, 0, 0.18),
    inset 3px 2px 0 rgba(255, 255, 255, 0.22);
  will-change: transform;
}

.deck-pile.empty .deck-stack {
  opacity: 0;
  transform: translateY(8px) scale(0.88);
}

.deck-pile.empty #deckCounter {
  opacity: 0;
  transform: scale(0.75);
}

.trump-card img, .hand-card img, .table-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.44);
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.deck-pile span {
  position: absolute;
  right: -8px;
  bottom: -8px;
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #06110d;
  background: var(--gold);
  font-weight: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.trump-card {
  rotate: 90deg;
  filter: drop-shadow(0 0 22px rgba(244, 200, 91, 0.38));
  z-index: 2;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.battle-zone {
  position: absolute;
  inset: 27% 18% 26% 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 22px);
  flex-wrap: wrap;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.battle-zone.drop-ready {
  background: rgba(84, 220, 255, 0.08);
  border-color: rgba(84, 220, 255, 0.32);
}

.battle-pair {
  position: relative;
  width: calc(var(--card-w) * 1.44);
  height: calc(var(--card-w) * 1.44);
}

.table-card {
  position: absolute;
  animation: none;
}

.table-card.attack { left: 0; top: 22px; rotate: -6deg; }
.table-card.defense { right: 0; top: 0; rotate: 10deg; }
.table-card.attack.drop-ready {
  filter: drop-shadow(0 0 20px rgba(53, 228, 162, 0.7));
}

.action-context-menu {
  position: absolute;
  z-index: 12;
  width: 198px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(7, 13, 22, 0.78);
  border: 1px solid rgba(84, 220, 255, 0.28);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), 0 0 34px rgba(84, 220, 255, 0.16);
  backdrop-filter: blur(18px);
  animation: menuPop 0.15s ease both;
}

.action-choice {
  min-height: 38px;
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(84, 220, 255, 0.16), rgba(53, 228, 162, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.action-choice:hover {
  color: #06110d;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 0 24px rgba(84, 220, 255, 0.22);
}

@keyframes menuPop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
}

.hand-card.launching {
  opacity: 0.18;
  transform: translateY(-12px) scale(0.98);
}

.hand-card.shake {
  animation: cardShake 0.24s ease both;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.flying-card {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  transform-origin: center;
  will-change: transform, filter;
}

.touch-card-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  pointer-events: none;
  transform-origin: center;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45));
  will-change: transform;
}

.touch-card-ghost img {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
}

.flying-card img {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
}

.card-impact-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.impact-ring {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 28px rgba(244, 200, 91, 0.42);
  animation: impactRing 0.56s ease-out both;
}

.impact-ring.defend {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(84, 220, 255, 0.45);
}

@keyframes impactRing {
  from { opacity: 0.9; scale: 0.45; }
  to { opacity: 0; scale: 4; }
}

.match-hud {
  position: absolute;
  left: 50%;
  bottom: 106px;
  transform: translateX(-50%);
  width: min(470px, 84%);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
}

.timer-ring {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06110d;
  background: conic-gradient(var(--emerald), var(--gold), var(--danger), var(--emerald));
  font-weight: 1000;
}

.timer-ring span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ecfff8;
}

.hand-zone {
  min-height: calc(var(--card-w) * 1.48);
  display: flex;
  justify-content: center;
  align-items: end;
  gap: clamp(4px, 0.7vw, 10px);
  padding: 4px 10px 0;
  overflow-x: auto;
}

.hand-card {
  flex: 0 0 var(--card-w);
  border: 0;
  padding: 0;
  background: transparent;
  transform-origin: bottom center;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.hand-card:hover {
  transform: translateY(-12px) scale(1.025);
  filter: drop-shadow(0 0 18px rgba(244, 200, 91, 0.5));
}

.hand-card.valid {
  filter: drop-shadow(0 0 14px rgba(244, 200, 91, 0.42));
}

.hand-card.invalid {
  filter: grayscale(0.7) brightness(0.72);
}

.hand-card.dragging {
  opacity: 0.35;
}

.hand-card:active img {
  transform: rotateY(10deg) translateY(-2px);
}

.action-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  border-radius: 12px;
  padding: 10px;
}

.action-bar button {
  flex: 0 0 auto;
}

.compact-actions {
  justify-content: center;
}

.compact-actions button {
  min-width: 96px;
}

.profile-scene, .social-scene, .shop-scene, .settings-scene {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  overflow: auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
}

.profile-panel {
  padding: 16px;
}

.avatar-profile-panel {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.avatar-shell {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.avatar-shell-profile {
  width: 152px;
  height: 152px;
}

.avatar-media {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #06110d;
  background: linear-gradient(135deg, var(--gold), var(--emerald), var(--cyan));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28), 0 16px 34px rgba(0,0,0,.28);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-size: 2rem;
  font-weight: 1000;
}

.avatar-frame-layer {
  position: absolute;
  inset: 8px;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
  border: 9px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from 120deg, var(--gold), var(--emerald), var(--cyan), var(--violet), var(--gold)) border-box;
  filter: drop-shadow(0 0 22px rgba(84,220,255,.28));
}

.frame-gold .avatar-frame-layer,
.frame-royal .avatar-frame-layer {
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from 120deg, #fff1a8, #ffd166, #8b5a18, #fff1a8) border-box;
}

.frame-crystal .avatar-frame-layer,
.frame-frost .avatar-frame-layer {
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from 120deg, #e6fbff, #65d8ff, #b7d8ff, #e6fbff) border-box;
}

.frame-fire .avatar-frame-layer {
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from 120deg, #ffd166, #ff5570, #ff8a3d, #ffd166) border-box;
}

.frame-cyber .avatar-frame-layer,
.frame-neon .avatar-frame-layer,
.frame-lightning .avatar-frame-layer {
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    conic-gradient(from 120deg, #38bdf8, #c084fc, #22d3ee, #38bdf8) border-box;
}

.avatar-upload-box {
  display: grid;
  gap: 10px;
}

.file-drop {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: var(--text);
  border: 1px dashed rgba(84,220,255,.42);
  border-radius: 10px;
  background: rgba(84,220,255,.08);
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.big-avatar {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  color: #06110d;
  font-size: 2rem;
  font-weight: 1000;
  background: conic-gradient(var(--gold), var(--emerald), var(--cyan), var(--violet), var(--gold));
}

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

.stat-box {
  min-height: 74px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-box b {
  display: block;
  font-size: 1.3rem;
}

.stat-box span {
  color: var(--soft);
  font-size: 0.76rem;
}

.right-widget {
  display: grid;
  gap: 12px;
}

.widget {
  padding: 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.widget h3 {
  margin: 0 0 8px;
}

.chat-dock {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 12px;
}

.chat-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}

.chat-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow-wrap: anywhere;
}

.chat-message b {
  color: var(--gold);
}

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

.chat-compose button {
  border-radius: 8px;
  color: #06110d;
  background: var(--emerald);
  font-weight: 1000;
}

.premium-dialog {
  width: min(720px, 94vw);
  max-height: 88vh;
  overflow: auto;
  color: var(--text);
  border-radius: 14px;
  padding: 0;
}

.premium-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
}

.notification-popup-root {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
}

.notification-popover {
  max-height: min(620px, calc(100vh - 110px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  animation: menuPop 0.18s cubic-bezier(.18,.9,.22,1) both;
}

.notification-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.notification-popover-head b,
.notification-popover-head small {
  display: block;
}

.notification-popover-head small {
  color: var(--soft);
  margin-top: 3px;
}

.notification-stack {
  max-height: 390px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.notification-preview {
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
}

.notification-preview.unread {
  border-color: rgba(84,220,255,.32);
  box-shadow: 0 0 24px rgba(84,220,255,.1);
}

.notification-preview i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  box-shadow: 0 0 22px rgba(84,220,255,.26);
}

.notification-preview span {
  min-width: 0;
}

.notification-preview b,
.notification-preview small {
  display: block;
}

.notification-preview small {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialog-head h2 {
  margin: 0;
}

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

.toast-root {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
  align-content: start;
}

.toast {
  width: min(380px, calc(100vw - 28px));
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(8, 13, 22, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 26px rgba(84, 220, 255, 0.1);
  backdrop-filter: blur(18px);
  animation: notificationIn 0.28s cubic-bezier(.18,.9,.22,1) both;
}

.toast.error { border-color: rgba(255, 85, 112, 0.5); box-shadow: var(--shadow), 0 0 28px rgba(255, 85, 112, 0.15); }
.toast.success { border-color: rgba(53, 228, 162, 0.5); }

.toast.closing {
  animation: notificationOut 0.2s ease both;
}

.toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #06110d;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  font-weight: 1000;
  box-shadow: 0 0 22px rgba(84, 220, 255, 0.22);
}

.toast.error .toast-icon {
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #ff9baa);
}

.toast-message {
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.toast-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes notificationIn {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
}

@keyframes notificationOut {
  to { opacity: 0; transform: translateX(22px) scale(0.96); }
}

.low-effects *, .low-effects *::before, .low-effects *::after {
  animation-duration: 0.001s !important;
  transition-duration: 0.001s !important;
}

.low-quality .fx-canvas, .low-quality .table-arena::before {
  display: none;
}

.medium-quality .table-arena::before {
  filter: blur(6px);
  opacity: 0.45;
}

.low-quality .glass,
.low-quality .glass-panel {
  backdrop-filter: none !important;
}

@media (max-width: 1180px) {
  .game-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "top"
      "scene"
      "rail"
      "dock";
  }
  .top-hud {
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 76px;
    padding: 10px;
  }
  .wallet-strip, .scene-tabs {
    grid-column: 1 / -1;
  }
  .right-rail {
    max-height: 280px;
  }
}

@media (max-width: 780px) {
  :root { --card-w: min(88px, 23vw); }
  .auth-scene, .loading-camera, .hub-scene, .profile-layout {
    grid-template-columns: 1fr;
  }
  .game-app {
    padding: 8px;
    gap: 8px;
  }
  .top-hud {
    grid-template-columns: 1fr;
  }
  .hud-actions, .wallet-strip, .scene-tabs, .hero-actions, .action-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: start;
  }
  .toast-root {
    left: 10px;
    right: 10px;
    top: 10px;
  }
  .toast {
    width: 100%;
  }
  .lobby-toolbar, .room-card {
    grid-template-columns: 1fr;
  }
  .table-scene {
    grid-template-rows: minmax(560px, 1fr) auto auto;
  }
  .table-arena {
    min-height: 560px;
  }
  .seat {
    width: 168px;
    min-height: 60px;
    grid-template-columns: 36px 1fr auto;
    padding: 7px;
  }
  .opponent-hand {
    height: 30px;
  }
  .opponent-hand i {
    width: 23px;
  }
  .seat-0 { bottom: 8px; }
  .seat-3 { top: 8px; }
  .seat-2 { right: 4px; top: 92px; }
  .seat-4 { left: 4px; top: 92px; }
  .seat-1 { right: 4px; bottom: 124px; }
  .seat-5 { left: 4px; bottom: 124px; }
  .deck-zone {
    left: 3%;
    top: 44%;
    scale: 0.82;
    transform-origin: left center;
  }
  .battle-zone {
    inset: 25% 7% 30% 10%;
  }
  .match-hud {
    bottom: 76px;
    width: 92%;
  }
  .chat-dock, .form-grid {
    grid-template-columns: 1fr;
  }
}
