:root {
  /* Core Palette: Petualangan Kartu Kayu (Warm Walnut, Oak, Cozy Forest Felt, Linen, Glossy Amber) */
  --wood-deep: #3A2415;
  --wood-mid: #5A3A21;
  --wood-oak: #8A5A30;
  --wood-rim: #6E492B;
  --wood-muted: #DECBB2;

  --felt-deep: #1F4D36;
  --felt-mid: #286446;
  --felt-rim: #3A7D5B;

  --linen-ground: #FBF1DE;
  --linen-surface: #FFFAF0;
  --linen-alt: #F1E2C4;
  --linen-border: #E2CCA4;
  --linen-border-strong: #D4B27A;

  --brass: #F5B83D;
  --brass-light: #FFD067;
  --brass-hover: #E6A628;
  --brass-dark: #C68A14;
  --brass-ink: #2B1A0F;
  --brass-on-linen: #7A5410;
  --brass-tint: #F8EAC8;

  --ink-primary: #2B1A0F;
  --ink-secondary: #5C4532;
  --ink-muted: #6B5440;
  --ink-on-dark: #FBF1DE;
  --ink-on-dark-muted: #E3D1B8;

  /* Semantic Player Identity Badges (used inside active games only) */
  --p1-accent: #C6422C;
  --p1-dark: #8C2D1D;
  --p1-tint: #FCECE8;

  --p2-accent: #275D85;
  --p2-dark: #1B425E;
  --p2-tint: #E7F1F8;

  --p3-accent: #1F6844;
  --p3-dark: #154B31;
  --p3-tint: #E4F3EB;

  --p4-accent: #7A3B5E;
  --p4-dark: #582843;
  --p4-tint: #F6E9F0;

  --danger-fill: #A83328;
  --danger-hover: #87251C;
  --danger-bg: #FCE8E6;
  --danger-text: #85221B;

  --success-bg: #D8ECD5;
  --success-text: #1C4A2D;

  --wood-plank:
    repeating-linear-gradient(
      180deg,
      rgba(255, 232, 198, 0.018) 0 1px,
      transparent 1px 6px,
      rgba(12, 5, 2, 0.05) 6px 7px,
      transparent 7px 15px
    ),
    linear-gradient(180deg, #432917 0%, #311D10 100%);
  --felt-fx:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.1), transparent 65%),
    repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    var(--felt-deep);
  --linen-fx:
    repeating-linear-gradient(0deg, rgba(120, 80, 30, 0.032) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(120, 80, 30, 0.032) 0 1px, transparent 1px 4px),
    var(--linen-ground);

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-tag: 6px;
  --radius-control: 11px;
  --radius-card: 16px;
  --radius-panel: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  background-color: #E8C574;
  color: var(--wood-deep);
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--wood-rim) var(--linen-alt);
  scrollbar-width: thin;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--linen-ground);
  color: var(--ink-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-viewport-locked {
  height: 100dvh;
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

a[href],
button,
[role="tab"],
input[type="range"] {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 2.5px solid var(--brass);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Shell Modes */
.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell.is-desk {
  min-height: 100dvh;
  background: var(--linen-fx);
}

.app-shell.is-playing {
  height: 100dvh;
  overflow: hidden;
  background-color: var(--wood-deep);
  padding: 6px 10px 8px;
  gap: 6px;
}

/* =====================================================
   SITE HEADER (Walnut Wood Bar)
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--wood-plank);
  color: var(--ink-on-dark);
  border-bottom: 1px solid rgba(255, 224, 178, 0.14);
  box-shadow: 0 4px 0 rgba(20, 10, 4, 0.25);
  flex-shrink: 0;
  transition: box-shadow 0.22s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 6px 24px rgba(12, 6, 2, 0.42);
}

.site-header-inner {
  width: min(94vw, 1600px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px clamp(16px, 2.5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: var(--radius-control);
  color: var(--ink-on-dark);
  text-align: left;
  min-height: 44px;
}

.brand-home-btn:hover {
  background-color: rgba(251, 241, 222, 0.07);
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
  border-radius: 10px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.32));
}

.brand-logo-img.is-sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-svg {
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.24rem;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--ink-on-dark-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--ink-on-dark-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.nav-link:hover {
  color: var(--ink-on-dark);
  background-color: rgba(251, 241, 222, 0.1);
}

.nav-link.is-active {
  background-color: rgba(245, 184, 61, 0.18);
  color: var(--brass);
  box-shadow: inset 0 0 0 1.8px rgba(245, 184, 61, 0.65);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn.btn-wood-icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--ink-on-dark);
  border: 1.5px solid rgba(251, 241, 222, 0.32);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
}

.btn.btn-wood-icon svg {
  flex-shrink: 0;
  display: block;
}

.btn.btn-wood-icon:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: var(--brass);
}

.btn.btn-wood-icon.is-muted {
  opacity: 0.58;
}

/* =====================================================
   BUTTONS (Deliberate Radius & High Contrast)
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-lg {
  min-height: 48px;
  padding: 0 24px;
  font-size: 0.98rem;
}

.btn-compact {
  min-height: 38px;
  padding: 0 13px;
  font-size: 0.85rem;
}

.btn-xs {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.btn-wide {
  width: 100%;
  min-height: 46px;
  font-size: 0.98rem;
}

/* Primary Focal 3D Glossy Amber CTA */
.btn-brass {
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 100%);
  color: var(--brass-ink);
  border-color: var(--brass-dark);
  box-shadow: 0 4px 0 var(--brass-dark), 0 8px 16px rgba(24, 12, 4, 0.26);
}

.btn-brass:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-brass:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--brass-dark);
}

/* 3D Forest Action CTA */
.btn-forest {
  background: linear-gradient(180deg, #2B6B4B 0%, var(--felt-deep) 100%);
  color: var(--ink-on-dark);
  border-color: #123121;
  box-shadow: 0 4px 0 #0F2B1D, 0 8px 14px rgba(15, 43, 29, 0.2);
}

.btn-forest:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-forest:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0F2B1D;
}

/* Dark Wood Surface Buttons */
.btn-wood-quiet {
  background-color: var(--wood-mid);
  color: var(--ink-on-dark);
  border-color: var(--wood-rim);
}

.btn-wood-quiet:hover:not(:disabled) {
  background-color: #423025;
  border-color: #6B5140;
}

.btn-wood-outline {
  background-color: transparent;
  color: var(--ink-on-dark);
  border-color: #6B5342;
}

.btn-wood-outline:hover:not(:disabled) {
  background-color: rgba(250, 243, 227, 0.08);
  border-color: var(--brass);
}

/* Light Linen Surface Buttons */
.btn-linen-outline {
  background-color: var(--linen-surface);
  color: var(--ink-primary);
  border-color: var(--linen-border-strong);
  box-shadow: 0 2px 0 var(--linen-border);
}

.btn-linen-outline:hover:not(:disabled) {
  background-color: var(--linen-alt);
  border-color: var(--wood-rim);
}

.btn-linen-outline:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--linen-border);
}

.btn-danger {
  background-color: var(--danger-fill);
  color: var(--ink-on-dark);
  border-color: var(--danger-hover);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
}

.btn-danger-quiet {
  background-color: #3E231F;
  color: #F8D4CE;
  border-color: #7D3E36;
}

.btn-danger-quiet:hover:not(:disabled) {
  background-color: #572D27;
  border-color: #A65247;
}

.btn-link {
  background: none;
  border: none;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 36px;
  padding: 0 6px;
}

/* Themed Transition Loading Overlay */
@keyframes loadingCardFlip {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes loadingBarSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(180%); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(34, 20, 11, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-box {
  background: var(--linen-surface);
  color: var(--ink-primary);
  border: 3px solid var(--wood-oak);
  border-radius: 20px;
  padding: 28px 36px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: min(90vw, 340px);
  text-align: center;
}

.loading-cards {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.load-card {
  width: 34px;
  height: 46px;
  border-radius: 6px;
  background: #263948;
  border: 2px solid var(--brass);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  animation: loadingCardFlip 0.7s ease-in-out infinite;
}

.load-card.lc-2 {
  background: var(--felt-deep);
  animation-delay: 0.12s;
}

.load-card.lc-3 {
  background: #C6422C;
  animation-delay: 0.24s;
}

.loading-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.18rem;
  color: var(--ink-primary);
}

.loading-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background-color: var(--linen-alt);
  overflow: hidden;
}

.loading-bar {
  display: block;
  width: 55%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brass-dark), var(--brass), var(--brass-light));
  animation: loadingBarSweep 0.65s ease-in-out infinite;
}

/* Floating Alert Toast */
.alert-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-radius: var(--radius-control);
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border: 1.5px solid #D4A19C;
  box-shadow: 0 10px 28px rgba(24, 16, 12, 0.24);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: min(92vw, 580px);
}

.alert-toast.is-info {
  background-color: var(--success-bg);
  color: var(--success-text);
  border-color: #9CC0AA;
}

/* Main Stage */
.main-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* =====================================================
   MOTION KEYFRAMES & SCROLL REVEAL CHOREOGRAPHY
   ===================================================== */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardFloatIdle {
  0%, 100% {
    transform: rotate(-1deg) translateY(-4px);
  }
  50% {
    transform: rotate(-1deg) translateY(-9px);
  }
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes calloutPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 155, 38, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(217, 155, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 155, 38, 0);
  }
}

@keyframes urgentPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes scoreBump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.22);
    color: var(--brass);
  }
  100% {
    transform: scale(1);
  }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes wordStaggerIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.hero-copy > *:not(h1) {
  animation: riseIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-copy > *:nth-child(2) { animation-delay: 420ms; }
.hero-copy > *:nth-child(3) { animation-delay: 520ms; }
.hero-copy > *:nth-child(4) { animation-delay: 610ms; }

.hero-word {
  display: inline-block;
  animation: wordStaggerIn 0.56s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--w, 0) * 65ms + 40ms) both;
}

.hero-stage-card {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

/* =====================================================
   LANDING PAGE (Petualangan Kartu Kayu)
   ===================================================== */
.landing-page {
  display: flex;
  flex-direction: column;
}

.band-inner {
  width: min(94vw, 1600px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 40px);
}

/* Band 1: Full-Bleed Tavern Hero (Character integrated directly into Hero Background!) */
.hero-band {
  background:
    linear-gradient(180deg, #2B180D 0%, #372012 100%);
  color: var(--ink-on-dark);
  min-height: calc(100dvh - 66px);
  padding: clamp(40px, 5vh, 72px) 0 clamp(56px, 7vh, 92px);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-backdrop-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-backdrop-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(24, 12, 5, 0.62) 0%,
    rgba(28, 15, 7, 0.36) 36%,
    rgba(28, 15, 7, 0.08) 54%,
    transparent 68%
  );
  pointer-events: none;
}

.hero-mascot-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 740px;
  text-shadow: 0 3px 16px rgba(12, 6, 2, 0.78);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.65rem, 4.7vw, 4.35rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: #FFF9EE;
  text-wrap: balance;
}

.hero-copy h1 em {
  font-style: normal;
  color: #FFD15C;
  text-shadow:
    0 3px 18px rgba(245, 184, 61, 0.38),
    0 4px 16px rgba(12, 6, 2, 0.85);
  text-decoration: underline;
  text-decoration-color: rgba(255, 209, 92, 0.55);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}

.hero-lead {
  margin: 0;
  font-size: clamp(1.06rem, 1.22vw, 1.18rem);
  color: #F6EAD6;
  max-width: 54ch;
  line-height: 1.62;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  text-shadow: none;
}

.hero-chips {
  list-style: none;
  margin: 10px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(251, 241, 222, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-on-dark);
}

.hero-chips svg {
  color: var(--brass);
  flex-shrink: 0;
}

.hero-scene-spacer {
  position: relative;
  min-height: 360px;
}

