/* ═══════════════════════════════════════════════
   STL Visual Identity — Notebook Paper + Qimah
   ═══════════════════════════════════════════════ */

/* ─── Page Body — Notebook Paper Background ─── */
body:has(#qimah-stl-root) {
  margin: 0;
  background-color: #F5F0E4;
  background-image:
    repeating-linear-gradient(180deg,
      transparent,
      transparent 31px,
      #B8D4E3 31px,
      #B8D4E3 32px);
  background-size: 100% 32px;
  font-family: 'Playpen Sans Arabic', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ─── Floating Creatures ─── */
.stl-creature {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  top: var(--y, 50%);
  left: var(--x, 50%);
  animation: stl-float var(--duration, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.stl-creature--sm { width: 28px; height: 28px; opacity: 0.15; }
.stl-creature--md { width: 40px; height: 40px; opacity: 0.18; }
.stl-creature--lg { width: 52px; height: 52px; opacity: 0.22; }

@keyframes stl-float {
  0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
  25% { transform: translateY(-15px) translateX(8px) rotate(5deg); }
  50% { transform: translateY(-8px) translateX(-5px) rotate(-3deg); }
  75% { transform: translateY(-20px) translateX(10px) rotate(4deg); }
}

@media (max-width: 640px) {
  .stl-creature { display: none; }
}

/* ─── Design Tokens ─── */
#qimah-stl-root {
  /* Premium Palette (HSL based for better harmony) */
  --stl-bg: hsl(42, 38%, 93%);
  /* Creamy paper */
  --stl-surface: hsl(44, 32%, 89%);
  /* Recycled paper */
  --stl-card: hsl(56, 100%, 92%);
  /* Sticky note yellow */
  --stl-border: hsl(40, 24%, 76%);
  --stl-text: hsl(30, 15%, 15%);
  --stl-text-dim: hsl(32, 16%, 36%);

  /* Qimah Brand & Accent Colors */
  --stl-green: hsl(157, 54%, 26%);
  /* Summit Green */
  --stl-green-hover: hsl(157, 58%, 20%);
  --stl-green-light: hsl(147, 56%, 78%);
  --stl-xp-gold: hsl(38, 91%, 54%);
  /* XP Gold */
  --stl-red: hsl(0, 68%, 55%);
  /* Red pen */
  --stl-pen-blue: hsl(215, 68%, 54%);
  /* Blue pen */
  --stl-pen-violet: hsl(260, 34%, 47%);
  /* Royal Violet */

  /* Glassmorphism / Modern Touches */
  --stl-glass-bg: rgba(255, 255, 255, 0.45);
  --stl-glass-border: rgba(255, 255, 255, 0.5);
  --stl-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --stl-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* Typography */
  --stl-font-display: 'Marhey', 'Lalezar', system-ui, sans-serif;
  --stl-font-body: 'Playpen Sans Arabic', 'Cairo', system-ui, sans-serif;
  --stl-font-mono: 'Courier Prime', monospace;
  --stl-font: var(--stl-font-body);

  /* Sticky Note Palette */
  --stl-sticky-yellow: hsl(56, 100%, 92%);
  --stl-sticky-blue: hsl(215, 68%, 88%);
  --stl-sticky-pink: hsl(340, 80%, 88%);
  --stl-sticky-green: hsl(147, 56%, 78%);
  --stl-margin-red: hsl(0, 68%, 55%);

  /* Legacy Compat */
  --stl-gold: var(--stl-xp-gold);
  --stl-ruled-line: #B8D4E3;
}

/* ─── Floating Animations ─── */
@keyframes stl-float {

  0%,
  100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }

  50% {
    transform: translateY(-10px) rotate(var(--rot, 0deg));
  }
}

@keyframes stl-spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes stl-pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(30, 102, 73, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(30, 102, 73, 0);
  }
}

/* ─── Loading Dots ─── */
.stl-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px 24px;
  width: 100%;
}

.stl-loading__dots {
  display: flex;
  gap: 8px;
}

.stl-loading__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stl-green);
  opacity: 0.3;
  animation: stl-dot-bounce 1.2s ease-in-out infinite;
}

.stl-loading__dot:nth-child(2) { animation-delay: 0.15s; }
.stl-loading__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes stl-dot-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.3); }
}

.stl-loading__text {
  font-size: 0.95rem;
  color: var(--stl-text-dim);
  opacity: 0.7;
}

/* ─── Root Container ─── */
#qimah-stl-root {
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  font-family: var(--stl-font);
  color: var(--stl-text);
  position: relative;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

#qimah-stl-root *,
#qimah-stl-root *::before,
#qimah-stl-root *::after {
  box-sizing: border-box;
}

/* ─── Elementor / Theme CSS Isolation ───
   Boost specificity with #id so game styles always beat
   Elementor's .elementor-page button / input / a rules. */
#qimah-stl-root a { color: inherit; text-decoration: none; }
#qimah-stl-root h1,
#qimah-stl-root h2,
#qimah-stl-root h3,
#qimah-stl-root p { margin: 0; padding: 0; }

/* ─── Qimah Margin Watermark ─── */
#qimah-stl-root::before {
  content: 'قمة';
  position: fixed;
  top: 50%;
  right: 48px;
  transform: translateY(-50%) rotate(-90deg);
  font-family: var(--stl-font-display);
  font-size: 1.2rem;
  color: rgba(107, 94, 78, 0.1);
  pointer-events: none;
  z-index: 0;
  letter-spacing: 0.1em;
}

/* Red margin line */
#qimah-stl-root::after {
  content: '';
  position: fixed;
  top: 0;
  right: 60px;
  bottom: 0;
  width: 1px;
  background: var(--stl-margin-red);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* ─── Panels — Sticky Notes ─── */
.stl-panel {
  background: var(--stl-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--stl-glass-border);
  border-radius: 24px;
  box-shadow: var(--stl-shadow-md);
  color: var(--stl-text);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.stl-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--stl-green);
  opacity: 0.5;
  border-radius: 24px 24px 0 0;
}

.stl-panel--light {
  background: var(--stl-sticky-blue);
  background-image: none;
  border: none;
  border-image: none;
}

.stl-panel--frame {
  background: var(--stl-surface);
  background-image: none;
  border: none;
  border-image: none;
}

/* Constrain full-screen panels */
.stl-menu.stl-panel,
.stl-lobby.stl-panel,
.stl-unified.stl-panel,
.stl-gameover.stl-panel,
.stl-leaderboard.stl-panel {
  max-width: 520px;
  width: calc(100% - 24px);
  margin: auto;
}

/* Per-screen sticky note colors */
/* Per-screen glass variants */
.stl-menu.stl-panel {
  background: rgba(255, 255, 255, 0.7);
}

.stl-lobby.stl-panel,
.stl-unified.stl-panel {
  background: rgba(255, 255, 255, 0.7);
}

.stl-gameover.stl-panel {
  background: rgba(224, 255, 232, 0.75);
}

.stl-leaderboard.stl-panel {
  background: rgba(255, 255, 255, 0.75);
}

/* ─── Menu Screen ─── */
.stl-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 24px;
  gap: 16px;
}

.stl-menu--active .stl-menu__header,
.stl-menu--active .stl-menu__identity,
.stl-menu--active .stl-uni-picker,
.stl-menu--active .stl-menu__actions {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Menu Header Zone ─── */
.stl-menu__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.05s;
}

.stl-menu__logo {
  width: clamp(56px, 15vw, 80px);
  height: auto;
  opacity: 0.85;
}

.stl-menu__title {
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-weight: 700;
  font-family: var(--stl-font-display);
  color: var(--stl-green);
  text-align: center;
  margin: 0;
  line-height: 1.1;
  text-shadow: none;
}

.stl-menu__subtitle {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: var(--stl-text-dim);
  text-align: center;
  margin: 0;
  opacity: 0.7;
}

/* ─── Identity Zone (name + character) ─── */
.stl-menu__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.15s;
}

