/* ================================================================
   ICT 8 Connect v429 — XP Mini-Games Hub
   Namespace-only stylesheet. Existing dashboard/header/editor geometry is
   intentionally untouched; only the existing XP badge gains interaction.
   ================================================================ */

.code-explorer-xp-badge.xp-games-launcher {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

@media (hover: hover) and (pointer: fine) {
  .code-explorer-xp-badge.xp-games-launcher:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 16px rgba(249, 115, 22, .14);
    filter: brightness(1.015);
  }
}

.code-explorer-xp-badge.xp-games-launcher:active { transform: scale(.985); }
.code-explorer-xp-badge.xp-games-launcher:focus-visible {
  outline: 3px solid rgba(249, 115, 22, .24);
  outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {
  .code-explorer-xp-badge.xp-games-launcher { position: relative; }
  .code-explorer-xp-badge.xp-games-launcher::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -6px;
    bottom: -6px;
  }
}

body.xp-games-modal-open {
  overscroll-behavior: none;
}

body.xp-games-modal-open .code-explorer-main {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.xp-games-overlay,
.xp-games-game-overlay {
  position: fixed;
  inset: 0;
  z-index: 24000;
  box-sizing: border-box;
  padding:
    max(14px, env(safe-area-inset-top, 0px))
    max(14px, env(safe-area-inset-right, 0px))
    max(14px, env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
  background: rgba(7, 15, 30, .62);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.xp-games-overlay[hidden],
.xp-games-game-overlay[hidden] { display: none !important; }

.xp-games-overlay {
  display: grid;
  place-items: center;
}

.xp-games-modal {
  width: min(520px, 100%);
  max-height: min(760px, calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, .92);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 0%, rgba(139, 92, 246, .12), transparent 32%),
    radial-gradient(circle at 4% 8%, rgba(59, 130, 246, .10), transparent 27%),
    var(--panel, #ffffff);
  color: var(--text, #172033);
  box-shadow: 0 28px 80px rgba(2, 8, 23, .28);
  transform-origin: center;
  animation: xpGamesModalIn .18s ease-out both;
}

@keyframes xpGamesModalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.xp-games-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid rgba(203, 213, 225, .76);
}

.xp-games-modal-titleline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.xp-games-modal-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #dbeafe, #ede9fe);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .10);
  font-size: 20px;
}

.xp-games-modal-titleline small {
  display: block;
  margin-bottom: 2px;
  color: #2563eb;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.xp-games-modal-titleline h2 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.05;
}

.xp-games-close {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 50%;
  background: rgba(248, 250, 252, .88);
  color: #475569;
  font: inherit;
  font-size: 1.18rem;
  line-height: 1;
  cursor: pointer;
}
.xp-games-close:hover { background: #f1f5f9; color: #0f172a; }
.xp-games-close:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }

.xp-games-summary {
  padding: 18px 18px 12px;
}

.xp-games-summary h3 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  letter-spacing: -.025em;
}

.xp-games-summary > p {
  margin: 7px 0 15px;
  color: var(--muted, #64748b);
  line-height: 1.45;
  font-size: .88rem;
}

.xp-games-daily {
  padding: 13px 14px;
  border: 1px solid rgba(253, 186, 116, .65);
  border-radius: 17px;
  background: linear-gradient(135deg, #fff7ed, #fff 72%);
}

.xp-games-daily-head,
.xp-games-daily-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.xp-games-daily-head span {
  color: #9a3412;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.xp-games-daily-head strong { color: #c2410c; font-size: .86rem; }

.xp-games-daily-track {
  height: 8px;
  margin: 9px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffedd5;
}
.xp-games-daily-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316, #fb7185);
  transition: width .28s ease;
}

.xp-games-daily-foot {
  align-items: flex-start;
  color: #7c2d12;
  font-size: .7rem;
  line-height: 1.35;
}
.xp-games-daily-foot b { flex: none; color: #c2410c; }

.xp-games-game-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 4px 18px 18px;
}

.xp-games-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas:
    "art copy action"
    "art meta action";
  align-items: center;
  gap: 8px 13px;
  padding: 15px;
  border: 1px solid rgba(147, 197, 253, .80);
  border-radius: 20px;
  background: linear-gradient(135deg, #eff6ff, #fff 54%, #f5f3ff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .07);
}

.xp-games-card-art {
  grid-area: art;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(124, 58, 237, .16)),
    #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12);
  font-size: 31px;
}

.xp-games-card-copy { grid-area: copy; min-width: 0; }
.xp-games-card-copy h4 { margin: 0; font-size: 1rem; letter-spacing: .01em; }
.xp-games-card-copy p {
  margin: 4px 0 0;
  color: var(--muted, #64748b);
  font-size: .76rem;
  line-height: 1.42;
}

.xp-games-card-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: .7rem;
}
.xp-games-best {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 850;
}
.xp-games-xp-note { color: #64748b; font-weight: 750; }

.xp-games-play {
  grid-area: action;
  min-width: 78px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
  color: #fff;
  font: inherit;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .035em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .21);
  transition: transform .15s ease, filter .15s ease;
}
.xp-games-play:hover { filter: brightness(1.04); transform: translateY(-1px); }
.xp-games-play:active { transform: translateY(0) scale(.98); }
.xp-games-play:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }

.xp-games-limit-message,
.xp-games-login-message {
  display: none;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: .72rem;
  line-height: 1.4;
  font-weight: 750;
}
.xp-games-limit-message.show {
  display: block;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.xp-games-login-message.show {
  display: block;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #854d0e;
}

.xp-games-xp-float {
  position: fixed;
  z-index: 25050;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: #ea580c;
  font-size: .86rem;
  font-weight: 950;
  text-shadow: 0 1px 0 #fff;
  animation: xpGamesFloat .9s ease-out forwards;
}
@keyframes xpGamesFloat {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.9); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(1.08); }
}

