/* Danex UNO v8: compact dark-purple arcade UI for desktop + mobile. */

:root {
  --du-void: #050508;
  --du-graphite: #0b0b10;
  --du-ink: #111117;
  --du-panel: rgba(13, 13, 20, 0.86);
  --du-panel-strong: rgba(17, 17, 25, 0.96);
  --du-line: rgba(154, 120, 255, 0.24);
  --du-line-strong: rgba(154, 120, 255, 0.46);
  --du-text: #f7f3ff;
  --du-soft: #b8b0cc;
  --du-faint: #7c748d;
  --du-gold: #f8cf5a;
  --du-gold-hot: #f59e0b;
  --du-purple: #8b5cf6;
  --du-purple-deep: #4c1d95;
  --du-red: #ef4444;
  --du-green: #22c55e;
  --du-blue: #3b82f6;
  --du-radius-xl: 34px;
  --du-radius-lg: 24px;
  --du-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--du-void);
}
body {
  min-height: 100vh;
  margin: 0 !important;
  padding: 0;
  color: var(--du-text) !important;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif !important;
  background: #050508 !important;
  background-attachment: fixed !important;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
}

.du-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  position: relative;
  z-index: 1;
}
.du-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}
.du-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--du-text) !important;
  text-decoration: none;
}
.du-brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #1b1203;
  font-family: "Archivo Black", Manrope, sans-serif;
  background: var(--du-gold);
  box-shadow: 0 10px 24px rgba(248, 207, 90, 0.14);
}
.du-brand strong {
  display: block;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.du-brand small {
  display: block;
  color: var(--du-soft);
  font-size: 12px;
  margin-top: 1px;
}
.du-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.du-icon-button,
.du-ghost-button,
.du-secondary-button,
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"] {
  border: 0;
  cursor: pointer;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif !important;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease,
    filter 170ms ease;
}
.du-icon-button,
.du-ghost-button,
.du-secondary-button {
  color: var(--du-text) !important;
  border: 1px solid var(--du-line) !important;
  background: rgba(17, 17, 25, 0.72) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28) !important;
}
.du-icon-button {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  font-weight: 900;
}
.du-ghost-button,
.du-secondary-button {
  min-height: 44px;
  border-radius: 15px !important;
  padding: 0 16px !important;
  font-weight: 800 !important;
}
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"] {
  min-height: 48px;
  min-width: 150px;
  border-radius: 16px !important;
  padding: 13px 22px !important;
  color: #1c1304 !important;
  font-weight: 950 !important;
  font-size: 16px !important;
  letter-spacing: -0.01em;
  background: var(--du-gold) !important;
  box-shadow:
    0 12px 28px rgba(245, 158, 11, 0.18),
    0 16px 42px rgba(0, 0, 0, 0.38) !important;
  text-shadow: none !important;
}
.du-icon-button:hover,
.du-ghost-button:hover,
.du-secondary-button:hover,
.du-primary-button:hover,
.button:hover,
#welbut:hover,
#start-button:hover,
#stackBut:hover,
#unoBut:hover,
input[type="submit"]:hover {
  width: auto !important;
  transform: translateY(-2px);
  border-color: rgba(248, 207, 90, 0.42) !important;
  filter: brightness(1.04);
}

.du-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: 660px;
}
.du-kicker {
  margin: 0 0 12px;
  color: var(--du-gold);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.du-hero h1,
.du-panel h1 {
  margin: 0;
  color: var(--du-text) !important;
  font-family: "Archivo Black", Manrope, sans-serif !important;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.07em;
  text-shadow: none !important;
}
.du-panel h1 {
  font-size: clamp(30px, 5vw, 54px);
  letter-spacing: -0.055em;
}
.du-lead {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--du-soft);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}
.du-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.du-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.du-feature-row span {
  padding: 9px 12px;
  border: 1px solid var(--du-line);
  border-radius: 999px;
  color: #d8d0ea;
  background: rgba(17, 17, 25, 0.62);
  font-size: 13px;
  font-weight: 800;
}
.du-showcase {
  perspective: 1200px;
}
.du-table-card {
  position: relative;
  min-height: 430px;
  border: 1px solid var(--du-line);
  border-radius: var(--du-radius-xl);
  background: #111119;
  box-shadow: var(--du-shadow);
  overflow: hidden;
  transform: rotateX(3deg) rotateY(-5deg);
}
.du-table-card::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(248, 207, 90, 0.12);
  border-radius: 26px;
}
.du-hero-logo {
  position: absolute;
  width: min(250px, 62%);
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.45));
  z-index: 2;
}
.du-card-stack {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.du-mini-card {
  position: absolute;
  width: 112px;
  height: 158px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 7px solid #f8fafc;
  border-radius: 18px;
  color: #fff;
  font-family: "Archivo Black", Manrope, sans-serif;
  font-size: 30px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}
.du-card-red {
  left: 32px;
  top: 42px;
  background: var(--du-red);
  transform: rotate(-13deg);
}
.du-card-gold {
  right: 38px;
  top: 54px;
  background: var(--du-gold);
  color: #291700;
  transform: rotate(11deg);
}
.du-card-purple {
  left: 50%;
  bottom: 34px;
  background: var(--du-purple);
  transform: translateX(-50%) rotate(4deg);
}
.du-table-status {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(5, 5, 8, 0.68);
  font-weight: 900;
  font-size: 13px;
}
.du-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--du-green);
  box-shadow: 0 0 16px var(--du-green);
}
.du-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  color: var(--du-faint);
  font-size: 13px;
}