.stl-menu__input {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--stl-border);
  border-radius: 16px;
  padding: 18px 24px;
  font-size: 1.15rem;
  color: var(--stl-text);
  text-align: center;
  width: 100%;
  outline: none;
  font-family: var(--stl-font);
  direction: rtl;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stl-menu__input:focus {
  border-color: var(--stl-green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 102, 73, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stl-menu__input::placeholder {
  color: var(--stl-text-dim);
}

/* ─── Compact Identity (return visitors) ─── */
.stl-menu__identity-bar {
  display: none;
}

.stl-menu__identity--compact .stl-menu__identity-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid var(--stl-border);
  width: 100%;
  justify-content: center;
  transition: background 0.2s;
}

.stl-menu__identity--compact .stl-menu__identity-bar:hover {
  background: rgba(255, 255, 255, 0.85);
}

.stl-menu__identity-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.stl-menu__identity-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stl-text);
  font-family: var(--stl-font);
}

.stl-menu__identity-edit {
  font-size: 1rem;
  color: var(--stl-text-dim);
  margin-inline-start: auto;
}

.stl-menu__identity--compact .stl-menu__identity-full {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.stl-menu__identity-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

/* ─── Buttons — Pen/Ink Style ─── */
#qimah-stl-root .stl-btn,
.stl-modal-overlay .stl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 36px;
  border-radius: 16px;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--stl-font);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 220px;
  direction: rtl;
  position: relative;
  overflow: hidden;
  background: none;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  outline: none;
  line-height: normal;
  box-sizing: border-box;
}

.stl-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.stl-btn:hover::after {
  left: 100%;
}

#qimah-stl-root .stl-btn--primary,
.stl-modal-overlay .stl-btn--primary {
  background: var(--stl-green);
  color: #fff;
  box-shadow: 0 4px 0 hsl(157, 58%, 15%), 0 8px 16px rgba(30, 102, 73, 0.24);
  position: relative;
  overflow: hidden;
}

.stl-btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: stl-btn-shimmer 3s ease-in-out infinite;
}

.stl-btn--primary:disabled::after {
  animation: none;
}

.stl-btn--primary:hover {
  background: var(--stl-green-hover);
  box-shadow: 0 6px 0 hsl(157, 58%, 15%), 0 12px 20px rgba(30, 102, 73, 0.3);
}

.stl-btn--primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 hsl(157, 58%, 15%);
}

#qimah-stl-root .stl-btn--secondary,
.stl-modal-overlay .stl-btn--secondary {
  background: #fff;
  color: var(--stl-text);
  border: 2px solid var(--stl-border);
  box-shadow: 0 4px 0 var(--stl-border);
}

.stl-btn--secondary:hover {
  border-color: var(--stl-text-dim);
  box-shadow: 0 6px 0 var(--stl-border);
}

.stl-btn--secondary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--stl-border);
}

#qimah-stl-root .stl-btn--green-outline {
  background: #fff;
  color: var(--stl-green);
  border: 2px solid var(--stl-green);
  box-shadow: 0 4px 0 hsl(157, 58%, 25%);
  position: relative;
  overflow: hidden;
}

.stl-btn--green-outline.stl-btn--shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(30, 102, 73, 0.12), transparent);
  animation: stl-btn-shimmer 2s ease-in-out infinite;
}
.stl-btn--green-outline:hover {
  background: rgba(30, 102, 73, 0.06);
  box-shadow: 0 6px 0 hsl(157, 58%, 25%);
}
.stl-btn--green-outline:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 hsl(157, 58%, 25%);
}

.stl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
}

/* ─── Hero CTA Button ─── */
#qimah-stl-root .stl-btn--hero {
  width: 100%;
  padding: 18px 36px;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--stl-font-display);
  background: var(--stl-green);
  color: #fff;
  border: none;
  border-radius: 18px;
  box-shadow: 0 6px 0 hsl(157, 58%, 15%), 0 12px 24px rgba(30, 102, 73, 0.28);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  min-width: 0;
  direction: rtl;
}

.stl-btn--hero:hover {
  background: var(--stl-green-hover);
  box-shadow: 0 8px 0 hsl(157, 58%, 15%), 0 16px 28px rgba(30, 102, 73, 0.32);
}

.stl-btn--hero:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 hsl(157, 58%, 15%);
}

.stl-btn--hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: stl-btn-shimmer 3s ease-in-out infinite;
}

@keyframes stl-btn-shimmer {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

.stl-btn--pulse {
  animation: stl-btn-pulse 2s ease-in-out infinite;
}

@keyframes stl-btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* ─── Menu Actions Layout ─── */
.stl-menu__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.35s;
}

.stl-menu__actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.stl-btn--compact {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 0.95rem;
}

/* Ghost button (leaderboard) */
.stl-btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--stl-font);
  color: var(--stl-text-dim);
  background: transparent;
  border: 1.5px dashed var(--stl-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  direction: rtl;
}

.stl-btn--ghost:hover {
  border-color: var(--stl-xp-gold);
  color: hsl(38, 70%, 40%);
  background: rgba(244, 167, 32, 0.06);
  border-style: solid;
}

/* ─── Lobby Screen ─── */
.stl-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
  gap: 20px;
}

/* Header block — title + code + subtitle stacked */
.stl-lobby__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.stl-lobby__title {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--stl-font);
  color: var(--stl-text-dim);
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stl-lobby__code {
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--stl-green);
  font-family: var(--stl-font-mono);
  direction: ltr;
  background: #fff;
  border: 3px dashed var(--stl-green);
  box-shadow: 0 4px 12px rgba(30, 102, 73, 0.1);
  border-radius: 12px;
  padding: 8px 24px;
  margin: 12px 0;
  display: inline-block;
}

.stl-lobby__subtitle {
  font-size: 0.9rem;
  color: var(--stl-text-dim);
  margin: 0;
  text-align: center;
}

/* Player list */
.stl-lobby__players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.stl-lobby__player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid var(--stl-border);
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 100px;
  box-shadow: var(--stl-shadow-sm);
}

.stl-lobby__player:hover {
  transform: scale(1.03);
  border-color: var(--stl-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stl-lobby__player--me {
  border-color: var(--stl-green);
  background: var(--stl-green-light);
  box-shadow: 0 0 0 4px rgba(30, 102, 73, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stl-lobby__avatar {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.stl-lobby__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
  color: var(--stl-text);
}

/* Config groups — centered with labels */
.stl-lobby__config {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.stl-lobby__config-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.stl-lobby__config-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--stl-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  text-align: center;
}

.stl-lobby__pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Action buttons — full width, stacked */
.stl-lobby__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.stl-lobby__actions > .stl-btn {
  width: 100%;
}

.stl-lobby__actions-row {
  display: flex;
  gap: 10px;
}

.stl-lobby__actions-row .stl-btn {
  flex: 1;
}

.stl-lobby__count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--stl-text);
  padding: 6px 16px;
  border-radius: 24px;
  background: var(--stl-glass-bg);
  border: 1px solid var(--stl-glass-border);
  margin-bottom: 8px;
}

.stl-lobby__hint {
  font-size: 0.8rem;
  color: var(--stl-text-dim);
  margin: 0;
  min-height: 1.2em;
  text-align: center;
}

.stl-lobby__start {
  margin-top: 0;
}

.stl-pill {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--stl-border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--stl-font);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--stl-text-dim);
  box-shadow: var(--stl-shadow-sm);
}

.stl-pill:hover {
  background: #fff;
  border-color: var(--stl-text-dim);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stl-pill--active {
  background: var(--stl-green-light) !important;
  color: var(--stl-green) !important;
  border-color: var(--stl-green) !important;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(30, 102, 73, 0.15);
}

/* ─── Unified Lobby ─── */

.stl-unified {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  padding: 28px 20px 24px;
}

/* ─── Branding (logo + title + subtitle) ─── */
.stl-unified__branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}
.stl-unified__logo {
  width: 56px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(30, 102, 73, 0.2));
}
.stl-unified__title {
  font-family: var(--stl-font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--stl-green);
  letter-spacing: 0.02em;
  direction: ltr;
  line-height: 1.2;
}
.stl-unified__subtitle {
  font-family: var(--stl-font-body);
  font-size: 0.85rem;
  color: var(--stl-text-dim);
  margin-top: 4px;
}

/* ─── Unified: Players ─── */

.stl-unified__avatar-label {
  font-size: 0.85rem;
  color: var(--stl-text-dim);
  text-align: center;
  margin-bottom: 10px;
}

.stl-unified__players {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 8px;
  position: relative;
  min-height: 140px;
  padding: 0 10px;
  flex-wrap: wrap;
  gap: 4px;
}