.hero-sticky-note {
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 4;
  background: linear-gradient(180deg, #F3E5C2 0%, #E3C28A 100%);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.24;
  padding: 10px 16px;
  border-radius: 4px;
  transform: rotate(3.5deg);
  box-shadow: 0 6px 16px rgba(12, 6, 2, 0.45);
  pointer-events: none;
}

.hero-ledge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  z-index: 3;
  background: linear-gradient(180deg, #9C693A 0%, #6D4624 65%, #3A2212 100%);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
}

/* Band 2: Warm Woven Linen Game Catalog */
.catalog-band {
  background: var(--linen-fx);
  padding: 60px 0 68px;
}

.section-head {
  margin-bottom: 28px;
  max-width: 64ch;
}

.section-head.is-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.heading-icon-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.section-head p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

/* Flagship Game Split (Elevated Warm Linen Card) */
.game-feature-flagship {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.18fr);
  border-radius: var(--radius-panel);
  overflow: hidden;
  border: 1.5px solid var(--linen-border);
  background-color: var(--linen-surface);
  margin-bottom: 24px;
  box-shadow: 0 6px 0 var(--linen-alt), 0 14px 24px rgba(90, 58, 33, 0.12);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.game-feature-flagship:hover {
  border-color: var(--wood-oak);
}

.flagship-plate {
  position: relative;
  background: var(--felt-fx);
  color: var(--ink-on-dark);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  overflow: hidden;
}

.sparkle-star {
  position: absolute;
  width: 11px;
  height: 11px;
  background-color: var(--brass-light);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  opacity: 0.85;
  pointer-events: none;
}

.sparkle-star.s1 { top: 22%; left: 16%; width: 13px; height: 13px; }
.sparkle-star.s2 { top: 18%; right: 20%; width: 9px; height: 9px; opacity: 0.7; }
.sparkle-star.s3 { bottom: 26%; right: 14%; width: 12px; height: 12px; }

.plate-card-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.plate-mini-card {
  width: 108px;
  height: 144px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 22px rgba(10, 8, 5, 0.38);
  transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.plate-mini-card.is-back {
  background-color: #263948;
  border: 2.5px solid var(--brass);
  transform: rotate(-11deg) translateX(12px);
  z-index: 1;
}

.mini-diamond {
  width: 30px;
  height: 30px;
  border: 2px solid var(--brass);
  background-color: rgba(245, 184, 61, 0.2);
  transform: rotate(45deg);
}

.plate-mini-card.is-mid {
  background-color: #F4F9F5;
  border: 2px solid #C6D8CC;
  transform: rotate(-1deg) translateY(-5px);
  overflow: hidden;
  z-index: 2;
  animation: cardFloatIdle 4.4s ease-in-out infinite;
}

.plate-mini-card.is-front {
  background-color: #FFF4EA;
  border: 2px solid #DEC9A8;
  transform: rotate(9deg) translateX(-12px);
  overflow: hidden;
  z-index: 3;
}

.game-feature-flagship:hover .plate-mini-card.is-back {
  transform: rotate(-16deg) translateX(2px);
}

.game-feature-flagship:hover .plate-mini-card.is-front {
  transform: rotate(14deg) translateX(-2px);
}

.mini-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background-color: #D6452F;
}

.mini-top-bar.is-pinus {
  background-color: #1F6844;
}

.mini-num {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  color: #C6422C;
}

.mini-num.is-pinus {
  color: #1F5945;
}

.plate-caption {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #EBF5ED;
}

.plate-cap-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.flagship-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.game-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-tag {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
}

.status-tag.is-live {
  background-color: var(--success-bg);
  color: var(--success-text);
}

.status-tag.is-soon {
  background-color: #F4E2BD;
  color: #7A5410;
}

.meta-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.flagship-body h3,
.game-card-secondary h3,
.game-card-upcoming h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.72rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.flagship-body p,
.game-card-secondary p,
.game-card-upcoming p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.96rem;
  max-width: 58ch;
}

.flagship-specs,
.secondary-specs {
  margin: 4px 0;
  padding: 12px 0;
  border-top: 1px dashed #D9BF8D;
  border-bottom: 1px dashed #D9BF8D;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flagship-specs dt,
.secondary-specs dt {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.flagship-specs dd,
.secondary-specs dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.card-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

/* Equal 2-Column Duo Row */
.catalog-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.game-card-secondary {
  background-color: var(--linen-surface);
  border: 1.5px solid var(--linen-border);
  border-radius: var(--radius-panel);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 0 var(--linen-alt), 0 14px 24px rgba(90, 58, 33, 0.12);
  transition: border-color 0.2s ease;
}

.game-card-secondary:hover {
  border-color: var(--wood-oak);
}

.secondary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tile-preview-strip {
  display: flex;
  gap: 6px;
}

.tile-swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 2px 0 rgba(24, 16, 12, 0.24);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.game-card-secondary:hover .tile-swatch:nth-child(1) { transform: translateY(-3px); }
.game-card-secondary:hover .tile-swatch:nth-child(2) { transform: translateY(-5px); transition-delay: 35ms; }
.game-card-secondary:hover .tile-swatch:nth-child(3) { transform: translateY(-3px); transition-delay: 70ms; }
.game-card-secondary:hover .tile-swatch:nth-child(4) { transform: translateY(-5px); transition-delay: 105ms; }

.tile-swatch.is-ochre {
  background-color: var(--brass);
  color: var(--brass-ink);
}

.tile-swatch.is-forest {
  background-color: var(--felt-deep);
  color: var(--ink-on-dark);
}

.tile-swatch.is-slate {
  background-color: var(--p2-accent);
  color: var(--ink-on-dark);
}

.tile-swatch.is-terracotta {
  background-color: var(--p1-accent);
  color: var(--ink-on-dark);
}

.tile-swatch.is-uno-red {
  background-color: #C8362B;
  color: #FFF9EC;
}

.tile-swatch.is-uno-yellow {
  background-color: #E8A825;
  color: #2B1A0F;
}

.tile-swatch.is-uno-green {
  background-color: #1E7A46;
  color: #FFF9EC;
}

.tile-swatch.is-uno-blue {
  background-color: #225D94;
  color: #FFF9EC;
}

.game-card-upcoming.is-full-row {
  margin-top: 24px;
  padding-right: clamp(28px, 18vw, 240px);
}

.upcoming-full-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.game-card-upcoming.is-full-row p {
  max-width: 64ch;
}

.game-card-upcoming {
  position: relative;
  overflow: hidden;
  background-color: #F6EAD3;
  border: 1.5px solid var(--linen-border);
  border-radius: var(--radius-panel);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 0 #E7D4B1, 0 14px 24px rgba(90, 58, 33, 0.1);
}

.game-card-upcoming p {
  max-width: 34ch;
  position: relative;
  z-index: 2;
}

.game-card-upcoming .card-action-row {
  position: relative;
  z-index: 2;
}

.upcoming-board-art {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 215px;
  height: auto;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(135deg, transparent 6%, #000 32%);
  mask-image: linear-gradient(135deg, transparent 6%, #000 32%);
}

.game-card-secondary .card-action-row,
.game-card-upcoming .card-action-row {
  margin-top: auto;
}

/* Band 3: Deep Forest Felt Highlights + Cozy Mascot & Gold Badges */
.highlights-band {
  position: relative;
  background: var(--felt-fx);
  color: var(--ink-on-dark);
  padding: 64px 0 0;
  overflow: hidden;
}

.highlights-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.22fr);
  gap: 44px;
  align-items: end;
}

.highlights-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.highlights-intro h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.highlights-intro p {
  margin: 0;
  color: #DCECE1;
  font-size: 0.98rem;
  line-height: 1.62;
  max-width: 48ch;
}

.perks-mascot-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: -2px;
}

.perks-mascot-art {
  display: block;
  width: min(360px, 92%);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(10, 24, 15, 0.34));
}

.perks-table-ledge {
  height: 11px;
  background: linear-gradient(180deg, #9C693A 0%, #6D4624 65%, #462B16 100%);
}

.highlights-list {
  list-style: none;
  counter-reset: rule-item;
  margin: 0 0 64px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.highlights-list li {
  counter-increment: rule-item;
  position: relative;
  padding: 15px 18px 15px 72px;
  background-color: rgba(14, 34, 24, 0.34);
  border: 1px solid rgba(251, 241, 222, 0.14);
  border-radius: 14px;
}

.highlights-list li::before {
  content: "0" counter(rule-item);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  background-color: var(--wood-mid);
  color: var(--brass);
  border: 2px solid var(--brass-dark);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.highlights-list h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--brass);
}

.highlights-list p {
  margin: 0;
  color: #E7F2EA;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Band 4: Two-Track Flow with Sage Circular Medallions */
.flow-band {
  background: var(--linen-fx);
  padding: 60px 0 68px;
}

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

.flow-track {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 0 20px;
  border-top: 1.5px solid #DFC496;
  border-bottom: 2px solid #D9B57A;
}

.flow-medallion {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background-color: #DDE6C8;
  color: var(--felt-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(31, 77, 54, 0.14);
}

.flow-track-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flow-track h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink-primary);
}

.flow-track p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.93rem;
  max-width: 50ch;
}

/* Cozy Wood Plank Footer */
.site-footer {
  background: var(--wood-plank);
  color: var(--ink-on-dark-muted);
  border-top: 3px solid var(--wood-oak);
  padding: 26px 0 22px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.1;
  color: var(--ink-on-dark);
}

.footer-brand span {
  display: block;
  font-size: 0.78rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--ink-on-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.footer-nav a:hover {
  color: var(--brass);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-links a,
.footer-btn {
  background: rgba(251, 241, 222, 0.08);
  border: 1px solid rgba(251, 241, 222, 0.22);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--ink-on-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

.footer-links a:hover,
.footer-btn:hover {
  color: var(--brass);
  border-color: var(--brass);
}

.footer-bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(251, 241, 222, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-copy {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink-on-dark-muted);
}

.footer-copy strong {
  color: var(--ink-on-dark);
}

.footer-socials {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--ink-on-dark-muted);
}

.footer-social-link {
  color: var(--brass-light);
  text-decoration: none;
  font-weight: 700;
}

.footer-social-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =====================================================
   ARENA PILIH GAME (Cozy Tavern Tabletop Menu) & CLEAN LOBBY DESKS
   ===================================================== */
.desk-shell {
  width: min(94vw, 1600px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px clamp(16px, 2.5vw, 40px) 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: viewFadeIn 0.22s ease-out;
}

.hub-shell {
  position: relative;
  width: 100%;
  min-height: calc(100dvh - 66px);
  padding: 16px clamp(16px, 3.6vw, 60px) clamp(150px, 21vh, 225px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(8px, 1.4vh, 18px);
  background:
    linear-gradient(180deg, rgba(22, 11, 5, 0.28) 0%, rgba(22, 11, 5, 0.04) 28%, rgba(22, 11, 5, 0) 68%),
    url('assets/Bocah%20Chibi/hub-tavern-bg.webp?v=2') center bottom / cover no-repeat;
  background-color: #2B170A;
  overflow: hidden;
  animation: viewFadeIn 0.24s ease-out;
}

.hub-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/Bocah%20Chibi/hub-tavern-table-fg.png?v=1') center bottom / cover no-repeat;
  pointer-events: none;
  z-index: 2;
}

.hub-topbar {
  width: min(100%, 1580px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 6;
}

.desk-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.desk-crumb {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.desk-crumb strong {
  color: var(--ink-primary);
}

.hub-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 999px;
  background: rgba(24, 12, 5, 0.56);
  border: 1px solid rgba(251, 241, 222, 0.2);
  backdrop-filter: blur(6px);
}

.filter-pill {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-on-dark-muted);
  font-weight: 700;
  font-size: 0.84rem;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-pill:hover {
  color: var(--ink-on-dark);
  background: rgba(255, 255, 255, 0.1);
}

.filter-pill.is-active {
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 100%);
  color: var(--brass-ink);
  border-color: var(--brass-dark);
  box-shadow: 0 2px 0 #9D620E;
}

/* Center Tavern Stage: Centered Upper Plaque + Mascot Left (Behind Table) + Game Carousel Right */
.hub-tavern-stage {
  width: min(100%, 1580px);
  flex: 1;
  margin: 0 auto;
  padding-top: clamp(4px, 1vh, 14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(14px, 2.4vh, 30px);
}

.hub-stage-row {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: minmax(300px, 435px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(12px, 1.8vw, 26px);
}

.hub-cards-col {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.hub-plaque-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 26px;
}

.hub-plaque-sparks {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(24, 12, 5, 0.45));
}

.hub-plaque {
  position: relative;
  min-width: min(440px, 76vw);
  padding: 15px 48px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #256142 0%, #19452E 100%);
  border: 4px solid #C68339;
  box-shadow:
    inset 0 0 0 2px rgba(255, 224, 152, 0.28),
    0 0 0 3px #3E1F0C,
    0 8px 0 #4B260F,
    0 14px 26px rgba(15, 7, 2, 0.48);
  text-align: center;
}

.hub-plaque-cards {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(20, 10, 4, 0.45));
}

.hub-plaque h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  letter-spacing: 0.02em;
  color: #FFF7E4;
  text-shadow: 0 2px 0 #102D1E, 0 4px 10px rgba(0, 0, 0, 0.35);
  line-height: 1.1;
}

.hub-mascot-col {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin-bottom: clamp(46px, 4.4vw, 82px);
  pointer-events: none;
}

.hub-mascot-sparks {
  position: absolute;
  top: 14%;
  left: 6px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(24, 12, 5, 0.45));
}

.hub-mascot-img {
  display: block;
  width: min(100%, 440px);
  height: auto;
  filter: drop-shadow(0 12px 22px rgba(16, 8, 3, 0.58));
  transform-origin: bottom center;
  animation: mascotFloatIdle 4.2s ease-in-out infinite;
}

@keyframes mascotFloatIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.hub-carousel-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hub-carousel-nav {
  position: static;
  transform: none;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid #E8B84B;
  background: rgba(43, 27, 17, 0.94);
  color: #FFF7E4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 6, 3, 0.55);
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease, opacity 0.18s ease;
}

.hub-carousel-nav:hover:not(:disabled) {
  background: #4A2B18;
  transform: scale(1.07);
}

.hub-carousel-nav:active:not(:disabled) {
  transform: scale(0.95);
}

.hub-carousel-nav.is-edge-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.hub-carousel-nav[hidden] {
  display: none;
}

.hub-games-grid {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(14px, 1.45vw, 22px);
  align-items: stretch;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 8px;
  padding: 14px 8px 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 184, 75, 0.6) rgba(24, 12, 5, 0.28);
}