.du-lobby {
  display: grid;
  place-items: center;
  padding: 24px 14px !important;
}
.du-panel,
.name,
center > form {
  width: min(760px, calc(100vw - 28px));
  margin: 0 auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid var(--du-line);
  border-radius: var(--du-radius-xl);
  background: var(--du-panel);
  box-shadow: var(--du-shadow);
  backdrop-filter: blur(14px);
  text-align: center;
}
.du-back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: #c4b5fd !important;
  text-decoration: none;
  font-weight: 900;
}
.du-panel-logo {
  width: min(210px, 58vw);
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.36));
}
.du-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.du-mode-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--du-line) !important;
  border-radius: 24px !important;
  color: var(--du-text) !important;
  background: rgba(17, 17, 25, 0.78) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34) !important;
  text-align: left;
}
.du-mode-card strong {
  display: block;
  margin-top: 18px;
  font-size: 22px;
}
.du-mode-card small {
  display: block;
  margin-top: 6px;
  color: var(--du-soft);
  font-weight: 800;
}
.du-mode-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #1b1203;
  background: var(--du-gold);
  font-size: 24px;
  font-weight: 950;
}
.du-form-card {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  text-align: left;
}
.du-form-card label {
  color: #efe9ff !important;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
input[type="text"],
input[type="number"],
select {
  width: 100%;
  margin: 0 0 8px;
  padding: 15px 16px;
  border: 1px solid var(--du-line);
  border-radius: 16px;
  outline: none;
  color: var(--du-text);
  background: rgba(17, 17, 25, 0.9);
  box-shadow: none;
  font: inherit;
}
input[type="text"]::placeholder {
  color: #696173;
}
input[type="text"]:focus {
  border-color: rgba(248, 207, 90, 0.58);
  box-shadow: 0 0 0 3px rgba(248, 207, 90, 0.1);
}

/* Legacy/gameplay compatibility */
#animated_div {
  width: min(330px, 72vw) !important;
  height: auto !important;
  min-height: 116px;
  margin: 0 auto 18px !important;
  border: 1px solid var(--du-line) !important;
  border-radius: 28px !important;
  background: var(--du-panel-strong) !important;
  animation: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--du-shadow) !important;
}
#animated_div img,
.animated_div {
  max-width: 74% !important;
  height: auto !important;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.42));
}
h1,
h2,
h3,
h4,
label {
  color: var(--du-text) !important;
  text-shadow: none !important;
}
a {
  color: #c4b5fd !important;
}
#players,
#floor,
#pt,
#cards {
  color: var(--du-text);
  border-color: var(--du-line) !important;
}
#players,
#floor {
  background: rgba(11, 11, 16, 0.72) !important;
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
}
#floor {
  padding: 14px;
}
#stat {
  color: #86efac !important;
  font-weight: 950;
}
#stat-2,
#indicator,
.msg,
.Players_remaining {
  color: var(--du-soft) !important;
}
.modal-content {
  color: var(--du-text);
  background: var(--du-panel-strong) !important;
  border-top: 1px solid var(--du-line);
}
.modal-header,
.modal-footer {
  background: #111119 !important;
}
.sound {
  background: rgba(17, 17, 25, 0.85) !important;
  border: 1px solid var(--du-line) !important;
  color: var(--du-gold) !important;
}
footer {
  color: var(--du-faint) !important;
  text-align: center;
  margin-top: 26px;
}
footer h2,
footer h3,
#designedby {
  color: var(--du-faint) !important;
}