.stl-unified__my-card {
  background: hsl(152, 52%, 72%);
  background: hsl(87, 100%, 94%);
  border: 2px solid hsl(152, 48%, 32%);
  border-radius: 16px;
  padding: 14px 20px 10px;
  text-align: center;
  position: relative;
  z-index: 2;
  min-width: 150px;
  margin: 0 -8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.stl-unified__my-host {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  background: hsl(38, 91%, 54%);
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.stl-unified__my-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.stl-unified__my-avatar-wrap--idle {
  transform-origin: 50% 65%;
  animation: stl-unified-avatar-breathe 2.6s ease-in-out infinite;
}

.stl-unified__my-avatar-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  transition: transform 0.2s;
}
.stl-unified__my-avatar-wrap:hover .stl-unified__my-avatar-canvas {
  transform: scale(1.08);
}

@keyframes stl-unified-avatar-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1px) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .stl-unified__my-avatar-wrap--idle {
    animation: none;
  }
}

.stl-unified__avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -6px;
  background: var(--stl-green);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid hsl(152, 52%, 72%);
  opacity: 0;
  transition: opacity 0.2s;
}
.stl-unified__my-avatar-wrap:hover .stl-unified__avatar-edit {
  opacity: 1;
}

#qimah-stl-root .stl-unified__my-name {
  background: rgba(255,255,255,0.85);
  border: 2px solid #ccc;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  text-align: center;
  width: 140px;
  padding: 5px 8px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  outline: none;
  font-size: 13px;
  margin-top: 4px;
  direction: rtl;
}
.stl-unified__my-name:focus {
  border-color: var(--stl-green);
  background: #fff;
}

#qimah-stl-root .stl-unified__my-uni {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--stl-green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: var(--stl-font-body);
  -webkit-appearance: none;
  appearance: none;
}
.stl-unified__my-uni:hover {
  background: hsl(157, 58%, 20%);
  transform: scale(1.05);
}

/* ─── Unified: Other Player Cards ─── */

.stl-unified__other {
  background: hsl(147, 56%, 78%);
  border: 2px solid hsl(147, 40%, 68%);
  border-radius: 12px;
  padding: 8px 10px 6px;
  text-align: center;
  width: 80px;
  position: relative;
  z-index: 1;
  opacity: 0.85;
  transform: scale(0.85);
}

.stl-unified__other-avatar {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  margin: 0 auto;
}

.stl-unified__other-name {
  font-size: 10px;
  color: var(--stl-text);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stl-unified__other-host {
  font-size: 10px;
  background: hsl(38, 91%, 54%);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 3px;
  display: inline-block;
  font-weight: 700;
}

.stl-unified__other-uni {
  display: block;
  font-size: 8px;
  font-weight: 700;
  color: var(--stl-green);
  background: rgba(255,255,255,0.6);
  padding: 1px 5px;
  border-radius: 6px;
  margin-top: 3px;
}

/* ─── Unified: Count ─── */

.stl-unified__count {
  text-align: center;
  font-size: 1rem;
  color: var(--stl-text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}

/* ─── Unified: Actions ─── */

.stl-unified__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
.stl-unified__actions-row {
  display: flex;
  gap: 10px;
}
.stl-unified__actions-row > .stl-btn {
  flex: 1;
}
#qimah-stl-root .stl-unified .stl-btn {
  padding: 13px 24px;
  font-size: 1.05rem;
  min-width: 0;
  border-radius: 14px;
}
#qimah-stl-root .stl-unified .stl-btn--primary {
  padding: 15px 24px;
  font-size: 1.15rem;
}
.stl-unified__start {
  margin-top: 0;
}

/* ── Room code pill ── */
.stl-unified__room-pill {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 auto 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
  width: fit-content;
}
.stl-unified__room-pill:active {
  transform: scale(0.97);
}

.stl-unified__room-pill.visible {
  display: flex;
}

.stl-unified__room-pill__label {
  font-family: var(--stl-font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--stl-text-dim);
  margin-bottom: 4px;
}

.stl-unified__room-pill__code {
  font-family: 'Courier New', monospace;
  font-size: 2.2rem;
  letter-spacing: 6px;
  font-weight: 900;
  color: var(--stl-green);
  border: 2.5px dashed var(--stl-green);
  border-radius: 14px;
  padding: 12px 28px 12px 22px;
}

.stl-unified__room-pill__copy {
  display: none;
}

/* ── Leaderboard teaser ── */
.stl-unified__lb-teaser {
  width: 100%;
  background: linear-gradient(135deg, hsl(40, 30%, 96%), hsl(45, 40%, 93%));
  border: 2px solid hsl(40, 40%, 80%);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  min-height: 120px;
}

.stl-unified__lb-teaser-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: hsl(35, 60%, 35%);
  margin-bottom: 10px;
}

/* ── Teaser podium (horizontal 3-col) ── */
.stl-teaser-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.stl-teaser-podium__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  position: relative;
  min-height: 80px;
}

.stl-teaser-podium__bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--col-color, #ccc);
  opacity: 0.3;
  height: 20px; /* 3rd place default */
}

.stl-teaser-podium__col--second .stl-teaser-podium__bar { height: 32px; }
.stl-teaser-podium__col--first  .stl-teaser-podium__bar { height: 48px; opacity: 0.45; }

.stl-teaser-podium__medal {
  font-size: 1.1rem;
  line-height: 1;
}

.stl-teaser-podium__col--first .stl-teaser-podium__medal { font-size: 1.4rem; }

.stl-teaser-podium__badge {
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stl-teaser-podium__col--first .stl-teaser-podium__badge { font-size: 0.8rem; }

.stl-teaser-podium__score {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--stl-text-dim);
}

.stl-teaser-podium__col--me .stl-teaser-podium__badge {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.stl-unified__lb-teaser-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.stl-unified__lb-teaser-row::before {
  content: '';
  position: absolute;
  inset: 0;
  width: var(--bar-pct, 0%);
  background: var(--bar-color, transparent);
  opacity: 0.15;
  border-radius: 8px;
  transition: width 0.6s ease;
}

.stl-unified__lb-teaser-row > * {
  position: relative;
  z-index: 1;
}

.stl-unified__lb-teaser-row.highlight {
  border-radius: 8px;
  padding: 5px 8px;
}

.stl-unified__lb-rank {
  font-weight: 800;
  color: var(--stl-text-dim);
  min-width: 24px;
}

.stl-unified__lb-uni-badge {
  color: #fff;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.stl-unified__lb-score {
  margin-right: auto;
  font-weight: 700;
  color: var(--stl-text);
}

.stl-unified__lb-cta {
  text-align: center;
  font-size: 0.9rem;
  color: hsl(35, 60%, 35%);
  font-weight: 800;
  margin-top: 10px;
  padding: 6px 12px;
  background: hsl(38, 60%, 90%);
  border-radius: 8px;
  border: 1.5px solid hsl(38, 50%, 78%);
}

/* Skeleton shimmer */
.stl-unified__lb-skeleton-row {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  align-items: center;
}

.stl-unified__lb-skeleton-bar {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, hsl(40, 20%, 88%) 25%, hsl(40, 20%, 93%) 50%, hsl(40, 20%, 88%) 75%);
  background-size: 200% 100%;
  animation: stl-shimmer 1.5s ease-in-out infinite;
}

@keyframes stl-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Unified: Join Card ─── */

.stl-unified__join {
  margin-top: 12px;
  background: hsl(215, 40%, 95%);
  border: 2px solid hsl(215, 40%, 85%);
  border-radius: 12px;
  padding: 7px 12px;
  text-align: center;
  width: 100%;
}
.stl-unified__join-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 700;
  color: hsl(215, 50%, 40%);
  margin-bottom: 4px;
}
.stl-unified__join-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
#qimah-stl-root .stl-unified__join-input {
  font-family: var(--stl-font-mono);
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: 0.25em;
  width: 126px;
  padding: 5px 10px;
  border: 2px solid hsl(215, 40%, 82%);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  background: #fff;
  background: #fff;
  outline: none;
  text-transform: uppercase;
}
.stl-unified__join-input:focus {
  border-color: hsl(215, 68%, 54%);
}
.stl-unified__join-input::placeholder {
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  color: #bbb;
}
#qimah-stl-root .stl-unified__join-btn {
  padding: 6px 16px;
  font-size: 0.92rem;
  border-radius: 10px;
  background: hsl(215, 68%, 54%);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--stl-font-body);
  transition: background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.stl-unified__join-btn:hover {
  background: hsl(215, 68%, 44%);
}