.hub-games-grid.is-overflowing {
  justify-content: flex-start;
}

.hub-games-grid::-webkit-scrollbar {
  height: 7px;
}

.hub-games-grid::-webkit-scrollbar-track {
  background: rgba(24, 12, 5, 0.34);
  border-radius: 999px;
  margin-inline: 24px;
}

.hub-games-grid::-webkit-scrollbar-thumb {
  background: rgba(232, 184, 75, 0.72);
  border-radius: 999px;
}

.hub-games-grid::-webkit-scrollbar-thumb:hover {
  background: #F5C85C;
}

.hub-game-card {
  flex: 0 0 clamp(256px, 18.8vw, 304px);
  min-width: 256px;
  max-width: 304px;
  scroll-snap-align: start;
  background: linear-gradient(180deg, #FDF6E6 0%, #F5E7C9 100%);
  border: 3.5px solid #5B3314;
  border-radius: 22px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 7px 0 #3E210C,
    0 16px 30px rgba(14, 7, 2, 0.48);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.hub-game-card:not(.is-upcoming):hover {
  transform: translateY(-7px);
  border-color: #E2A23B;
  box-shadow:
    0 11px 0 #3E210C,
    0 22px 34px rgba(14, 7, 2, 0.54);
}

.hub-game-card.is-upcoming {
  background: linear-gradient(180deg, #F4E9D2 0%, #E8D7B6 100%);
  opacity: 0.94;
}

.hub-card-inner {
  flex: 1;
  border: 2px solid #DEC496;
  border-radius: 15px;
  padding: 16px 15px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.hub-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hub-card-badge.is-live {
  background: #DCEFE3;
  color: #165334;
  border: 1px solid #A8D4B8;
}

.hub-card-badge.is-soon {
  background: #E8D9BD;
  color: #6B4D2E;
  border: 1px solid #CEBA96;
}

.hub-card-art {
  width: 100%;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

.hub-card-art svg {
  max-width: 100%;
  max-height: 144px;
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(61, 36, 18, 0.14));
}

.hub-art-img {
  width: 136px;
  height: 136px;
  object-fit: contain;
  border-radius: 16px;
}

.hub-art-img.is-trophy {
  mix-blend-mode: multiply;
  filter: none;
}

.hub-card-info h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 1.45vw, 1.44rem);
  color: #351E0D;
  line-height: 1.15;
}

.hub-card-info p {
  margin: 4px 0 0;
  font-size: 0.83rem;
  font-weight: 700;
  color: #745537;
  line-height: 1.3;
}

.hub-card-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hub-play-pill {
  width: 88%;
  min-height: 46px;
  min-height: 44px;
  border-radius: 999px;
  border: 2.5px solid #78420C;
  background: linear-gradient(180deg, #FFDD6B 0%, #F4A825 100%);
  color: #422108;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 4px 0 #A55E0B;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.hub-play-pill:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 5px 0 #A55E0B;
}

.hub-play-pill:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 2px 0 #A55E0B;
}

.hub-play-pill.is-disabled {
  background: linear-gradient(180deg, #E2D5BC 0%, #CFC0A1 100%);
  border-color: #9C8563;
  color: #6B573C;
  box-shadow: 0 3px 0 #A49072;
  cursor: not-allowed;
  font-size: 0.82rem;
}

.hub-room-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #8A6A46;
}

.hub-mini-link {
  border: 0;
  background: transparent;
  padding: 2px 4px;
  color: #1F5B3C;
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hub-mini-link:hover {
  color: #123D27;
}

.hub-card-foot-note {
  font-size: 0.73rem;
  font-weight: 700;
  color: #8A6A46;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1120px) {
  .hub-stage-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hub-mascot-col {
    margin-bottom: -18px;
  }

  .hub-mascot-img {
    width: 215px;
  }

  .hub-games-grid {
    gap: 14px;
  }

  .hub-game-card {
    flex: 0 0 248px;
    min-width: 248px;
    max-width: 264px;
  }
}

@media (max-width: 600px) {
  .hub-shell {
    padding: 12px 12px 34px;
    min-height: calc(100dvh - 58px);
    justify-content: flex-start;
    gap: 10px;
  }

  .hub-topbar {
    gap: 8px;
  }

  .hub-filter-bar {
    width: 100%;
    justify-content: center;
  }

  .filter-pill {
    flex: 1;
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.76rem;
    text-align: center;
  }

  .hub-plaque-wrap {
    padding-top: 18px;
    gap: 8px;
  }

  .hub-plaque {
    min-width: 0;
    width: 100%;
    max-width: 310px;
    padding: 10px 18px;
    border-width: 3px;
  }

  .hub-plaque h2 {
    font-size: 1.28rem;
  }

  .hub-plaque-sparks {
    display: none;
  }

  .hub-mascot-col {
    margin-bottom: -14px;
  }

  .hub-mascot-img {
    width: 152px;
  }

  .hub-mascot-sparks {
    width: 30px;
    height: 30px;
    left: 22%;
  }

  .hub-carousel-wrap {
    padding-inline: 0;
  }

  .hub-games-grid {
    gap: 12px;
    padding: 10px 4px 16px;
    scroll-padding-inline: 4px;
  }

  .hub-carousel-nav {
    display: none;
  }

  .hub-game-card {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 230px;
    border-width: 2.5px;
    border-radius: 16px;
    padding: 4px;
  }

  .hub-card-inner {
    padding: 9px 8px 10px;
    border-radius: 11px;
    gap: 5px;
  }

  .hub-card-art {
    height: 82px;
  }

  .hub-card-art svg {
    max-height: 80px;
    width: auto;
  }

  .hub-art-img {
    width: 78px;
    height: 78px;
  }

  .hub-card-info h3 {
    font-size: 0.98rem;
  }

  .hub-card-info p {
    font-size: 0.69rem;
  }

  .hub-play-pill {
    width: 94%;
    min-height: 44px;
    font-size: 0.82rem;
  }

  .hub-room-links {
    gap: 4px;
    font-size: 0.68rem;
  }

  .hub-mini-link {
    font-size: 0.72rem;
    min-height: 28px;
  }
}

@media (max-width: 350px) {
  .hub-game-card {
    flex-basis: 204px;
    min-width: 204px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-mascot-img {
    animation: none;
  }
}

/* Game Lobby Top Header + 4-Mode Selector */
.game-lobby-header {
  background: var(--wood-plank);
  color: var(--ink-on-dark);
  border: 2px solid var(--wood-oak);
  border-radius: var(--radius-panel);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 8px 22px rgba(43, 26, 15, 0.14);
}

.game-badge-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(245, 184, 61, 0.2);
  color: var(--brass);
  border: 1px solid rgba(245, 184, 61, 0.45);
  margin-bottom: 4px;
}

.game-lobby-title h2,
.lobby-top h2 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.1;
}

.game-lobby-title p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-on-dark-muted);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  background-color: rgba(18, 10, 5, 0.48);
  border: 1px solid rgba(251, 241, 222, 0.18);
  border-radius: 13px;
}

.mode-tabs.is-four {
  grid-template-columns: repeat(4, minmax(135px, 1fr));
}

.mode-tabs.is-two {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.mode-tab {
  min-height: 48px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--ink-on-dark-muted);
  user-select: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.mode-tab strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.94rem;
  line-height: 1.1;
}

.mode-tab span {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
}

.mode-tab:hover {
  color: var(--ink-on-dark);
  background: rgba(255, 255, 255, 0.06);
}

.mode-tab.is-active {
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 100%);
  color: var(--brass-ink);
  box-shadow: 0 2px 0 var(--brass-dark);
}

.workspace-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.15fr);
  gap: 22px;
  align-items: start;
}

.pane {
  border-radius: var(--radius-panel);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pane-wood {
  background: var(--wood-plank);
  color: var(--ink-on-dark);
  border: 2px solid var(--wood-oak);
  box-shadow: 0 10px 26px rgba(43, 26, 15, 0.15);
}

.pane-config {
  background-color: var(--linen-surface);
  color: var(--ink-primary);
  border: 1.5px solid var(--linen-border-strong);
  box-shadow: 0 6px 0 var(--linen-alt), 0 14px 24px rgba(90, 58, 33, 0.1);
}

.pane-card-head h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.32rem;
  line-height: 1.15;
}

.pane-card-head p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-on-dark-muted);
}

.room-lock-chip {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success-text);
  margin-bottom: 8px;
}

.switch-mode-note {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-on-dark-muted);
}

/* Dedicated Separate JOIN ROOM Stage */
.join-room-stage {
  display: flex;
  justify-content: center;
  padding: 12px 0 24px;
}

.join-room-card {
  width: min(100%, 540px);
  background-color: var(--linen-surface);
  border: 2px solid var(--wood-oak);
  border-radius: 22px;
  padding: 30px 32px;
  box-shadow: 0 8px 0 var(--linen-alt), 0 20px 40px rgba(43, 26, 15, 0.16);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.join-room-banner h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.12;
}

.join-room-banner p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-secondary);
}

.join-room-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.join-room-form-body label {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.input-code.is-hero-code {
  min-height: 54px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.24em;
  background-color: #FFFDF8;
  border: 2px solid var(--wood-oak);
}

.join-room-foot {
  padding-top: 14px;
  border-top: 1px dashed var(--linen-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* Live Urut Kilat Mini Board Preview */
.seq-mini-preview {
  background: var(--felt-fx);
  border: 5px solid var(--wood-oak);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  justify-content: center;
  gap: 10px;
}

.seq-mini-preview.cols-2 { grid-template-columns: repeat(2, 54px); }
.seq-mini-preview.cols-3 { grid-template-columns: repeat(3, 50px); }

.seq-preview-tile {
  height: 50px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.setup-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.field-inline-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-on-dark-muted);
}

.mini-pill-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 6px;
}

.pane-wood .count-pill {
  background-color: var(--wood-mid);
  color: var(--ink-on-dark);
  border-color: var(--wood-rim);
}

.pane-wood .count-pill:hover:not(:disabled) {
  background-color: #423025;
}

.pane-wood .count-pill.is-selected {
  background-color: var(--brass);
  color: var(--brass-ink);
  border-color: #B47B14;
}

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

.fields-grid-players.is-single {
  grid-template-columns: 1fr;
}

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

.pane-wood .field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-on-dark-muted);
}

.field input {
  min-height: 42px;
  padding: 7px 12px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--linen-border-strong);
  background-color: var(--linen-surface);
  color: var(--ink-primary);
  width: 100%;
}

.field input::placeholder {
  color: #77695B;
}

.field input:focus {
  border-color: var(--brass);
  outline: none;
  box-shadow: 0 0 0 2.5px rgba(217, 155, 38, 0.28);
}

.input-code {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Forest Felt Match Summary Ticket inside Wood Pane */
.match-ticket {
  margin-top: auto;
  background-color: var(--felt-deep);
  border: 1px solid var(--felt-rim);
  border-radius: var(--radius-card);
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
}

.ticket-row span {
  color: #C9DDD1;
  font-weight: 500;
}

.ticket-row strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-on-dark);
}

.form-actions {
  display: flex;
}