/* Host, queue, and gameplay surfaces */
.du-room-page,
.du-game-page {
  min-height: 100vh;
}
.du-room-shell,
.du-game-shell {
  width: min(1220px, calc(100vw - 28px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.du-room-shell {
  display: grid;
  grid-template-columns: minmax(310px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: stretch;
}
.du-room-hero,
.du-room-board,
.du-opponents-panel,
.du-table-zone,
.du-hand-panel,
.du-game-topbar,
.du-loading-card {
  border: 1px solid var(--du-line);
  border-radius: var(--du-radius-xl);
  background: rgba(13, 13, 20, 0.92);
  box-shadow: var(--du-shadow);
  backdrop-filter: blur(14px);
}
.du-room-hero,
.du-room-board {
  padding: clamp(22px, 4vw, 34px);
}
.du-room-hero h1,
.du-room-board h2,
.du-game-topbar h2,
.du-hand-panel h2,
.du-opponents-panel h2 {
  margin: 0;
  letter-spacing: -0.045em;
}
.du-room-code {
  color: var(--du-gold);
  text-shadow: 0 0 24px rgba(248, 207, 90, 0.22);
}
.du-room-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.du-room-stats > div {
  padding: 14px;
  border: 1px solid rgba(248, 207, 90, 0.16);
  border-radius: 18px;
  background: rgba(5, 5, 8, 0.48);
}
.du-room-stats span,
.du-table-meta span,
.du-live-badge,
.du-loading-card small {
  display: block;
  color: var(--du-faint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.du-room-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--du-text);
  font-size: 22px;
  font-weight: 950;
}
.du-board-header,
.du-hand-actions,
.du-game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.du-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(5, 5, 8, 0.54);
}
.du-players-table,
#players,
#pt,
#cards,
#floor {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 8px !important;
}
.du-players-table th,
.du-players-table td,
#players th,
#players td,
#pt td {
  padding: 10px 12px;
  border: 1px solid rgba(154, 120, 255, 0.2);
  border-radius: 14px;
  color: var(--du-text) !important;
  background: rgba(5, 5, 8, 0.42);
}
#players th {
  color: var(--du-gold) !important;
}
.du-current-player td {
  border-color: rgba(248, 207, 90, 0.42) !important;
  background: rgba(248, 207, 90, 0.1) !important;
}
.du-loading-card {
  margin-top: 18px;
  padding: 18px;
  text-align: center;
}
.du-loading-card-large {
  min-height: 320px;
  display: grid;
  align-content: center;
}
.du-start-form {
  margin-top: 20px;
  text-align: center;
}
.du-room-footer,
.du-game-footer {
  width: min(1220px, calc(100vw - 28px));
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}
.du-game-shell {
  padding: 18px 0 0;
}
.du-game-topbar {
  padding: 16px;
  margin-bottom: 16px;
}
.du-game-status {
  min-width: min(360px, 52vw);
  padding: 10px 14px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 18px;
  background: rgba(5, 5, 8, 0.44);
  text-align: right;
}
.du-game-status #stat,
.du-game-status #stat-2 {
  margin: 0;
}
.du-game-status #stat {
  color: #86efac !important;
  font-size: 16px;
}
.du-game-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: stretch;
}
.du-opponents-panel,
.du-table-zone,
.du-hand-panel {
  padding: clamp(16px, 3vw, 24px);
}
.du-table-zone {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.du-table-glow {
  position: absolute;
  width: min(520px, 80vw);
  height: min(520px, 80vw);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  filter: blur(4px);
}
.du-table-meta {
  position: absolute;
  left: 20px;
  top: 18px;
  z-index: 2;
}
.du-table-meta strong {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--du-gold) !important;
  background: rgba(5, 5, 8, 0.54);
}
.du-table-zone #floor {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 190px;
  min-height: 230px;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 8, 0.58) !important;
}
#cardOnTable {
  margin: 0;
}
.du-hand-panel {
  margin-top: 16px;
}
.du-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.du-cards-scroll {
  margin-top: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scrollbar-color: var(--du-purple) rgba(17, 17, 25, 0.8);
}
.du-cards-scroll #cards {
  min-width: max-content;
}
.du-cards-scroll #cards td {
  padding: 8px;
  vertical-align: top;
}
.div_war9a_aadiyya,
.div_war9a_plus4,
.div_war9et_4_colors {
  transform-origin: center bottom;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42) !important;
}
.div_war9a_aadiyya:hover,
.div_war9a_plus4:hover,
.div_war9et_4_colors:hover {
  transform: translateY(-8px) rotate(-2deg);
  filter: brightness(1.08);
}
.du-color-modal {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--du-shadow);
}
.du-color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 12px;
  padding: 18px;
}
.du-color-grid button {
  min-height: 92px;
  border: 5px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}