/* ─── Modal Overlay ─── */

/* Modals are appended to document.body, outside #qimah-stl-root.
   Re-declare the tokens modals need so var() references resolve. */
.stl-modal-overlay {
  --stl-green: hsl(157, 54%, 26%);
  --stl-green-hover: hsl(157, 58%, 20%);
  --stl-green-glow: hsl(155, 52%, 88%);
  --stl-border: hsl(40, 24%, 76%);
  --stl-text: hsl(30, 15%, 15%);
  --stl-text-dim: hsl(32, 16%, 36%);
  --stl-glass-bg: rgba(255, 255, 255, 0.45);
  --stl-pen-blue: hsl(215, 68%, 54%);
  --stl-font-display: 'Marhey', 'Lalezar', system-ui, sans-serif;
  --stl-font-body: 'Playpen Sans Arabic', 'Cairo', system-ui, sans-serif;
  --stl-font: var(--stl-font-body);
  --stl-rule-line: rgba(0, 0, 0, 0.06);

  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stl-modal {
  position: relative;
  border-radius: 16px;
  width: min(420px, 92vw);
  max-height: min(540px, 82vh);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  background-color: #F2EDE0;
  background-image: repeating-linear-gradient(
    transparent, transparent 31px,
    var(--stl-rule-line, rgba(0,0,0,0.06)) 31px, var(--stl-rule-line, rgba(0,0,0,0.06)) 32px
  );
  display: flex;
  flex-direction: column;
}

.stl-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  background: var(--stl-green);
  flex-shrink: 0;
}
.stl-modal__title {
  font-family: var(--stl-font-display);
  font-size: 18px;
  color: #fff;
  font-weight: 700;
}
.stl-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  line-height: 1;
  padding: 0 4px;
}

.stl-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Compact avatar picker modal (prevents regression to oversized/scrolling modal) */
.stl-modal--char {
  width: min(400px, 92vw);
  max-height: min(420px, 76vh);
}
.stl-modal--char .stl-modal__body {
  overflow: hidden;
  padding: 16px 16px 14px;
}

/* Disable shimmer inside modals — buttons are functional, not decorative */
.stl-modal .stl-btn::after,
.stl-modal .stl-btn--primary::after {
  display: none;
}
.stl-modal .stl-btn {
  min-width: 0;
}

/* ─── Settings Modal ─── */

.stl-settings-group {
  margin-bottom: 20px;
}
.stl-settings-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--stl-text);
  margin-bottom: 8px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ─── Setting Hint Tooltip ─── */
.stl-settings-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--stl-border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--stl-text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--stl-font-body);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.stl-settings-hint:hover,
.stl-settings-hint--active {
  border-color: var(--stl-green);
  color: var(--stl-green);
  background: rgba(30, 102, 73, 0.08);
}
.stl-settings-hint-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--stl-font-body);
  padding: 8px 14px;
  border-radius: 10px;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  direction: rtl;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  line-height: 1.5;
}
.stl-settings-hint-bubble--visible {
  opacity: 1;
}
.stl-settings-hint-bubble::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(30, 30, 30, 0.92);
}
.stl-settings-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.stl-settings-pill {
  flex: 1;
  padding: 10px 12px;
  font-family: var(--stl-font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--stl-border);
  background: #fff;
  color: var(--stl-text);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.stl-settings-pill:hover {
  background: var(--stl-glass-bg);
}
.stl-settings-pill--active {
  background: var(--stl-green);
  color: #fff;
  border-color: var(--stl-green);
  box-shadow: 0 2px 8px rgba(30, 102, 73, 0.25);
}
.stl-settings-pill--active:hover {
  background: var(--stl-green);
}

.stl-settings-save {
  margin-top: 16px;
  width: 100%;
}

/* ─── Settings Slider ─── */

.stl-settings-slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stl-settings-slider-value {
  font-family: var(--stl-font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--stl-green);
  line-height: 1;
}
.stl-settings-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--stl-border);
  outline: none;
  direction: ltr;
}
.stl-settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stl-green);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(30, 102, 73, 0.3);
}
.stl-settings-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--stl-green);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(30, 102, 73, 0.3);
}
.stl-settings-slider-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: var(--stl-text-dim);
  direction: ltr;
}

/* ─── Exclude Games Button ─── */

.stl-settings-exclude-btn {
  width: 100%;
  text-align: center;
  position: relative;
}
.stl-settings-exclude-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c0392b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 5px;
  margin-inline-start: 4px;
  vertical-align: middle;
}

/* ─── Game Picker Modal ─── */

.stl-game-picker__hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--stl-text-dim);
  margin-bottom: 8px;
}
.stl-game-picker__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}
.stl-game-picker__chip {
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid var(--stl-green);
  background: rgba(30, 102, 73, 0.08);
  cursor: pointer;
  font-family: var(--stl-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stl-green);
  transition: all 0.15s;
  text-align: center;
}
.stl-game-picker__chip:hover {
  background: rgba(30, 102, 73, 0.15);
}
.stl-game-picker__chip--off {
  border-color: var(--stl-border);
  background: rgba(0, 0, 0, 0.04);
  color: var(--stl-text-dim);
  text-decoration: line-through;
  opacity: 0.6;
}
.stl-game-picker__chip--off:hover {
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.06);
}
.stl-game-picker__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
}
.stl-game-picker__count {
  font-family: var(--stl-font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--stl-green);
}
.stl-game-picker__confirm {
  min-width: 80px;
}

/* ─── University Picker Modal ─── */