/* Online Forms inside Wood Pane (flat divider, no nested card box) */
.online-setup {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.online-panel {
  padding-top: 12px;
  border-top: 1px solid var(--wood-rim);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.online-panel:first-child {
  padding-top: 0;
  border-top: none;
}

.online-card-head h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 1.04rem;
  color: var(--ink-on-dark);
}

.online-card-note {
  font-size: 0.82rem;
  color: var(--ink-on-dark-muted);
}

.inline-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-form-row.is-three {
  grid-template-columns: minmax(0, 1fr) minmax(108px, 0.72fr) auto;
}

/* Right Linen Workbench Config Controls */
.config-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pane-divider {
  border: none;
  border-top: 1px solid var(--linen-border);
  margin: 0;
}

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.block-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
}

.block-hint {
  font-size: 0.83rem;
  color: var(--ink-secondary);
  font-weight: 500;
}

.block-hint.is-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background-color: #EFE5D1;
  border: 1px solid rgba(116, 86, 52, 0.2);
  color: var(--ink-primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.config-subcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background-color: #FBF6EC;
  border: 1px solid rgba(116, 86, 52, 0.18);
}

.config-subcard.is-featured {
  background-color: #FAF3E5;
  border-color: rgba(116, 86, 52, 0.24);
}

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

.config-timer-grid .block-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.config-subcard.is-skill-card {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.preset-grid {
  display: grid;
  gap: 8px;
}

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

/* Compact zero-scroll UNO Setup & Online Lobby layout with Cozy Tavern Background */
.desk-shell.is-uno-desk {
  width: 100%;
  max-width: none;
  min-height: calc(100dvh - 64px);
  margin: 0;
  padding: 12px max(20px, calc((100vw - 1380px) / 2)) 16px;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(24, 13, 6, 0.42) 0%, rgba(24, 13, 6, 0.24) 48%, rgba(16, 26, 18, 0.42) 100%),
    url('assets/Bocah%20Chibi/hub-tavern-bg.webp?v=2') center bottom / cover no-repeat;
  background-color: #2B170A;
}

.desk-shell.is-uno-desk .desk-subbar .btn-linen-outline {
  background: rgba(251, 244, 232, 0.92);
  border-color: rgba(232, 184, 75, 0.55);
}

.desk-shell.is-uno-desk .desk-crumb {
  color: #F2E2C9;
  text-shadow: 0 1px 4px rgba(15, 7, 2, 0.65);
}

.desk-shell.is-uno-desk .desk-crumb strong {
  color: #FFE082;
}

.desk-shell.is-uno-desk .game-lobby-header {
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(66, 38, 19, 0.94) 0%, rgba(44, 24, 11, 0.96) 100%);
  border: 1.5px solid rgba(232, 184, 75, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 130, 0.14),
    0 12px 28px rgba(14, 7, 2, 0.42);
  backdrop-filter: blur(8px);
}

.desk-shell.is-uno-desk .game-lobby-header h2 {
  font-size: 1.48rem;
  margin-bottom: 2px;
}

.desk-shell.is-uno-desk .workspace-grid {
  gap: 16px;
  align-items: start;
}

.desk-shell.is-uno-desk .pane-wood {
  padding: 16px 20px;
  gap: 12px;
  background: linear-gradient(180deg, rgba(64, 37, 19, 0.93) 0%, rgba(41, 23, 11, 0.96) 100%);
  border: 1.5px solid rgba(232, 184, 75, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 130, 0.14),
    0 14px 32px rgba(14, 7, 2, 0.46);
  backdrop-filter: blur(8px);
}

.desk-shell.is-uno-desk .pane-config {
  background: rgba(252, 246, 234, 0.96);
  border: 1.5px solid rgba(232, 184, 75, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 14px 32px rgba(14, 7, 2, 0.36);
  backdrop-filter: blur(8px);
}

.desk-shell.is-uno-desk .player-count-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.desk-shell.is-uno-desk .player-count-row .mini-pill-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.desk-shell.is-uno-desk .player-count-row .count-pill {
  width: 100%;
  justify-content: center;
}

.desk-shell.is-uno-desk .lobby-actions {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 224, 130, 0.16);
  flex-wrap: wrap;
  gap: 10px;
}

.desk-shell.is-uno-desk .lobby-start-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.desk-shell.is-uno-desk .setup-form {
  gap: 8px;
}

.desk-shell.is-uno-desk .match-ticket {
  padding: 8px 12px;
  gap: 4px;
  font-size: 0.83rem;
}

.desk-shell.is-uno-desk .btn-lg {
  min-height: 42px;
  padding: 8px 18px;
}

.pane-config.is-uno-compact {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.pane-config.is-uno-compact .config-subcard {
  padding: 10px 12px;
  gap: 7px;
  border-radius: 12px;
}

.pane-config.is-uno-compact .config-subcard.is-span-2 {
  grid-column: 1 / -1;
}

.pane-config.is-uno-compact .config-subcard.is-skill-card {
  padding: 10px 12px;
  gap: 10px;
}

.pane-config.is-uno-compact .uno-hand-row {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
  gap: 12px;
  align-items: center;
}

.pane-config.is-uno-compact .custom-slider-row {
  min-width: 0;
  gap: 8px;
}

.pane-config.is-uno-compact .custom-slider-row input[type="range"] {
  min-width: 60px;
}

.pane-config.is-uno-compact .count-pill {
  min-height: 36px;
  padding: 5px 7px;
  font-size: 0.8rem;
}

.pane-config.is-uno-compact .count-pill strong {
  font-size: 0.84rem;
}

.pane-config.is-uno-compact .count-pill span {
  font-size: 0.68rem;
  line-height: 1.15;
}

.pane-config.is-uno-compact .block-label {
  font-size: 0.88rem;
}

.pane-config.is-uno-compact .block-hint {
  font-size: 0.74rem;
}

@media (max-width: 960px) {
  .pane-config.is-uno-compact {
    grid-template-columns: 1fr;
  }

  .pane-config.is-uno-compact .uno-hand-row {
    grid-template-columns: 1fr;
  }
}

.preset-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.preset-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.preset-grid.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.preset-grid.cols-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.count-pill {
  min-height: 40px;
  padding: 6px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--linen-border);
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
  user-select: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.count-pill strong {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.1;
  font-weight: 800;
}

.count-pill span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.1;
}

.count-pill:hover:not(:disabled) {
  border-color: var(--wood-rim);
  background-color: var(--linen-alt);
}

.count-pill.is-selected {
  background-color: var(--felt-deep);
  color: var(--ink-on-dark);
  border-color: #153126;
  box-shadow: 0 2px 0 #122B21;
}

.count-pill.is-selected span {
  color: rgba(251, 241, 222, 0.85);
}

.count-pill:disabled:not(.is-selected) {
  background-color: #EFE8DB;
  border-color: rgba(116, 86, 52, 0.22);
  color: rgba(82, 62, 42, 0.48);
  opacity: 0.68;
  cursor: not-allowed;
  box-shadow: none;
}

.count-pill:disabled:not(.is-selected) span {
  color: rgba(82, 62, 42, 0.45);
}

.custom-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #FFFFFF;
  border: 1px solid rgba(116, 86, 52, 0.18);
  border-radius: 10px;
  padding: 6px 12px;
}

.custom-slider-row.is-compact {
  padding: 5px 10px;
  gap: 8px;
}

.custom-slider-row.is-compact .number-unit input[type="number"] {
  width: 56px;
  min-height: 30px;
}

.slider-caption {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.custom-slider-row input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--felt-deep);
}

.number-unit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.number-unit input[type="number"] {
  width: 66px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1.5px solid var(--linen-border-strong);
  background-color: #FFFFFF;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.number-unit span {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  font-weight: 600;
}

.skill-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skill-toggle-row > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.skill-switch.is-on {
  background-color: var(--felt-deep);
  color: var(--ink-on-dark);
  border-color: #153126;
}

.skill-switch.is-on:hover:not(:disabled) {
  background-color: var(--felt-mid);
}

/* Lobby Elements inside Wood Pane */
.lobby-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--wood-rim);
}

.lobby-code-box {
  background-color: var(--wood-mid);
  border: 1px solid var(--wood-rim);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.code-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-on-dark-muted);
}

.code-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 0.16em;
  line-height: 1.1;
  color: var(--brass);
}

.code-buttons {
  display: flex;
  gap: 6px;
}

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

.uno-lobby-banner {
  gap: 12px;
}

.uno-lobby-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uno-lobby-fan-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(15, 7, 2, 0.38));
}

.uno-lobby-banner-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.uno-lobby-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #F4E6CF;
  background: rgba(25, 14, 7, 0.55);
  border: 1px solid rgba(251, 241, 222, 0.22);
}

.uno-lobby-pill.is-gold {
  color: #2B1A0F;
  background: linear-gradient(180deg, #FFE082 0%, #F2B532 100%);
  border-color: rgba(133, 83, 12, 0.45);
  font-weight: 800;
}

.uno-lobby-subhead {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-on-dark);
}

.lobby-seat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(28, 16, 8, 0.52);
  border: 1.5px solid var(--wood-rim);
  min-width: 0;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.lobby-seat.is-filled {
  background: linear-gradient(180deg, rgba(64, 38, 20, 0.92) 0%, rgba(44, 26, 13, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 194, 0.1);
}

.lobby-seat.is-empty {
  opacity: 0.72;
  border-style: dashed;
  background: rgba(24, 14, 7, 0.34);
}

.seat-badge {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFF9EC;
  background: #6D4C34;
  border: 1px solid rgba(255, 244, 224, 0.24);
}

.lobby-seat.is-filled.is-p1 .seat-badge {
  background: linear-gradient(180deg, #D84B3C 0%, #A92D22 100%);
}

.lobby-seat.is-filled.is-p2 .seat-badge {
  background: linear-gradient(180deg, #3A80C9 0%, #245A96 100%);
}

.lobby-seat.is-filled.is-p3 .seat-badge {
  background: linear-gradient(180deg, #2D8A56 0%, #1D5E3A 100%);
}

.lobby-seat.is-filled.is-p4 .seat-badge {
  background: linear-gradient(180deg, #E2A22B 0%, #B37714 100%);
  color: #2B1A0F;
}

.seat-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.seat-meta strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #FFF7E6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--ink-on-dark-muted);
}

.seat-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #9A846B;
  flex-shrink: 0;
}

.seat-dot.is-online {
  background: #52D273;
  box-shadow: 0 0 6px rgba(82, 210, 115, 0.65);
}

.seat-dot.is-ready {
  background: #F5B83D;
}

.seat-ready-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.seat-ready-chip.is-ready {
  background: rgba(66, 198, 108, 0.22);
  color: #8CF0A8;
  border: 1px solid rgba(82, 210, 115, 0.45);
}

.seat-ready-chip.is-waiting {
  background: rgba(245, 184, 61, 0.16);
  color: #F7D37C;
  border: 1px solid rgba(245, 184, 61, 0.34);
}

.seat-ready-chip.is-host {
  background: rgba(255, 224, 130, 0.22);
  color: #FFE082;
  border: 1px solid rgba(255, 224, 130, 0.4);
}

.seat-kick-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(239, 108, 92, 0.55);
  background: rgba(168, 42, 32, 0.28);
  color: #FFC6BE;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.seat-kick-btn:hover:not(:disabled) {
  background: rgba(196, 48, 36, 0.78);
  border-color: #FF8C7D;
  color: #FFF7F5;
}

.seat-kick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#uno-lobby-ready-btn.is-ready-active {
  background: linear-gradient(180deg, #338B5A 0%, #20623E 100%);
  border-color: #6CE09A;
  color: #FFF9EC;
}

/* Clean bordered slots (NO colored border-left stripes per craft-floor!) */
.player-slot {
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--wood-rim);
  background-color: var(--wood-mid);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-slot.is-empty {
  opacity: 0.68;
  border-style: dashed;
}

.slot-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.slot-role {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-on-dark-muted);
}

.slot-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--ink-on-dark);
}

.slot-status {
  font-size: 0.8rem;
  color: var(--ink-on-dark-muted);
}

.lobby-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--wood-rim);
}

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

.wait-note {
  font-size: 0.84rem;
  color: var(--ink-on-dark-muted);
}

/* =====================================================
   FULL-SCREEN PLAY STAGE (Walnut Frame + Felt Canvas)
   ===================================================== */
.play-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: viewFadeIn 0.22s ease-out;
}

.play-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: var(--wood-mid);
  color: var(--ink-on-dark);
  border: 1px solid var(--wood-rim);
  border-radius: var(--radius-card);
  padding: 5px 12px;
  min-height: 48px;
}