.du-pick-red {
  background: #ef4444 !important;
}
.du-pick-green {
  background: #22c55e !important;
}
.du-pick-blue {
  background: #3b82f6 !important;
}
.du-pick-yellow {
  background: #f8cf5a !important;
}
.du-uno-ready {
  background: #ef4444 !important;
  color: #fff !important;
}
.du-uno-pressed {
  background: #22c55e !important;
  color: #06140b !important;
}

@media (max-width: 860px) {
  .du-shell {
    width: min(100% - 24px, 640px);
    padding-top: 16px;
  }
  .du-topbar {
    margin-bottom: 22px;
  }
  .du-brand small,
  .du-ghost-button {
    display: none;
  }
  .du-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 28px;
  }
  .du-hero h1 {
    font-size: clamp(42px, 14vw, 66px);
  }
  .du-table-card {
    min-height: 320px;
    transform: none;
  }
  .du-mini-card {
    width: 86px;
    height: 124px;
    font-size: 22px;
    border-width: 5px;
  }
  .du-choice-grid {
    grid-template-columns: 1fr;
  }
  .du-mode-card {
    min-height: 142px;
    text-align: center;
  }
  .du-footer {
    flex-direction: column;
    text-align: center;
  }
  .du-room-shell,
  .du-game-grid {
    grid-template-columns: 1fr;
  }
  .du-room-stats {
    grid-template-columns: 1fr;
  }
  .du-game-topbar,
  .du-hand-actions,
  .du-board-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .du-game-status {
    width: 100%;
    min-width: 0;
    text-align: left;
  }
  .du-table-zone {
    min-height: 320px;
  }
  .du-action-buttons {
    width: 100%;
    justify-content: flex-start;
  }
  .du-action-buttons form,
  .du-action-buttons input,
  .du-action-buttons button {
    flex: 1 1 150px;
  }
}

@media (max-width: 520px) {
  body {
    padding: 0;
  }
  .du-shell {
    width: calc(100% - 18px);
  }
  .du-top-actions {
    gap: 6px;
  }
  .du-icon-button {
    width: 42px;
    height: 42px;
  }
  .du-hero-actions > * {
    width: 100% !important;
  }
  .du-feature-row span {
    flex: 1 1 auto;
    text-align: center;
  }
  .du-panel {
    width: calc(100vw - 18px);
    border-radius: 26px;
  }
  .du-form-card .du-primary-button,
  .du-primary-button,
  input[type="submit"] {
    width: 100% !important;
  }
  .du-room-shell,
  .du-game-shell,
  .du-room-footer,
  .du-game-footer {
    width: calc(100vw - 18px);
  }
  .du-room-hero,
  .du-room-board,
  .du-opponents-panel,
  .du-table-zone,
  .du-hand-panel,
  .du-game-topbar {
    border-radius: 24px;
    padding: 16px;
  }
  .du-game-page .du-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
  .du-table-zone {
    min-height: 280px;
  }
  .du-table-zone #floor {
    min-width: 160px;
    min-height: 200px;
  }
  .du-cards-scroll {
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .du-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .du-color-grid button {
    min-height: 76px;
  }
}