html[data-theme="dark"] .xp-games-modal {
  border-color: #334155;
  background:
    radial-gradient(circle at 92% 0%, rgba(124, 58, 237, .18), transparent 34%),
    radial-gradient(circle at 4% 8%, rgba(37, 99, 235, .16), transparent 29%),
    #101827;
  color: #e5edf7;
}
html[data-theme="dark"] .xp-games-modal-head { border-color: #334155; }
html[data-theme="dark"] .xp-games-close { background: #182235; border-color: #3b4b63; color: #d9e3ef; }
html[data-theme="dark"] .xp-games-close:hover { background: #223047; color: #fff; }
html[data-theme="dark"] .xp-games-summary > p,
html[data-theme="dark"] .xp-games-card-copy p,
html[data-theme="dark"] .xp-games-xp-note { color: #9fb0c4; }
html[data-theme="dark"] .xp-games-daily {
  border-color: #6b4622;
  background: linear-gradient(135deg, #2c2117, #151d2c 75%);
}
html[data-theme="dark"] .xp-games-daily-track { background: #49301b; }
html[data-theme="dark"] .xp-games-daily-head span,
html[data-theme="dark"] .xp-games-daily-foot { color: #fdba74; }
html[data-theme="dark"] .xp-games-daily-head strong,
html[data-theme="dark"] .xp-games-daily-foot b { color: #fb923c; }
html[data-theme="dark"] .xp-games-card {
  border-color: #354968;
  background: linear-gradient(135deg, #12223a, #111827 55%, #211a39);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}
html[data-theme="dark"] .xp-games-card-art { background: linear-gradient(135deg, #193052, #2c2350); }
html[data-theme="dark"] .xp-games-best { background: #382e17; color: #fde68a; }
html[data-theme="dark"] .xp-games-limit-message.show { background: #102a20; border-color: #255840; color: #bbf7d0; }
html[data-theme="dark"] .xp-games-login-message.show { background: #30270f; border-color: #66521a; color: #fde68a; }
html[data-theme="dark"] .xp-games-xp-float { text-shadow: 0 1px 0 #0f172a; }

@media (max-width: 600px) {
  .xp-games-overlay {
    place-items: center;
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
  }
  .xp-games-modal {
    width: 100%;
    max-height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
    border-radius: 23px;
  }
  .xp-games-modal-head { padding: 13px 14px 11px; }
  .xp-games-modal-icon { flex-basis: 34px; width: 34px; height: 34px; border-radius: 11px; font-size: 18px; }
  .xp-games-close { flex-basis: 38px; width: 38px; height: 38px; }
  .xp-games-summary { padding: 14px 14px 10px; }
  .xp-games-summary > p { margin-bottom: 12px; font-size: .8rem; }
  .xp-games-daily { padding: 11px 12px; border-radius: 15px; }
  .xp-games-game-list { padding: 3px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .xp-games-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 7px 10px;
    padding: 12px;
    border-radius: 17px;
  }
  .xp-games-card-art { width: 52px; height: 52px; border-radius: 15px; font-size: 26px; }
  .xp-games-card-copy h4 { font-size: .92rem; }
  .xp-games-card-copy p { font-size: .7rem; }
  .xp-games-play { min-width: 70px; min-height: 40px; padding: 0 12px; }
}

@media (max-width: 370px) {
  .xp-games-modal-titleline small { font-size: .6rem; }
  .xp-games-modal-titleline h2 { font-size: 1rem; }
  .xp-games-summary h3 { font-size: 1.08rem; }
  .xp-games-card {
    grid-template-columns: 48px minmax(0,1fr);
    grid-template-areas:
      "art copy"
      "meta meta"
      "action action";
  }
  .xp-games-card-art { width: 48px; height: 48px; }
  .xp-games-play { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-games-modal,
  .xp-games-xp-float { animation: none !important; }
  .code-explorer-xp-badge.xp-games-launcher,
  .xp-games-daily-track i,
  .xp-games-play { transition: none !important; }
}

/* v434 — multiple reusable game cards inside the existing scrollable list. */
.xp-games-game-list [data-xp-games-cards] {
  display: grid;
  gap: 12px;
}
.xp-games-play:disabled {
  cursor: wait;
  opacity: .72;
  transform: none !important;
}

/* ================================================================
   v447 — Weekly Arcade leaderboard inside the existing XP Hub.
   Namespace-only: no dashboard/header/editor geometry is touched.
   ================================================================ */
.xp-games-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(203, 213, 225, .72);
  background: rgba(248, 250, 252, .72);
}

.xp-games-tab {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .045em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.xp-games-tab:hover { background: rgba(226, 232, 240, .7); color: #334155; }
.xp-games-tab:active { transform: scale(.985); }
.xp-games-tab.active {
  border-color: rgba(96, 165, 250, .55);
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
  color: #1d4ed8;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .08);
}
.xp-games-tab:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }

.xp-games-panels {
  min-height: 0;
  overflow: hidden;
}

.xp-games-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.xp-games-panel[hidden] { display: none !important; }

.xp-games-panel-games {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.xp-games-panel-weekly {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
  padding: 14px 16px 15px;
  gap: 10px;
}

.xp-games-weekly-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.xp-games-weekly-head > div { min-width: 0; }
.xp-games-weekly-head small {
  display: block;
  color: #7c3aed;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .08em;
}
.xp-games-weekly-head h3 {
  margin: 3px 0 1px;
  color: #172033;
  font-size: 1.17rem;
  letter-spacing: -.02em;
}
.xp-games-weekly-head p {
  margin: 0;
  color: #64748b;
  font-size: .7rem;
  font-weight: 700;
}

.xp-games-weekly-refresh {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(148, 163, 184, .38);
  border-radius: 11px;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  font-size: .68rem;
  font-weight: 850;
  cursor: pointer;
}
.xp-games-weekly-refresh:hover { background: #f1f5f9; color: #1e293b; }
.xp-games-weekly-refresh:disabled { opacity: .55; cursor: wait; }
.xp-games-weekly-refresh:focus-visible { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }

.xp-games-weekly-rule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 10px 11px;
  border: 1px solid rgba(196, 181, 253, .55);
  border-radius: 14px;
  background: linear-gradient(135deg, #faf5ff, #eff6ff);
  color: #5b21b6;
  font-size: .67rem;
  line-height: 1.35;
}
.xp-games-weekly-rule span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  white-space: nowrap;
}
.xp-games-weekly-rule small {
  flex: 1 0 100%;
  color: #64748b;
  font-size: .64rem;
  font-weight: 650;
}

.xp-games-weekly-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.xp-games-weekly-status {
  margin: 4px 0;
  padding: 14px;
  border: 1px dashed rgba(148, 163, 184, .55);
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-size: .74rem;
  line-height: 1.45;
  font-weight: 750;
}
.xp-games-weekly-status.loading { color: #1d4ed8; border-color: rgba(96, 165, 250, .55); background: #eff6ff; }
.xp-games-weekly-status.warning { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.xp-games-weekly-status.error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.xp-games-weekly-status.empty { color: #475569; }

.xp-games-weekly-list {
  display: grid;
  gap: 7px;
}

.xp-games-weekly-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid rgba(203, 213, 225, .82);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(15, 23, 42, .035);
}
.xp-games-weekly-row.top-1 { border-color: rgba(245, 158, 11, .55); background: linear-gradient(135deg, #fffbeb, #fff); }
.xp-games-weekly-row.top-2 { border-color: rgba(148, 163, 184, .6); background: linear-gradient(135deg, #f8fafc, #fff); }
.xp-games-weekly-row.top-3 { border-color: rgba(180, 83, 9, .32); background: linear-gradient(135deg, #fff7ed, #fff); }
.xp-games-weekly-row.is-you {
  border-color: rgba(59, 130, 246, .72);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .08), 0 7px 18px rgba(37, 99, 235, .07);
}

.xp-games-weekly-rank {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: .82rem;
  font-weight: 950;
}
.xp-games-weekly-row.top-1 .xp-games-weekly-rank,
.xp-games-weekly-row.top-2 .xp-games-weekly-rank,
.xp-games-weekly-row.top-3 .xp-games-weekly-rank { font-size: 1.22rem; }

.xp-games-weekly-person { min-width: 0; }
.xp-games-weekly-person strong {
  display: block;
  overflow: hidden;
  color: #1e293b;
  font-size: .79rem;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.xp-games-weekly-person strong em {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .52rem;
  font-style: normal;
  letter-spacing: .05em;
  vertical-align: 1px;
}
.xp-games-weekly-person small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #64748b;
  font-size: .64rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.xp-games-weekly-score {
  min-width: 78px;
  text-align: right;
}
.xp-games-weekly-score strong { display: block; color: #7c3aed; font-size: .82rem; font-weight: 950; }
.xp-games-weekly-score small { display: block; margin-top: 2px; color: #94a3b8; font-size: .57rem; white-space: nowrap; }

.xp-games-weekly-you {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label score" "detail detail";
  gap: 2px 10px;
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, .62);
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f5f3ff);
}
.xp-games-weekly-you[hidden] { display: none !important; }
.xp-games-weekly-you span { grid-area: label; color: #1d4ed8; font-size: .62rem; font-weight: 950; letter-spacing: .06em; }
.xp-games-weekly-you strong { grid-area: score; color: #5b21b6; font-size: .79rem; font-weight: 950; }
.xp-games-weekly-you small { grid-area: detail; color: #64748b; font-size: .62rem; }

html[data-theme="dark"] .xp-games-tabs {
  border-color: #334155;
  background: rgba(15, 23, 42, .72);
}
html[data-theme="dark"] .xp-games-tab { color: #94a3b8; }
html[data-theme="dark"] .xp-games-tab:hover { background: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .xp-games-tab.active { border-color: #405b82; background: linear-gradient(135deg, #172a46, #251d42); color: #93c5fd; }
html[data-theme="dark"] .xp-games-weekly-head h3 { color: #e5edf7; }
html[data-theme="dark"] .xp-games-weekly-head p { color: #94a3b8; }
html[data-theme="dark"] .xp-games-weekly-head small { color: #c4b5fd; }
html[data-theme="dark"] .xp-games-weekly-refresh { border-color: #3b4b63; background: #182235; color: #cbd5e1; }
html[data-theme="dark"] .xp-games-weekly-refresh:hover { background: #223047; color: #fff; }
html[data-theme="dark"] .xp-games-weekly-rule { border-color: #423b69; background: linear-gradient(135deg, #211b34, #14243a); color: #c4b5fd; }
html[data-theme="dark"] .xp-games-weekly-rule span { background: rgba(15, 23, 42, .6); }
html[data-theme="dark"] .xp-games-weekly-rule small { color: #94a3b8; }
html[data-theme="dark"] .xp-games-weekly-status { border-color: #475569; background: #111827; color: #94a3b8; }
html[data-theme="dark"] .xp-games-weekly-status.loading { border-color: #345b91; background: #10203a; color: #93c5fd; }
html[data-theme="dark"] .xp-games-weekly-status.warning { border-color: #6b5720; background: #2c250f; color: #fde68a; }
html[data-theme="dark"] .xp-games-weekly-status.error { border-color: #6f2d35; background: #32191d; color: #fecaca; }
html[data-theme="dark"] .xp-games-weekly-row { border-color: #334155; background: #131d2d; box-shadow: none; }
html[data-theme="dark"] .xp-games-weekly-row.top-1 { border-color: #6b5528; background: linear-gradient(135deg, #2a2416, #131d2d); }
html[data-theme="dark"] .xp-games-weekly-row.top-2 { border-color: #475569; background: linear-gradient(135deg, #1b2535, #131d2d); }
html[data-theme="dark"] .xp-games-weekly-row.top-3 { border-color: #65432f; background: linear-gradient(135deg, #291e19, #131d2d); }
html[data-theme="dark"] .xp-games-weekly-row.is-you { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.1); }
html[data-theme="dark"] .xp-games-weekly-rank { background: #1e293b; color: #cbd5e1; }
html[data-theme="dark"] .xp-games-weekly-person strong { color: #e2e8f0; }
html[data-theme="dark"] .xp-games-weekly-person small,
html[data-theme="dark"] .xp-games-weekly-you small { color: #94a3b8; }
html[data-theme="dark"] .xp-games-weekly-person strong em { background: #17365d; color: #93c5fd; }
html[data-theme="dark"] .xp-games-weekly-score strong { color: #c4b5fd; }
html[data-theme="dark"] .xp-games-weekly-score small { color: #64748b; }
html[data-theme="dark"] .xp-games-weekly-you { border-color: #345b91; background: linear-gradient(135deg, #14243a, #211b34); }
html[data-theme="dark"] .xp-games-weekly-you span { color: #93c5fd; }
html[data-theme="dark"] .xp-games-weekly-you strong { color: #c4b5fd; }

@media (max-width: 600px) {
  .xp-games-tabs { padding: 7px 10px; }
  .xp-games-tab { min-height: 36px; font-size: .68rem; }
  .xp-games-panel-weekly { padding: 11px 12px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .xp-games-weekly-head h3 { font-size: 1.03rem; }
  .xp-games-weekly-refresh { min-height: 34px; padding: 0 9px; }
  .xp-games-weekly-rule { padding: 9px; }
  .xp-games-weekly-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; min-height: 54px; padding: 8px 9px; }
  .xp-games-weekly-rank { width: 36px; height: 36px; }
  .xp-games-weekly-score { min-width: 68px; }
  .xp-games-weekly-score strong { font-size: .77rem; }
  .xp-games-weekly-score small { font-size: .53rem; }
}

@media (max-width: 370px) {
  .xp-games-weekly-rule span { white-space: normal; }
  .xp-games-weekly-row { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: "rank person" "rank score"; }
  .xp-games-weekly-rank { grid-area: rank; width: 34px; height: 34px; }
  .xp-games-weekly-person { grid-area: person; }
  .xp-games-weekly-score { grid-area: score; min-width: 0; text-align: left; }
  .xp-games-weekly-score strong,
  .xp-games-weekly-score small { display: inline; }
  .xp-games-weekly-score small { margin-left: 5px; }
}