.play-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.play-meta {
  display: flex;
  flex-direction: column;
}

.play-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.1;
}

.play-subtitle {
  font-size: 0.74rem;
  color: var(--ink-on-dark-muted);
  font-weight: 600;
}

.play-hud-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hud-solo-inline {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.inline-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.inline-stat span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-on-dark-muted);
}

.inline-stat strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.hud-duel-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.hud-multi-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--wood-rim);
  background-color: #261B15;
  color: var(--ink-on-dark);
  min-width: 0;
  opacity: 0.56;
  transition: background-color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.score-pill.is-active {
  opacity: 1;
  border-width: 2px;
  border-color: #FFF7E4;
  color: #FFFFFF;
  transform: translateY(-1px) scale(1.03);
}

.score-pill.is-p1.is-active {
  background-color: var(--p1-accent);
  box-shadow: 0 0 0 2px var(--p1-accent), 0 6px 14px rgba(198, 66, 44, 0.42);
}

.score-pill.is-p2.is-active {
  background-color: var(--p2-accent);
  box-shadow: 0 0 0 2px var(--p2-accent), 0 6px 14px rgba(39, 93, 133, 0.42);
}

.score-pill.is-p3.is-active {
  background-color: var(--p3-accent);
  box-shadow: 0 0 0 2px var(--p3-accent), 0 6px 14px rgba(31, 104, 68, 0.42);
}

.score-pill.is-p4.is-active {
  background-color: var(--p4-accent);
  box-shadow: 0 0 0 2px var(--p4-accent), 0 6px 14px rgba(122, 62, 157, 0.42);
}

.score-pill.is-active .player-badge {
  background-color: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}

.score-pill.is-active .pairs-num {
  color: rgba(255, 255, 255, 0.88);
}

.score-pill.is-active .turn-live-tag {
  background-color: #FFD046;
  color: #3D2412;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.score-pill.is-surrendered {
  opacity: 0.52;
  border-style: dashed;
}

.player-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-tag);
  color: var(--ink-on-dark);
  flex-shrink: 0;
}

.is-p1 .player-badge {
  background-color: var(--p1-accent);
}

.is-p2 .player-badge {
  background-color: var(--p2-accent);
}

.is-p3 .player-badge {
  background-color: var(--p3-accent);
}

.is-p4 .player-badge {
  background-color: var(--p4-accent);
}

.player-name {
  font-weight: 600;
  font-size: 0.84rem;
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.pairs-num {
  font-size: 0.74rem;
  opacity: 0.78;
}

.turn-live-tag {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: var(--radius-tag);
  color: var(--ink-on-dark);
  flex-shrink: 0;
}

.is-p1 .turn-live-tag {
  background-color: var(--p1-accent);
}

.is-p2 .turn-live-tag {
  background-color: var(--p2-accent);
}

.is-p3 .turn-live-tag {
  background-color: var(--p3-accent);
}

.is-p4 .turn-live-tag {
  background-color: var(--p4-accent);
}

.surrender-tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--danger-text);
  background-color: var(--danger-bg);
  padding: 1px 5px;
  border-radius: var(--radius-tag);
}

.rank-tag {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-tag);
  color: #2B1A0F;
  background: linear-gradient(180deg, #FFE082 0%, #F2B532 100%);
  border: 1px solid rgba(112, 68, 12, 0.35);
}

.rank-tag.is-rank-2 {
  background: linear-gradient(180deg, #F2F5F7 0%, #CFD8DF 100%);
  color: #26313A;
}

.rank-tag.is-rank-3 {
  background: linear-gradient(180deg, #F3C49A 0%, #D38E55 100%);
  color: #361C0A;
}

.play-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.conn-dot-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #CFE9D9;
  background-color: var(--felt-deep);
  padding: 4px 8px;
  border-radius: 6px;
}

.canvas-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* Non-blocking floating tabletop callout banner */
.table-callout {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  padding: 7px 16px;
  border-radius: 999px;
  background-color: rgba(36, 26, 20, 0.94);
  color: #FAF3E3;
  border: 1.5px solid #E8B84B;
  box-shadow: 0 8px 22px rgba(10, 7, 5, 0.42);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: calloutPop 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.table-callout.is-p1 { border-color: var(--p1-accent); }
.table-callout.is-p2 { border-color: var(--p2-accent); }
.table-callout.is-p3 { border-color: var(--p3-accent); }
.table-callout.is-p4 { border-color: var(--p4-accent); }
.table-callout.is-warn {
  background-color: rgba(124, 38, 31, 0.95);
  border-color: #F4D284;
}

#uno-callout {
  top: 118px;
}

#uno-callout.is-skip,
#uno-callout.is-penalty {
  background-color: rgba(132, 32, 26, 0.96);
  border-color: #FFD467;
  box-shadow: 0 10px 26px rgba(96, 18, 12, 0.55);
}

#uno-callout.is-reverse {
  background-color: rgba(58, 36, 15, 0.96);
  border-color: #FFD067;
}

#uno-callout.is-draw {
  background-color: rgba(24, 52, 76, 0.95);
  border-color: #9CD2FF;
}

#uno-callout.is-uno {
  background-color: rgba(31, 78, 52, 0.96);
  border-color: #FFE082;
}

#uno-callout.is-wild {
  background-color: rgba(44, 28, 18, 0.96);
  border-color: #F5B83D;
}

.skip-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #C8362B;
  color: #FFF9EC;
  border: 1px solid #FFD467;
}

@media (max-width: 720px) {
  #uno-callout {
    top: 84px;
    padding: 4px 12px;
    font-size: 0.78rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 20px);
  }
}

#memory-canvas,
#sequence-canvas,
#uno-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

/* Bottom Tactical Dock */
.play-dock {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--wood-mid);
  color: var(--ink-on-dark);
  border: 1px solid var(--wood-rim);
  border-radius: var(--radius-card);
  padding: 6px 12px;
  min-height: 54px;
}

.dock-turn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.turn-spotlight {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-control);
  border: 2px solid var(--wood-rim);
  border-left-width: 6px;
  background-color: var(--wood-deep);
  color: var(--ink-primary);
}

.turn-spotlight.is-p1 {
  background-color: var(--p1-tint);
  border-color: var(--p1-accent);
}

.turn-spotlight.is-p2 {
  background-color: var(--p2-tint);
  border-color: var(--p2-accent);
}

.turn-spotlight.is-p3 {
  background-color: var(--p3-tint);
  border-color: var(--p3-accent);
}

.turn-spotlight.is-p4 {
  background-color: var(--p4-tint);
  border-color: var(--p4-accent);
}

.turn-spotlight.is-waiting {
  background-color: #261B15;
  border-color: var(--wood-rim);
  color: var(--ink-on-dark);
}

.score-num.is-bumped,
.inline-stat strong.is-bumped {
  animation: scoreBump 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.turn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--ink-on-dark-muted);
  flex-shrink: 0;
}

.turn-spotlight:not(.is-waiting) .turn-dot {
  animation: livePulse 1.9s ease-out infinite;
}

.turn-spotlight.is-p1 .turn-dot {
  background-color: var(--p1-accent);
}

.turn-spotlight.is-p2 .turn-dot {
  background-color: var(--p2-accent);
}

.turn-spotlight.is-p3 .turn-dot {
  background-color: var(--p3-accent);
}

.turn-spotlight.is-p4 .turn-dot {
  background-color: var(--p4-accent);
}

.turn-spotlight-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.turn-spotlight-text strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
}

.turn-spotlight-text span {
  font-size: 0.74rem;
  opacity: 0.8;
}

.peek-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-control);
  background-color: var(--brass-tint);
  border: 1.5px solid var(--brass);
  color: var(--brass-ink);
  font-weight: 700;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.btn-skip-peek {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #B47B14;
  background-color: var(--linen-surface);
  color: var(--brass-ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.turn-timer-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-control);
  background-color: var(--linen-surface);
  border: 1.5px solid var(--linen-border-strong);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.turn-timer-pill.is-p1 {
  background-color: var(--p1-tint);
  border-color: var(--p1-accent);
  color: var(--p1-dark);
}

.turn-timer-pill.is-p2 {
  background-color: var(--p2-tint);
  border-color: var(--p2-accent);
  color: var(--p2-dark);
}

.turn-timer-pill.is-p3 {
  background-color: var(--p3-tint);
  border-color: var(--p3-accent);
  color: var(--p3-dark);
}

.turn-timer-pill.is-p4 {
  background-color: var(--p4-tint);
  border-color: var(--p4-accent);
  color: var(--p4-dark);
}

.turn-timer-pill.is-low {
  background-color: var(--danger-bg);
  border-color: var(--danger-fill);
  color: var(--danger-text);
  animation: urgentPulse 0.75s ease-in-out infinite;
}

.active-buffs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.buff-chip {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--brass-tint);
  border: 1px solid var(--brass);
  color: var(--brass-ink);
  white-space: nowrap;
}

.skill-dock-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.skill-owner-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-on-dark-muted);
  white-space: nowrap;
}

.skill-dock {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.skill-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px 10px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--wood-rim);
  background-color: var(--linen-surface);
  color: var(--ink-primary);
  text-align: left;
  box-shadow: 0 2px 0 var(--wood-rim);
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.skill-btn:hover:not(:disabled) {
  background-color: var(--brass-tint);
  border-color: var(--brass);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 #8F5E0C;
}

.skill-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #8F5E0C;
}

.skill-hotkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background-color: var(--linen-alt);
  border: 1px solid var(--linen-border-strong);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.skill-btn.is-used {
  opacity: 0.45;
  border-style: dashed;
  background-color: #2B1F18;
  color: var(--ink-on-dark-muted);
  box-shadow: none;
}

.skill-btn.is-used .skill-hotkey {
  background-color: var(--wood-mid);
  border-color: var(--wood-rim);
  color: var(--ink-on-dark-muted);
}

.skill-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: var(--radius-tag);
  background-color: var(--felt-deep);
  color: var(--ink-on-dark);
  flex-shrink: 0;
}

.skill-btn.is-used .skill-tag {
  background-color: var(--wood-rim);
}

.skill-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.skill-btn-text strong {
  font-size: 0.8rem;
  white-space: nowrap;
}

.skill-btn-text span {
  font-size: 0.69rem;
  opacity: 0.78;
  white-space: nowrap;
}

.seq-kbd-hint {
  font-size: 0.8rem;
  color: var(--ink-on-dark-muted);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(20, 14, 10, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 70;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  background-color: var(--linen-surface);
  color: var(--ink-primary);
  border: 2px solid var(--wood-rim);
  border-radius: var(--radius-panel);
  padding: 22px 24px;
  box-shadow: 0 20px 48px rgba(14, 10, 7, 0.36);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: modalPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-card.modal-sm {
  max-width: 480px;
}

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

.modal-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.48rem;
  line-height: 1.18;
}

.modal-subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.rules-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  display: grid;
  gap: 8px;
}

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

.summary-box {
  background-color: var(--linen-ground);
  border: 1.5px solid var(--linen-border);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-box.is-p1-winner,
.summary-box.is-winner {
  border-color: var(--p1-accent);
  background-color: var(--p1-tint);
}

.summary-box.is-p2-winner {
  border-color: var(--p2-accent);
  background-color: var(--p2-tint);
}

.summary-box.is-p3-winner {
  border-color: var(--p3-accent);
  background-color: var(--p3-tint);
}

.summary-box.is-p4-winner {
  border-color: var(--p4-accent);
  background-color: var(--p4-tint);
}

.summary-box.is-surrendered {
  opacity: 0.72;
  border-style: dashed;
}

.summary-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.summary-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.38rem;
  font-variant-numeric: tabular-nums;
}

.summary-sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.result-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  background-color: var(--linen-ground);
  padding: 9px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--linen-border);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS (Mobile-First Hygiene, R-03)
   ===================================================== */