/* Danex UNO motion + button polish override. */
@keyframes du-page-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes du-soft-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--du-rotate, 0deg));
  }
  50% {
    transform: translate3d(0, -12px, 0)
      rotate(calc(var(--du-rotate, 0deg) + 2deg));
  }
}
@keyframes du-table-breathe {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      var(--du-shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  50% {
    filter: brightness(1.08);
    box-shadow:
      0 32px 110px rgba(139, 92, 246, 0.22),
      var(--du-shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}
@keyframes du-gold-sheen {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 160% 50%;
  }
}
@keyframes du-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.55);
    opacity: 1;
  }
}
@keyframes du-orbit-glow {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

.du-shell,
.du-panel,
.du-room-shell,
.du-game-shell {
  animation: du-page-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.du-brand-mark,
.du-panel-logo,
.du-hero-logo {
  transition:
    transform 220ms ease,
    filter 220ms ease;
}
.du-brand:hover .du-brand-mark,
.du-panel-logo:hover,
.du-hero-logo:hover {
  transform: translateY(-2px) scale(1.035);
}
.du-hero-actions,
.du-form-card,
.du-start-form,
.du-action-buttons {
  align-items: center;
}
.du-hero-actions {
  width: fit-content;
  padding: 8px;
  border: 1px solid rgba(154, 120, 255, 0.18);
  border-radius: 24px;
  background: rgba(5, 5, 8, 0.38);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"] {
  position: relative;
  overflow: hidden;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  background-size: 220% 100% !important;
  animation: du-gold-sheen 3.8s linear infinite;
}
.du-primary-button::after,
#welbut::after,
#stackBut::after,
#unoBut::after,
input[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    transparent 12%,
    rgba(255, 255, 255, 0.42) 48%,
    transparent 62%
  );
  transform: translateX(-140%);
  transition: transform 520ms ease;
}
.du-primary-button:hover::after,
#welbut:hover::after,
#stackBut:hover::after,
#unoBut:hover::after,
input[type="submit"]:hover::after {
  transform: translateX(140%);
}
.du-icon-button:hover,
.du-ghost-button:hover,
.du-secondary-button:hover,
.du-primary-button:hover,
.button:hover,
#welbut:hover,
#start-button:hover,
#stackBut:hover,
#unoBut:hover,
input[type="submit"]:hover {
  width: auto !important;
  transform: translateY(-3px) scale(1.02);
}
.du-table-card {
  animation: du-table-breathe 5.5s ease-in-out infinite;
}
.du-mini-card {
  animation: du-soft-float 4.8s ease-in-out infinite;
}
.du-card-red {
  --du-rotate: -13deg;
  animation-delay: 0ms;
}
.du-card-gold {
  --du-rotate: 11deg;
  animation-delay: 260ms;
}
.du-card-purple {
  --du-rotate: 4deg;
  animation-delay: 520ms;
}
.du-live-dot {
  animation: du-dot-pulse 1.35s ease-in-out infinite;
}
.du-table-glow {
  animation: du-orbit-glow 18s linear infinite;
}
.du-mode-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}
.du-mode-card::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(
    circle,
    rgba(248, 207, 90, 0.16),
    transparent 34%
  );
  transform: translateY(38%);
  opacity: 0;
  transition:
    transform 260ms ease,
    opacity 260ms ease;
}
.du-mode-card:hover {
  transform: translateY(-6px);
  border-color: rgba(248, 207, 90, 0.44) !important;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.46) !important;
}
.du-mode-card:hover::after {
  transform: translateY(0);
  opacity: 1;
}
.du-action-buttons {
  padding: 8px;
  border: 1px solid rgba(154, 120, 255, 0.18);
  border-radius: 22px;
  background: rgba(5, 5, 8, 0.36);
}
.du-action-buttons form {
  margin: 0;
}
.du-action-buttons input,
.du-action-buttons button {
  min-width: 132px !important;
  min-height: 44px !important;
  padding: 11px 16px !important;
  white-space: nowrap;
}
.du-hand-panel {
  position: sticky;
  bottom: 12px;
  z-index: 5;
}
.du-cards-scroll {
  scroll-snap-type: x proximity;
}
.du-cards-scroll #cards td {
  scroll-snap-align: center;
}
.div_war9a_aadiyya,
.div_war9a_plus4,
.div_war9et_4_colors {
  will-change: transform;
}