.stl-uni-modal__preview {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.stl-uni-modal__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--stl-font-body);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: var(--stl-green);
  padding: 10px 28px;
  border-radius: 14px;
  letter-spacing: 1px;
  min-width: 90px;
  transition: background 0.2s;
}
.stl-uni-modal__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.stl-uni-modal__chip {
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--uni-color, #666) 30%, transparent);
  background: color-mix(in srgb, var(--uni-color, #666) 10%, rgba(255,255,255,0.6));
  cursor: pointer;
  font-family: var(--stl-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--uni-color, var(--stl-text));
  text-align: center;
  transition: all 0.15s;
}
.stl-uni-modal__chip:hover {
  background: color-mix(in srgb, var(--uni-color, #666) 18%, rgba(255,255,255,0.9));
  border-color: var(--uni-color, var(--stl-border));
}
.stl-uni-modal__chip--selected {
  color: #fff;
  border-color: var(--uni-color, var(--stl-green));
  background: var(--uni-color, var(--stl-green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--uni-color, #666) 20%, transparent);
}

/* ─── Char Picker Modal ─── */

.stl-char-modal__preview {
  display: grid;
  place-items: center;
  width: 100%;
  margin-bottom: 12px;
  direction: ltr;
  text-align: center;
}
.stl-char-modal__preview canvas {
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.stl-char-modal__preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-width: 108px;
  margin: 0 auto 12px;
}
.stl-char-modal__preview-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 10px;
  border: 2px solid var(--stl-border);
  background: rgba(255,255,255,0.7);
}
.stl-char-modal__preview-cell--baseline {
  border-color: var(--stl-green);
  background: var(--stl-green-glow);
  box-shadow: 0 0 0 2px rgba(30, 102, 73, 0.14);
}
.stl-char-modal__preview-cell canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.stl-char-modal__preview-label {
  display: none;
}
.stl-char-modal__strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.stl-char-modal__chip {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px solid var(--stl-border);
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stl-char-modal__chip:hover {
  background: rgba(255,255,255,0.9);
  border-color: var(--stl-border);
}
.stl-char-modal__chip--selected {
  border-color: var(--stl-green);
  background: var(--stl-green-glow);
  box-shadow: 0 0 0 3px rgba(30, 102, 73, 0.15);
}
.stl-char-modal__chip canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ─── Utility ─── */
.dimmed { opacity: 0.35; pointer-events: none; }

/* ─── Decorative Stationery ─── */
.stl-decoration {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
  filter: grayscale(1) contrast(1.2);
  user-select: none;
}

.stl-decoration--pencil {
  width: 40px;
  height: auto;
  --rot: -15deg;
  animation: stl-float 4s ease-in-out infinite;
}

.stl-decoration--paperclip {
  width: 24px;
  height: auto;
  --rot: 25deg;
  animation: stl-float 3.5s ease-in-out infinite reverse;
}

/* ─── Character Picker (Horizontal Strip + Preview) ─── */
.stl-char-picker__label {
  display: none;
}

.stl-char-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

/* Large selected character preview */
.stl-char-picker__preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 3px solid var(--stl-green-light);
  box-shadow: 0 4px 16px rgba(30, 102, 73, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stl-char-picker__preview-canvas {
  display: block;
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Horizontal scroll strip */
.stl-char-picker__strip-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.stl-char-picker__strip-wrap::-webkit-scrollbar {
  display: none;
}

.stl-char-picker__strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: min-content;
  padding: 0 8px;
}

/* Individual character chip */
.stl-char-picker__chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  scroll-snap-align: center;
}

.stl-char-picker__chip:hover {
  border-color: var(--stl-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stl-char-picker__chip--selected {
  border-color: var(--stl-green);
  background: var(--stl-green-light);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 3px rgba(30, 102, 73, 0.15), 0 6px 16px rgba(0, 0, 0, 0.1);
}

.stl-char-picker__chip canvas {
  display: block;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Keep old classes hidden for other screens */
.stl-char-picker__sheets { display: none; }
.stl-char-picker__sheet { display: none; }

/* ─── University Picker (Dropdown) ─── */
.stl-uni-picker {
  width: 100%;
  max-width: 400px;
  margin: 4px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.25s;
}

.stl-uni-picker__select {
  width: 100%;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--stl-font);
  color: var(--stl-text);
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--stl-border);
  border-radius: 14px;
  cursor: pointer;
  direction: rtl;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B5E4E' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  background-size: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  outline: none;
}

.stl-uni-picker__select:focus {
  border-color: var(--stl-green);
  box-shadow: 0 0 0 3px rgba(30, 102, 73, 0.1);
}

/* Hide old grid/button classes */
.stl-uni-picker__label { display: none; }
.stl-uni-picker__grid { display: none; }
.stl-uni-picker__btn { display: none; }

.stl-lobby__status {
  font-size: 1rem;
  color: var(--stl-text-dim);
}

/* ─── Canvas Area ─── */
.stl-canvas-wrap {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-self: flex-start; /* Pin to top instead of vertical centering from root */
}

.stl-canvas-wrap canvas {
  display: block;
  width: 100%;
  max-width: 840px;
  border-radius: 8px;
  background: #F2EDE0;
  touch-action: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ─── Quit Button ─── */
.stl-quit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--stl-text-dim, #888);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
  line-height: 32px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.stl-quit-btn:hover,
.stl-quit-btn:active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.2);
  color: #c0392b;
}

/* ─── Game Over Overlay ─── */
.stl-gameover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 20px;
}

.stl-gameover__crown {
  font-size: 3rem;
  line-height: 1;
}

.stl-gameover__winner {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 700;
  font-family: var(--stl-font-display);
  color: var(--stl-text);
  text-align: center;
  margin: 0;
}

.stl-gameover__me {
  font-size: 1.2rem;
  color: var(--stl-green);
  font-weight: 600;
  margin: 0;
}

/* ─── Qimah Tagline ─── */
.stl-gameover__tagline {
  font-size: 0.9rem;
  color: var(--stl-text-dim);
  font-family: var(--stl-font-body);
  margin: 0;
}

/* Stats Grid — Mini Sticky Notes */
.stl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.stl-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-radius: 4px;
  border: none;
  border-image: none;
  gap: 4px;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.08);
  transform: rotate(0deg);
  /* overridden per child via nth-child */
}

.stl-stats__item:nth-child(1) {
  background: var(--stl-sticky-yellow);
  background-image: none;
  transform: rotate(-1deg);
}

.stl-stats__item:nth-child(2) {
  background: var(--stl-sticky-blue);
  background-image: none;
  transform: rotate(0.5deg);
}

.stl-stats__item:nth-child(3) {
  background: var(--stl-sticky-pink);
  background-image: none;
  transform: rotate(0.8deg);
}

.stl-stats__item:nth-child(4) {
  background: var(--stl-sticky-green);
  background-image: none;
  transform: rotate(-0.5deg);
}

.stl-stats__value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--stl-text);
}

.stl-stats__value--gold {
  color: var(--stl-xp-gold);
}

.stl-stats__label {
  font-size: 0.8rem;
  color: var(--stl-text-dim);
}

/* Awards */
.stl-awards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 360px;
}

.stl-awards__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
}

.stl-awards__emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.stl-awards__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--stl-xp-gold);
}

.stl-awards__player {
  font-size: 0.8rem;
  color: var(--stl-text-dim);
}

/* Leaderboard teaser on end screen */
.stl-gameover__lb-teaser {
  width: 100%;
}

/* Action buttons row */
.stl-gameover__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  align-self: stretch;
}

.stl-gameover__play-again {
  width: 100%;
}

.stl-gameover__actions-row2 {
  display: flex;
  gap: 10px;
  width: 100%;
}

.stl-gameover__actions-row2 .stl-btn {
  flex: 1;
}

.stl-btn__main {
  display: block;
  line-height: 1.2;
}

.stl-btn__sub {
  display: block;
  font-size: 0.7em;
  opacity: 0.65;
  line-height: 1.2;
  margin-top: 2px;
}



/* ─── Game Over Slide-Up Card (over podium background) ─── */
/* Full-page game-over overlay (fades in over podium canvas) */
.stl-gameover--overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(245, 240, 228, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: stl-overlay-fade 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Keep end-screen overlay compact so it doesn't force internal scrolling */
.stl-gameover--overlay > .stl-stats,
.stl-gameover--overlay > .stl-awards,
.stl-gameover--overlay > .stl-uni-nudge,
.stl-gameover--overlay > .stl-gameover__actions {
  width: min(100%, 520px);
  max-width: 520px;
  align-self: center;
  margin-inline: auto;
}

.stl-gameover--overlay .stl-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 520px;
  margin: 0;
}

.stl-gameover--overlay .stl-stats__item {
  padding: 9px 7px;
  gap: 2px;
}

.stl-gameover--overlay .stl-stats__value {
  font-size: 1.32rem;
}

.stl-gameover--overlay .stl-stats__label {
  font-size: 0.72rem;
}

.stl-gameover--overlay .stl-gameover__actions {
  align-self: center;
  gap: 8px;
}

.stl-gameover--overlay .stl-gameover__actions-row2 {
  gap: 6px;
}

.stl-gameover--overlay .stl-unified__lb-teaser {
  min-height: 78px;
  margin-bottom: 6px;
  padding: 8px 10px;
}

.stl-gameover--overlay .stl-unified__lb-teaser-title {
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.stl-gameover--overlay .stl-teaser-podium {
  gap: 4px;
  margin-bottom: 4px;
}

.stl-gameover--overlay .stl-teaser-podium__col {
  min-height: 56px;
}

.stl-gameover--overlay .stl-teaser-podium__bar {
  height: 14px;
}

.stl-gameover--overlay .stl-teaser-podium__col--second .stl-teaser-podium__bar {
  height: 24px;
}

.stl-gameover--overlay .stl-teaser-podium__col--first .stl-teaser-podium__bar {
  height: 34px;
}

.stl-gameover--overlay .stl-teaser-podium__medal {
  font-size: 0.95rem;
}

.stl-gameover--overlay .stl-teaser-podium__col--first .stl-teaser-podium__medal {
  font-size: 1.12rem;
}

.stl-gameover--overlay .stl-teaser-podium__badge {
  font-size: 0.64rem;
  padding: 2px 5px;
}

.stl-gameover--overlay .stl-teaser-podium__score {
  font-size: 0.62rem;
}

.stl-gameover--overlay .stl-unified__lb-cta {
  margin-top: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.stl-gameover--overlay .stl-btn {
  min-width: 0;
  padding: 10px 14px;
  font-size: 0.92rem;
  border-radius: 12px;
}

.stl-gameover--overlay .stl-awards {
  max-width: 520px;
  gap: 6px;
}

.stl-gameover--overlay .stl-awards__item {
  padding: 6px 10px;
  gap: 6px;
}

.stl-gameover--overlay .stl-awards__emoji {
  font-size: 1rem;
}

.stl-gameover--overlay .stl-awards__title,
.stl-gameover--overlay .stl-awards__player {
  font-size: 0.72rem;
}

.stl-gameover--overlay .stl-uni-nudge {
  margin: 6px 0 !important;
  padding: 8px 12px !important;
}

.stl-gameover__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--stl-green);
  text-align: center;
  margin: 0 0 8px;
}