@media (max-width: 980px) {
  .app-shell.is-desk {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .mode-tabs.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .hero-backdrop-art {
    width: 100%;
    opacity: 0.34;
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
  }

  .hero-scene-spacer {
    display: none;
  }

  .hero-grid,
  .game-feature-flagship,
  .catalog-secondary-grid,
  .highlights-grid,
  .flow-two-col,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .pane {
    overflow: visible;
  }

  .site-nav {
    display: none;
  }

  .play-topbar {
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 6px;
  }

  .play-hud-center {
    order: 3;
    flex-basis: 100%;
    border-top: 1px solid var(--wood-rim);
    padding-top: 6px;
  }

  .play-dock {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px 8px;
  }

  .skill-dock {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skill-btn {
    padding: 4px 6px;
    justify-content: center;
  }

  .skill-tag,
  .skill-btn-text span {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header-inner,
  .band-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-header {
    min-height: 58px;
  }

  .brand-logo-img {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.06rem;
  }

  .brand-sub {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .hero-band {
    min-height: auto;
    padding: 28px 0 36px;
  }

  .hero-backdrop-art {
    opacity: 0.48;
  }

  .hero-backdrop-art::after {
    background: linear-gradient(
      180deg,
      rgba(22, 11, 5, 0.72) 0%,
      rgba(22, 11, 5, 0.56) 55%,
      rgba(22, 11, 5, 0.82) 100%
    );
  }

  .hero-mascot-bg {
    object-position: 74% 30%;
  }

  .hero-cta-row {
    width: 100%;
  }

  .hero-cta-row .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .hero-facts {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .catalog-band,
  .highlights-band,
  .flow-band {
    padding: 40px 0;
  }

  .flagship-body,
  .game-card-secondary,
  .game-card-upcoming {
    padding: 18px 16px;
  }

  .header-actions #nav-quick-memory-btn {
    display: none;
  }

  .desk-shell {
    width: 100%;
    padding: 14px 12px 32px;
    gap: 12px;
  }

  .game-lobby-header {
    padding: 16px;
    gap: 14px;
  }

  .pane {
    padding: 16px 14px;
  }

  .join-room-card {
    padding: 18px 14px;
  }

  .config-timer-grid {
    grid-template-columns: 1fr;
  }

  .preset-grid.cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preset-grid.cols-6,
  .preset-grid.cols-7 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .inline-form-row,
  .inline-form-row.is-three,
  .fields-grid-players,
  .lobby-players {
    grid-template-columns: 1fr;
  }

  .custom-slider-row {
    flex-wrap: wrap;
  }

  /* Play HUD Mobile Fixes (zero horizontal clipping) */
  .play-shell {
    padding: 4px;
    gap: 4px;
  }

  .play-topbar {
    padding: 6px 8px;
    gap: 6px;
  }

  .play-brand {
    min-width: 0;
  }

  .play-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .play-actions .btn {
    min-height: 38px;
    padding: 4px 10px;
    font-size: 0.78rem;
  }

  .mode-tabs.is-three {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .game-card-upcoming.is-full-row {
    padding-right: 16px;
  }

  .play-hud-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
  }

  .play-hud-actions .btn-hud {
    padding: 5px 8px;
    min-height: 32px;
    font-size: 0.74rem;
  }

  .hud-solo-inline {
    gap: 8px 12px;
  }

  .inline-stat strong {
    font-size: 0.96rem;
  }

  .hud-multi-players {
    flex-wrap: wrap;
    gap: 4px;
  }

  .score-pill {
    padding: 3px 7px;
    gap: 4px;
    font-size: 0.76rem;
  }

  .player-name {
    max-width: 68px;
    font-size: 0.75rem;
  }

  .play-dock {
    padding: 6px 8px;
    gap: 6px;
  }

  .play-dock-left {
    width: 100%;
    gap: 6px;
  }

  .turn-spotlight {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 9px;
  }

  .turn-spotlight-text strong {
    font-size: 0.82rem;
  }

  .turn-spotlight-text span {
    font-size: 0.69rem;
  }

  .skill-dock-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .skill-owner-label {
    font-size: 0.68rem;
  }

  .skill-dock {
    width: 100%;
    gap: 5px;
  }

  .skill-btn {
    min-width: 0;
    min-height: 36px;
    padding: 4px 5px;
    justify-content: center;
  }

  .skill-hotkey {
    display: none;
  }

  .skill-btn-text {
    align-items: center;
    min-width: 0;
  }

  .skill-btn-text strong {
    white-space: normal;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.12;
  }

  .flagship-specs,
  .secondary-specs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .highlights-band {
    padding: 44px 0 38px;
  }

  .highlights-list {
    margin-bottom: 0;
  }

  .perks-mascot-wrap {
    justify-content: center;
  }

  .upcoming-board-art {
    width: 122px;
    opacity: 0.92;
  }

  .hero-sticky-note {
    top: 10px;
    right: 10px;
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .flow-track {
    align-items: flex-start;
  }

  .seq-kbd-hint {
    display: none;
  }

  .footer-inner,
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =====================================================
   NAVBAR "MASUK ROOM" GAME PICKER DROPDOWN
   ===================================================== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-dropdown-toggle svg {
  transition: transform 0.16s ease;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  padding: 8px;
  border-radius: 14px;
  background: #FDF6E6;
  border: 2px solid #5B3314;
  box-shadow: 0 5px 0 #3E210C, 0 18px 34px rgba(14, 7, 2, 0.42);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: modalPop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-dropdown-menu[hidden] {
  display: none;
}

.nav-dropdown-title {
  margin: 2px 8px 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8A6A46;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: #351E0D;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.nav-dropdown-item:hover:not(:disabled),
.nav-dropdown-item:focus-visible {
  background: #F2E3C3;
  border-color: #DEC496;
  outline: none;
}

.nav-dropdown-item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ndi-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #EFE1C2;
  border: 1.5px solid #DEC496;
  font-weight: 800;
  color: #8A6A46;
}

.ndi-icon.is-memori {
  background: #DCEFE3;
  border-color: #A8D4B8;
}

.ndi-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ndi-text strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.15;
}

.ndi-text small {
  font-size: 0.74rem;
  font-weight: 600;
  color: #745537;
}

/* =====================================================
   RESULT MODALS (SOLO & MAIN BARENG)
   ===================================================== */
.result-modal-card {
  max-width: 540px;
  padding: 0 0 20px;
  gap: 16px;
  overflow-x: hidden;
}

.result-modal-card > *:not(.result-hero-banner) {
  margin-left: 22px;
  margin-right: 22px;
}

.result-hero-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(180deg, #256142 0%, #19452E 100%);
  border-bottom: 4px solid #C68339;
  color: #FFF7E4;
}

.result-hero-banner.is-surrendered {
  background: linear-gradient(180deg, #5B4636 0%, #3F2F23 100%);
}

.result-trophy-badge {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 16px;
  background: #FDF6E6;
  border: 3px solid #C68339;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 4px 0 #3E1F0C;
}

.result-trophy-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.result-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-mode-badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 224, 152, 0.18);
  border: 1px solid rgba(255, 224, 152, 0.4);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #FFE29A;
}

.result-hero-banner h2 {
  color: #FFF7E4;
  font-size: 1.5rem;
  text-shadow: 0 2px 0 #102D1E;
}

.result-hero-banner .modal-subtitle {
  color: rgba(255, 247, 228, 0.82);
  font-size: 0.86rem;
}

.result-modal-card .result-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.solo-score-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #FFF4D6 0%, #F8E2AE 100%);
  border: 2.5px solid #E2A23B;
}

.solo-score-hero.is-surrendered {
  background: #F1E8D8;
  border-color: #BCA98A;
  border-style: dashed;
}

.solo-score-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8A5A1C;
}

.solo-score-hero.is-new-best .solo-score-label {
  color: #1F6844;
}

.solo-score-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.1rem;
  line-height: 1;
  color: #3D2412;
  font-variant-numeric: tabular-nums;
}

.solo-score-unit {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8A6A46;
}

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

.solo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 9px 6px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid rgba(116, 86, 52, 0.18);
}

.solo-stat.is-wide {
  grid-column: span 2;
}

.seq-result-modal .solo-stat-grid,
#seq-result-summary .solo-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.solo-stat span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #8A6A46;
  line-height: 1.2;
}

.solo-stat strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: #351E0D;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

/* Multiplayer leaderboard rows */
.podium-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.podium-row {
  --pc: #8A6A46;
  --pt: #FFFFFF;
  display: grid;
  grid-template-columns: 30px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1.5px solid rgba(116, 86, 52, 0.2);
}

.podium-row.is-p1 { --pc: var(--p1-accent); --pt: var(--p1-tint); }
.podium-row.is-p2 { --pc: var(--p2-accent); --pt: var(--p2-tint); }
.podium-row.is-p3 { --pc: var(--p3-accent); --pt: var(--p3-tint); }
.podium-row.is-p4 { --pc: var(--p4-accent); --pt: var(--p4-tint); }

.podium-row.is-champion {
  background: linear-gradient(90deg, #FFF4D6 0%, var(--pt) 100%);
  border: 2.5px solid #E2A23B;
  box-shadow: 0 3px 0 #C88A2A;
}

.podium-row.is-surrendered {
  opacity: 0.62;
  border-style: dashed;
}

.podium-rank {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #8A6A46;
  text-align: center;
}

.podium-row.is-champion .podium-rank {
  color: #D18B12;
  font-size: 1.35rem;
}

.podium-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pc);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.podium-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.podium-name strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: #351E0D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-name small {
  font-size: 0.74rem;
  font-weight: 600;
  color: #745537;
}

.podium-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  color: #351E0D;
  font-variant-numeric: tabular-nums;
}

.podium-score small {
  font-family: var(--font-body, inherit);
  font-size: 0.66rem;
  font-weight: 700;
  color: #8A6A46;
}

/* Collapsible rematch settings drawer */
.result-rematch-drawer {
  border-radius: 14px;
  border: 1.5px solid rgba(116, 86, 52, 0.22);
  background: #FBF6EC;
}

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

.result-drawer-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 0.86rem;
  color: #351E0D;
  user-select: none;
}

.result-drawer-summary::-webkit-details-marker {
  display: none;
}

.result-drawer-summary::before {
  content: '\25B8';
  margin-right: 4px;
  color: #8A6A46;
  transition: transform 0.15s ease;
  display: inline-block;
}

.result-rematch-drawer[open] .result-drawer-summary::before {
  transform: rotate(90deg);
}

.result-drawer-pill {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: #EFE5D1;
  border: 1px solid rgba(116, 86, 52, 0.2);
  font-size: 0.74rem;
  font-weight: 700;
  color: #5B3E22;
}

.result-rematch-drawer .result-config {
  padding: 0 12px 12px;
  gap: 10px;
}

.config-subcard.is-compact-modal {
  padding: 12px;
  gap: 8px;
  background: #FFFFFF;
}

.result-modal-card .modal-actions .btn {
  flex: 1;
  min-height: 46px;
}

@media (max-width: 560px) {
  .solo-stat-grid,
  #seq-result-summary .solo-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-modal-card .config-timer-grid {
    grid-template-columns: 1fr;
  }

  .nav-dropdown-menu {
    right: -60px;
    width: min(290px, 88vw);
  }
}