@media (max-width: 860px) {
  .du-hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .du-hero-actions > * {
    width: 100% !important;
  }
  .du-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
  .du-action-buttons form,
  .du-action-buttons input,
  .du-action-buttons button {
    width: 100% !important;
  }
}
@media (max-width: 520px) {
  .du-hero-actions {
    grid-template-columns: 1fr;
  }
  .du-hand-panel {
    bottom: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes du-purple-float {
  0%,
  100% {
    transform: translateX(-50%) translate3d(0, 0, 0) rotate(4deg);
  }
  50% {
    transform: translateX(-50%) translate3d(0, -12px, 0) rotate(6deg);
  }
}
.du-card-purple {
  animation-name: du-purple-float !important;
}
.du-form-card .du-primary-button,
.du-start-form input[type="submit"] {
  justify-self: center;
}
@media (max-width: 520px) {
  .du-form-card .du-primary-button,
  .du-start-form input[type="submit"] {
    justify-self: stretch;
    width: 100% !important;
  }
}

/* Danex panel cleanup: less arcade, more Danex dashboard. */
:root {
  --du-panel-clean: #0b0b10;
  --du-panel-clean-2: #111117;
  --du-panel-border: rgba(139, 92, 246, 0.24);
}
body {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
  background:
    radial-gradient(
      circle at 18% 0%,
      rgba(139, 92, 246, 0.16),
      transparent 26rem
    ),
    linear-gradient(180deg, #07070b 0%, #0b0b10 42%, #07070b 100%) !important;
}
body::before {
  opacity: 0.18;
  background-size: 56px 56px;
}
.du-lobby {
  align-items: start;
  justify-items: center;
  padding-top: clamp(28px, 7vh, 76px) !important;
}
.du-panel,
.name,
center > form {
  position: relative;
  width: min(720px, calc(100vw - 28px));
  padding: clamp(74px, 8vw, 88px) clamp(20px, 4vw, 36px) clamp(24px, 4vw, 36px);
  border-radius: 20px;
  border-color: var(--du-panel-border);
  background:
    linear-gradient(180deg, rgba(17, 17, 23, 0.96), rgba(11, 11, 16, 0.98)),
    var(--du-panel-clean) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.du-back-link {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: 10px;
  color: #d8d0ea !important;
  background: rgba(17, 17, 23, 0.84);
  box-shadow: none;
  font-size: 13px;
  line-height: 1;
}
.du-back-link:hover {
  color: #f8cf5a !important;
  border-color: rgba(248, 207, 90, 0.38);
  transform: translateY(-1px);
}
.du-panel-logo {
  width: min(128px, 42vw);
  margin: 0 0 18px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.34));
}
.du-kicker {
  color: #f8cf5a;
  letter-spacing: 0.14em;
}
.du-panel h1,
.du-hero h1 {
  max-width: 680px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.du-lead {
  max-width: 600px;
  color: #b8b0cc;
  line-height: 1.65;
}
.du-choice-grid {
  gap: 14px;
  margin-top: 28px;
}
.du-mode-card {
  min-height: 148px;
  display: grid;
  align-content: start;
  padding: 18px;
  border-radius: 16px !important;
  background: #111117 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34) !important;
}
.du-mode-card strong {
  margin-top: 14px;
}
.du-mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.du-form-card {
  max-width: 520px;
  margin-top: 26px;
}
.du-form-card .du-primary-button,
.du-start-form input[type="submit"] {
  justify-self: start;
}
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"] {
  min-height: 44px;
  border-radius: 10px !important;
  padding: 11px 18px !important;
  box-shadow:
    0 12px 28px rgba(245, 158, 11, 0.18),
    0 12px 28px rgba(0, 0, 0, 0.3) !important;
  animation-duration: 6s;
}
input[type="text"],
input[type="number"],
select {
  border-radius: 10px;
  background: #111117;
}
.du-shell {
  width: min(1100px, calc(100vw - 32px));
}
.du-topbar {
  margin-bottom: 22px;
}
.du-hero {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--du-panel-border);
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 23, 0.96),
    rgba(11, 11, 16, 0.98)
  );
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.du-hero-actions {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.du-table-card {
  min-height: 320px;
  border-radius: 20px;
  transform: none;
  animation-duration: 8s;
}
.du-mini-card {
  border-radius: 14px;
}
.du-room-shell,
.du-game-shell,
.du-room-footer,
.du-game-footer {
  width: min(1120px, calc(100vw - 28px));
}
.du-room-hero,
.du-room-board,
.du-opponents-panel,
.du-table-zone,
.du-hand-panel,
.du-game-topbar,
.du-loading-card {
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(17, 17, 23, 0.95),
    rgba(11, 11, 16, 0.98)
  ) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}