.stl-gameover--overlay .stl-gameover__me {
  color: var(--stl-green);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.stl-gameover--overlay .stl-gameover__title {
  font-size: clamp(1.35rem, 3.8vw, 1.75rem);
  margin: 0;
}

@media (max-width: 760px) {
  .stl-gameover--overlay .stl-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }

  .stl-gameover--overlay .stl-gameover__actions-row2 {
    gap: 8px;
  }
}

@keyframes stl-overlay-fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ─── Round Intro Overlay ─── */
.stl-round-intro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(245, 240, 228, 0.94);
  z-index: 10;
  gap: 12px;
  padding: 20px;
}

.stl-round-intro__title {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 700;
  font-family: var(--stl-font-display);
  color: var(--stl-text);
  text-align: center;
  margin: 0;
}

.stl-round-intro__instruction {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  color: var(--stl-text-dim);
  text-align: center;
  margin: 0;
}

/* ─── Countdown Overlay ─── */
.stl-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 240, 228, 0.88);
  z-index: 10;
}

.stl-countdown__num {
  font-size: clamp(4rem, 20vw, 8rem);
  font-weight: 900;
  font-family: var(--stl-font-display);
  color: var(--stl-text);
  animation: stl-pulse 0.5s ease-out;
  text-shadow: 0 2px 12px rgba(42, 37, 32, 0.15);
}

@keyframes stl-pulse {
  from {
    transform: scale(1.6);
    opacity: 0.3;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Results Overlay ─── */
.stl-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  gap: 8px;
}

.stl-results__title {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--stl-font-display);
  color: var(--stl-text);
  margin: 0 0 12px;
}

.stl-results__row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
}

.stl-results__row--me {
  border-color: var(--stl-green);
  background: rgba(168, 230, 195, 0.15);
}

.stl-results__row--lost {
  border-color: var(--stl-red);
  background: rgba(217, 64, 64, 0.06);
}

.stl-results__rank {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
}

.stl-results__name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--stl-text);
}

.stl-results__time {
  font-size: 0.9rem;
  color: var(--stl-pen-blue);
  font-family: var(--stl-font-mono);
  direction: ltr;
}

/* ─── Spectator Badge ─── */
.stl-spectator {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: rgba(42, 37, 32, 0.08);
  color: var(--stl-text-dim);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  z-index: 20;
  border: 1px solid var(--stl-border);
}

/* ─── Leaderboard Screen (v2) ─── */
.stl-leaderboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  gap: 12px;
}

.stl-lb-title {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--stl-font-display);
  color: var(--stl-green);
  margin: 0 0 4px;
}

/* ─── Tabs ─── */
.stl-lb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  padding: 4px;
}
.stl-lb-tabs__btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--stl-font);
  color: var(--stl-text-dim);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.stl-lb-tabs__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.6);
  color: var(--stl-green);
}
.stl-lb-tabs__btn--active {
  background: #fff;
  color: var(--stl-green);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.stl-lb-tabs__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Sort Toggle (segmented pill) ─── */
.stl-lb-sort-wrap {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
  position: relative;
}
.stl-lb-sort-wrap--hidden {
  display: none;
}
.stl-lb-sort {
  display: flex;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.stl-lb-sort__btn {
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--stl-font);
  color: var(--stl-text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stl-lb-sort__btn:hover {
  color: var(--stl-green);
  background: rgba(255, 255, 255, 0.6);
}
.stl-lb-sort__btn--active {
  background: var(--stl-green);
  color: #fff;
  font-weight: 700;
}
.stl-lb-sort__btn--active:hover {
  background: var(--stl-green);
  color: #fff;
  filter: brightness(1.1);
}
/* Tooltip */
.stl-lb-sort-wrap .stl-lb-sort-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  direction: rtl;
}
.stl-lb-sort-wrap .stl-lb-sort-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(30, 30, 30, 0.92);
}
.stl-lb-sort-wrap:hover .stl-lb-sort-tip {
  opacity: 1;
}

/* ─── Me Banner ─── */
.stl-lb-me {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 440px;
  padding: 10px 14px;
  background: rgba(168, 230, 195, 0.15);
  border-radius: 14px;
  border-inline-start: 4px solid var(--stl-green);
  box-shadow: 0 0 0 1px rgba(30, 102, 73, 0.08);
}
.stl-lb-me--nudge {
  justify-content: center;
  border-inline-start: none;
  background: rgba(0, 0, 0, 0.03);
}
.stl-lb-me__nudge-text {
  font-size: 0.85rem;
  color: var(--stl-text-dim);
  font-weight: 600;
}
.stl-lb-me__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  image-rendering: pixelated;
}
.stl-lb-me__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stl-lb-me__name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--stl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stl-lb-me__rank {
  font-size: 0.75rem;
  color: var(--stl-text-dim);
  font-family: var(--stl-font-mono);
  direction: ltr;
  text-align: start;
}
.stl-lb-me__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.stl-lb-me__score {
  font-weight: 700;
  color: var(--stl-xp-gold);
  font-family: var(--stl-font-mono);
  font-size: 1rem;
  direction: ltr;
}
.stl-lb-me__streak {
  font-size: 0.7rem;
  font-weight: 700;
  color: hsl(15, 80%, 50%);
}

/* ─── Podium (top 3) ─── */
.stl-lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin: 8px auto 12px;
  direction: ltr;
}
.stl-lb-podium__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 140px;
}
.stl-lb-podium__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-bottom: 6px;
}
.stl-lb-podium__crown {
  font-size: 1.2rem;
  line-height: 1;
}
.stl-lb-podium__medal {
  font-size: 1.4rem;
  line-height: 1;
}
.stl-lb-podium__slot--1st .stl-lb-podium__medal {
  font-size: 1.8rem;
}
.stl-lb-podium__avatar {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 3px solid var(--stl-border);
  image-rendering: pixelated;
}
.stl-lb-podium__slot--1st .stl-lb-podium__avatar {
  border-color: var(--stl-xp-gold);
  box-shadow: 0 0 16px rgba(244, 167, 32, 0.3);
}
.stl-lb-podium__slot--2nd .stl-lb-podium__avatar {
  border-color: hsl(215, 60%, 55%);
}
.stl-lb-podium__slot--3rd .stl-lb-podium__avatar {
  border-color: hsl(25, 35%, 55%);
}
.stl-lb-podium__slot--me .stl-lb-podium__avatar {
  box-shadow: 0 0 0 3px rgba(30, 102, 73, 0.2), 0 0 12px rgba(30, 102, 73, 0.15);
}
.stl-lb-podium__name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--stl-text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  direction: rtl;
}
.stl-lb-podium__uni {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.8;
}
.stl-lb-podium__score {
  font-family: var(--stl-font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--stl-xp-gold);
  direction: ltr;
}
.stl-lb-podium__slot--1st .stl-lb-podium__score {
  font-size: 1.05rem;
}
.stl-lb-podium__games {
  font-size: 0.7em;
  opacity: 0.65;
  margin-top: 2px;
}

/* Podium bars */
.stl-lb-podium__bar {
  width: 100%;
  height: var(--bar-h, 80px);
  border-radius: 10px 10px 0 0;
  animation: stl-lb-rise 0.6s ease-out both;
}
.stl-lb-podium__bar--1st {
  background: linear-gradient(to top, hsl(38, 70%, 42%), var(--stl-xp-gold));
  animation-delay: 0.3s;
}
.stl-lb-podium__bar--2nd {
  background: linear-gradient(to top, hsl(215, 50%, 40%), hsl(215, 60%, 55%));
  animation-delay: 0.15s;
}
.stl-lb-podium__bar--3rd {
  background: linear-gradient(to top, hsl(25, 25%, 42%), hsl(25, 35%, 55%));
  animation-delay: 0s;
}