/* =====================================================
   UNO KLASIK UI, ACTION BAR & ACCESSIBILITY
   ===================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ndi-icon.is-uno {
  background: #FCECE8;
}

.uno-canvas-wrap {
  background: #1B4B36 url('/assets/uno-table-bg.webp?v=1') center / 100% 100% no-repeat;
  border: 1px solid rgba(112, 70, 34, 0.72);
  box-shadow:
    inset 0 0 28px rgba(10, 18, 12, 0.28),
    0 12px 30px rgba(10, 6, 3, 0.45);
}

.uno-bottom-left-hud {
  position: absolute;
  left: clamp(14px, 1.8vw, 30px);
  bottom: clamp(14px, 2vh, 24px);
  z-index: 17;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: clamp(205px, 18.5vw, 248px);
  pointer-events: none;
}

.uno-bottom-left-hud > * {
  pointer-events: auto;
}

.uno-viewer-profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1.5px solid rgba(232, 184, 75, 0.55);
  background: rgba(29, 17, 9, 0.9);
  color: #FFF7E4;
  box-shadow: 0 8px 20px rgba(10, 6, 3, 0.45);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.uno-viewer-profile.is-active-turn {
  border-color: #FFD067;
  box-shadow:
    0 0 0 3px rgba(245, 184, 61, 0.28),
    0 10px 24px rgba(10, 6, 3, 0.52);
}

.uno-viewer-profile.is-active-turn.is-low {
  border-color: #FF6B52;
  box-shadow:
    0 0 0 3px rgba(255, 107, 82, 0.34),
    0 10px 24px rgba(84, 16, 12, 0.55);
}

.uno-profile-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.uno-profile-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}

.uno-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 4.5;
}

.uno-ring-fill {
  fill: none;
  stroke: #FFD067;
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.12s linear, stroke 0.2s ease, opacity 0.15s ease;
}

.uno-viewer-profile:not(.is-active-turn) .uno-ring-fill {
  opacity: 0;
}

.uno-viewer-profile.is-low .uno-ring-fill {
  stroke: #FF6B52;
}

.uno-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #C6422C;
  border: 1.5px solid rgba(255, 247, 228, 0.65);
  color: #FFF9EC;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.uno-viewer-profile.is-p2 .uno-profile-avatar { background: #2D6FA8; }
.uno-viewer-profile.is-p3 .uno-profile-avatar { background: #22794B; }
.uno-viewer-profile.is-p4 .uno-profile-avatar { background: #9C5B1A; }

.uno-profile-timer-badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #FFD067;
  border: 1.5px solid #2B1A0F;
  color: #2B1A0F;
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.2;
}

.uno-viewer-profile.is-low .uno-profile-timer-badge {
  background: #FF6B52;
  color: #FFF9EC;
}

.uno-profile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.uno-profile-meta strong {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: #FFF8EB;
  white-space: nowrap;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uno-comm-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px;
  border-radius: 999px;
  border: 1.5px solid rgba(232, 184, 75, 0.75);
  background: rgba(29, 17, 9, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 178, 0.14),
    0 8px 22px rgba(10, 5, 2, 0.5);
  backdrop-filter: blur(6px);
}

.uno-inline-chat-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.uno-inline-chat-wrap[hidden] {
  display: none;
}

.uno-inline-chat-form {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.uno-inline-chat-input {
  width: clamp(88px, 8.2vw, 118px);
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(232, 184, 75, 0.28);
  background: rgba(54, 32, 16, 0.85);
  color: #FFF8EB;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
}

.uno-inline-chat-input::placeholder {
  color: rgba(244, 226, 201, 0.55);
}

.uno-inline-chat-input:focus {
  outline: none;
  border-color: #FFD467;
  background: rgba(66, 39, 20, 0.95);
}

.uno-inline-send-btn,
.uno-inline-log-btn {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #E8B84B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease, background-color 0.14s ease;
}

.uno-inline-send-btn {
  background: linear-gradient(180deg, #F8CB57 0%, #D99B26 100%);
  color: #2B1A0F;
}

.uno-inline-log-btn {
  background: rgba(68, 42, 23, 0.9);
  color: #FFE18A;
}

.uno-inline-send-btn:hover,
.uno-inline-log-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.06);
}

.uno-inline-send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.uno-inline-log-btn .chat-unread-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  font-size: 0.64rem;
}

.uno-floating-actions {
  position: absolute;
  right: clamp(66px, 6.4vw, 110px);
  bottom: calc(clamp(66px, 8.2vh, 92px) + clamp(86px, 6.8vw, 102px) + 12px);
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: clamp(178px, 16vw, 224px);
  pointer-events: none;
}

.uno-action-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: auto;
}

.uno-act-btn {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(10, 5, 2, 0.48);
}

.uno-call-orb {
  position: absolute;
  right: clamp(72px, 6.8vw, 118px);
  bottom: clamp(66px, 8.2vh, 92px);
  z-index: 16;
  width: clamp(86px, 6.8vw, 102px);
  height: clamp(86px, 6.8vw, 102px);
  border-radius: 50%;
  border: 4px solid #FFE082;
  background: radial-gradient(circle at 30% 26%, #FF8442 0%, #DF2920 54%, #8E110E 100%);
  color: #FFF8E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: visible;
  box-shadow:
    0 0 0 5px rgba(255, 212, 103, 0.42),
    0 0 32px rgba(255, 138, 56, 0.7),
    0 12px 28px rgba(154, 22, 14, 0.65),
    inset 0 -8px 14px rgba(68, 8, 6, 0.52);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), filter 0.18s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  animation: unoOrbAttention 1.15s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}

.uno-call-orb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3.5px solid #FFD467;
  box-shadow: 0 0 18px rgba(255, 180, 64, 0.75);
  pointer-events: none;
  animation: unoOrbRadar 1.15s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.uno-call-orb::after {
  content: 'TEKAN!';
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: #FFD467;
  color: #2B1A0F;
  border: 1.5px solid #3D1A0E;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  animation: unoOrbTagBounce 1.15s ease-in-out infinite;
}

.uno-call-orb:hover:not(:disabled) {
  transform: scale(1.1);
  filter: brightness(1.08);
}

.uno-call-orb:active:not(:disabled) {
  transform: scale(0.94);
}

.uno-call-orb:disabled {
  background: radial-gradient(circle at 34% 28%, #8B8780 0%, #5B5752 60%, #3E3B38 100%);
  border-color: #77726B;
  color: #D2CEC7;
  box-shadow:
    0 6px 16px rgba(10, 8, 6, 0.44),
    inset 0 -5px 10px rgba(20, 18, 16, 0.48);
  opacity: 0.78;
  cursor: not-allowed;
  animation: none;
}

.uno-call-orb:disabled::before,
.uno-call-orb:disabled::after {
  display: none;
}

.uno-orb-gloss {
  position: absolute;
  top: 8px;
  left: 16px;
  width: 56%;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.uno-orb-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.2vw, 2.02rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  transform: rotate(-11deg);
  text-shadow:
    0 2.5px 0 #3D1A0E,
    0 5px 12px rgba(0, 0, 0, 0.5);
}

.uno-call-orb:disabled .uno-orb-text {
  text-shadow: 0 2px 0 rgba(25, 22, 20, 0.65);
}

@keyframes unoOrbAttention {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    box-shadow:
      0 0 0 5px rgba(255, 212, 103, 0.42),
      0 0 28px rgba(255, 132, 54, 0.62),
      0 12px 28px rgba(154, 22, 14, 0.62);
  }
  18% {
    transform: scale(1.12) rotate(-5deg);
    box-shadow:
      0 0 0 9px rgba(255, 212, 103, 0.58),
      0 0 42px rgba(255, 172, 64, 0.92),
      0 14px 32px rgba(190, 28, 18, 0.76);
  }
  32% {
    transform: scale(1.1) rotate(5deg);
  }
  46% {
    transform: scale(1.08) rotate(-3deg);
  }
  60% {
    transform: scale(1.03) rotate(2deg);
  }
}

@keyframes unoOrbRadar {
  0% {
    opacity: 0.92;
    transform: scale(0.98);
  }
  100% {
    opacity: 0;
    transform: scale(1.56);
  }
}

@keyframes unoOrbTagBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  45% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.uno-emote-wrap {
  position: relative;
  z-index: 18;
  flex-shrink: 0;
}

.uno-emote-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #E8B84B;
  background: rgba(54, 33, 19, 0.96);
  color: #FFE18A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 6, 3, 0.4);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.uno-emote-toggle-btn:hover {
  background: #53321C;
  transform: scale(1.07);
}

.uno-emote-toggle-btn:active {
  transform: scale(0.95);
}

.uno-emote-toggle-btn[aria-expanded="true"] {
  background: #5A351D;
  border-color: #FFF4CC;
}

.uno-emote-picker {
  position: absolute;
  left: 0;
  bottom: 60px;
  width: min(286px, calc(100vw - 32px));
  padding: 10px;
  border-radius: 16px;
  background: rgba(34, 21, 13, 0.96);
  border: 2px solid #E8B84B;
  box-shadow: 0 14px 32px rgba(10, 6, 3, 0.62);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  animation: unoEmotePop 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.uno-emote-picker[hidden] {
  display: none;
}

@keyframes unoEmotePop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.uno-emote-item {
  min-height: 66px;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(251, 241, 222, 0.2);
  background: rgba(65, 42, 26, 0.85);
  color: #FFF7E4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.71rem;
  font-weight: 800;
  transition: transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}

.uno-emote-item:hover {
  background: #6B4429;
  border-color: #FFD467;
  transform: translateY(-2px);
}

.uno-emote-item:active {
  transform: scale(0.94);
}

.uno-emote-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.32));
}

.uno-emote-face {
  font-size: 1.3rem;
  line-height: 1;
}

@media (max-width: 699px) {
  .uno-canvas-wrap {
    background-size: cover;
    background-position: center;
  }

  .uno-call-orb {
    width: 66px;
    height: 66px;
    right: 12px;
    bottom: 164px;
    border-width: 3px;
  }

  .uno-call-orb::after {
    top: -22px;
    font-size: 0.64rem;
    padding: 1px 8px;
  }

  .uno-orb-text {
    font-size: 1.15rem;
  }

  .uno-floating-actions {
    right: 12px;
    bottom: 238px;
    max-width: 170px;
  }

  .uno-floating-actions .uno-act-btn {
    min-height: 34px;
    padding: 5px 11px;
    font-size: 0.74rem;
  }

  .uno-bottom-left-hud {
    left: 10px;
    bottom: 164px;
    max-width: min(226px, calc(100vw - 108px));
    gap: 6px;
  }

  .uno-viewer-profile {
    padding: 4px 10px 4px 5px;
    gap: 7px;
  }

  .uno-profile-avatar-wrap {
    width: 36px;
    height: 36px;
  }

  .uno-profile-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.74rem;
  }

  .uno-profile-meta strong {
    font-size: 0.78rem;
    max-width: 96px;
  }

  .uno-inline-chat-input {
    width: 82px;
    height: 30px;
    font-size: 0.72rem;
  }

  .uno-emote-toggle-btn {
    width: 34px;
    height: 34px;
  }

  .uno-inline-send-btn,
  .uno-inline-log-btn {
    width: 30px;
    height: 30px;
  }

  .uno-emote-picker {
    bottom: 48px;
    width: min(246px, calc(100vw - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .uno-call-orb,
  .uno-call-orb::before,
  .uno-call-orb::after {
    animation: none;
  }
}

.uno-catch-btn {
  background: linear-gradient(180deg, #D9483B 0%, #A82E22 100%);
  border: 2px solid #FFF7E4;
  color: #FFF9EC;
  box-shadow: 0 3px 0 #5E1710;
}

.uno-catch-btn:hover:not(:disabled) {
  filter: brightness(1.07);
}

.uno-color-backdrop {
  background: rgba(15, 22, 17, 0.56);
  backdrop-filter: blur(4px);
}

.uno-color-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  max-width: 100%;
}

.uno-color-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 20px);
  perspective: 900px;
}

.uno-color-btn {
  --fan-rot: 0deg;
  --fan-y: 0px;
  position: relative;
  width: clamp(74px, 19vw, 118px);
  aspect-ratio: 68 / 100;
  min-height: 108px;
  padding: 6px;
  border-radius: 16px;
  border: 2.5px solid #3D2412;
  background: #FFF9EC;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(10, 6, 3, 0.52),
    0 4px 0 #3D2412;
  transform: translateY(var(--fan-y)) rotate(var(--fan-rot));
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    opacity 0.22s ease,
    filter 0.2s ease;
  animation: unoColorCardIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.uno-color-btn:nth-child(1) {
  --fan-rot: -7deg;
  --fan-y: 8px;
  animation-delay: 0ms;
}

.uno-color-btn:nth-child(2) {
  --fan-rot: -2.2deg;
  --fan-y: 0px;
  animation-delay: 45ms;
}

.uno-color-btn:nth-child(3) {
  --fan-rot: 2.2deg;
  --fan-y: 0px;
  animation-delay: 90ms;
}

.uno-color-btn:nth-child(4) {
  --fan-rot: 7deg;
  --fan-y: 8px;
  animation-delay: 135ms;
}

@keyframes unoColorCardIn {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.74) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(var(--fan-y)) scale(1) rotate(var(--fan-rot));
  }
}

.uno-color-btn:hover,
.uno-color-btn:focus-visible {
  transform: translateY(calc(var(--fan-y) - 14px)) scale(1.08) rotate(0deg);
  box-shadow:
    0 0 0 3.5px #FFD467,
    0 18px 34px rgba(10, 6, 3, 0.62);
  outline: none;
  z-index: 3;
}

.uno-color-btn:active {
  transform: translateY(calc(var(--fan-y) - 8px)) scale(1.02) rotate(0deg);
}

.uno-color-btn.is-picked {
  transform: translateY(-24px) scale(1.2) rotate(0deg) !important;
  box-shadow:
    0 0 0 4px #FFD467,
    0 0 28px rgba(255, 212, 103, 0.72),
    0 22px 42px rgba(10, 6, 3, 0.68) !important;
  z-index: 5;
  pointer-events: none;
}

.uno-color-btn.is-dimmed {
  opacity: 0.14;
  transform: translateY(20px) scale(0.84) rotate(var(--fan-rot)) !important;
  filter: saturate(0.5);
  pointer-events: none;
}

.uno-pick-card-inner {
  position: relative;
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uno-color-btn.is-red .uno-pick-card-inner {
  background: linear-gradient(160deg, #D94338 0%, #B32B21 100%);
  color: #C8362B;
}

.uno-color-btn.is-yellow .uno-pick-card-inner {
  background: linear-gradient(160deg, #F3BC38 0%, #D99518 100%);
  color: #B77409;
}

.uno-color-btn.is-green .uno-pick-card-inner {
  background: linear-gradient(160deg, #279155 0%, #17663A 100%);
  color: #1E7A46;
}

.uno-color-btn.is-blue .uno-pick-card-inner {
  background: linear-gradient(160deg, #2E73B0 0%, #1B4C7A 100%);
  color: #225D94;
}

.uno-pick-oval {
  position: absolute;
  width: 74%;
  height: 82%;
  border-radius: 50%;
  background: #FFF9EC;
  transform: rotate(-22deg);
  box-shadow: inset 0 2px 5px rgba(61, 36, 18, 0.14);
}

.uno-pick-center {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.uno-pick-center .uno-shape-dot {
  width: clamp(20px, 3.8vw, 30px);
  height: clamp(20px, 3.8vw, 30px);
}

.uno-pick-corner {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  color: #FFF9EC;
  opacity: 0.92;
}

.uno-pick-corner.is-tl {
  top: 7px;
  left: 7px;
}

.uno-pick-corner.is-br {
  bottom: 7px;
  right: 7px;
}

.uno-pick-corner .uno-shape-dot {
  width: clamp(8px, 1.4vw, 11px);
  height: clamp(8px, 1.4vw, 11px);
}

.uno-shape-dot {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: currentColor;
}

.uno-shape-dot.is-diamond {
  transform: rotate(45deg);
  border-radius: 2px;
}

.uno-shape-dot.is-circle {
  border-radius: 50%;
}

.uno-shape-dot.is-triangle {
  clip-path: polygon(50% 6%, 96% 92%, 4% 92%);
}

.uno-shape-dot.is-square {
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .uno-color-btn {
    animation: none;
  }
}

.uno-challenge-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.uno-points-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(116, 86, 52, 0.22);
}

.uno-points-table th,
.uno-points-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(116, 86, 52, 0.12);
}

.uno-points-table th {
  background: #F4E7CE;
  font-weight: 800;
  color: #4A3018;
  font-size: 0.76rem;
}

.seat-meta .uno-wins-chip,
.score-pill .uno-wins-chip,
.uno-wins-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #F7D47A;
  border: 1px solid #C68314;
  color: #3D2104;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.score-pill .uno-wins-chip.is-compact,
.uno-wins-chip.is-compact {
  margin-left: 2px;
  padding: 1px 6px;
  font-size: 0.66rem;
}

@media (max-width: 640px) {
  .uno-floating-actions {
    right: 10px;
    bottom: 222px;
  }
}

/* =====================================================
   UNIFIED ROOM CHAT (All Online Lobbies & All Play Stages)
   ===================================================== */