.du-hand-panel {
  position: static;
}
@media (max-width: 860px) {
  .du-hero {
    grid-template-columns: 1fr;
  }
  .du-hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .du-panel-logo {
    margin-left: auto;
    margin-right: auto;
  }
  .du-panel h1,
  .du-panel .du-lead,
  .du-panel .du-kicker {
    text-align: center;
  }
  .du-form-card .du-primary-button,
  .du-start-form input[type="submit"] {
    justify-self: stretch;
    width: 100% !important;
  }
}
@media (max-width: 520px) {
  .du-lobby {
    min-height: 100dvh;
    padding: 12px 9px 18px !important;
    align-items: start;
  }
  .du-shell {
    width: calc(100vw - 18px);
    padding-top: 10px;
    padding-bottom: 18px;
  }
  .du-topbar {
    gap: 10px;
    margin-bottom: 12px;
  }
  .du-brand {
    min-width: 0;
  }
  .du-brand strong {
    max-width: 156px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .du-panel {
    width: calc(100vw - 18px);
    padding: 64px 16px 20px;
    border-radius: 16px;
  }
  .du-back-link {
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }
  .du-panel-logo {
    width: min(112px, 38vw);
  }
  .du-panel h1,
  .du-hero h1 {
    font-size: clamp(28px, 10vw, 40px);
    line-height: 1.05;
  }
  .du-lead {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.55;
  }
  .du-choice-grid,
  .du-hero-actions {
    grid-template-columns: 1fr;
  }
  .du-mode-card {
    min-height: 116px;
    padding: 15px;
    text-align: left;
  }
  .du-mode-card strong {
    margin-top: 10px;
    font-size: 18px;
  }
  .du-form-card {
    max-width: none;
    gap: 10px;
  }
  .du-room-shell,
  .du-game-shell,
  .du-room-footer,
  .du-game-footer {
    width: calc(100vw - 12px);
  }
  .du-room-shell {
    gap: 10px;
  }
  .du-room-hero,
  .du-room-board,
  .du-opponents-panel,
  .du-table-zone,
  .du-hand-panel,
  .du-game-topbar,
  .du-loading-card {
    border-radius: 14px;
    padding: 12px;
  }
  .du-game-shell {
    padding-top: 6px;
  }
  .du-game-topbar {
    margin-bottom: 10px;
  }
  .du-game-topbar .du-brand small {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .du-game-status {
    padding: 8px 10px;
    border-radius: 12px;
  }
  .du-game-grid {
    gap: 10px;
  }
  .du-opponents-panel {
    max-height: 180px;
    overflow: auto;
  }
  .du-table-zone {
    min-height: 238px;
  }
  .du-table-zone #floor {
    min-width: 132px;
    min-height: 170px;
    padding: 8px;
  }
  .du-table-meta {
    left: 12px;
    top: 12px;
  }
  .du-hand-panel {
    margin-top: 10px;
  }
  .du-hand-actions {
    gap: 10px;
  }
  .du-action-buttons {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
  }
  .du-action-buttons form,
  .du-action-buttons input,
  .du-action-buttons button,
  #stackBut,
  #unoBut {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
  }
  .du-cards-scroll {
    margin: 12px -12px 0;
    padding: 0 12px 8px;
  }
  .du-cards-scroll #cards td {
    padding: 4px;
  }
  .div_war9a_aadiyya,
  .div_war9a_plus4,
  .div_war9et_4_colors {
    transform: scale(0.86);
    transform-origin: center bottom;
  }
  .div_war9a_aadiyya:hover,
  .div_war9a_plus4:hover,
  .div_war9et_4_colors:hover {
    transform: scale(0.88) translateY(-5px);
  }
}