@keyframes stl-lb-rise {
  from { height: 0; }
  to   { height: var(--bar-h, 80px); }
}

/* Gold glow pulse on 1st place */
.stl-lb-podium__slot--1st .stl-lb-podium__bar {
  box-shadow: 0 -4px 20px rgba(244, 167, 32, 0.25);
}

/* ─── University Podium Overrides ─── */
.stl-lb-podium--uni .stl-lb-podium__bar {
  background: var(--bar-color, var(--stl-green)) !important;
}
.stl-lb-podium--uni .stl-lb-podium__slot--1st .stl-lb-podium__bar {
  box-shadow: none;
  filter: brightness(1.05);
}
.stl-lb-podium__uni-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  padding: 4px 14px;
  border-radius: 10px;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.03em;
}
.stl-lb-podium__players {
  font-size: 0.7rem;
  color: var(--stl-text-dim);
  margin-top: 1px;
}

/* ─── Content Container ─── */
.stl-lb-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* ─── Score Rows (rank 4+) ─── */
.stl-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  border: 1.5px solid var(--stl-border);
  animation: stl-lb-slide-in 0.3s ease-out both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.stl-lb-row--me {
  border-color: var(--stl-green);
  background: rgba(168, 230, 195, 0.15);
  box-shadow: 0 0 0 2px rgba(30, 102, 73, 0.08);
}
.stl-lb-row__rank {
  font-size: 1rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: var(--stl-text-dim);
}
.stl-lb-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  image-rendering: pixelated;
}
.stl-lb-row__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stl-lb-row__name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--stl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
}
.stl-lb-row__meta {
  display: flex;
  gap: 6px;
  align-items: center;
}
.stl-lb-row__uni {
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.4;
}
.stl-lb-row__streak {
  font-size: 0.7rem;
  font-weight: 700;
  color: hsl(15, 80%, 50%);
}
.stl-lb-row__scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.stl-lb-row__score {
  font-weight: 700;
  color: var(--stl-xp-gold);
  font-family: var(--stl-font-mono);
  font-size: 0.95rem;
  direction: ltr;
}
.stl-lb-row__mode {
  font-size: 0.65rem;
  color: var(--stl-text-dim);
}

@keyframes stl-lb-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── University Cards ─── */
.stl-lb-unis {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.stl-lb-uni {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  border: 1.5px solid var(--stl-border);
  position: relative;
  overflow: hidden;
  animation: stl-lb-slide-in 0.3s ease-out both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.stl-lb-uni--me {
  border-color: var(--stl-green);
  background: rgba(168, 230, 195, 0.12);
  box-shadow: 0 0 0 2px rgba(30, 102, 73, 0.08);
}
.stl-lb-uni__rank {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--stl-text-dim);
  flex-shrink: 0;
}
.stl-lb-uni__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stl-lb-uni__abbr {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--uni-color, var(--stl-green));
}
.stl-lb-uni__name {
  font-size: 0.72rem;
  color: var(--stl-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
}
.stl-lb-uni__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.stl-lb-uni__score {
  font-weight: 700;
  color: var(--stl-xp-gold);
  font-family: var(--stl-font-mono);
  font-size: 0.95rem;
  direction: ltr;
}
.stl-lb-uni__players {
  font-size: 0.7rem;
  color: var(--stl-text-dim);
  white-space: nowrap;
}
/* Progress bar at bottom */
.stl-lb-uni__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: var(--bar-pct, 0%);
  background: var(--uni-color, var(--stl-green));
  border-radius: 0 4px 0 0;
  transition: width 0.6s ease-out;
}

/* ─── Back Button ─── */
.stl-lb-back {
  margin-top: 12px;
}

/* ─── Share Button (outlined) ─── */
.stl-btn--share,
.stl-share-btn {
  background: transparent;
  border: 2px dashed var(--stl-green);
  border-image: none;
  color: var(--stl-green);
  gap: 6px;
}

.stl-btn--share:hover,
.stl-share-btn:hover {
  border-style: solid;
  background: rgba(30, 102, 73, 0.06);
}

/* ─── Toast Notification ─── */
.stl-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0));
  left: 0;
  right: 0;
  width: fit-content;
  margin-inline: auto;
  background: var(--stl-sticky-yellow);
  color: var(--stl-text);
  padding: 12px 24px;
  border-radius: 4px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.12);
  animation: stl-toast-in 0.3s ease-out;
}

@keyframes stl-toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Screen Shake ─── */
@keyframes stl-shake {

  0%,
  100% {
    transform: translate(0);
  }

  10% {
    transform: translate(calc(var(--shake-intensity, 4px) * -0.75), calc(var(--shake-intensity, 4px) * 0.5));
  }

  20% {
    transform: translate(calc(var(--shake-intensity, 4px) * 0.75), calc(var(--shake-intensity, 4px) * -0.5));
  }

  30% {
    transform: translate(calc(var(--shake-intensity, 4px) * -0.5), calc(var(--shake-intensity, 4px) * 0.75));
  }

  40% {
    transform: translate(calc(var(--shake-intensity, 4px) * 0.5), calc(var(--shake-intensity, 4px) * -0.75));
  }

  50% {
    transform: translate(calc(var(--shake-intensity, 4px) * -0.75), calc(var(--shake-intensity, 4px) * 0.25));
  }

  60% {
    transform: translate(calc(var(--shake-intensity, 4px) * 0.75), calc(var(--shake-intensity, 4px) * -0.25));
  }

  70% {
    transform: translate(calc(var(--shake-intensity, 4px) * -0.25), calc(var(--shake-intensity, 4px) * 0.75));
  }

  80% {
    transform: translate(calc(var(--shake-intensity, 4px) * 0.25), calc(var(--shake-intensity, 4px) * -0.5));
  }

  90% {
    transform: translate(calc(var(--shake-intensity, 4px) * -0.5), calc(var(--shake-intensity, 4px) * 0.5));
  }
}

.stl-shake {
  animation: stl-shake 0.3s ease-in-out;
}

/* ─── Join Room Input ─── */
.stl-join {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.stl-join__input {
  background: #fff;
  border: none;
  border-bottom: 2px solid var(--stl-pen-blue);
  border-radius: 0;
  border-image: none;
  padding: 14px 20px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--stl-text);
  text-align: center;
  width: min(200px, 80vw);
  letter-spacing: 0.2em;
  font-family: var(--stl-font-mono);
  outline: none;
  direction: ltr;
  text-transform: uppercase;
}

.stl-join__input:focus {
  border-color: var(--stl-green);
}

/* ─── Focus States ─── */
.stl-btn:focus-visible {
  outline: 2px solid var(--stl-green);
  outline-offset: 2px;
}

.stl-menu__input:focus-visible,
.stl-join__input:focus-visible {
  outline: 2px solid var(--stl-green);
  outline-offset: 2px;
}

/* ─── Awards (inline badge next to player name) ─── */
.stl-award {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(42, 37, 32, 0.05);
  border-radius: 10px;
  color: var(--stl-text-dim);
  font-size: 11px;
  direction: ltr;
  white-space: nowrap;
  vertical-align: middle;
}

.stl-award__emoji {
  font-size: 0.8rem;
  line-height: 1;
}

.stl-award__title {
  font-weight: 600;
}

/* ─── Podium (top 3) ─── */
.stl-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 24px 20px 16px;
  width: 100%;
  max-width: 360px;
}

.stl-podium__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 100px;
}

.stl-podium__slot--1st {
  order: 2;
}

.stl-podium__slot--2nd {
  order: 1;
}

.stl-podium__slot--3rd {
  order: 3;
}

.stl-podium__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: #fff;
  border: 2px solid var(--stl-border);
  position: relative;
}

.stl-podium__slot--1st .stl-podium__avatar {
  width: 64px;
  height: 64px;
  font-size: 2rem;
  border-color: var(--stl-xp-gold);
}