.lobby-left-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-chat-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(232, 184, 75, 0.58);
  color: #FFE49E;
  background: rgba(39, 23, 12, 0.72);
}

.btn-chat-trigger:hover:not(:disabled) {
  background: rgba(74, 43, 22, 0.92);
  border-color: #FFD467;
  color: #FFF7DF;
}

.btn-chat-trigger.is-topbar {
  min-height: 32px;
  padding: 4px 10px;
  border: 1.5px solid rgba(232, 184, 75, 0.45);
  background: rgba(42, 24, 12, 0.65);
}

.btn-chat-trigger.is-active {
  background: linear-gradient(180deg, #E8B84B 0%, #CC8C1E 100%);
  border-color: #FFF1C2;
  color: #2B1A0F;
}

.btn-chat-trigger.has-unread {
  border-color: #FFD467;
  box-shadow: 0 0 0 2px rgba(245, 184, 61, 0.28);
}

.chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #D94132;
  border: 1.5px solid #FFF7E4;
  color: #FFF9EC;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.chat-unread-badge[hidden] {
  display: none;
}

.room-chat-fab {
  position: fixed;
  right: clamp(24px, 2.8vw, 40px);
  bottom: clamp(24px, 3vh, 38px);
  z-index: 83;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid #E8B84B;
  background: linear-gradient(180deg, #4D2D17 0%, #2C180B 100%);
  color: #FFE49E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 194, 0.2),
    0 12px 28px rgba(10, 5, 2, 0.56);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.room-chat-fab[hidden] {
  display: none;
}

.room-chat-fab:hover {
  transform: translateY(-2px) scale(1.06);
  background: linear-gradient(180deg, #5F371C 0%, #371E0E 100%);
  border-color: #FFF0BE;
}

.room-chat-fab:active {
  transform: scale(0.95);
}

.room-chat-fab.is-active {
  background: linear-gradient(180deg, #F0BF52 0%, #D4901E 100%);
  border-color: #FFF4CE;
  color: #2B1A0F;
}

.room-chat-fab.has-unread {
  border-color: #FFE082;
  box-shadow:
    0 0 0 4px rgba(245, 184, 61, 0.34),
    0 12px 28px rgba(10, 5, 2, 0.6);
}

.room-chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
}

.room-chat-toast {
  position: fixed;
  right: clamp(24px, 2.8vw, 40px);
  bottom: calc(clamp(24px, 3vh, 38px) + 68px);
  z-index: 82;
  max-width: min(330px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(232, 184, 75, 0.72);
  background: linear-gradient(180deg, rgba(49, 29, 15, 0.96) 0%, rgba(30, 17, 9, 0.98) 100%);
  color: #FFF7E6;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(10, 5, 2, 0.55);
  animation: unoEmotePop 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.room-chat-toast.is-play-anchor {
  right: clamp(12px, 2vw, 22px);
  bottom: auto;
  top: 58px;
}

.room-chat-toast.is-uno-play-anchor {
  left: clamp(16px, 2vw, 34px);
  right: auto;
  top: auto;
  bottom: 144px;
}

.room-chat-toast[hidden] {
  display: none;
}

.room-chat-toast:hover {
  border-color: #FFE49E;
  transform: translateY(-1px);
}

.room-chat-toast-badge {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: #FFF9EC;
  background: #6D4C34;
}

.room-chat-toast-badge.is-p1 { background: #C6422C; }
.room-chat-toast-badge.is-p2 { background: #2D6FA8; }
.room-chat-toast-badge.is-p3 { background: #22794B; }
.room-chat-toast-badge.is-p4 { background: #9C5B1A; }

.room-chat-toast-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.room-chat-toast-copy strong {
  font-size: 0.76rem;
  font-weight: 800;
  color: #FFE082;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chat-toast-copy span {
  font-size: 0.82rem;
  color: #FFF6E3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chat-toast-cta {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(232, 184, 75, 0.22);
  border: 1px solid rgba(232, 184, 75, 0.5);
  color: #FFE082;
  font-size: 0.7rem;
  font-weight: 800;
}

.room-chat-drawer {
  position: fixed;
  right: clamp(24px, 2.8vw, 40px);
  bottom: calc(clamp(24px, 3vh, 38px) + 68px);
  z-index: 82;
  width: min(364px, calc(100vw - 32px));
  height: min(430px, calc(100dvh - 150px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 2px solid rgba(232, 184, 75, 0.72);
  background: linear-gradient(180deg, rgba(46, 27, 14, 0.97) 0%, rgba(28, 16, 8, 0.98) 100%);
  color: #FFF7E6;
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 130, 0.14),
    0 20px 46px rgba(10, 5, 2, 0.65);
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: unoEmotePop 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.room-chat-drawer.is-play-anchor {
  right: clamp(12px, 2vw, 22px);
  bottom: auto;
  top: 58px;
  width: min(364px, calc(100vw - 24px));
  height: min(410px, calc(100dvh - 134px));
}

.room-chat-drawer.is-uno-play-anchor {
  left: clamp(16px, 2vw, 34px);
  right: auto;
  top: auto;
  bottom: 136px;
  width: min(350px, calc(100vw - 24px));
  height: min(340px, calc(100dvh - 210px));
}

.room-chat-drawer[hidden] {
  display: none;
}

.room-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(24, 13, 6, 0.68);
  border-bottom: 1px solid rgba(232, 184, 75, 0.26);
}

.room-chat-head-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.room-chat-head-copy strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  color: #FFE296;
  line-height: 1.15;
}

.room-chat-head-copy span {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-on-dark-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chat-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(251, 241, 222, 0.22);
  background: rgba(74, 43, 22, 0.65);
  color: #F4E6CF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.room-chat-close-btn:hover {
  background: rgba(145, 45, 34, 0.85);
  border-color: rgba(255, 178, 166, 0.6);
  color: #FFFFFF;
}

.room-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at top right, rgba(31, 77, 54, 0.18), transparent 62%),
    rgba(21, 12, 6, 0.45);
}

.room-chat-empty {
  margin: auto 8px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(232, 184, 75, 0.28);
  background: rgba(34, 20, 11, 0.5);
  color: var(--ink-on-dark-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.room-chat-empty[hidden] {
  display: none;
}

.room-chat-msg {
  max-width: 86%;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-chat-msg.is-self {
  align-self: flex-end;
  align-items: flex-end;
}

.room-chat-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-on-dark-muted);
  padding: 0 2px;
}

.room-chat-sender-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #A98E72;
  flex-shrink: 0;
}

.room-chat-msg.is-p1 .room-chat-sender-dot { background: #E35D46; }
.room-chat-msg.is-p2 .room-chat-sender-dot { background: #4B97D9; }
.room-chat-msg.is-p3 .room-chat-sender-dot { background: #42B976; }
.room-chat-msg.is-p4 .room-chat-sender-dot { background: #F0AF3A; }

.room-chat-sender-name {
  color: #F4DEC0;
  font-weight: 800;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-chat-msg.is-self .room-chat-sender-name {
  color: #FFE082;
}

.room-chat-bubble {
  margin: 0;
  padding: 8px 11px;
  border-radius: 13px 13px 13px 4px;
  background: rgba(68, 42, 23, 0.94);
  border: 1px solid rgba(251, 241, 222, 0.16);
  color: #FFF8EB;
  font-size: 0.86rem;
  line-height: 1.38;
  word-break: break-word;
  box-shadow: 0 3px 10px rgba(8, 4, 1, 0.25);
}

.room-chat-msg.is-self .room-chat-bubble {
  border-radius: 13px 13px 4px 13px;
  background: linear-gradient(180deg, rgba(162, 108, 30, 0.92) 0%, rgba(124, 79, 19, 0.95) 100%);
  border-color: rgba(255, 224, 130, 0.45);
  color: #FFFDF7;
}

.room-chat-quick {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(27, 15, 7, 0.72);
  border-top: 1px solid rgba(251, 241, 222, 0.1);
}

.room-chat-quick::-webkit-scrollbar {
  display: none;
}

.room-chat-chip {
  flex-shrink: 0;
  padding: 4px 7.5px;
  border-radius: 999px;
  border: 1px solid rgba(232, 184, 75, 0.34);
  background: rgba(68, 42, 23, 0.8);
  color: #F8E5C0;
  font-family: var(--font-body);
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.room-chat-chip:hover:not(:disabled) {
  background: rgba(112, 68, 34, 0.95);
  border-color: #FFD467;
  color: #FFF9EC;
  transform: translateY(-1px);
}

.room-chat-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.room-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: rgba(20, 11, 5, 0.85);
  border-top: 1px solid rgba(232, 184, 75, 0.22);
}

.room-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 10px;
  border: 1.5px solid rgba(232, 184, 75, 0.34);
  background: rgba(44, 26, 13, 0.92);
  color: #FFF8EB;
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.room-chat-input::placeholder {
  color: rgba(244, 226, 201, 0.55);
}

.room-chat-input:focus {
  outline: none;
  border-color: #FFD467;
  box-shadow: 0 0 0 2px rgba(255, 212, 103, 0.22);
}

.room-chat-send-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px 13px;
}

@media (max-width: 640px) {
  .room-chat-fab {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }

  .room-chat-drawer {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: 78px;
    height: min(350px, calc(100dvh - 130px));
  }

  .room-chat-drawer.is-play-anchor {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: 10px;
    height: min(360px, calc(100dvh - 80px));
  }

  .room-chat-drawer.is-uno-play-anchor {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: 214px;
    height: min(280px, calc(100dvh - 255px));
  }

  .room-chat-toast,
  .room-chat-toast.is-play-anchor,
  .room-chat-toast.is-uno-play-anchor {
    right: 10px;
    left: auto;
    top: 56px;
    bottom: auto;
    max-width: calc(100vw - 20px);
  }
}