/* Danex UNO v7 card redesign + one-click wild cards. */
.du-uno-card,
button.du-uno-card,
.div_war9a_aadiyya,
.div_war9a_plus2,
.div_war9a_plus4,
.div_war9a_inverse,
.div_war9a_block,
.div_war9et_4_colors {
  width: 96px !important;
  height: 142px !important;
  min-width: 96px !important;
  min-height: 142px !important;
  position: relative;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  padding: 0 !important;
  border: 5px solid rgba(255, 255, 255, 0.92) !important;
  border-radius: 18px !important;
  color: #fff !important;
  background:
    radial-gradient(
      circle at 50% 48%,
      rgba(255, 255, 255, 0.24),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      var(--uno-card-color, #111117),
      color-mix(in srgb, var(--uno-card-color, #111117), #000 34%)
    ) !important;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -18px 32px rgba(0, 0, 0, 0.18) !important;
  cursor: pointer;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
.du-uno-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  transform: rotate(-24deg);
  background: rgba(255, 255, 255, 0.06);
}
.du-uno-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 12%,
    rgba(255, 255, 255, 0.26) 46%,
    transparent 58%
  );
  transform: translateX(-130%);
  transition: transform 420ms ease;
}
.du-uno-card:hover::after {
  transform: translateX(130%);
}
.du-uno-center,
.du-action-glyph {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: #fff;
  font-size: 42px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
}
.du-action-glyph {
  font-size: 38px;
}
.du-uno-corner {
  position: absolute;
  z-index: 2;
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  text-shadow: 0 3px 9px rgba(0, 0, 0, 0.48);
}
.du-uno-corner-top {
  top: 9px;
  left: 10px;
}
.du-uno-corner-bottom {
  right: 10px;
  bottom: 9px;
  transform: rotate(180deg);
}
.du-uno-brand-mini {
  position: absolute;
  z-index: 2;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  color: #1b1203;
  background: linear-gradient(145deg, #fff2b8, #f8cf5a, #f59e0b);
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
}
.du-uno-card-wild,
.du-uno-card-plus4 {
  --uno-card-color: #111117;
  background:
    radial-gradient(
      circle at 50% 48%,
      rgba(255, 255, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(145deg, #171720, #050508) !important;
}
.du-wild-orb,
.du-stack-icon {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.36);
  transform: rotate(-14deg);
}
.du-wild-orb i,
.du-stack-icon i {
  display: block;
  border-radius: 8px;
}
.du-wild-orb i:nth-child(1),
.du-stack-icon i:nth-child(1) {
  background: #ef4444;
}
.du-wild-orb i:nth-child(2),
.du-stack-icon i:nth-child(2) {
  background: #22c55e;
}
.du-wild-orb i:nth-child(3),
.du-stack-icon i:nth-child(3) {
  background: #3b82f6;
}
.du-wild-orb i:nth-child(4),
.du-stack-icon i:nth-child(4) {
  background: #f8cf5a;
}
.du-stack-icon {
  border-radius: 13px;
  transform: rotate(-8deg);
}
.du-stack-icon::after {
  content: "+4";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 1000;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.65);
}
.du-cards-scroll #cards td {
  padding: 8px 6px !important;
}
#floor .du-uno-card {
  width: 112px !important;
  height: 166px !important;
  min-width: 112px !important;
  min-height: 166px !important;
  pointer-events: none;
}
#floor .du-uno-center,
#floor .du-action-glyph {
  width: 68px;
  height: 68px;
  font-size: 48px;
}
@media (max-width: 520px) {
  .du-uno-card,
  button.du-uno-card,
  .div_war9a_aadiyya,
  .div_war9a_plus2,
  .div_war9a_plus4,
  .div_war9a_inverse,
  .div_war9a_block,
  .div_war9et_4_colors {
    width: 82px !important;
    height: 122px !important;
    min-width: 82px !important;
    min-height: 122px !important;
    border-radius: 15px !important;
  }
  .du-uno-center,
  .du-action-glyph {
    width: 50px;
    height: 50px;
    font-size: 34px;
  }
  .du-wild-orb,
  .du-stack-icon {
    width: 50px;
    height: 50px;
  }
  #floor .du-uno-card {
    width: 96px !important;
    height: 142px !important;
    min-width: 96px !important;
    min-height: 142px !important;
  }
}

/* Final anti-slop pass: flat dark-purple surfaces, restrained motion. */
body {
  background: #050508 !important;
}
.du-panel,
.name,
center > form,
.du-hero,
.du-table-card,
.du-room-hero,
.du-room-board,
.du-opponents-panel,
.du-table-zone,
.du-hand-panel,
.du-game-topbar,
.du-loading-card {
  background: #0b0b10 !important;
  border-color: rgba(139, 92, 246, 0.24) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42) !important;
}
.du-brand-mark,
.du-mode-icon,
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"],
.du-uno-brand-mini {
  background: #f8cf5a !important;
}
.du-card-gold {
  background: #f8cf5a !important;
}
.du-card-purple {
  background: #8b5cf6 !important;
}
.du-table-glow,
.du-primary-button::after,
#welbut::after,
#stackBut::after,
#unoBut::after,
input[type="submit"]::after,
.du-mode-card::after,
.du-uno-card::after {
  display: none !important;
}
.du-primary-button,
.button,
#welbut,
#start-button,
#stackBut,
#unoBut,
input[type="submit"],
.du-table-card,
.du-mini-card,
.du-live-dot,
.du-table-glow {
  animation: none !important;
}
.du-mode-card,
.du-uno-card,
button.du-uno-card,
.div_war9a_aadiyya,
.div_war9a_plus2,
.div_war9a_plus4,
.div_war9a_inverse,
.div_war9a_block,
.div_war9et_4_colors {
  background-image: none !important;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.du-mode-card:hover,
.du-uno-card:hover,
button.du-uno-card:hover,
.div_war9a_aadiyya:hover,
.div_war9a_plus2:hover,
.div_war9a_plus4:hover,
.div_war9a_inverse:hover,
.div_war9a_block:hover,
.div_war9et_4_colors:hover {
  transform: translateY(-3px) !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