.stl-podium__crown {
  position: absolute;
  top: -10px;
  width: 24px;
  height: 14px;
  background:
    linear-gradient(135deg, var(--stl-xp-gold) 33%, transparent 33%) 0 0 / 8px 14px no-repeat,
    linear-gradient(180deg, var(--stl-xp-gold) 33%, transparent 33%) 8px 0 / 8px 14px no-repeat,
    linear-gradient(225deg, var(--stl-xp-gold) 33%, transparent 33%) 16px 0 / 8px 14px no-repeat,
    linear-gradient(180deg, var(--stl-xp-gold) 60%, transparent 60%) 0 6px / 24px 8px no-repeat;
  filter: drop-shadow(0 1px 3px rgba(244, 167, 32, 0.4));
}

.stl-podium__rank {
  position: absolute;
  bottom: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--stl-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.stl-podium__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--stl-green);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stl-podium__score {
  font-size: 11px;
  color: var(--stl-text-dim);
  direction: ltr;
}

/* ─── Standings list ─── */
.stl-standings {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 0 16px;
}

.stl-standings__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
  min-height: 44px;
}

.stl-standings__row--me {
  border-color: var(--stl-green);
  background: rgba(168, 230, 195, 0.15);
}

.stl-standings__rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--stl-text-dim);
  min-width: 20px;
  text-align: center;
  direction: ltr;
}

.stl-standings__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--stl-surface);
  border: 1.5px solid var(--stl-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1;
}

.stl-standings__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stl-standings__name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stl-standings__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--stl-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stl-standings__streak {
  font-size: 11px;
  color: var(--stl-xp-gold);
  white-space: nowrap;
  direction: ltr;
}

.stl-standings__score {
  font-size: 13px;
  font-weight: 700;
  color: var(--stl-text);
  margin-inline-start: auto;
  flex-shrink: 0;
  direction: ltr;
}

/* ─── Lobby Config (pills) — see main .stl-pill above ─── */

/* (old .stl-leaderboard__back removed — replaced by .stl-lb-back) */

/* ─── Entrance Animations ─── */
@keyframes stl-stick-in {
  from {
    opacity: 0;
    transform: rotate(-2deg) translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: rotate(var(--stl-panel-rotate, -0.3deg)) translateY(0) scale(1);
  }
}

.stl-panel {
  animation: stl-stick-in 0.4s ease-out;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {

  /* Remove panel rotation on mobile to prevent clipping */
  .stl-panel,
  .stl-menu.stl-panel,
  .stl-lobby.stl-panel,
  .stl-unified.stl-panel,
  .stl-gameover.stl-panel,
  .stl-leaderboard.stl-panel {
    transform: none;
  }

  /* Remove margin line + watermark on narrow screens */
  #qimah-stl-root::before,
  #qimah-stl-root::after {
    display: none;
  }



  /* ─── Compact unified lobby on mobile ─── */
  .stl-unified.stl-panel {
    padding: 16px 12px;
    margin: 10px auto;
  }
  #qimah-stl-root .stl-unified .stl-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  #qimah-stl-root .stl-unified .stl-btn--primary {
    padding: 12px 16px;
    font-size: 1rem;
  }
  .stl-unified__branding {
    margin-bottom: 8px;
  }
  .stl-unified__title {
    font-size: 1.4rem;
  }
  .stl-unified__actions-row {
    gap: 6px;
  }
  .stl-unified__actions-row > .stl-btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ─── Compact lobby on mobile ─── */
  .stl-lobby {
    padding: 20px 16px;
    gap: 10px;
  }

  .stl-lobby__code {
    font-size: clamp(2rem, 10vw, 3rem);
    letter-spacing: 0.15em;
    padding: 4px 16px;
    margin: 4px 0;
  }

  .stl-lobby__count {
    margin-bottom: 0;
    padding: 4px 12px;
    font-size: 0.8rem;
  }

  .stl-lobby__hint {
    margin: 0;
    font-size: 0.75rem;
  }

  .stl-lobby__players {
    gap: 8px;
  }

  .stl-lobby__player {
    flex-direction: row;
    gap: 8px;
    padding: 8px 14px;
    min-width: 0;
  }

  .stl-lobby__avatar {
    font-size: 1.3rem;
  }

  .stl-lobby__config {
    gap: 8px;
  }

  .stl-lobby__config-group {
    gap: 4px;
    margin-bottom: 4px;
  }

  .stl-lobby__config-label {
    font-size: 0.75rem;
    margin-bottom: 2px;
  }

  .stl-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .stl-lobby__actions {
    gap: 8px;
    margin-top: 0;
  }

  /* Reduce podium gap to avoid overflow */
  .stl-podium {
    gap: 8px;
    padding: 20px 12px 12px;
  }
}

@media (max-width: 480px) {
  .stl-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 100%;
  }

  .stl-stats__item {
    padding: 12px 8px;
  }

  .stl-stats__value {
    font-size: 1.4rem;
  }

  .stl-btn {
    min-width: 0;
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
  }

  .stl-results__row,
  .stl-lb-row {
    padding: 8px 12px;
    gap: 8px;
  }

  .stl-lb-row__avatar {
    width: 24px;
    height: 24px;
  }

  .stl-lb-podium__slot {
    max-width: 110px;
  }

  .stl-lobby__name {
    max-width: 80px;
  }

  /* Character picker: smaller on narrow */
  .stl-char-picker {
    padding: 12px;
  }

  .stl-char-picker__preview {
    width: 80px;
    height: 80px;
  }

  .stl-char-picker__preview-canvas {
    width: 80px;
    height: 80px;
  }

  .stl-char-picker__chip {
    width: 46px;
    height: 46px;
  }

  .stl-char-picker__chip canvas {
    width: 34px;
    height: 34px;
  }

  .stl-btn--hero {
    padding: 16px 24px;
    font-size: 1.15rem;
  }

  /* Standings tighter padding */
  .stl-standings {
    padding: 0 8px;
  }

  /* Awards overflow guard */
  .stl-awards {
    max-width: 100%;
  }

  .stl-awards__item {
    max-width: 100%;
  }

  /* Menu + lobby panels flush on small screens */
  .stl-menu.stl-panel,
  .stl-lobby.stl-panel,
  .stl-unified.stl-panel,
  .stl-gameover.stl-panel,
  .stl-leaderboard.stl-panel {
    width: calc(100% - 16px);
    margin: 12px auto;
  }
}

/* ─── Share Modal ─── */
.stl-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 37, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.stl-share-modal {
  background: var(--stl-sticky-yellow);
  background-image: none;
  border-radius: 6px;
  box-shadow: 3px 4px 12px rgba(0, 0, 0, 0.18);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: stl-stick-in 0.35s ease-out;
  transform: rotate(0.3deg);
}

.stl-share-modal__close {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--stl-text-dim);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s;
}

.stl-share-modal__close:hover {
  background: rgba(42, 37, 32, 0.08);
}

.stl-share-modal__title {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--stl-font-display);
  color: var(--stl-text);
  margin: 0;
}

.stl-share-modal__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
  width: 100%;
}

.stl-share-modal__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--stl-green);
}

.stl-share-modal__score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--stl-xp-gold);
  direction: ltr;
}

.stl-share-modal__rank {
  font-size: 0.85rem;
  color: var(--stl-text-dim);
}

/* Share option buttons — 2x2 grid */
.stl-share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.stl-share-options__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
  cursor: pointer;
  font-family: var(--stl-font);
  transition: border-color 0.15s, background 0.15s;
}

.stl-share-options__btn:hover {
  border-color: var(--stl-text-dim);
  background: rgba(42, 37, 32, 0.03);
}

.stl-share-options__btn:active {
  background: rgba(42, 37, 32, 0.06);
}

.stl-share-options__icon {
  font-size: 1.6rem;
  line-height: 1;
}

.stl-share-options__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--stl-text);
}

/* WhatsApp brand tint on hover */
.stl-share-options__btn[data-share="whatsapp"]:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.06);
}

/* Snapchat brand tint on hover */
.stl-share-options__btn[data-share="snapchat"]:hover {
  border-color: #FFFC00;
  background: rgba(255, 252, 0, 0.08);
}

/* QR code container */
.stl-share-modal__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1.5px solid var(--stl-border);
  border-image: none;
  width: 100%;
}



.stl-share-modal__qr-hint {
  font-size: 0.75rem;
  color: var(--stl-text-dim);
}

@media (max-width: 480px) {
  .stl-share-modal {
    padding: 24px 16px;
    max-width: 100%;
  }

  .stl-share-options__btn {
    padding: 12px 8px;
  }
}
