:root {
  color-scheme: dark;
  --ink: #f8f6ff;
  --muted: #aaa7bd;
  --dim: #77738d;
  --night: #0c0b1d;
  --night-soft: #121127;
  --panel: rgba(24, 22, 47, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --purple: #8176ff;
  --purple-deep: #5e54e8;
  --coral: #ff645f;
  --lime: #caff63;
  --yellow: #ffc857;
  --blue: #4aa8ff;
  --green: #55d690;
  --radius-lg: 32px;
  --radius-md: 22px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --shell: min(1180px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(93, 73, 199, 0.22), transparent 38rem),
    linear-gradient(180deg, #0d0c20 0%, #090916 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -3;
  inset: 0;
  content: "";
  opacity: 0.16;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 0.45px, transparent 0.55px);
  background-size: 4px 4px;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(202, 255, 99, 0.78);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.page-glow {
  position: fixed;
  z-index: -2;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
}

.page-glow-one {
  top: 8rem;
  right: -15rem;
  background: rgba(129, 118, 255, 0.25);
}

.page-glow-two {
  top: 54rem;
  left: -18rem;
  background: rgba(255, 100, 95, 0.16);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  width: 34px;
  height: 34px;
  place-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(-6deg);
}

.brand-mark span {
  border-radius: 3px;
}

.brand-mark span:nth-child(1) { background: var(--coral); }
.brand-mark span:nth-child(2) { background: var(--yellow); }
.brand-mark span:nth-child(3) { background: var(--blue); }
.brand-mark span:nth-child(4) { background: var(--green); }

.brand-name {
  font-size: 0.83rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.brand-name strong {
  color: var(--lime);
}

.connection-pill {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.73rem;
  font-weight: 700;
}

.connection-dot,
.live-badge i,
.game-status i,
.eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 14px currentColor;
}

.connection-pill[data-status="connected"] .connection-dot {
  color: var(--green);
  background: var(--green);
}

.connection-pill[data-status="offline"] .connection-dot {
  color: var(--coral);
  background: var(--coral);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  gap: clamp(42px, 6vw, 90px);
  align-items: center;
  min-height: 690px;
  padding-block: 72px 82px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
}

.eyebrow span {
  color: var(--lime);
  background: var(--lime);
}

.hero h1,
.lobby-hero h1 {
  margin: 0;
  font-family: "Arial Black", Impact, ui-sans-serif, sans-serif;
  font-size: clamp(4.1rem, 7vw, 7.1rem);
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-transform: uppercase;
}

.hero h1 em,
.lobby-hero h1 em {
  display: inline-block;
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 2px var(--purple);
  transform: translateX(0.03em);
}

.hero-intro {
  max-width: 610px;
  margin: 30px 0 0;
  color: #bbb8cc;
  font-size: clamp(1.02rem, 1.45vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.button-primary {
  color: #151128;
  background: var(--lime);
  box-shadow: 0 15px 35px rgba(202, 255, 99, 0.13);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 18px 42px rgba(202, 255, 99, 0.22);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
}

.button-arrow {
  display: grid;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  color: var(--lime);
  background: #17132b;
  place-items: center;
}

.hero-facts {
  display: flex;
  gap: 0;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.hero-facts li {
  display: grid;
  gap: 0;
  min-width: 120px;
  padding-right: 28px;
}

.hero-facts li + li {
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-facts strong {
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
}

.hero-facts span {
  color: var(--dim);
  font-size: 0.69rem;
}

.hero-visual {
  position: relative;
  display: grid;
  min-height: 510px;
  place-items: center;
  isolation: isolate;
}

.hero-visual::before {
  position: absolute;
  z-index: -2;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(129, 118, 255, 0.25), rgba(129, 118, 255, 0) 66%);
}

.table-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.orbit-one {
  width: 430px;
  height: 430px;
}

.orbit-two {
  width: 520px;
  height: 520px;
  border-style: dashed;
  opacity: 0.65;
  transform: rotate(17deg);
}

.game-table {
  position: relative;
  width: 355px;
  height: 355px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, rgba(255, 255, 255, 0.09), transparent 28%),
    linear-gradient(145deg, #2b2858, #17152f 70%);
  box-shadow: inset 0 0 0 14px rgba(7, 7, 20, 0.2), 0 40px 80px rgba(0, 0, 0, 0.4);
  transform: rotateX(57deg) rotateZ(-7deg);
  transform-style: preserve-3d;
}

.game-table::after {
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.table-label {
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.32);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.15;
  text-align: center;
  transform: translate(-50%, -50%);
}

.table-label strong {
  color: rgba(202, 255, 99, 0.64);
}

.play-card {
  position: absolute;
  display: grid;
  width: 74px;
  height: 104px;
  padding: 8px;
  border: 4px solid #f4f0ed;
  border-radius: 12px;
  color: white;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.34);
  font-family: "Arial Black", sans-serif;
  transform-style: preserve-3d;
}

.play-card span { font-size: 0.74rem; }
.play-card b { align-self: center; justify-self: center; font-size: 1.55rem; }
.card-red { top: 58px; left: 54px; background: #ef5754; transform: translateZ(18px) rotateZ(-21deg); }
.card-yellow { top: 72px; right: 48px; color: #342b17; background: #ffcb55; transform: translateZ(24px) rotateZ(19deg); }
.card-blue { bottom: 52px; left: 79px; background: #4397ed; transform: translateZ(28px) rotateZ(9deg); }
.card-green { right: 73px; bottom: 45px; background: #45bd7b; transform: translateZ(13px) rotateZ(-12deg); }

.player-seat {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 48px;
  height: 48px;
  border: 4px solid #121024;
  border-radius: 50%;
  color: #181427;
  font-size: 0.72rem;
  font-weight: 900;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.player-seat i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border: 3px solid #121024;
  border-radius: 50%;
  background: var(--green);
}

.seat-one { top: 40px; right: 72px; background: var(--yellow); }
.seat-two { bottom: 55px; left: 66px; background: var(--blue); }
.seat-three { right: 16px; bottom: 122px; background: var(--coral); }

.floating-code {
  position: absolute;
  z-index: 6;
  right: -6px;
  bottom: 25px;
  display: grid;
  min-width: 162px;
  padding: 17px 19px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 18px;
  background: rgba(17, 15, 38, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: rotate(4deg);
}

.floating-code span {
  color: var(--dim);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.floating-code strong {
  margin: 2px 0;
  font-size: 1.38rem;
  letter-spacing: 0.12em;
}

.floating-code i {
  color: var(--green);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
}

.games-section {
  padding-block: 88px 110px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-heading {
  display: flex;
  gap: 40px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 36px;
}

.section-heading h2,
.steps-intro h2,
.lobby-panel h2,
.invite-panel h2,
.table-preview h2,
.join-dialog h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.game-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: linear-gradient(150deg, rgba(35, 32, 67, 0.92), rgba(18, 17, 39, 0.95));
  text-align: left;
}

button.game-card {
  cursor: pointer;
}

button.game-card::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  opacity: 0;
  box-shadow: inset 0 0 0 2px var(--lime);
  transition: opacity 180ms ease;
}

button.game-card:hover::after {
  opacity: 1;
}

.game-card-featured {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 200, 87, 0.26), transparent 30%),
    linear-gradient(145deg, #31265e 0%, #20184c 54%, #17142e 100%);
}

.game-card-coming {
  filter: saturate(0.55);
}

.game-status {
  position: relative;
  z-index: 2;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  align-self: flex-start;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(202, 255, 99, 0.25);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(202, 255, 99, 0.07);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-status i {
  width: 5px;
  height: 5px;
  color: var(--lime);
  background: var(--lime);
}

.game-status.muted {
  border-color: rgba(255, 255, 255, 0.12);
  color: #9894aa;
  background: rgba(255, 255, 255, 0.04);
}

.game-art {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 210px;
  place-items: center;
}

.uno-art::before {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  content: "";
  background: rgba(255, 100, 95, 0.12);
  box-shadow: 0 0 70px rgba(255, 100, 95, 0.13);
}

.mini-card {
  position: absolute;
  display: grid;
  width: 76px;
  height: 112px;
  border: 5px solid #f8f4eb;
  border-radius: 13px;
  color: white;
  font-family: "Arial Black", sans-serif;
  font-size: 1.55rem;
  font-style: normal;
  place-items: center;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.mini-card-one { background: #ef5a55; transform: translateX(-48px) rotate(-16deg); }
.mini-card-two { z-index: 2; color: #282113; background: var(--yellow); transform: translateY(-8px) rotate(2deg); }
.mini-card-three { background: #4d9bea; transform: translateX(48px) rotate(17deg); }

.game-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.game-meta > span:first-child {
  display: grid;
}

.game-meta small {
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-meta strong {
  font-family: "Arial Black", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.round-arrow,
.locked-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #181427;
  background: var(--lime);
  font-size: 1.1rem;
  font-weight: 900;
  place-items: center;
}

.locked-mark {
  color: #918da2;
  background: rgba(255, 255, 255, 0.07);
}

.game-description {
  position: relative;
  z-index: 2;
  display: block;
  max-width: 360px;
  margin-top: 16px;
  color: #918da6;
  font-size: 0.76rem;
  line-height: 1.55;
}

.monopoly-art {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
}

.monopoly-art::before {
  position: absolute;
  width: 190px;
  height: 120px;
  border: 7px solid #ded9c8;
  border-radius: 8px;
  content: "";
  background: #e7e2d2;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.25);
}

.monopoly-art .property {
  z-index: 2;
  width: 42px;
  height: 62px;
  border: 2px solid #4b493f;
  background: linear-gradient(#d85f5b 0 19px, #f3edda 19px);
}

.monopoly-art .property-two { background: linear-gradient(#65aee9 0 19px, #f3edda 19px); }
.monopoly-art .property-three { background: linear-gradient(#e8c85f 0 19px, #f3edda 19px); }
.monopoly-art b { position: absolute; z-index: 3; top: 51%; color: #424036; font-size: 1.2rem; transform: translateY(-50%); }

.dice-art {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  transform: rotate(8deg);
}

.dice-art > i {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 12px);
  grid-template-rows: repeat(3, 12px);
  gap: 8px;
  width: 94px;
  height: 94px;
  padding: 18px;
  border-radius: 21px;
  background: #eeeaf5;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.dice-art > i:last-child {
  width: 78px;
  height: 78px;
  transform: translateY(20px) rotate(-19deg);
}

.dice-art b {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #25213f;
}

.steps-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(50px, 8vw, 120px);
  padding-block: 100px 130px;
}

.steps-intro h2 {
  font-size: clamp(2.2rem, 4.2vw, 4.2rem);
  line-height: 1.03;
}

.steps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.steps-list li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.steps-list > li > span {
  color: var(--purple);
  font-family: "Arial Black", sans-serif;
  font-size: 0.9rem;
}

.steps-list strong {
  font-size: 1.04rem;
}

.steps-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  min-height: 110px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--dim);
  font-size: 0.68rem;
}

.site-footer p { margin: 0; }
.site-footer strong { color: var(--ink); letter-spacing: 0.08em; }

/* Lobby */

.lobby-view {
  padding-block: 50px 110px;
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.text-button:hover { color: var(--ink); }

.lobby-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: end;
  padding-block: 46px 70px;
}

.lobby-hero h1 {
  font-size: clamp(3.8rem, 7vw, 6.7rem);
}

.lobby-hero > div:first-child > p:last-child {
  max-width: 580px;
  margin: 25px 0 0;
  color: var(--muted);
}

.room-ticket {
  position: relative;
  display: grid;
  min-width: 280px;
  padding: 25px 27px;
  border: 1px solid rgba(202, 255, 99, 0.26);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(202, 255, 99, 0.12), rgba(129, 118, 255, 0.08));
  box-shadow: var(--shadow);
}

.room-ticket::before,
.room-ticket::after {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  content: "";
  background: var(--night);
  transform: translateY(-50%);
}

.room-ticket::before { left: -10px; }
.room-ticket::after { right: -10px; }

.room-ticket > span {
  color: var(--lime);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.room-ticket strong {
  margin: 3px 0 15px;
  font-size: 2.4rem;
  letter-spacing: 0.16em;
  line-height: 1;
}

.ticket-copy {
  justify-self: start;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 18px;
}

.lobby-panel,
.invite-panel,
.ready-panel,
.table-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px);
}

.players-panel {
  min-height: 500px;
  padding: 29px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.panel-heading .section-kicker { margin-bottom: 8px; }
.panel-heading h2 { font-size: 2.2rem; }
.panel-heading h2 span { color: var(--dim); font-size: 0.78rem; letter-spacing: 0; }

.live-badge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(85, 214, 144, 0.22);
  border-radius: 999px;
  color: var(--green);
  background: rgba(85, 214, 144, 0.07);
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-badge i { width: 5px; height: 5px; color: var(--green); background: var(--green); }

.player-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.player-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 68px;
  padding: 9px 14px 9px 9px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.045);
}

.player-item.is-you {
  border-color: rgba(129, 118, 255, 0.32);
  background: rgba(129, 118, 255, 0.08);
}

.player-item.is-ready {
  border-color: rgba(85, 214, 144, 0.19);
}

.player-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  color: #171326;
  font-size: 0.72rem;
  font-weight: 950;
  place-items: center;
}

.avatar-1 { background: var(--yellow); }
.avatar-2 { background: var(--blue); }
.avatar-3 { background: var(--coral); }
.avatar-4 { background: var(--green); }
.avatar-5 { background: var(--purple); }

.player-identity {
  display: grid;
  min-width: 0;
}

.player-identity strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-identity small {
  color: var(--dim);
  font-size: 0.64rem;
  text-transform: capitalize;
}

.player-ready-state {
  color: var(--dim);
  font-size: 0.68rem;
  font-weight: 750;
}

.is-ready .player-ready-state { color: var(--green); }

.player-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-self: end;
}

.player-kick {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 100, 95, 0.28);
  border-radius: 999px;
  color: #ffaaa7;
  background: rgba(255, 100, 95, 0.09);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.player-kick:hover,
.player-kick:focus-visible {
  border-color: rgba(255, 100, 95, 0.58);
  color: #fff;
  background: rgba(255, 100, 95, 0.2);
}

.player-kick:disabled {
  opacity: 0.45;
  cursor: wait;
}

.empty-seats {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: 13px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  color: var(--dim);
}

.empty-seats > span {
  display: grid;
  flex: 0 0 auto;
  width: 37px;
  height: 37px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.2rem;
  place-items: center;
}

.empty-seats p { margin: 0; font-size: 0.71rem; }

.lobby-sidebar {
  display: grid;
  gap: 18px;
}

.invite-panel,
.ready-panel {
  padding: 28px;
}

.invite-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 95% 0%, rgba(202, 255, 99, 0.16), transparent 45%),
    linear-gradient(150deg, rgba(41, 36, 83, 0.95), rgba(24, 22, 47, 0.9));
}

.invite-panel::after {
  position: absolute;
  top: -22px;
  right: -28px;
  width: 105px;
  height: 105px;
  border: 1px dashed rgba(202, 255, 99, 0.2);
  border-radius: 50%;
  content: "";
}

.invite-panel .section-kicker { margin-bottom: 10px; }
.invite-panel h2 { font-size: 2.45rem; }
.invite-panel > p:not(.section-kicker) { margin: 16px 0 22px; color: var(--muted); font-size: 0.79rem; }

.button-invite {
  width: 100%;
  color: #171327;
  background: var(--lime);
}

.copy-link {
  display: block;
  margin: 13px auto 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.66rem;
}

.ready-panel {
  background: rgba(17, 16, 36, 0.9);
}

.ready-score {
  display: flex;
  gap: 10px;
  align-items: end;
}

.ready-score strong {
  font-family: "Arial Black", sans-serif;
  font-size: 2.7rem;
  line-height: 1;
}

.ready-score span {
  padding-bottom: 4px;
  color: var(--dim);
  font-size: 0.72rem;
}

.ready-track {
  height: 7px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.ready-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--green));
  transition: width 260ms ease;
}

.ready-panel p {
  min-height: 38px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.72rem;
}

.button-ready {
  width: 100%;
  border: 1px solid rgba(129, 118, 255, 0.28);
  background: rgba(129, 118, 255, 0.12);
}

.button-ready.is-ready {
  border-color: rgba(85, 214, 144, 0.3);
  color: var(--green);
  background: rgba(85, 214, 144, 0.09);
}

.table-preview {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 30px;
  align-items: center;
  margin-top: 18px;
  padding: 34px;
  overflow: hidden;
}

.table-preview::before {
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  content: "";
  background: rgba(129, 118, 255, 0.08);
}

.preview-deck {
  position: relative;
  height: 105px;
}

.preview-deck i {
  position: absolute;
  top: 0;
  left: 40px;
  width: 70px;
  height: 100px;
  border: 5px solid #eae7ef;
  border-radius: 13px;
  background: var(--purple-deep);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.28);
}

.preview-deck i:nth-child(1) { transform: translateX(-28px) rotate(-14deg); background: var(--coral); }
.preview-deck i:nth-child(2) { z-index: 2; transform: translateY(-5px); background: var(--yellow); }
.preview-deck i:nth-child(3) { transform: translateX(28px) rotate(14deg); background: var(--blue); }

.table-preview .section-kicker { margin-bottom: 7px; }
.table-preview h2 { font-size: 2rem; }
.table-preview p:last-child { max-width: 690px; margin: 10px 0 0; color: var(--muted); font-size: 0.76rem; }

.foundation-label {
  position: relative;
  z-index: 2;
  padding: 9px 12px;
  border: 1px solid rgba(202, 255, 99, 0.22);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(202, 255, 99, 0.06);
  font-size: 0.61rem;
  font-weight: 850;
  white-space: nowrap;
}

/* Dialog and notifications */

.join-dialog {
  width: min(500px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  color: var(--ink);
  background: #17152f;
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.65);
}

.join-dialog::backdrop {
  background: rgba(5, 5, 15, 0.78);
  backdrop-filter: blur(10px);
}

.dialog-shell {
  position: relative;
  max-height: calc(100vh - 30px);
  padding: 34px;
  overflow-y: auto;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 1.25rem;
  place-items: center;
}

.join-dialog .section-kicker { margin-bottom: 9px; }
.join-dialog h2 { max-width: 390px; font-size: 2.35rem; }

.dialog-intro {
  margin: 13px 0 22px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dialog-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.dialog-tabs button {
  min-height: 39px;
  border: 0;
  border-radius: 10px;
  color: var(--dim);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.dialog-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: rgba(129, 118, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(129, 118, 255, 0.21);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.field > span {
  color: #b5b1c5;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(6, 6, 18, 0.4);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input:focus {
  border-color: rgba(129, 118, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(129, 118, 255, 0.1);
}

.field input::placeholder { color: #625e76; }
#room-code-input { font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }

.form-error {
  min-height: 21px;
  margin: 9px 0 2px;
  color: #ff8a85;
  font-size: 0.7rem;
}

.dialog-submit {
  width: 100%;
}

.dialog-submit.is-loading span:last-child {
  animation: spin 0.8s linear infinite;
}

.privacy-note {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: 0.62rem;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(25, 23, 49, 0.95);
  box-shadow: var(--shadow);
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(16px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.start-game {
  width: 100%;
  margin-top: 11px;
  justify-content: space-between;
}

.player-item.is-offline,
.opponent-card.is-offline {
  opacity: 0.58;
}

.uno-game {
  display: grid;
  gap: 22px;
  padding-bottom: 92px;
}

.game-statusbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(17, 15, 42, 0.82);
  box-shadow: var(--shadow-soft);
}

.game-statusbar h2 {
  margin: 6px 0 4px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.game-statusbar p:last-child {
  margin: 0;
  color: var(--muted);
}

.game-statuschips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.game-statuschips span,
.game-statuschips strong {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d8d5ef;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-statuschips strong {
  border-color: rgba(255, 96, 90, 0.35);
  color: #ffd0ce;
  background: rgba(255, 96, 90, 0.13);
}

.opponent-strip {
  position: absolute;
  z-index: 5;
  inset: 0;
  perspective: 900px;
  pointer-events: none;
}

.opponent-card {
  position: absolute;
  left: var(--seat-x);
  top: var(--seat-y);
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  pointer-events: auto;
  transform-style: preserve-3d;
  transition: transform 180ms ease, filter 180ms ease;
}

.opponent-card[data-seat-side="top"] {
  flex-direction: column;
  transform: translate(-50%, -50%) rotateX(5deg);
}

.opponent-card[data-seat-side="left"] {
  flex-direction: column;
  transform: translate(0, -50%) rotateY(5deg);
}

.opponent-card[data-seat-side="right"] {
  flex-direction: column;
  transform: translate(-100%, -50%) rotateY(-5deg);
}

.opponent-card.is-turn {
  filter: drop-shadow(0 0 13px rgba(190, 255, 86, 0.42));
}

.opponent-card[data-seat-side="top"].is-turn {
  transform: translate(-50%, -50%) rotateX(5deg) scale(1.04);
}

.opponent-card[data-seat-side="left"].is-turn {
  transform: translate(0, -50%) rotateY(5deg) scale(1.04);
}

.opponent-card[data-seat-side="right"].is-turn {
  transform: translate(-100%, -50%) rotateY(-5deg) scale(1.04);
}

.opponent-nameplate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 136px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(20, 17, 54, 0.97), rgba(9, 8, 29, 0.97));
  box-shadow: 0 13px 26px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  transform: translateZ(14px);
}

.opponent-card.is-turn .opponent-nameplate {
  border-color: rgba(190, 255, 86, 0.72);
  background: linear-gradient(145deg, rgba(43, 56, 46, 0.98), rgba(12, 17, 27, 0.98));
}

.opponent-hand {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: calc(54px + ((var(--visible-cards) - 1) * 13px));
  height: 90px;
  transform-style: preserve-3d;
}

.opponent-card[data-seat-side="left"] .opponent-hand,
.opponent-card[data-seat-side="right"] .opponent-hand {
  width: 62px;
  height: calc(80px + ((var(--visible-cards) - 1) * 13px));
}

.opponent-card-back {
  position: absolute;
  top: var(--card-arch-offset);
  left: var(--card-linear-offset);
  display: block;
  width: 54px;
  height: 80px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 9px;
  background: linear-gradient(145deg, #242060, #0b0a25);
  box-shadow: 0 7px 13px rgba(0, 0, 0, 0.42);
  transform: translateZ(var(--card-depth)) rotate(var(--card-rotation));
}

.opponent-card-back::before {
  position: absolute;
  inset: 22% 15%;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 7px;
  background: conic-gradient(from 45deg, #ef4b47 0 25%, #4da7ff 0 50%, #43c973 0 75%, #ffd351 0);
  box-shadow: inset 0 0 0 3px #17132f;
  transform: rotate(45deg);
}

.opponent-card[data-seat-side="left"] .opponent-card-back,
.opponent-card[data-seat-side="right"] .opponent-card-back {
  top: var(--card-linear-offset);
  left: var(--card-arch-offset);
  transform: translateZ(var(--card-depth)) rotate(calc(var(--card-rotation) * 0.45));
}

.opponent-hand-extra {
  position: absolute;
  z-index: 20;
  right: -13px;
  bottom: -7px;
  display: grid;
  min-width: 25px;
  height: 25px;
  padding-inline: 5px;
  place-items: center;
  border: 2px solid #11102c;
  border-radius: 999px;
  color: #11102c;
  background: var(--yellow);
  font-size: 0.62rem;
  font-weight: 950;
}

.opponent-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.opponent-identity > b {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 12px;
  color: #0b0a17;
  background: var(--yellow);
  font-size: 0.72rem;
}

.opponent-identity > span {
  display: grid;
  min-width: 0;
}

.opponent-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 66px;
  white-space: nowrap;
}

.opponent-identity small {
  color: var(--muted);
  font-size: 0.7rem;
}

.opponent-actions {
  position: absolute;
  top: -7px;
  right: -7px;
  display: flex;
}

.opponent-actions > i {
  color: var(--lime);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.opponent-card .player-kick {
  width: 27px;
  min-height: 28px;
  padding-inline: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.opponent-card .player-kick::after {
  color: #ffb8b5;
  content: "×";
  font-size: 0.84rem;
}

.opponent-card.is-compact {
  gap: 5px;
}

.opponent-card.is-compact .opponent-nameplate {
  width: 116px;
  padding: 6px 7px;
}

.opponent-card.is-compact .opponent-identity small,
.opponent-card.is-compact .opponent-actions > i {
  display: none;
}

@media (min-width: 721px) {
  .opponent-card.is-compact .opponent-hand {
    width: calc(46px + ((var(--visible-cards) - 1) * 9px));
    height: 76px;
  }

  .opponent-card.is-compact[data-seat-side="left"] .opponent-hand,
  .opponent-card.is-compact[data-seat-side="right"] .opponent-hand {
    width: 52px;
    height: calc(68px + ((var(--visible-cards) - 1) * 9px));
  }

  .opponent-card.is-compact .opponent-card-back {
    width: 46px;
    height: 68px;
    border-width: 3px;
    border-radius: 8px;
  }

  .opponent-card.is-compact .opponent-card-back::before {
    border-width: 1px;
    border-radius: 5px;
    box-shadow: inset 0 0 0 2px #17132f;
  }
}

.uno-table-shell {
  padding: 15px;
  border: 1px solid rgba(129, 112, 255, 0.25);
  border-radius: 38px;
  background: linear-gradient(145deg, #40337f, #14102f 55%, #09081d);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px rgba(255, 255, 255, 0.16),
    inset 0 -8px 18px rgba(0, 0, 0, 0.35);
  perspective: 1200px;
}

.uno-table {
  position: relative;
  display: grid;
  grid-template-columns: 108px 112px minmax(220px, 340px);
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 4vw, 56px);
  min-height: 880px;
  padding: 180px clamp(180px, 16vw, 210px) 310px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(45, 185, 178, 0.16), transparent 38%),
    linear-gradient(145deg, #19174a, #0e1835 56%, #0b0a25);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.025),
    inset 0 28px 55px rgba(255, 255, 255, 0.025),
    inset 0 -35px 70px rgba(0, 0, 0, 0.32);
  transform-style: preserve-3d;
}

.uno-table::before,
.uno-table::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.uno-table::before { inset: 12% 6%; border-width: 2px; }
.uno-table::after { inset: 26% 18%; }

.draw-pile {
  position: relative;
  z-index: 1;
  display: grid;
  width: 108px;
  height: 154px;
  place-items: center;
  border: 7px solid #f7f5ff;
  border-radius: 17px;
  color: white;
  background:
    linear-gradient(32deg, transparent 45%, rgba(255, 255, 255, 0.18) 46% 52%, transparent 53%),
    linear-gradient(145deg, #3429a5, #151044);
  box-shadow: 7px 7px 0 #0a0820, 11px 11px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.draw-pile:not(:disabled):hover,
.draw-pile:not(:disabled):focus-visible {
  transform: translateY(-8px) rotate(-2deg);
  filter: brightness(1.15);
}

.draw-pile:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.draw-pile.is-penalty {
  box-shadow: 7px 7px 0 #0a0820, 11px 11px 0 rgba(255, 96, 90, 0.48), 0 0 34px rgba(255, 96, 90, 0.25);
}

.card-back-mark {
  display: grid;
  width: 58px;
  height: 88px;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 2.5rem;
  transform: rotate(-22deg);
}

.draw-pile small {
  position: absolute;
  right: 50%;
  bottom: -43px;
  width: max-content;
  color: var(--muted);
  font-size: 0.68rem;
  transform: translateX(50%);
}

.draw-pile small b { color: white; }

.discard-zone {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 18px;
}

#top-card {
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

#top-card .is-reveal-pending {
  opacity: 0.12;
  filter: blur(3px) saturate(0.4);
  transform: rotate(5deg) scale(0.88);
}

#top-card .is-card-revealed {
  animation: card-reveal-pop 420ms cubic-bezier(.2,.9,.25,1);
}

.thrown-card {
  position: fixed;
  z-index: 999;
  width: 92px;
  height: 138px;
  margin: 0;
  perspective: 700px;
  pointer-events: none;
  will-change: transform, opacity;
}

.thrown-card-face,
.thrown-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.thrown-card-face {
  margin: 0;
  transform: none;
}

.thrown-card-back {
  display: grid;
  place-items: center;
  border: 6px solid #f7f5ff;
  border-radius: 15px;
  color: var(--yellow);
  background:
    linear-gradient(32deg, transparent 45%, rgba(255, 255, 255, 0.18) 46% 52%, transparent 53%),
    linear-gradient(145deg, #3429a5, #151044);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3);
  font-family: var(--display);
  font-size: 2.4rem;
}

@keyframes card-reveal-pop {
  0% { filter: brightness(1.8); transform: rotate(5deg) scale(0.86); }
  55% { filter: brightness(1.3); transform: rotate(2deg) scale(1.12); }
  100% { filter: none; transform: rotate(5deg) scale(1); }
}

.discard-zone > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

#current-color[data-color="red"] { color: #ff6963; }
#current-color[data-color="yellow"] { color: #ffd351; }
#current-color[data-color="green"] { color: #69df8a; }
#current-color[data-color="blue"] { color: #55aaff; }

.table-message {
  position: relative;
  z-index: 1;
  max-width: 420px;
  padding: 22px 24px;
  border-left: 3px solid var(--lime);
  border-radius: 0 16px 16px 0;
  color: #dedcf0;
  background: rgba(8, 7, 25, 0.54);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  line-height: 1.6;
}

.uno-card {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  width: 92px;
  height: 138px;
  padding: 8px;
  overflow: hidden;
  border: 6px solid #f7f5ff;
  border-radius: 15px;
  color: white;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3);
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.uno-card::before {
  position: absolute;
  z-index: 0;
  inset: 16% 7%;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(20, 16, 47, 0.1);
  transform: rotate(-28deg);
}

.uno-card-red { background: linear-gradient(145deg, #f34a45, #a71326); }
.uno-card-yellow { color: #21181a; background: linear-gradient(145deg, #ffd957, #e69a18); }
.uno-card-green { background: linear-gradient(145deg, #43c973, #087545); }
.uno-card-blue { background: linear-gradient(145deg, #4da7ff, #164cb5); }
.uno-card-wild { background: conic-gradient(from 35deg, #f34a45, #ffd957, #43c973, #4da7ff, #f34a45); }

.uno-card-corner,
.uno-card-symbol {
  position: relative;
  z-index: 1;
}

.uno-card-corner {
  position: absolute;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.uno-card-corner-top {
  top: 6px;
  left: 6px;
}

.uno-card-corner-bottom {
  right: 6px;
  bottom: 6px;
  transform: rotate(180deg);
}

.uno-card-symbol {
  color: #171329;
  font-family: var(--display);
  font-size: 3.35rem;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
  transform: rotate(-7deg);
}

.uno-card[data-kind="skip"] .uno-card-symbol,
.uno-card[data-kind="reverse"] .uno-card-symbol {
  font-size: 3rem;
}

.uno-card[data-kind="draw2"] .uno-card-symbol,
.uno-card[data-kind="wild4"] .uno-card-symbol {
  font-size: 2.55rem;
  letter-spacing: -0.08em;
}

.uno-card[data-kind="wild"] .uno-card-symbol {
  font-size: 2.75rem;
}

.uno-card.is-static {
  cursor: default;
  transform: rotate(5deg);
}

.uno-card:disabled {
  cursor: not-allowed;
  filter: saturate(0.48) brightness(0.68);
  opacity: 0.62;
}

.uno-card.is-playable {
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(190, 255, 86, 0.72);
}

.uno-card.is-playable:hover,
.uno-card.is-playable:focus-visible {
  z-index: 4;
  transform: translateY(-16px) rotate(-2deg);
  filter: brightness(1.12);
}

.uno-card.is-selected {
  z-index: 5;
  transform: translateY(-22px);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.42), 0 0 0 3px var(--lime);
  filter: none;
}

.selection-order {
  position: absolute;
  z-index: 6;
  top: 5px;
  right: 5px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  color: #0d0b20;
  background: var(--lime);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
}

.hand-panel {
  position: absolute;
  z-index: 6;
  right: 30px;
  bottom: 18px;
  left: 30px;
  padding: 15px 24px 17px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 23px 23px;
  background: linear-gradient(180deg, rgba(11, 10, 37, 0.1), rgba(11, 10, 37, 0.88) 20%, rgba(9, 8, 31, 0.96));
  box-shadow: 0 -18px 45px rgba(8, 7, 27, 0.2);
}

.hand-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.hand-heading h3 {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 1.5rem;
  text-transform: uppercase;
}

.hand-heading > p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.uno-hand {
  display: flex;
  justify-content: center;
  gap: 0;
  min-height: 168px;
  margin: 5px -8px 0;
  padding: 14px 18px 9px;
  overflow-x: auto;
  overflow-y: hidden;
  perspective: 1000px;
  scrollbar-color: rgba(190, 255, 86, 0.4) transparent;
}

.uno-hand.is-wide {
  justify-content: flex-start;
}

.uno-hand .uno-card {
  margin-left: -17px;
  transform: translateY(var(--hand-drop, 0)) rotate(var(--hand-rotation, 0));
  transform-origin: 50% 125%;
}

.uno-hand .uno-card:first-child {
  margin-left: 0;
}

.uno-hand .uno-card.is-selected {
  transform: translateY(-22px) rotate(-1deg);
}

.color-picker {
  position: absolute;
  right: 24px;
  bottom: 76px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(330px, calc(100% - 48px));
  margin-top: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.color-picker > span {
  color: #dedcf0;
  font-size: 0.78rem;
  font-weight: 800;
}

.color-picker > div {
  display: flex;
  gap: 9px;
}

.color-picker button {
  width: 34px;
  height: 34px;
  border: 3px solid transparent;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.color-picker button[data-wild-color="red"] { background: #ef4b47; }
.color-picker button[data-wild-color="yellow"] { background: #ffd351; }
.color-picker button[data-wild-color="green"] { background: #43c973; }
.color-picker button[data-wild-color="blue"] { background: #4da7ff; }
.color-picker button.is-selected { border-color: white; box-shadow: 0 0 0 3px var(--lime); }

.game-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  margin-top: 5px;
}

.uno-call {
  color: #fff;
  background: linear-gradient(135deg, #ef433f, #a51931);
}

.uno-call.is-live-window,
.uno-call.is-catch,
.uno-call.is-late {
  position: fixed;
  z-index: 1000;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 18px));
  min-width: min(310px, calc(100vw - 44px));
  min-height: 74px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  letter-spacing: 0.025em;
  box-shadow: 0 0 0 7px rgba(239, 67, 63, 0.18), 0 24px 70px rgba(0, 0, 0, 0.48);
  isolation: isolate;
}

.uno-call.is-live-window:not(:disabled),
.uno-call.is-catch:not(:disabled) {
  animation: uno-alert 620ms ease-in-out infinite alternate;
}

.uno-call.is-live-window:disabled,
.uno-call.is-late:disabled {
  cursor: default;
  opacity: 0.94;
}

.uno-call.is-catch {
  color: #161124;
  border-color: #fff4bb;
  background: linear-gradient(135deg, #ffe675, #ffb72e);
  box-shadow: 0 0 0 7px rgba(255, 211, 81, 0.2), 0 24px 70px rgba(0, 0, 0, 0.48);
}

.uno-call.is-late {
  color: #f5edf2;
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(135deg, #5d344c, #2b2036);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

@keyframes uno-alert {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.035); }
}

.play-selected {
  min-width: 210px;
  justify-content: space-between;
}

.play-selected #selected-count {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.72rem;
}

.house-rules {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(17, 15, 42, 0.58);
}

.house-rules summary {
  padding: 18px 22px;
  color: #e8e6f7;
  font-weight: 850;
  cursor: pointer;
}

.house-rules > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 22px 22px;
}

.house-rules p {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  line-height: 1.55;
}

.house-rules strong { color: white; }

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 75px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-visual {
    min-height: 560px;
  }

  .game-grid {
    grid-template-columns: 1fr 1fr;
  }

  .game-card-featured {
    grid-column: 1 / -1;
  }

  .steps-section,
  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .lobby-sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .table-preview {
    grid-template-columns: 130px 1fr;
  }

  .foundation-label {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  :root {
    --shell: min(100% - 28px, 1180px);
    --radius-lg: 24px;
  }

  .site-header {
    min-height: 74px;
  }

  .brand-name {
    display: none;
  }

  .connection-pill {
    min-height: 31px;
    font-size: 0.66rem;
  }

  .hero {
    gap: 35px;
    min-height: auto;
    padding-block: 62px 66px;
  }

  .hero h1,
  .lobby-hero h1 {
    font-size: clamp(3.65rem, 18vw, 5.7rem);
  }

  .hero h1 em,
  .lobby-hero h1 em {
    -webkit-text-stroke-width: 1.5px;
  }

  .hero-intro {
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-facts li {
    min-width: 0;
    padding-right: 12px;
  }

  .hero-facts li + li {
    padding-left: 12px;
  }

  .hero-facts span {
    font-size: 0.59rem;
  }

  .hero-visual {
    min-height: 410px;
    transform: scale(0.82);
    transform-origin: center;
  }

  .orbit-two { width: 470px; height: 470px; }
  .floating-code { right: 0; bottom: -4px; }

  .games-section {
    padding-block: 70px 80px;
  }

  .section-heading {
    display: grid;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card-featured {
    grid-column: auto;
  }

  .game-card {
    min-height: 390px;
  }

  .steps-section {
    gap: 46px;
    padding-block: 70px 90px;
  }

  .site-footer {
    display: grid;
    gap: 9px;
    padding-block: 28px;
  }

  .lobby-view {
    padding-block: 32px 80px;
  }

  .lobby-hero {
    grid-template-columns: 1fr;
    gap: 35px;
    padding-block: 35px 52px;
  }

  .room-ticket {
    min-width: 0;
  }

  .lobby-sidebar {
    grid-template-columns: 1fr;
  }

  .players-panel,
  .invite-panel,
  .ready-panel {
    padding: 21px;
  }

  .player-item {
    grid-template-columns: 43px 1fr;
  }

  .player-avatar {
    width: 43px;
    height: 43px;
    border-radius: 13px;
  }

  .player-actions {
    grid-column: 2;
    margin-top: -13px;
    justify-self: stretch;
    justify-content: space-between;
  }

  .table-preview {
    grid-template-columns: 1fr;
    padding: 25px;
  }

  .preview-deck {
    width: 150px;
  }

  .foundation-label {
    grid-column: auto;
  }

  .dialog-shell {
    padding: 28px 21px 24px;
  }

  .join-dialog h2 {
    padding-right: 20px;
    font-size: 2rem;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

@media (max-width: 1000px) {
  .uno-table {
    grid-template-columns: 96px 104px minmax(190px, 290px);
    gap: 28px;
    min-height: 850px;
    padding: 170px 145px 300px;
  }

  .opponent-nameplate {
    width: 124px;
  }

  .house-rules > div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .game-statusbar,
  .hand-heading,
  .color-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .game-statusbar {
    padding: 22px;
  }

  .game-statuschips {
    justify-content: flex-start;
  }

  .opponent-card {
    gap: 4px;
  }

  .opponent-nameplate,
  .opponent-card.is-compact .opponent-nameplate {
    width: 96px;
    padding: 6px 7px;
    border-radius: 11px;
  }

  .opponent-identity > b {
    display: none;
  }

  .opponent-identity {
    gap: 0;
  }

  .opponent-identity strong {
    max-width: 57px;
    font-size: 0.72rem;
  }

  .opponent-identity small {
    font-size: 0.62rem;
  }

  .opponent-actions > i {
    display: none;
  }

  .opponent-card .player-kick {
    width: 24px;
    min-height: 27px;
    padding-inline: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  .opponent-card .player-kick::after {
    color: #ffb8b5;
    content: "×";
    font-size: 0.82rem;
  }

  .opponent-hand {
    width: calc(38px + ((var(--visible-cards) - 1) * 8px));
    height: 62px;
  }

  .opponent-card[data-seat-side="left"] .opponent-hand,
  .opponent-card[data-seat-side="right"] .opponent-hand {
    width: 44px;
    height: calc(56px + ((var(--visible-cards) - 1) * 8px));
  }

  .opponent-card[data-seat-side="left"] .opponent-hand {
    transform: translateX(-10px);
  }

  .opponent-card[data-seat-side="right"] .opponent-hand {
    transform: translateX(10px);
  }

  .opponent-card-back {
    width: 38px;
    height: 56px;
    border-width: 3px;
    border-radius: 7px;
  }

  .opponent-card-back::before {
    border-width: 1px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px #17132f;
  }

  .opponent-card.is-compact .opponent-nameplate {
    width: 58px;
    padding: 5px;
  }

  .opponent-card.is-compact .opponent-identity strong {
    max-width: 46px;
    font-size: 0.62rem;
  }

  .opponent-card.is-compact .opponent-hand {
    width: calc(30px + ((var(--visible-cards) - 1) * 6px));
    height: 48px;
  }

  .opponent-card.is-compact[data-seat-side="left"] .opponent-hand,
  .opponent-card.is-compact[data-seat-side="right"] .opponent-hand {
    width: 34px;
    height: calc(44px + ((var(--visible-cards) - 1) * 6px));
  }

  .opponent-card.is-compact .opponent-card-back {
    width: 30px;
    height: 44px;
    border-width: 2px;
    border-radius: 6px;
  }

  .opponent-card.is-compact .opponent-card-back::before {
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px #17132f;
  }

  .uno-table-shell {
    border-radius: 26px;
  }

  .uno-table {
    grid-template-columns: 78px 78px;
    gap: 32px 18px;
    min-height: 900px;
    padding: 170px 70px 365px;
    border-radius: 20px;
  }

  .draw-pile {
    justify-self: center;
    width: 78px;
    height: 118px;
    border-width: 5px;
    border-radius: 14px;
    box-shadow: 5px 5px 0 #0a0820, 8px 8px 0 rgba(255, 255, 255, 0.18);
  }

  .card-back-mark {
    width: 44px;
    height: 68px;
    font-size: 1.9rem;
  }

  .discard-zone {
    justify-self: center;
  }

  .table-message {
    grid-column: 1 / -1;
    max-width: none;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    transform: translateY(-14px);
  }

  .hand-panel {
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 14px 12px 13px;
  }

  .hand-heading > p {
    text-align: left;
  }

  .uno-hand {
    min-height: 153px;
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .uno-hand .uno-card {
    margin-left: -12px;
  }

  .uno-card {
    flex-basis: 78px;
    width: 78px;
    height: 118px;
    border-width: 5px;
  }

  .uno-card-symbol {
    font-size: 2.75rem;
  }

  .uno-card[data-kind="skip"] .uno-card-symbol,
  .uno-card[data-kind="reverse"] .uno-card-symbol {
    font-size: 2.5rem;
  }

  .uno-card[data-kind="draw2"] .uno-card-symbol,
  .uno-card[data-kind="wild4"] .uno-card-symbol {
    font-size: 2.12rem;
  }

  .uno-card-corner {
    font-size: 1rem;
  }

  .thrown-card {
    width: 78px;
    height: 118px;
  }

  .color-picker > div {
    justify-content: space-between;
  }

  .color-picker {
    position: static;
    width: auto;
    margin-top: 7px;
  }

  .color-picker button {
    width: 42px;
    height: 42px;
  }

  .game-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .game-actions .button,
  .play-selected {
    min-width: 0;
    width: 100%;
  }

  .uno-call.is-live-window,
  .uno-call.is-catch,
  .uno-call.is-late {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 14px));
    left: max(14px, env(safe-area-inset-left));
    width: auto;
    min-width: 0;
    min-height: 68px;
    padding-inline: 18px;
    font-size: 0.82rem;
  }

  #pass-turn {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
