:root {
  --bg: #fff6e4;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(0, 0, 0, 0.1);
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.12);

  --accent: #ffb000;
  --accent2: #ff8a00;
  --good: #16a34a;
  --bad: #dc2626;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: radial-gradient(
    1200px 600px at 50% 0%,
    #fffdf6 0%,
    var(--bg) 60%,
    #ffebc7 100%
  );
  color: var(--text);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: #1f2937;
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.55),
    rgba(255, 176, 0, 0.18)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.1);
}
.logo.logo--triduc {
  flex: 0 0 40px;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
}
.logo--triduc img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brandName {
  font-weight: 1000;
}
.brandSub {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat {
  font-weight: 950;
  font-size: 12px;
  color: #1f2937;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.stat.cultivationStat {
  color: #111827;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 231, 0.92)
  );
  border: 1px solid rgba(255, 176, 0, 0.32);
  box-shadow:
    0 10px 22px rgba(17, 24, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.pillBtn {
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 950;
  font-size: 12px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}
.pillBtn:active {
  transform: scale(0.99);
}
.pillStudyContentBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #173b2d;
  border-color: rgba(22, 163, 74, 0.28);
  background: linear-gradient(
    180deg,
    rgba(240, 253, 244, 0.98),
    rgba(220, 252, 231, 0.92)
  );
}
.pillStudyContentBtn:hover,
.pillStudyContentBtn.active {
  color: #ffffff;
  border-color: rgba(22, 163, 74, 0.58);
  background: linear-gradient(135deg, #16a34a, #0f766e);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.24);
}
.pillStudyContentIcon {
  font-size: 14px;
  line-height: 1;
}
.pillNavBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  text-decoration: none;
  color: #111827;
  line-height: 1;
  white-space: nowrap;
}

.pillNavBtn:hover {
  color: #111827;
  text-decoration: none;
}
.pillLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 235, 0.96)
  );
  color: #1f2937;
  text-decoration: none;
  font-weight: 950;
  font-size: 12px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.pillLink:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1),
    rgba(255, 243, 214, 0.98)
  );
}

.pillLink:active {
  transform: scale(0.99);
}

.pillLinkGhost {
  background: rgba(255, 255, 255, 0.88);
}
.app {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== Thư viện Nội Dung Học ===== */
.studyLibraryShell {
  display: grid;
  gap: 16px;
  padding-bottom: 34px;
}

.studyLibraryHero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 78% 12%,
      rgba(253, 224, 71, 0.45),
      transparent 34%
    ),
    linear-gradient(135deg, #14532d 0%, #0f766e 54%, #0891b2 100%);
  box-shadow: 0 22px 50px rgba(15, 118, 110, 0.22);
}

.studyLibraryHero::before,
.studyLibraryHero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.studyLibraryHero::before {
  width: 250px;
  height: 250px;
  right: -70px;
  top: -130px;
}

.studyLibraryHero::after {
  width: 160px;
  height: 160px;
  right: 120px;
  bottom: -118px;
}

.studyLibraryHeroCopy {
  max-width: 630px;
}

.studyLibraryEyebrow {
  margin-bottom: 8px;
  color: #fef08a;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 1.8px;
}

.studyLibraryTitle {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 1000;
  letter-spacing: -1.2px;
}

.studyLibraryIntro {
  max-width: 590px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.55;
}

.studyLibraryStats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.studyLibraryStat {
  min-width: 92px;
  padding: 16px 14px;
  text-align: center;
}

.studyLibraryStat + .studyLibraryStat {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.studyLibraryStat b,
.studyLibraryStat span {
  display: block;
}

.studyLibraryStat b {
  font-size: 24px;
  font-weight: 1000;
}

.studyLibraryStat span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.studyLibraryGuide {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 176, 0, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.07);
}

.studyLibraryGuideIcon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: #fff3c4;
}

.studyLibraryGuide > div {
  min-width: 0;
}

.studyLibraryGuide b,
.studyLibraryGuide span {
  display: block;
}

.studyLibraryGuide b {
  font-size: 13px;
  font-weight: 1000;
}

.studyLibraryGuide > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.studyLibraryHomeBtn {
  flex: 0 0 auto;
  margin-left: auto;
}

.studySubjectList {
  display: grid;
  gap: 14px;
}

.studySubjectCard {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.studySubjectCard.isOpen {
  border-color: color-mix(in srgb, var(--study-tone) 42%, transparent);
  box-shadow: 0 18px 42px
    color-mix(in srgb, var(--study-tone) 18%, transparent);
}

.studySubjectCard.tone-blue {
  --study-tone: #0284c7;
  --study-tone-soft: #e0f2fe;
}

.studySubjectCard.tone-violet {
  --study-tone: #7c3aed;
  --study-tone-soft: #ede9fe;
}

.studySubjectToggle {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  color: var(--text);
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.studySubjectToggle:hover {
  background: color-mix(in srgb, var(--study-tone-soft) 52%, transparent);
}

.studySubjectIcon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--study-tone);
  border: 1px solid
    color-mix(in srgb, var(--study-tone) 22%, transparent);
  border-radius: 17px;
  background: var(--study-tone-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 900;
}

.studySubjectCopy {
  min-width: 0;
}

.studySubjectCopy > span,
.studySubjectCopy > strong {
  display: block;
}

.studySubjectCopy strong {
  margin: 2px 0 4px;
  font-size: 19px;
  font-weight: 1000;
}

.studySubjectCopy > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.studySubjectMeta {
  color: var(--study-tone);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.studySubjectOpenLabel {
  color: var(--study-tone);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.studySubjectChevron {
  color: var(--study-tone);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.studySubjectCard.isOpen .studySubjectChevron {
  transform: translateY(2px) rotate(180deg);
}

.studyLessonPanel {
  padding: 0 16px 16px;
  animation: studyLessonReveal 0.2s ease both;
}

@keyframes studyLessonReveal {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.studyLessonTableWrap {
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
}

.studyLessonTable {
  width: 100%;
  min-width: 710px;
  border-collapse: collapse;
  background: #ffffff;
}

.studyLessonTable th {
  padding: 12px 15px;
  color: #475569;
  text-align: left;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.studyLessonTable th:nth-child(1),
.studyLessonTable td:nth-child(1) {
  width: 150px;
}

.studyLessonTable th:nth-child(3),
.studyLessonTable th:nth-child(4),
.studyLessonTable td:nth-child(3),
.studyLessonTable td:nth-child(4) {
  width: 190px;
}

.studyLessonTable th:nth-child(5),
.studyLessonTable td:nth-child(5) {
  width: 210px;
}

.studyLessonTable td {
  padding: 14px 15px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.studyLessonTable tr:last-child td {
  border-bottom: 0;
}

.studyLessonTable tbody tr:hover {
  background: color-mix(in srgb, var(--study-tone-soft) 42%, white);
}

.studyLessonNumber {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  color: var(--study-tone);
  border-radius: 999px;
  background: var(--study-tone-soft);
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.studyLessonTitle {
  font-size: 14px;
  font-weight: 950;
}

.studyLessonRemark {
  display: inline-flex;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--study-tone) 20%, transparent);
  border-radius: 999px;
  color: var(--study-tone);
  background: color-mix(in srgb, var(--study-tone-soft) 72%, white);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.studyLessonRemark.isEmpty {
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  background: #f8fafc;
}

.studyResourceBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 138px;
  min-height: 38px;
  padding: 8px 12px;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid
    color-mix(in srgb, var(--study-tone) 74%, transparent);
  border-radius: 12px;
  background: var(--study-tone);
  box-shadow: 0 8px 18px
    color-mix(in srgb, var(--study-tone) 20%, transparent);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.studyResourceBtn:hover {
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 11px 22px
    color-mix(in srgb, var(--study-tone) 28%, transparent);
}

.studyResourceBtn.isDisabled {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.25);
  background: #f1f5f9;
  box-shadow: none;
  cursor: not-allowed;
}

.studyResourceBtn.isLocked {
  color: #667085;
  border-color: rgba(148, 163, 184, 0.34);
  background: linear-gradient(135deg, #f3f5f8, #e8edf4);
  box-shadow: none;
  cursor: pointer;
}

.studyResourceBtn.isLocked:hover {
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.36);
  background: #eef2ff;
  box-shadow: 0 11px 22px rgba(79, 70, 229, 0.14);
}

.studyResourceLock {
  font-size: 11px;
  opacity: 0.82;
}

.studyPremiumNotice[hidden] {
  display: none !important;
}

.studyPremiumNotice {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 30, 48, 0.56);
  backdrop-filter: blur(8px);
}

.studyPremiumNoticeCard {
  position: relative;
  width: min(100%, 480px);
  padding: 34px 32px 32px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.studyPremiumNoticeClose {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 50%;
  color: #64748b;
  background: #f8fafc;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.studyPremiumNoticeIcon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffb54a, #f7654c);
  box-shadow: 0 16px 28px rgba(247, 101, 76, 0.24);
  font-size: 31px;
}

.studyPremiumNoticeKicker {
  margin: 0 0 8px;
  color: #f2654e;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 1.3px;
}

.studyPremiumNoticeCard h2 {
  margin: 0;
  color: #17213a;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.2;
}

.studyPremiumNoticeMessage {
  margin: 16px 0 0;
  color: #66748e;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.65;
}

.studyResourceExternal {
  opacity: 0.78;
  font-size: 12px;
}

.studyLessonEmpty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.studyLessonEmpty > span {
  font-size: 30px;
}

.studyLessonEmpty b {
  color: var(--text);
  font-size: 14px;
}

.studyLessonEmpty p {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 800px) {
  .studyLibraryHero {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .studyLibraryStats {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .studyLibraryShell {
    gap: 12px;
  }

  .studyLibraryHero {
    min-height: 0;
    padding: 21px 18px;
    border-radius: 22px;
  }

  .studyLibraryIntro {
    font-size: 12px;
  }

  .studyLibraryStat {
    min-width: 0;
    padding: 12px 8px;
  }

  .studyLibraryStat b {
    font-size: 20px;
  }

  .studyLibraryGuide {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .studyLibraryHomeBtn {
    width: 100%;
    margin-left: 0;
  }

  .studySubjectToggle {
    grid-template-columns: 46px minmax(0, 1fr) 22px;
    gap: 11px;
    padding: 15px;
  }

  .studySubjectIcon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 22px;
  }

  .studySubjectOpenLabel {
    display: none;
  }

  .studyLessonPanel {
    padding: 0 10px 10px;
  }

  .studyLessonTableWrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .studyLessonTable,
  .studyLessonTable tbody,
  .studyLessonTable tr,
  .studyLessonTable td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .studyLessonTable thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .studyLessonTable tbody {
    display: grid;
    gap: 10px;
  }

  .studyLessonTable tr {
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 15px;
    background: #ffffff;
  }

  .studyLessonTable td,
  .studyLessonTable td:nth-child(1),
  .studyLessonTable td:nth-child(3),
  .studyLessonTable td:nth-child(4),
  .studyLessonTable td:nth-child(5) {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  }

  .studyLessonTable td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 9px;
    font-weight: 1000;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  .studyLessonTable td:last-child {
    border-bottom: 0;
  }

  .studyResourceBtn {
    width: 100%;
    min-width: 0;
  }
}

.hero {
  border-radius: 26px;
  background: linear-gradient(
    135deg,
    rgba(255, 176, 0, 0.25),
    rgba(255, 255, 255, 0.8)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow);
  padding: 18px;
}
.heroContent {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
}
.h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 1000;
}
.small {
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
  line-height: 1.35;
}

.panel {
  margin-top: 14px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
}

.sectionHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sectionTitle {
  font-weight: 1000;
  font-size: 18px;
}

.btnRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.btn {
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.75),
    rgba(255, 176, 0, 0.35)
  );
  color: #111827;
  border-radius: 18px;
  padding: 10px 14px;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
}
.btnGhost {
  background: rgba(255, 255, 255, 0.92);
}
.btnDanger {
  border-color: rgba(185, 28, 28, 0.55);
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.98),
    rgba(185, 28, 28, 0.92)
  );
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(185, 28, 28, 0.22);
}
.btn:active,
.btnGhost:active {
  transform: scale(0.99);
}
.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
}

/* ===== Server switcher (left-middle) ===== */
.serverSwitch {
  position: fixed;
  left: 12px;
  top: 39%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 80;
}
.serverBtn {
  cursor: pointer;
  width: 86px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  font-weight: 1000;
}
.serverBtn .sub {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  margin-top: 4px;
}
.serverBtn.active {
  outline: 3px solid rgba(255, 176, 0, 0.35);
  border-color: rgba(255, 176, 0, 0.35);
}

/* ===== Menu grid ===== */
.gridMenu {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.menuCard {
  grid-column: span 4;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}
@media (max-width: 900px) {
  .menuCard {
    grid-column: span 6;
  }
}
@media (max-width: 560px) {
  .menuCard {
    grid-column: span 12;
  }
}
.menuTitle {
  font-weight: 1000;
  font-size: 16px;
}
.menuDesc {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 850;
  line-height: 1.35;
}
.menuCard.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

/* ===== Hộp công cụ Server Xác Suất ===== */
.probabilityToolbox {
  position: relative;
  width: 100%;
  min-height: 142px;
  margin-top: 22px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(125, 211, 252, 0.34), transparent 34%),
    linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(245, 243, 255, 0.98));
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
}

.probabilityToolbox::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -65px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  pointer-events: none;
}

.probabilityToolboxIcon {
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  background: linear-gradient(145deg, #ffffff, #dbeafe);
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.88);
  font-size: 34px;
}

.probabilityToolboxContent {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}

.probabilityToolboxEyebrow {
  margin-bottom: 5px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.probabilityToolboxTitle {
  margin: 0;
  color: #14213d;
  font-size: 25px;
  line-height: 1.16;
  font-weight: 1000;
}

.probabilityToolboxDesc {
  margin: 7px 0 0;
  color: #60708d;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 750;
}

.probabilityToolboxButton {
  position: relative;
  z-index: 1;
  min-width: 210px;
  min-height: 58px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.24);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 1000;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.probabilityToolboxButton:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 18px 32px rgba(79, 70, 229, 0.3);
}

.probabilityToolboxButton:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 3px;
}

.probabilityToolboxButton.isPending {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 12px 22px rgba(71, 85, 105, 0.2);
}

.probabilityToolboxArrow {
  font-size: 22px;
  line-height: 1;
}

/* ===== Cửa sổ chọn môn cho Server Xác Suất ===== */
body.learningPathPickerOpen {
  overflow: hidden;
}

.learningPathPicker {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity 0.18s ease;
  backdrop-filter: blur(8px);
}

.learningPathPicker.isOpen {
  opacity: 1;
}

.learningPathPickerDialog {
  position: relative;
  width: min(780px, 100%);
  max-height: min(700px, calc(100vh - 56px));
  overflow: auto;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background:
    radial-gradient(circle at 94% 4%, rgba(167, 139, 250, 0.2), transparent 28%),
    radial-gradient(circle at 8% 100%, rgba(96, 165, 250, 0.16), transparent 30%),
    #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1.08);
}

.learningPathPicker.isOpen .learningPathPickerDialog {
  transform: translateY(0) scale(1);
}

.learningPathPickerClose {
  position: absolute;
  top: 16px;
  right: 17px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #475569;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font: 900 24px/1 system-ui, sans-serif;
  transition: transform 0.15s ease, background 0.15s ease;
}

.learningPathPickerClose:hover {
  transform: rotate(90deg);
  background: #f1f5f9;
}

.learningPathPickerIntro {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-right: 42px;
}

.learningPathPickerBadge {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  place-items: center;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.26);
  font-size: 27px;
}

.learningPathPickerIntro p {
  margin: 3px 0 5px;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.13em;
}

.learningPathPickerIntro h2 {
  margin: 0;
  color: #17213c;
  font-size: clamp(24px, 4vw, 31px);
  line-height: 1.16;
  font-weight: 1000;
}

.learningPathPickerIntro > div > span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.learningPathPickerGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.learningPathChoice {
  --choice-color: #2563eb;
  display: flex;
  min-height: 126px;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--choice-color) 22%, #d9e2ef);
  border-radius: 21px;
  color: #17213c;
  background: linear-gradient(135deg, color-mix(in srgb, var(--choice-color) 8%, #ffffff), #ffffff);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.17s ease, border-color 0.17s ease, box-shadow 0.17s ease;
}

.learningPathChoice:hover,
.learningPathChoice:focus-visible {
  border-color: color-mix(in srgb, var(--choice-color) 52%, white);
  outline: none;
  box-shadow: 0 16px 28px color-mix(in srgb, var(--choice-color) 18%, transparent);
  transform: translateY(-3px);
}

.learningPathChoice.isProbability { --choice-color: #2563eb; }
.learningPathChoice.isQuickSolve { --choice-color: #e8664b; }
.learningPathChoice.isSpatial { --choice-color: #1597a8; }
.learningPathChoice.isInvariant { --choice-color: #6d4bd8; }

.learningPathChoiceIcon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
  background: var(--choice-color);
  box-shadow: 0 9px 17px color-mix(in srgb, var(--choice-color) 30%, transparent);
  font-size: 17px;
  font-weight: 1000;
}

.learningPathChoiceCopy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.learningPathChoiceCopy strong {
  color: #17213c;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 1000;
}

.learningPathChoiceCopy small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

.learningPathChoiceArrow {
  margin-left: auto;
  color: var(--choice-color);
  font-size: 22px;
  font-weight: 900;
}

@media (max-width: 720px) {
  .probabilityToolbox {
    padding: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .probabilityToolboxIcon {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 17px;
    font-size: 29px;
  }

  .probabilityToolboxContent {
    flex-basis: calc(100% - 76px);
  }

  .probabilityToolboxTitle {
    font-size: 21px;
  }

  .probabilityToolboxButton {
    width: 100%;
    min-width: 0;
  }

  .learningPathPicker {
    align-items: end;
    padding: 14px;
  }

  .learningPathPickerDialog {
    max-height: calc(100vh - 28px);
    padding: 26px 20px 20px;
    border-radius: 25px;
  }

  .learningPathPickerGrid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .learningPathChoice {
    min-height: 93px;
    padding: 13px;
  }

  .learningPathChoiceIcon {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
    border-radius: 13px;
  }
}

.badgeSoon {
  display: inline-flex;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 1000;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.breadcrumb {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 950;
  color: #6b7280;
}
.breadcrumb b {
  color: #111827;
}

/* ===== Map picker ===== */
.mapPickGrid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.mapCard {
  grid-column: span 4;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  cursor: pointer;
  text-align: left;
  padding: 0;
}
@media (max-width: 900px) {
  .mapCard {
    grid-column: span 6;
  }
}
@media (max-width: 560px) {
  .mapCard {
    grid-column: span 12;
  }
}

.mapThumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.mapCardBody {
  padding: 12px;
}
.mapName {
  font-weight: 1000;
}
.mapDesc {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
}

/* ===== Map view ===== */
.mapWrap {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mapToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.16),
    rgba(255, 255, 255, 0.65)
  );
}
.mapViewport {
  overflow: auto;
  cursor: grab;
  background: rgba(255, 255, 255, 0.35);
}
.mapViewport.dragging {
  cursor: grabbing;
}
.mapInner {
  position: relative;
  width: max-content;
}
.mapImg {
  display: block;
  width: 2048px;
  height: auto;
  user-select: none;
}
.mapNodes {
  position: absolute;
  inset: 0;
}

.levelNode {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  border: 2px solid rgba(255, 176, 0, 0);
  cursor: pointer;
}
.levelNode:hover {
  border-color: rgba(255, 176, 0, 0.95);
  box-shadow: 0 0 0 6px rgba(255, 176, 0, 0.18);
}
.levelNode.locked {
  cursor: not-allowed;
  opacity: 0.45;
}
.levelNode.done {
  border-color: rgba(22, 163, 74, 0.65);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.15);
}
.levelNode.current {
  border-color: rgba(255, 138, 0, 0.95);
  box-shadow: 0 0 0 6px rgba(255, 138, 0, 0.18);
}

/* ===== Play ===== */
.playTopRow {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.playTopActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.btnSubmitTop {
  min-width: 148px;
  margin-left: auto;
}
.playBottomNav {
  justify-content: flex-start;
}
.qTitle {
  margin: 0 0 10px 0;
  font-weight: 1000;
}
.qImgWrap {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  position: relative;
}
.qImgWrap img {
  width: 100%;
  height: auto;
  display: block;
}
.imgError {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.08);
  font-weight: 900;
  color: #7f1d1d;
}

.answers {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ansBtn {
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 12px 10px;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.08);
}
.ansBtn:active {
  transform: scale(0.99);
}

.timerPill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 236, 179, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 1000;
  font-size: 12px;
}

/* ===== Overlay modal (mục lục câu) ===== */
.toolOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 14px;
}
.toolModal {
  width: min(980px, 96vw);
  height: min(680px, 92vh);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.toolTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.9),
    rgba(255, 255, 255, 0.9)
  );
}
.toolTitle {
  font-weight: 1000;
}
.toolClose {
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 36px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 1000;
}
.toolBody {
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

/* ===== Question Navigator ===== */
.qnavGrid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}
@media (max-width: 560px) {
  .qnavGrid {
    grid-template-columns: repeat(6, 1fr);
  }
}
.qnavCell {
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  padding: 10px 0;
  font-weight: 1000;
  cursor: pointer;
  text-align: center;
}
.qnavCell.current {
  outline: 3px solid rgba(255, 138, 0, 0.35);
  border-color: rgba(255, 138, 0, 0.4);
}
.qnavCell.attempted {
  background: rgba(255, 176, 0, 0.18);
  border-color: rgba(255, 176, 0, 0.35);
}
.qnavCell.solved {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.35);
}
.qnavLegend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.qdot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.qdot.none {
  background: rgba(0, 0, 0, 0.04);
}
.qdot.att {
  background: rgba(255, 176, 0, 0.18);
  border-color: rgba(255, 176, 0, 0.35);
}
.qdot.sol {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.35);
}

/* ===== Split view: đề trái, hint/sol phải ===== */
.playLayout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.playLayout.withSide {
  grid-template-columns: 1.25fr 0.75fr;
  align-items: start;
}
@media (max-width: 980px) {
  .playLayout.withSide {
    grid-template-columns: 1fr;
  }
}
.playLeft {
  min-width: 0;
}
.playRight {
  min-width: 0;
  min-height: 0;
  display: none;
}
.playLayout.withSide .playRight {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.playRight.bothOpen {
  display: grid !important;
  grid-template-rows: 3fr 7fr;
  gap: 12px;
}

.sideCard {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sideHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.9),
    rgba(255, 255, 255, 0.9)
  );
  font-weight: 1000;
}
.sideBody {
  padding: 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.sideBody img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.sideLock {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 176, 0, 0.35);
  background: rgba(255, 176, 0, 0.12);
  font-weight: 900;
  color: #7c4a00;
}

/* ===== Question Types UI ===== */
.answerArea {
  margin-top: 12px;
}

.shortRow {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.shortInput {
  flex: 1;
  min-width: 0;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  outline: none;
}
.shortInput:focus {
  outline: 3px solid rgba(255, 176, 0, 0.25);
  border-color: rgba(255, 176, 0, 0.35);
}

/* DragDrop overlay */
.ddOverlay {
  position: absolute;
  inset: 0;
}
.ddTarget {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 176, 0, 0.85);
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 1000;
  color: #111827;
  cursor: pointer;
  user-select: none;
}
.ddTarget.filled {
  border-style: solid;
  background: rgba(255, 176, 0, 0.15);
}
.ddPool {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ddPiece {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.1);
}
.ddPiece.used {
  opacity: 0.45;
  cursor: not-allowed;
}
.ddPiece.selected {
  outline: 3px solid rgba(255, 176, 0, 0.35);
  border-color: rgba(255, 176, 0, 0.35);
}
.ddGhost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 1000;
  transform: translate(-50%, -50%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
/* ===== Progress bar ===== */
.progressWrap {
  margin-top: 10px;
}
.progressBar {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(255, 176, 0, 0.95),
    rgba(255, 138, 0, 0.95)
  );
}
.progressMeta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.progressMeta .small b {
  color: #111827;
}

/* ===== Result list ===== */
.resultList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(62vh, 520px);
  overflow: auto;
  padding-right: 6px;
}
.resultItem {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}
.resultTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 1000;
}
.resultMeta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 850;
  color: #6b7280;
  line-height: 1.35;
}
.resultMeta b {
  color: #111827;
}
/* Phóng to phần Lời giải ~20% */
#solCard .sideBody {
  font-size: 1.2em;
}

#solCard .sideBody img {
  transform: scale(1.5);
  transform-origin: top left;
}

/* Để khi zoom không bị cắt mất nội dung */
#solCard .sideBody {
  overflow: auto;
  padding-right: 16px;
}

@media (max-width: 768px) {
  .playTopActions {
    width: 100%;
    justify-content: flex-start;
  }

  .btnSubmitTop {
    order: 99;
    margin-left: 0;
  }
}
/* ===== KHÔI PHỤC TÍNH NĂNG: server switch + submit top + side zoom + music scene ===== */

.app {
  transition: max-width 0.18s ease;
}

.app.appPlayWide {
  max-width: 1520px;
}

.btnDanger {
  border-color: rgba(185, 28, 28, 0.55);
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.98),
    rgba(185, 28, 28, 0.92)
  );
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(185, 28, 28, 0.22);
}

.serverSwitch {
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.serverSwitch.hiddenDuringActivity {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-18px);
}

.playTopInfo {
  flex: 1 1 420px;
}

.playTopActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.btnSubmitTop {
  min-width: 148px;
}

.playBottomNav {
  justify-content: flex-start;
}

.playLayout.withSide {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: start;
  gap: 16px;
}

.playRight {
  align-self: stretch;
}

.playRight.bothOpen {
  display: grid !important;
  grid-template-rows: minmax(220px, 3fr) minmax(360px, 7fr);
  gap: 12px;
}

#hintCard,
#solCard {
  min-height: 0;
}

#hintCard .sideBody,
#solCard .sideBody {
  padding-right: 10px;
}

#hintCard .sideBody img,
#solCard .sideBody img {
  width: 130%;
  max-width: none;
  height: auto;
  display: block;
}

#hintCard .sideBody img {
  transform: translateX(4%);
  transform-origin: top left;
}

#solCard .sideBody img {
  transform: translateX(8%);
  transform-origin: top left;
}

#solCard .sideBody {
  overflow: auto;
  padding-right: 18px;
}

@media (max-width: 980px) {
  .playLayout.withSide {
    grid-template-columns: 1fr;
  }

  .playTopActions {
    width: 100%;
    justify-content: flex-start;
  }

  .btnSubmitTop {
    order: -1;
  }

  #hintCard .sideBody img,
  #solCard .sideBody img {
    width: 100%;
    transform: none;
  }
}
/* ===== FIX NÚT NỘP BÀI + FIX SIDE GỢI Ý / LỜI GIẢI ===== */

.app {
  transition: max-width 0.18s ease;
}

.app.appPlayWide {
  max-width: 1480px;
}

.btnDanger {
  border-color: rgba(185, 28, 28, 0.55);
  background: linear-gradient(
    180deg,
    rgba(239, 68, 68, 0.98),
    rgba(185, 28, 28, 0.92)
  );
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(185, 28, 28, 0.22);
}

.playTopInfo {
  flex: 1 1 420px;
}

.playTopActions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.btnSubmitTop {
  min-width: 150px;
}

.playBottomNav {
  justify-content: flex-start;
}

.playLayout.withSide {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: start;
  gap: 18px;
}

.playRight {
  min-width: 0;
  align-self: stretch;
}

.playRight.bothOpen {
  display: grid !important;
  grid-template-rows: minmax(210px, 3fr) minmax(360px, 7fr);
  gap: 14px;
}

#hintCard,
#solCard {
  min-height: 0;
}

#hintCard .sideBody,
#solCard .sideBody {
  overflow: auto;
  padding-right: 14px;
}

#hintCard .sideBody img,
#solCard .sideBody img {
  width: 130%;
  max-width: none;
  height: auto;
  display: block;
  border-radius: 14px;
}

#hintCard .sideBody img {
  transform: translateX(2%);
  transform-origin: top left;
}

#solCard .sideBody img {
  transform: translateX(8%);
  transform-origin: top left;
}

#solCard .sideBody {
  padding-right: 20px;
}

@media (max-width: 980px) {
  .playLayout.withSide {
    grid-template-columns: 1fr;
  }

  .playTopActions {
    width: 100%;
    justify-content: flex-start;
  }

  .btnSubmitTop {
    order: -1;
  }

  #hintCard .sideBody img,
  #solCard .sideBody img {
    width: 100%;
    transform: none;
  }
}
/* ===== FIX DRAGDROP DẠNG TEXT/LATEX ===== */

.dragdropBoard {
  position: relative;
  width: 100%;
  min-height: 220px;
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px dashed rgba(255, 176, 0, 0.4);
}

.dragdropTargets {
  position: relative;
  width: 100%;
  min-height: 220px;
}

.ddTargetBox {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #f3b43a;
  border-radius: 14px;
  background: rgba(255, 248, 220, 0.82);
  color: #111827;
  font-weight: 900;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

.ddTargetBox.filled {
  border-style: solid;
  background: rgba(255, 237, 170, 0.95);
}

.ddPool {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ddPiece {
  min-width: 90px;
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(59, 130, 246, 0.45);
  background: linear-gradient(
    180deg,
    rgba(191, 219, 254, 0.95),
    rgba(147, 197, 253, 0.95)
  );
  color: #111827;
  font-weight: 900;
  font-size: 20px;
  padding: 10px 16px;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.18);
}

.ddPiece.selected {
  outline: 3px solid rgba(255, 176, 0, 0.45);
}

.ddPiece.used {
  opacity: 0.45;
}
/* ===== FIX DRAGDROP / SHORT / MSQ ===== */

.dragdropBoard {
  position: relative;
  width: 100%;
  min-height: 220px;
  margin-top: 12px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(255, 176, 0, 0.4);
}

.dragdropTargets {
  position: relative;
  width: 100%;
  min-height: 220px;
}

.ddTargetBox {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #f3b43a;
  border-radius: 14px;
  background: rgba(255, 248, 220, 0.82);
  color: #111827;
  font-weight: 900;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
}

.ddTargetBox.filled {
  border-style: solid;
  background: rgba(255, 237, 170, 0.95);
}

.ddPool {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ddPiece {
  min-width: 90px;
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(59, 130, 246, 0.45);
  background: linear-gradient(
    180deg,
    rgba(191, 219, 254, 0.95),
    rgba(147, 197, 253, 0.95)
  );
  color: #111827;
  font-weight: 900;
  font-size: 20px;
  padding: 10px 16px;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.18);
}

.ddPiece.selected {
  outline: 3px solid rgba(255, 176, 0, 0.45);
}

.ddPiece.used {
  opacity: 0.45;
}
/* ===== INLINE DRAGDROP TRÊN CHỮ / LATEX ===== */

.inlineDropSlot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-width: 110px;
  min-height: 44px;
  margin: 0 6px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 2px dashed #f3b43a;
  background: rgba(255, 248, 220, 0.82);
  color: #111827;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;
}

.inlineDropSlot.filled {
  border-style: solid;
  background: rgba(255, 237, 170, 0.95);
}

.ddPool {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ddPiece {
  min-width: 90px;
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(59, 130, 246, 0.45);
  background: linear-gradient(
    180deg,
    rgba(191, 219, 254, 0.95),
    rgba(147, 197, 253, 0.95)
  );
  color: #111827;
  font-weight: 900;
  font-size: 20px;
  padding: 10px 16px;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.18);
}

.ddPiece.selected {
  outline: 3px solid rgba(255, 176, 0, 0.45);
}

.ddPiece.used {
  opacity: 0.45;
}
/* ===== FIX SHORT ANSWER HIỂN THỊ CHẮC CHẮN ===== */

.shortRow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.shortInput {
  min-width: 180px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid rgba(96, 165, 250, 0.45);
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  outline: none;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.08);
}

.shortInput:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}
.hsaMultipartAnswers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.hsaMultipartAnswer {
  display: grid;
  gap: 5px;
  font-weight: 700;
}
.hsaMultipartAnswer .shortInput {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* ===== FIX HIỂN THỊ LATEX TRONG NÚT ĐÁP ÁN ===== */

.answers .ansBtn,
#msqAnswers .ansBtn {
  line-height: 1.45;
  white-space: normal;
  text-align: center;
}

.answers .ansBtn mjx-container,
#msqAnswers .ansBtn mjx-container {
  display: inline-block !important;
  max-width: 100%;
}
/* ===== FIX KHOẢNG CÁCH PHẦN LỜI GIẢI / GỢI Ý ===== */

.contentTextBlock {
  line-height: 1.48 !important;
  margin-bottom: 8px !important;
}

.contentLatex {
  margin: 2px 0 8px !important;
  line-height: 1.3 !important;
}

#hintBody,
#solutionContent,
#solBody {
  line-height: 1.48;
}

#hintBody p,
#solutionContent p,
#solBody p {
  margin: 0 0 8px !important;
}

#hintBody br + br,
#solutionContent br + br,
#solBody br + br {
  display: none;
}

#hintBody mjx-container[display="true"],
#solutionContent mjx-container[display="true"],
#solBody mjx-container[display="true"] {
  margin: 0.35em 0 !important;
}

#hintBody mjx-container,
#solutionContent mjx-container,
#solBody mjx-container {
  line-height: 1.25 !important;
}
/* ===== Question Comment Drawer ===== */
.commentLauncher {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 76px;
  height: 76px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1200;
}

.commentLauncherIcon {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background-image: url("assets/img/ui/comment-launcher.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.commentLauncherCount {
  position: absolute;
  top: 8px;
  left: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 14px;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.commentDrawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 300ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 300ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1300;
}

.commentDrawerOverlay.open {
  opacity: 1;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.46);
}

.commentDrawer {
  position: absolute;
  left: 0;
  top: 0;
  height: 100dvh;
  width: clamp(320px, 28vw, 440px);
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e5e7eb;
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.35);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.commentDrawer.open {
  transform: translateX(0);
}

.commentDrawerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.commentDrawerEyebrow {
  font-size: 12px;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.commentDrawerTitle {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 1000;
  color: #f8fafc;
}

.commentDrawerClose {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  font-weight: 1000;
}

.commentDrawerBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.commentDrawerItem {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px 13px;
}

.commentDrawerMeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.commentDrawerMeta strong {
  color: #f8fafc;
}

.commentDrawerText {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #e5e7eb;
}

.commentDrawerEmpty {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
}

.commentDrawerFooter {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.92);
}

.commentDrawerInput {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  padding: 12px 13px;
  outline: none;
}

.commentDrawerInput:focus {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.commentDrawerSend {
  margin-top: 12px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 1000;
  cursor: pointer;
}

@media (max-width: 900px) {
  .commentDrawer {
    width: min(88vw, 420px);
  }

  .commentLauncher {
    left: 12px;
    bottom: 12px;
    width: 68px;
    height: 68px;
  }
}
/* ===== Reply + Delete trong comment drawer ===== */
.commentReplyBox {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.commentReplyText {
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
}

.commentReplyCancel {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

.commentDrawerActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.commentMiniBtn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.commentMiniBtn.danger {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

.commentDrawerChildren {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.commentDrawerItem.isDeleted .commentDrawerText {
  color: #94a3b8;
  font-style: italic;
}
/* ===== Friends / Social Panel ===== */
.friendsMiniBtn {
  position: relative;
  width: 42px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.friendsMiniGlyph {
  font-size: 18px;
  line-height: 1;
}

.friendsMiniBadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.28);
}

.friendsLayer {
  position: fixed;
  inset: 0;
  z-index: 1700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.friendsLayer.open {
  pointer-events: auto;
  opacity: 1;
}

.friendsLayer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(2px);
}

.friendsPanel {
  position: absolute;
  top: 74px;
  right: 16px;
  z-index: 1701;
  width: min(980px, calc(100vw - 32px));
  height: min(76vh, 760px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.18);
  overflow: hidden;
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.friendsPanel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.friendsPanelTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.95),
    rgba(255, 255, 255, 0.95)
  );
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.friendsEyebrow {
  font-size: 11px;
  font-weight: 1000;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.friendsTitle {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 1000;
  color: #111827;
}

.friendsCloseBtn {
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 1000;
  cursor: pointer;
}

.friendsTabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.friendsTabBtn {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.friendsTabBtn.active {
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.18),
    rgba(255, 255, 255, 0.95)
  );
  border-color: rgba(255, 176, 0, 0.35);
}

.friendsTabBadge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 8px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 10px;
  font-weight: 1000;
  align-items: center;
  justify-content: center;
}

.friendsTabBadge.danger {
  background: #ef4444;
  color: #fff;
}

.friendsPanelBody {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.friendsSectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.friendsSectionTitle,
.friendsSubSectionTitle {
  font-weight: 1000;
  color: #111827;
}

.friendsSubSectionTitle {
  margin: 14px 0 10px;
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.friendsSoftBtn,
.friendsActionBtn {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.friendsActionBtn {
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.65),
    rgba(255, 176, 0, 0.28)
  );
}

.friendsActionBtn.ghost {
  background: rgba(255, 255, 255, 0.95);
}

.friendsActionBtn.danger {
  border-color: rgba(220, 38, 38, 0.16);
  color: #991b1b;
}

.friendsSearchBox {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.friendsInput,
.friendsComposerInput {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  color: #111827;
}

.friendsComposerInput {
  min-height: 74px;
  resize: vertical;
}

.friendsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friendsCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.friendsCardMain {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.friendsAvatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.45),
    rgba(255, 255, 255, 0.95)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.friendsCardInfo {
  min-width: 0;
}

.friendsCardNameRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.friendsCardName {
  font-weight: 1000;
  color: #111827;
}

.friendsCardSub,
.friendsCardMeta,
.friendsThreadSub,
.friendsThreadLast,
.friendsChatHeaderSub,
.friendsBubbleTime {
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
}

.friendsStatusDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.friendsStatusDot.online {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.friendsStatusDot.offline {
  background: #cbd5e1;
}

.friendsCardActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.friendsEmpty {
  padding: 22px;
  border-radius: 20px;
  text-align: center;
  color: #6b7280;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

.friendsSkeletonList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friendsSkeletonCard {
  height: 88px;
  border-radius: 22px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.04)
  );
  background-size: 200% 100%;
  animation: friendsShimmer 1.2s infinite linear;
}

@keyframes friendsShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.friendsChatLayout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  min-height: 480px;
}

.friendsThreadsCol,
.friendsMessagesCol {
  min-width: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.friendsThreadsCol {
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friendsThreadItem {
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 18px;
  padding: 12px;
  cursor: pointer;
}

.friendsThreadItem.active {
  border-color: rgba(255, 176, 0, 0.35);
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.14),
    rgba(255, 255, 255, 0.96)
  );
}

.friendsThreadTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.friendsThreadName {
  font-weight: 1000;
  color: #111827;
}

.friendsThreadBadge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.friendsMessagesCol {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.friendsChatHeader {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.9),
    rgba(255, 255, 255, 0.9)
  );
}

.friendsChatHeaderName {
  font-weight: 1000;
  color: #111827;
}

.friendsMessagesList {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friendsBubbleRow {
  display: flex;
}

.friendsBubbleRow.mine {
  justify-content: flex-end;
}

.friendsBubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.friendsBubble.mine {
  background: linear-gradient(
    180deg,
    rgba(255, 176, 0, 0.22),
    rgba(255, 255, 255, 0.95)
  );
}

.friendsComposer {
  padding: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 980px) {
  .friendsPanel {
    top: 70px;
    right: 12px;
    width: calc(100vw - 24px);
    height: min(82vh, 760px);
  }

  .friendsChatLayout {
    grid-template-columns: 1fr;
  }

  .friendsCard {
    flex-direction: column;
    align-items: stretch;
  }

  .friendsCardActions {
    justify-content: flex-start;
  }
}
/* ===== WORLD CHAT 2026 - SMALLER + HIDE/SHOW ===== */
.worldChatShell {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 1350;
  width: min(290px, calc(100vw - 24px));
  transition:
    opacity 240ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.worldChatShell.isHidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
}

.worldChatShell.isCollapsed .worldMiniWidget {
  transform: translateY(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
}

.worldMiniWidget {
  position: relative;
  border-radius: 22px;
  padding: 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 247, 232, 0.92)
  );
  border: 1px solid rgba(126, 170, 255, 0.14);
  box-shadow:
    0 16px 38px rgba(17, 24, 39, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
}

.worldMiniCollapseBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.08);
  color: #374151;
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 8px 16px rgba(17, 24, 39, 0.08);
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.worldMiniCollapseBtn:hover {
  transform: translateY(-1px);
  background: rgba(17, 24, 39, 0.12);
}

.worldMiniHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 28px;
}

.worldMiniEyebrow {
  font-size: 10px;
  font-weight: 1000;
  color: #7c8aa0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.worldMiniTitle {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 1000;
  color: #111827;
}

.worldMiniUnread {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff6b6b, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.24);
}

.worldMiniFeed {
  display: block;
}

.worldMiniFeedList {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.worldMiniItem {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 10px 22px rgba(17, 24, 39, 0.06),
    0 0 14px rgba(99, 102, 241, 0.04);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.66)
  );
}

.worldMiniItem.palette-violet {
  background: linear-gradient(
    135deg,
    rgba(129, 140, 248, 0.14),
    rgba(255, 255, 255, 0.82)
  );
}

.worldMiniItem.palette-cyan {
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.12),
    rgba(255, 255, 255, 0.82)
  );
}

.worldMiniItem.palette-gold {
  background: linear-gradient(
    135deg,
    rgba(255, 196, 0, 0.16),
    rgba(255, 255, 255, 0.82)
  );
}

.worldMiniItem.palette-orange {
  background: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.16),
    rgba(255, 255, 255, 0.82)
  );
}

.worldMiniItem.palette-pink {
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.12),
    rgba(255, 255, 255, 0.82)
  );
}

.worldMiniOrb {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  font-size: 12px;
  font-weight: 1000;
  color: #111827;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.42)
    ),
    linear-gradient(180deg, rgba(255, 176, 0, 0.52), rgba(128, 90, 213, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px 14px rgba(17, 24, 39, 0.08),
    0 0 8px rgba(99, 102, 241, 0.08);
}

.worldMiniTextWrap {
  min-width: 0;
  flex: 1;
}

.worldMiniTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.worldMiniName {
  font-size: 12px;
  font-weight: 1000;
  color: #312e81;
  text-shadow: 0 0 8px rgba(129, 140, 248, 0.1);
}

.worldMiniTime {
  font-size: 10px;
  font-weight: 900;
  color: #7c8aa0;
}

.worldMiniBody {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 850;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.worldMiniStateCard,
.worldPopupStateCard {
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88),
    rgba(250, 250, 255, 0.8)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06);
}

.worldMiniStateCard.compact {
  padding: 12px 10px;
}

.worldMiniStateCard.error,
.worldPopupStateCard.error {
  background: linear-gradient(
    180deg,
    rgba(255, 245, 245, 0.96),
    rgba(255, 255, 255, 0.9)
  );
  border-color: rgba(239, 68, 68, 0.16);
}

.worldMiniStateIcon,
.worldPopupStateIcon {
  font-size: 18px;
  margin-bottom: 6px;
}

.worldMiniStateText,
.worldPopupStateSub {
  font-size: 12px;
  font-weight: 850;
  color: #6b7280;
  line-height: 1.4;
}

.worldPopupStateTitle {
  font-size: 15px;
  font-weight: 1000;
  color: #111827;
  margin-bottom: 5px;
}

.worldMiniRetryBtn {
  margin-top: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 1000;
  color: #fff;
  background: linear-gradient(
    180deg,
    rgba(99, 102, 241, 0.95),
    rgba(79, 70, 229, 0.92)
  );
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.16);
}

.worldMiniSkeletonList,
.worldPopupSkeletonList {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.worldMiniSkeleton,
.worldPopupSkeleton {
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.04)
  );
  background-size: 200% 100%;
  animation: worldChatShimmer 1.2s linear infinite;
}

.worldPopupSkeleton.short {
  height: 42px;
}

@keyframes worldChatShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.worldActionBar {
  margin-top: 9px;
  width: 100%;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(88, 91, 255, 0.9),
    rgba(25, 211, 252, 0.76),
    rgba(255, 176, 0, 0.68)
  );
  color: #ffffff;
  box-shadow:
    0 14px 26px rgba(79, 70, 229, 0.18),
    0 0 20px rgba(34, 211, 238, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.worldActionBar:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
}

.worldActionBar:active {
  transform: scale(0.99);
}

.worldActionIcon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 14px;
}

.worldActionText {
  flex: 1;
  text-align: left;
  font-size: 12px;
  font-weight: 1000;
}

.worldActionBadge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  font-size: 10px;
  font-weight: 1000;
}

.worldMiniDock {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(88, 91, 255, 0.92),
    rgba(25, 211, 252, 0.8)
  );
  color: #fff;
  box-shadow:
    0 14px 28px rgba(79, 70, 229, 0.2),
    0 0 20px rgba(34, 211, 238, 0.1);
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
}

.worldMiniDock.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.worldMiniDockIcon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.worldMiniDockText {
  font-size: 12px;
  font-weight: 1000;
}

.worldPopupLayer {
  position: fixed;
  inset: 0;
  z-index: 1380;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.worldPopupLayer.open {
  pointer-events: auto;
  opacity: 1;
}

.worldPopupLayer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.1);
  backdrop-filter: blur(2px);
}

.worldPopupPanel {
  position: absolute;
  left: 12px;
  bottom: 98px;
  width: min(420px, calc(100vw - 24px));
  height: min(500px, 68vh);
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(250, 244, 255, 0.84)
  );
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    0 24px 56px rgba(17, 24, 39, 0.16),
    0 0 24px rgba(99, 102, 241, 0.06);
  backdrop-filter: blur(14px);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.worldPopupPanel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.worldPopupHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.12),
    rgba(34, 211, 238, 0.12),
    rgba(255, 176, 0, 0.12)
  );
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.worldPopupHeaderLeft {
  display: flex;
  align-items: center;
  gap: 10px;
}

.worldPopupHeaderIcon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.44)
    ),
    linear-gradient(180deg, rgba(255, 176, 0, 0.48), rgba(129, 140, 248, 0.24));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 10px 18px rgba(17, 24, 39, 0.08),
    0 0 12px rgba(99, 102, 241, 0.08);
}

.worldPopupTitle {
  font-size: 18px;
  font-weight: 1000;
  color: #111827;
}

.worldPopupSub {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
  color: #7c8aa0;
}

.worldPopupClose {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 1000;
}

.worldPopupBody {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.worldChatMessages {
  height: 100%;
  overflow: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.worldChatRow {
  display: flex;
  justify-content: flex-start;
}

.worldChatRow.mine {
  justify-content: flex-end;
}

.worldChatBubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(247, 247, 255, 0.92)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 10px 18px rgba(17, 24, 39, 0.06),
    0 0 12px rgba(99, 102, 241, 0.04);
}

.worldChatBubble.mine {
  background: linear-gradient(
    180deg,
    rgba(255, 228, 173, 0.92),
    rgba(255, 255, 255, 0.94)
  );
}

.worldChatBubbleTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.worldChatAuthorWrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.worldChatAvatar {
  width: 22px;
  height: 22px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 1000;
  color: #111827;
  background:
    radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.46)
    ),
    linear-gradient(180deg, rgba(255, 176, 0, 0.52), rgba(129, 140, 248, 0.22));
}

.worldChatAuthor {
  font-size: 12px;
  font-weight: 1000;
  color: #312e81;
}

.worldChatStamp {
  font-size: 10px;
  font-weight: 900;
  color: #7c8aa0;
}

.worldChatBody {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 850;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-word;
}

.worldPopupComposer {
  padding: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 249, 240, 0.86)
  );
}

.worldComposerWrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.worldChatInput {
  flex: 1;
  min-height: 48px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid rgba(126, 170, 255, 0.2);
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(246, 248, 255, 0.92)
  );
  color: #111827;
  font-size: 13px;
  font-weight: 850;
  outline: none;
  box-shadow:
    0 10px 18px rgba(17, 24, 39, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}

.worldChatInput::placeholder {
  color: #94a3b8;
  font-weight: 800;
}

.worldChatInput:focus {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow:
    0 10px 18px rgba(17, 24, 39, 0.05),
    0 0 0 4px rgba(99, 102, 241, 0.1);
}

.worldSendBtn {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.96),
    rgba(34, 211, 238, 0.86),
    rgba(255, 176, 0, 0.76)
  );
  box-shadow:
    0 14px 24px rgba(79, 70, 229, 0.18),
    0 0 18px rgba(34, 211, 238, 0.1);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.worldSendBtn:hover {
  transform: translateY(-1px);
}

.worldSendBtn:active {
  transform: scale(0.98);
}

.worldChatMessages::-webkit-scrollbar {
  width: 8px;
}

.worldChatMessages::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.24);
  border-radius: 999px;
}

@media (max-width: 720px) {
  .worldChatShell {
    left: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .worldPopupPanel {
    left: 10px;
    bottom: 84px;
    width: calc(100vw - 20px);
    height: min(62vh, 480px);
  }
}
/* ===== LÝ THUYẾT NỀN TẢNG ===== */
.app.appTheoryMode {
  max-width: 1560px;
}

.theoryShell {
  padding: 8px 0 30px;
}

.theoryHero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.theoryEyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 244, 223, 0.92)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 900;
  color: #5b6475;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.07);
}

.theoryTitle {
  margin: 12px 0 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 1000;
  color: #0f172a;
}

.theorySub {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #5f6b7a;
}

.theoryGrid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
  grid-template-areas:
    "sample practice"
    "steps solution";
  gap: 18px;
  align-items: start;
}

.theoryPaneSample {
  grid-area: sample;
}

.theoryPaneSteps {
  grid-area: steps;
}

.theoryPanePractice {
  grid-area: practice;
}

.theoryPaneSolution {
  grid-area: solution;
}

.theoryPane {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(247, 250, 255, 0.92)
  );
  box-shadow:
    0 24px 55px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.theoryPane::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, 0.45),
      transparent 28%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(255, 255, 255, 0.22),
      transparent 30%
    );
}

.theoryPaneHead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.theoryPaneHead.isSample {
  background: linear-gradient(135deg, #4a83ff, #2e67d3);
}

.theoryPaneHead.isSteps {
  background: linear-gradient(135deg, #36c0eb, #2387b8);
}

.theoryPaneHead.isPractice {
  background: linear-gradient(135deg, #38c59a, #249f80);
}

.theoryPaneHead.isSolution {
  background: linear-gradient(135deg, #22c38e, #2a9f65);
}

.theoryPaneIcon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  flex: 0 0 auto;
}

.theoryPaneLabel {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 1000;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.theoryPaneBody {
  position: relative;
  padding: 22px 22px 28px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.92),
      rgba(248, 250, 255, 0.96)
    ),
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.55),
      transparent 30%
    );
}

.theoryPaneBodyTop {
  min-height: 320px;
}

.theoryPaneBodyLong {
  min-height: 980px;
}

.theoryPaneBody .contentTextBlock {
  font-size: 17px !important;
  line-height: 1.68 !important;
  font-weight: 700;
  color: #1f2937 !important;
}

.theoryPaneBody .contentImage {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  background: #fff;
}

.theoryPaneBody .qImgWrap {
  margin-top: 0 !important;
}

.theoryPaneBody .imgError {
  font-size: 13px;
  font-weight: 800;
  color: #7c2d12;
  background: rgba(255, 244, 230, 0.9);
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
}

.theoryBottomNav {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}

.theoryArrowBtn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 999px;
  padding: 18px 26px;
  background: linear-gradient(135deg, #4f8dff, #57d2ff 55%, #78e1a7);
  color: #ffffff;
  font-size: 18px;
  font-weight: 1000;
  box-shadow:
    0 22px 44px rgba(59, 130, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.theoryArrowBtn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 26px 52px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: saturate(1.06);
}

.theoryArrowBtn:active {
  transform: scale(0.99);
}

.theoryArrowBtnIcon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 24px;
  animation: theoryArrowFloat 1.35s ease-in-out infinite;
}

.theoryArrowBtnText {
  line-height: 1;
}

@keyframes theoryArrowFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

@media (max-width: 1180px) {
  .app.appTheoryMode {
    max-width: 1120px;
  }

  .theoryGrid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sample"
      "steps"
      "practice"
      "solution";
  }

  .theoryPaneBodyTop {
    min-height: 260px;
  }

  .theoryPaneBodyLong {
    min-height: 620px;
  }

  .theoryPaneLabel {
    font-size: 20px;
  }

  .theoryTitle {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .theoryPaneHead {
    padding: 16px 16px;
  }

  .theoryPaneIcon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: 14px;
  }

  .theoryPaneLabel {
    font-size: 18px;
  }

  .theoryPaneBody {
    padding: 18px 16px 22px;
  }

  .theoryPaneBodyLong {
    min-height: 520px;
  }

  .theoryArrowBtn {
    width: 100%;
    justify-content: center;
  }
}
/* ===== NÚT LÝ THUYẾT TRONG PLAY ===== */
.playQuestionPanel {
  position: relative;
}

.playQuestionHead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.playQuestionHead .qTitle {
  margin: 0;
}

.theorySideBtn {
  position: absolute;
  left: -140px;
  top: 6px;
  width: 122px;
  min-height: 58px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(135deg, #67a6ff, #55d2e9);
  color: #ffffff;
  box-shadow:
    0 18px 34px rgba(59, 130, 246, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.theorySideBtn:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow:
    0 22px 42px rgba(59, 130, 246, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theorySideBtn:active {
  transform: scale(0.99);
}

.theorySideBtnIcon {
  font-size: 20px;
  line-height: 1;
}

.theorySideBtnText {
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
}

/* ===== NÚT BẮT ĐẦU / TIẾP TỤC Ở TRÊN GIAO DIỆN LÝ THUYẾT ===== */
.theoryHero {
  align-items: flex-start;
}

.theoryHeroMain {
  flex: 1 1 720px;
  min-width: 280px;
}

.theoryHeroAside {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.theoryTopStartBtn {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  min-width: 320px;
  min-height: 96px;
  padding: 18px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, #4f8dff, #58cfff 55%, #69ddb4);
  color: #ffffff;
  font-size: 20px;
  font-weight: 1000;
  box-shadow:
    0 22px 46px rgba(59, 130, 246, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.theoryTopStartBtn:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow:
    0 28px 52px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.theoryTopStartBtn:active {
  transform: scale(0.99);
}

.theoryTopStartIcon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 28px;
  animation: theoryArrowFloat 1.35s ease-in-out infinite;
}

.theoryTopStartText {
  line-height: 1;
}

/* nếu trước đó bạn vẫn còn thanh ở dưới thì ẩn đi */
.theoryBottomNav {
  display: none !important;
}

@media (max-width: 1380px) {
  .theorySideBtn {
    position: static;
    width: auto;
    min-width: 132px;
    min-height: 44px;
    flex-direction: row;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 18px;
  }
}

@media (max-width: 980px) {
  .theoryHeroAside {
    width: 100%;
    align-items: stretch;
  }

  .theoryTopStartBtn {
    width: 100%;
    min-width: 0;
  }
}
/* ===== THEORY LAYOUT TÙY BIẾN THEO TỪNG LÝ THUYẾT ===== */
.app.appTheoryMode {
  max-width: min(1680px, calc(100vw - 16px));
  padding-left: 8px;
  padding-right: 8px;
}

.theoryCols {
  display: grid;
  gap: 18px;
  align-items: start;
}

.theoryCols5050 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.theoryCols4060 {
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
}

.theoryCols3070 {
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
}

.theoryCols6040 {
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
}

.theoryCols7030 {
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.theoryCol {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.theoryPane {
  height: auto;
}

.theoryPaneBody {
  min-height: 0 !important;
  height: auto;
  padding: 22px 22px 28px;
}

.theoryPaneBodyTop,
.theoryPaneBodyLong {
  min-height: 0 !important;
  height: auto !important;
}

.theoryPaneBody .contentTextBlock:last-child,
.theoryPaneBody .qImgWrap:last-child,
.theoryPaneBody .imgError:last-child {
  margin-bottom: 0;
}

.theoryColLeft .theoryPaneSample,
.theoryColRight .theoryPanePractice {
  align-self: stretch;
}

.theoryColLeft .theoryPaneSteps,
.theoryColRight .theoryPaneSolution {
  align-self: stretch;
}

@media (max-width: 1180px) {
  .app.appTheoryMode {
    max-width: min(1200px, calc(100vw - 14px));
    padding-left: 7px;
    padding-right: 7px;
  }

  .theoryCols,
  .theoryCols5050,
  .theoryCols4060,
  .theoryCols3070,
  .theoryCols6040,
  .theoryCols7030 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app.appTheoryMode {
    max-width: calc(100vw - 10px);
    padding-left: 5px;
    padding-right: 5px;
  }

  .theoryCol {
    gap: 14px;
  }

  .theoryPaneBody {
    padding: 18px 16px 22px;
  }
}
/* ===== VIDEO TOOL BUTTON ===== */
.videoToolBtn {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.12)
  );
  color: #ffffff;
  border-radius: 999px;
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 1000;
  font-size: 13px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.videoToolBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
  filter: saturate(1.05);
}

.videoToolBtn:active {
  transform: scale(0.99);
}

.videoToolBtnTheory {
  margin-left: auto;
  flex: 0 0 auto;
}
.theoryPaneHead.isSolution {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theoryPaneHead.isSolution .theoryPaneHeadMain {
  flex: 1;
  min-width: 0;
}
.theoryPaneHeadMain {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.playVideoDock {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 0;
}

/* ===== VIDEO MODAL ===== */
.videoModalLayer {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.videoModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.54);
  backdrop-filter: blur(4px);
}

.videoModalCard {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1100px, calc(100vw - 32px));
  max-height: min(86vh, 880px);
  transform: translate(-50%, -50%);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.videoModalTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.95),
    rgba(255, 255, 255, 0.96)
  );
}

.videoModalTitle {
  font-size: 18px;
  font-weight: 1000;
  color: #111827;
}

.videoModalClose {
  border: 0;
  cursor: pointer;
  width: 42px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 1000;
  font-size: 18px;
}

.videoModalBody {
  padding: 16px;
  background: #0f172a;
}

.videoPlayer {
  width: 100%;
  height: auto;
  max-height: calc(86vh - 110px);
  border-radius: 18px;
  background: #000000;
  display: block;
}

body.videoModalOpen {
  overflow: hidden;
}

@media (max-width: 768px) {
  .playVideoDock {
    justify-content: flex-start;
  }

  .videoToolBtnTheory {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .videoModalCard {
    width: min(100vw - 14px, 980px);
    border-radius: 20px;
  }

  .videoModalBody {
    padding: 10px;
  }
}
/* ===== DAILY MISSIONS ===== */
#dailyMissionsRoot {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1450;
}

.dailyMissionWidget {
  position: relative;
}

.dailyMissionLauncher {
  position: relative;
  min-width: 146px;
  min-height: 54px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ffb347, #ff8c42);
  color: #fff;
  font-weight: 1000;
  font-size: 15px;
  box-shadow:
    0 18px 36px rgba(251, 146, 60, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.dailyMissionLauncher:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
  box-shadow:
    0 22px 42px rgba(251, 146, 60, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dailyMissionLauncher:active {
  transform: scale(0.99);
}

.dailyMissionLauncherIcon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.16);
}

.dailyMissionLauncherText {
  line-height: 1;
}

.dailyMissionLauncherBadge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.dailyMissionPanel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(560px, calc(100vw - 24px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 24px;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.16);
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.dailyMissionPanel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.dailyMissionPanelTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dailyMissionEyebrow {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
  margin-bottom: 4px;
}

.dailyMissionTitle {
  font-size: 20px;
  font-weight: 1000;
  color: #0f172a;
}

.dailyMissionReset {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.dailyMissionCloseBtn {
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 1000;
}

.dailyMissionHeadRow {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 110px 150px;
  gap: 12px;
  padding: 0 6px 10px;
  font-size: 12px;
  font-weight: 1000;
  color: #64748b;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dailyMissionList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
}

.dailyMissionItem {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 110px 150px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 1),
    rgba(255, 248, 235, 0.95)
  );
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.dailyMissionName {
  font-size: 15px;
  font-weight: 1000;
  color: #111827;
  line-height: 1.3;
}

.dailyMissionMeta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #475569;
}

.dailyMissionSubMeta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
}

.dailyMissionActionCol,
.dailyMissionRewardCol {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dailyMissionActionBtn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.22);
}

.dailyMissionActionPlaceholder {
  color: #94a3b8;
  font-weight: 900;
}

.dailyMissionRewardBtn {
  min-width: 120px;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 1000;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  cursor: default;
}

.dailyMissionRewardBtn.ready {
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.2);
}

.dailyMissionRewardBtn.claimed {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #fff;
}

.dailyMissionRewardBtn:disabled {
  opacity: 0.92;
}

@media (max-width: 720px) {
  #dailyMissionsRoot {
    right: 12px;
    bottom: 12px;
  }

  .dailyMissionPanel {
    width: min(96vw, 560px);
  }

  .dailyMissionHeadRow {
    display: none;
  }

  .dailyMissionItem {
    grid-template-columns: 1fr;
  }

  .dailyMissionActionCol,
  .dailyMissionRewardCol {
    justify-content: flex-start;
  }

  .dailyMissionLauncher {
    min-width: 132px;
  }
}
/* ===== GUILD / BANG HỘI ===== */
#guildRoot {
  position: fixed;
  right: 188px; /* đặt bên trái nút Nhiệm Vụ hiện tại của bạn */
  bottom: 20px;
  z-index: 1450;
}

.guildWidget {
  position: relative;
}

.guildLauncher {
  min-width: 152px;
  min-height: 58px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
  box-shadow:
    0 18px 38px rgba(99, 102, 241, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.guildLauncher:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
  box-shadow:
    0 24px 44px rgba(99, 102, 241, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.guildLauncher:active {
  transform: scale(0.99);
}

.guildLauncherIcon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
}

.guildLauncherText {
  line-height: 1;
}

.guildLayer {
  position: fixed;
  inset: 0;
  z-index: 1490;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.guildLayer.open {
  pointer-events: auto;
  opacity: 1;
}

.guildLayer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
}

.guildPanel {
  position: absolute;
  left: 50%;
  top: 74px;
  transform: translateX(-50%) translateY(10px) scale(0.98);
  width: min(1180px, calc(100vw - 24px));
  height: min(78vh, 780px);
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 247, 232, 0.98)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
}

.guildPanel.open {
  transform: translateX(-50%) translateY(0) scale(1);
}

.guildPanelTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.95),
    rgba(255, 255, 255, 0.95)
  );
}

.guildEyebrow {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
  margin-bottom: 4px;
}

.guildTitle {
  font-size: 24px;
  font-weight: 1000;
  color: #111827;
}

.guildCloseBtn {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 1000;
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
}

.guildTabs {
  display: flex;
  gap: 10px;
  padding: 14px 18px 0;
  flex-wrap: wrap;
}

.guildTabBtn {
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 1000;
  color: #334155;
  background: rgba(15, 23, 42, 0.06);
}

.guildTabBtn.active {
  background: linear-gradient(135deg, #f59e0b, #fb923c);
  color: #fff;
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.22);
}

.guildPanelBody {
  flex: 1;
  min-height: 0;
  padding: 16px 18px 18px;
  overflow: auto;
}

.guildLoading,
.guildEmpty,
.guildEmptyMini {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  color: #475569;
  font-weight: 800;
}

.guildBrowseLayout,
.guildMineLayout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

.guildBrowseLeft,
.guildBrowseRight,
.guildMineMembersCard,
.guildRightCard,
.guildRankingWrap,
.guildFormCard {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
}

.guildBrowseLeft,
.guildMineMembersCard,
.guildRankingWrap {
  padding: 14px;
}

.guildBrowseRight,
.guildRightCard,
.guildFormCard {
  padding: 16px;
}

.guildCardTitle,
.guildRightTitle,
.guildFormTitle {
  font-size: 18px;
  font-weight: 1000;
  color: #111827;
  margin-bottom: 12px;
}

.guildTableHead,
.guildTableItem,
.guildMembersHead,
.guildMembersRow,
.guildRankingHead,
.guildRankingRow {
  display: grid;
  gap: 10px;
  align-items: center;
}

.guildTableHead {
  grid-template-columns: 1.2fr 1.1fr 0.9fr 0.9fr;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff4d8, #fffaf0);
  border: 1px solid rgba(245, 158, 11, 0.14);
  font-size: 13px;
  font-weight: 1000;
  color: #7c5b17;
}

.guildTableBody,
.guildMembersBody,
.guildRankingBody {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.guildTableItem {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  grid-template-columns: 1.2fr 1.1fr 0.9fr 0.9fr;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.guildTableItem.selected {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(180deg, #eef2ff, #ffffff);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.12);
}

.guildBrowseBottom {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.guildSearchLabel,
.guildFormLabel {
  font-size: 13px;
  font-weight: 1000;
  color: #475569;
}

.guildSearchInput,
.guildFormInput,
.guildMottoInput {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  outline: none;
}

.guildMottoInput {
  min-height: 140px;
  resize: vertical;
}

.guildPrimaryBtn,
.guildSecondaryBtn,
.guildSmallActionBtn {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 1000;
  color: #fff;
}

.guildPrimaryBtn {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.18);
}

.guildPrimaryBtn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.guildSecondaryBtn {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 14px 28px rgba(71, 85, 105, 0.16);
}

.guildStatusLine,
.guildStatLine,
.guildRequestMeta {
  font-size: 13px;
  font-weight: 800;
  color: #475569;
}

.guildStatusLine {
  margin-top: 10px;
}

.guildMottoBox {
  min-height: 180px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  background: linear-gradient(180deg, #fffefb, #fff8ea);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 14px;
}

.guildMembersHead,
.guildMembersRow {
  grid-template-columns: 1.2fr 0.7fr 70px;
}

.guildMembersHead {
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff4d8, #fffaf0);
  border: 1px solid rgba(245, 158, 11, 0.14);
  font-size: 13px;
  font-weight: 1000;
  color: #7c5b17;
}

.guildMembersRow {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 900;
  color: #111827;
}

.guildOwnerBadge {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.guildMineSide {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guildCardActions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guildRequestItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.guildRequestName {
  font-size: 14px;
  font-weight: 1000;
  color: #111827;
}

.guildRequestActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guildSmallActionBtn {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

.guildSmallActionBtn.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.guildMiniDangerBtn {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  font-weight: 1000;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.guildFormCard {
  max-width: 520px;
}

.guildFormField {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guildFormActions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guildRankingHead,
.guildRankingRow {
  grid-template-columns: 90px 1.3fr 150px;
}

.guildRankingHead {
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff4d8, #fffaf0);
  border: 1px solid rgba(245, 158, 11, 0.14);
  font-size: 13px;
  font-weight: 1000;
  color: #7c5b17;
}

.guildRankingRow {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 900;
  color: #111827;
}

@media (max-width: 980px) {
  #guildRoot {
    right: 12px;
    bottom: 82px;
  }

  .guildPanel {
    width: calc(100vw - 20px);
    height: min(82vh, 840px);
  }

  .guildBrowseLayout,
  .guildMineLayout {
    grid-template-columns: 1fr;
  }

  .guildBrowseBottom {
    grid-template-columns: 1fr;
  }
}
/* ===== PLAYER LEADERBOARD ===== */
#playerLeaderboardRoot {
  position: fixed;
  right: 12px;
  top: 86px;
  z-index: 1450;
}

.playerRankWidget {
  position: relative;
}

.playerRankLauncher {
  width: 72px;
  min-height: 168px;
  border: 0;
  border-radius: 24px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  box-shadow:
    0 18px 38px rgba(249, 115, 22, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.playerRankLauncher:hover {
  transform: translateY(-2px);
  filter: saturate(1.04);
  box-shadow:
    0 24px 44px rgba(249, 115, 22, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.playerRankLauncher:active {
  transform: scale(0.99);
}

.playerRankLauncherIcon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 20px;
}

.playerRankLauncherText {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
  font-size: 14px;
  font-weight: 1000;
}

.playerRankLayer {
  position: fixed;
  inset: 0;
  z-index: 1490;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.playerRankLayer.open {
  opacity: 1;
  pointer-events: auto;
}

.playerRankLayer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(2px);
}

.playerRankPanel {
  position: absolute;
  right: 96px;
  top: 86px;
  width: min(460px, calc(100vw - 120px));
  max-height: min(74vh, 760px);
  border-radius: 26px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 248, 235, 0.98)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
}

.playerRankPanel.open {
  transform: translateY(0) scale(1);
}

.playerRankPanelTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 250, 230, 0.95),
    rgba(255, 255, 255, 0.95)
  );
}

.playerRankEyebrow {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
  margin-bottom: 4px;
}

.playerRankTitle {
  font-size: 22px;
  font-weight: 1000;
  color: #111827;
}

.playerRankTopActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.playerRankRefreshBtn,
.playerRankCloseBtn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 1000;
}

.playerRankRefreshBtn {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.playerRankCloseBtn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
}

.playerRankPanelBody {
  padding: 16px;
  overflow: auto;
}

.playerRankCard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.playerRankHeadRow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 90px;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff4d8, #fffaf0);
  border: 1px solid rgba(245, 158, 11, 0.14);
  font-size: 13px;
  font-weight: 1000;
  color: #7c5b17;
}

.playerRankList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.playerRankRow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 90px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fff9ef);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 900;
  color: #111827;
}

.playerRankRow.mine {
  border-color: rgba(59, 130, 246, 0.28);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.1);
}

.playerRankName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playerRankFooter {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.playerRankFooterBox {
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fffaf0);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.06);
}

.playerRankFooterLabel {
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
}

.playerRankFooterValue {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 1000;
  color: #111827;
}

.playerRankLoading,
.playerRankEmpty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  color: #475569;
  font-weight: 800;
}

@media (max-width: 980px) {
  #playerLeaderboardRoot {
    top: auto;
    bottom: 92px;
    right: 12px;
  }

  .playerRankPanel {
    right: 12px;
    top: 72px;
    width: calc(100vw - 24px);
    max-height: min(78vh, 760px);
  }

  .playerRankLauncher {
    width: 64px;
    min-height: 148px;
  }
}
/* ===== PROGRESS ===== */
#topServerProgress {
  display: flex;
  align-items: center;
}

.progressWidget {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 108px;
  max-width: 100%;
}

.progressWidget.isTop {
  width: 150px;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 235, 0.96)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

.progressWidget.isHeader {
  width: 190px;
  min-width: 190px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 235, 0.96)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

.progressWidget.isCard {
  width: 106px;
  min-width: 106px;
  align-self: flex-start;
}

.progressWidget.isMapCard {
  width: 104px;
  min-width: 104px;
}

.progressLabel {
  font-size: 11px;
  font-weight: 1000;
  color: #6b7280;
  line-height: 1.15;
}

.progressTrack {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.progressFill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #3b82f6, #06b6d4);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.22);
}

.progressPercent {
  font-size: 13px;
  font-weight: 1000;
  color: #111827;
  line-height: 1;
}

.menuCardTop,
.mapCardHeadRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sectionHeadAside {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0;
}

@media (max-width: 1180px) {
  #topServerProgress {
    order: -1;
    width: 100%;
  }

  .progressWidget.isTop {
    width: min(280px, 100%);
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .progressWidget.isHeader {
    width: min(240px, 100%);
    min-width: 0;
  }

  .progressWidget.isCard,
  .progressWidget.isMapCard {
    width: 98px;
    min-width: 98px;
  }

  .sectionHeadAside {
    width: 100%;
    justify-content: flex-start;
  }
}
/* ===== XP BURST WHEN ANSWER CORRECT ===== */
.playQuestionPanel {
  position: relative;
  overflow: visible;
}

.xpBurstDock {
  position: absolute;
  left: -146px;
  top: 18px;
  width: 126px;
  pointer-events: none;
  z-index: 6;
  display: flex;
  justify-content: flex-end;
}

.xpBurstBadge {
  min-width: 118px;
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #22c55e, #14b8a6, #3b82f6);
  color: #fff;
  box-shadow:
    0 18px 40px rgba(34, 197, 94, 0.22),
    0 10px 22px rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 1000;
  font-size: 24px;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(24px) scale(0.82);
  filter: blur(1px);
}

.xpBurstBadge.show {
  animation: xpBurstPop 2.8s ease forwards;
}

.xpBurstSpark {
  font-size: 18px;
  line-height: 1;
}

.xpBurstText {
  line-height: 1;
  white-space: nowrap;
}

@keyframes xpBurstPop {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.78);
    filter: blur(2px);
  }

  12% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
    filter: blur(0);
  }

  24% {
    opacity: 1;
    transform: translateY(-6px) scale(1);
    filter: blur(0);
  }

  78% {
    opacity: 1;
    transform: translateY(-12px) scale(1);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-26px) scale(0.92);
    filter: blur(1px);
  }
}

@media (max-width: 1200px) {
  .xpBurstDock {
    left: -132px;
    width: 116px;
  }

  .xpBurstBadge {
    min-width: 108px;
    padding: 11px 12px;
    font-size: 22px;
  }
}

@media (max-width: 980px) {
  .xpBurstDock {
    left: 10px;
    top: -58px;
    width: auto;
    justify-content: flex-start;
  }

  .xpBurstBadge {
    min-width: 104px;
    font-size: 20px;
  }
}
/* ===== PLAY ENTRY SWORD CLASH ===== */
.playEntryOverlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
  display: grid;
  place-items: center;
  animation: playEntryOverlayFade 2.55s ease forwards;
}

.playEntryStage {
  position: relative;
  width: min(560px, 82vw);
  height: min(420px, 58vh);
  display: grid;
  place-items: center;
}

.playEntryAura {
  position: absolute;
  inset: 10% 18%;
  border-radius: 999px;
  background:
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.36),
      rgba(255, 255, 255, 0) 58%
    ),
    radial-gradient(
      circle at center,
      rgba(59, 130, 246, 0.18),
      rgba(59, 130, 246, 0) 72%
    );
  filter: blur(16px);
  transform: scale(0.92);
  opacity: 0;
  animation: playEntryAuraPulse 2.55s ease forwards;
}

.playEntryShockwave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -36px;
  border-radius: 999px;
  border: 2px solid rgba(255, 244, 214, 0.84);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.04),
    0 0 28px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: scale(0.15);
  animation: playEntryShockwave 2.55s ease forwards;
}

.playEntryFlash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  margin-top: -60px;
  border-radius: 999px;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 220, 0.55) 36%,
    rgba(255, 255, 255, 0) 72%
  );
  opacity: 0;
  filter: blur(4px);
  transform: scale(0.3);
  animation: playEntryFlash 2.55s ease forwards;
}

.playEntrySword {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 390px;
  margin-left: -95px;
  margin-top: -195px;
  transform-origin: 50% 78%;
  will-change: transform, filter, opacity;
}

.playEntrySwordSvg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 18px rgba(17, 24, 39, 0.18))
    drop-shadow(0 0 18px rgba(191, 219, 254, 0.12));
}

.playEntrySwordLeft {
  animation: playEntrySwordLeft 2.55s cubic-bezier(0.2, 0.84, 0.22, 1) forwards;
}

.playEntrySwordRight {
  animation: playEntrySwordRight 2.55s cubic-bezier(0.2, 0.84, 0.22, 1) forwards;
}

.swordBladeEdge {
  fill: #cfd9e6;
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 2;
}

.swordBladeCore {
  fill: #f6fbff;
  stroke: #d6e5f2;
  stroke-width: 1.5;
}

.swordFuller {
  fill: rgba(159, 183, 205, 0.72);
}

.swordGuardMetal {
  fill: #d8b587;
  stroke: #fff2cf;
  stroke-width: 1.2;
}

.swordGrip {
  fill: #7f4b2d;
  stroke: #d8a26c;
  stroke-width: 1.3;
}

.swordGripLine {
  fill: rgba(232, 188, 133, 0.8);
}

.swordPommel {
  fill: #d9af78;
  stroke: #fff0c9;
  stroke-width: 1.3;
}

.swordPommelCore {
  fill: rgba(255, 255, 255, 0.72);
}

@keyframes playEntrySwordLeft {
  0%,
  23.5% {
    opacity: 0.98;
    transform: translate(-242px, 78px) rotate(4deg) scale(0.94);
    filter: brightness(0.98);
  }

  37.2% {
    opacity: 1;
    transform: translate(-72px, 18px) rotate(41.5deg) scale(1.025);
    filter: brightness(1.08);
  }

  54.9%,
  94% {
    opacity: 1;
    transform: translate(-76px, 22px) rotate(37.5deg) scale(1);
    filter: brightness(1);
  }

  100% {
    opacity: 0;
    transform: translate(-76px, 22px) rotate(37.5deg) scale(1);
  }
}

@keyframes playEntrySwordRight {
  0%,
  23.5% {
    opacity: 0.98;
    transform: translate(242px, 78px) rotate(-4deg) scale(0.94);
    filter: brightness(0.98);
  }

  37.2% {
    opacity: 1;
    transform: translate(72px, 18px) rotate(-41.5deg) scale(1.025);
    filter: brightness(1.08);
  }

  54.9%,
  94% {
    opacity: 1;
    transform: translate(76px, 22px) rotate(-37.5deg) scale(1);
    filter: brightness(1);
  }

  100% {
    opacity: 0;
    transform: translate(76px, 22px) rotate(-37.5deg) scale(1);
  }
}

@keyframes playEntryShockwave {
  0%,
  34% {
    opacity: 0;
    transform: scale(0.1);
  }

  38% {
    opacity: 0.7;
    transform: scale(0.55);
  }

  48% {
    opacity: 0.35;
    transform: scale(1.5);
  }

  55%,
  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes playEntryFlash {
  0%,
  35% {
    opacity: 0;
    transform: scale(0.25);
  }

  38% {
    opacity: 1;
    transform: scale(0.92);
  }

  45% {
    opacity: 0.5;
    transform: scale(1.08);
  }

  55%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

@keyframes playEntryAuraPulse {
  0%,
  24% {
    opacity: 0;
    transform: scale(0.88);
  }

  38% {
    opacity: 0.95;
    transform: scale(1.02);
  }

  55%,
  92% {
    opacity: 0.5;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes playEntryOverlayFade {
  0%,
  92% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .playEntryStage {
    width: min(470px, 92vw);
    height: min(360px, 48vh);
  }

  .playEntrySword {
    width: 156px;
    height: 320px;
    margin-left: -78px;
    margin-top: -160px;
  }

  @keyframes playEntrySwordLeft {
    0%,
    23.5% {
      opacity: 0.98;
      transform: translate(-198px, 62px) rotate(4deg) scale(0.94);
      filter: brightness(0.98);
    }

    37.2% {
      opacity: 1;
      transform: translate(-58px, 16px) rotate(41deg) scale(1.02);
      filter: brightness(1.08);
    }

    54.9%,
    94% {
      opacity: 1;
      transform: translate(-61px, 18px) rotate(37deg) scale(1);
      filter: brightness(1);
    }

    100% {
      opacity: 0;
      transform: translate(-61px, 18px) rotate(37deg) scale(1);
    }
  }

  @keyframes playEntrySwordRight {
    0%,
    23.5% {
      opacity: 0.98;
      transform: translate(198px, 62px) rotate(-4deg) scale(0.94);
      filter: brightness(0.98);
    }

    37.2% {
      opacity: 1;
      transform: translate(58px, 16px) rotate(-41deg) scale(1.02);
      filter: brightness(1.08);
    }

    54.9%,
    94% {
      opacity: 1;
      transform: translate(61px, 18px) rotate(-37deg) scale(1);
      filter: brightness(1);
    }

    100% {
      opacity: 0;
      transform: translate(61px, 18px) rotate(-37deg) scale(1);
    }
  }
}
/* ===== RESULT CELEBRATION: YOU WIN ===== */
.winCelebrateOverlay {
  position: fixed;
  inset: 0;
  z-index: 1450;
  pointer-events: none;
  overflow: hidden;
  animation: winOverlayHide 2.5s linear forwards;
}

.winCelebrateDim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(1.5px);
  animation: winDimPulse 2.5s ease forwards;
}

.winCelebrateLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.winCelebrateCenter {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: grid;
  place-items: center;
}

.winCelebrateGlow {
  position: absolute;
  width: min(560px, 72vw);
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(
    circle at center,
    rgba(255, 240, 160, 0.95),
    rgba(255, 240, 160, 0.22) 38%,
    rgba(255, 255, 255, 0) 72%
  );
  filter: blur(18px);
  opacity: 0;
  animation: winGlowPulse 2.5s ease forwards;
}

.winCelebrateText {
  position: relative;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0.05em;
  color: #fff4aa;
  -webkit-text-stroke: 2px rgba(135, 77, 9, 0.72);
  text-shadow:
    0 1px 0 #fff9d1,
    0 3px 0 #f2c94c,
    0 7px 18px rgba(255, 196, 0, 0.4),
    0 0 18px rgba(255, 236, 150, 0.72),
    0 0 34px rgba(255, 196, 0, 0.45);
  opacity: 0;
  transform: scale(0.72) translateY(18px);
  animation: winTextPop 2.5s cubic-bezier(0.2, 0.84, 0.22, 1) forwards;
}

.winCelebrateConfetti {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.winConfetti {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: max(5px, calc(var(--size) * 0.34));
  height: var(--size);
  border-radius: 999px;
  background: var(--color);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translate3d(0, -8px, 0) rotate(var(--rot)) scale(0.25);
  animation: winConfettiDrop var(--dur) cubic-bezier(0.18, 0.84, 0.24, 1)
    forwards;
  animation-delay: var(--delay);
}

.winConfetti:nth-child(4n) {
  border-radius: 2px;
}
.winConfetti:nth-child(5n) {
  width: max(7px, calc(var(--size) * 0.56));
  height: max(4px, calc(var(--size) * 0.24));
}
.winConfetti:nth-child(7n) {
  border-radius: 40% 60% 52% 48%;
}

.winCelebrateSparkles {
  position: absolute;
  inset: 0;
  z-index: 7;
}

.winSparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  opacity: 0;
  animation: winSparkleTwinkle 1.2s ease-out forwards;
  animation-delay: var(--delay);
}

.winSparkle::before,
.winSparkle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0)
  );
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.winSparkle::before {
  width: 3px;
  height: 18px;
}

.winSparkle::after {
  width: 18px;
  height: 3px;
}

.winFirework {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  margin-left: calc(var(--size) / -2);
  margin-top: calc(var(--size) / -2);
  z-index: 4;
  opacity: 0;
  animation: winFireworkWrap 1.3s ease-out forwards;
  animation-delay: var(--delay);
}

.winFirework span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: calc(var(--size) * 0.34);
  margin-left: -3px;
  margin-top: calc(var(--size) * -0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--c));
  transform-origin: 50% 100%;
  transform: rotate(calc(var(--i) * 25.714deg)) scaleY(0.12);
  opacity: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.22);
  animation: winFireworkRay 1.1s ease-out forwards;
  animation-delay: var(--delay);
}

.winPopper {
  position: absolute;
  bottom: 54px;
  width: 124px;
  height: 108px;
  z-index: 4;
  opacity: 0;
  animation: winPopperShow 2.5s ease forwards;
}

.winPopper.left {
  left: 18px;
  transform: rotate(-18deg);
}

.winPopper.right {
  right: 18px;
  transform: scaleX(-1) rotate(-18deg);
}

.winPopperCone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 102px;
  height: 62px;
  clip-path: polygon(0 0, 86% 18%, 86% 82%, 0 100%);
  border-radius: 20px 10px 10px 20px;
  background: repeating-linear-gradient(
    135deg,
    #4cc9f0 0 14px,
    #ffd166 14px 28px,
    #7b2cbf 28px 42px
  );
  border: 2px solid rgba(129, 64, 10, 0.22);
  box-shadow: 0 18px 24px rgba(17, 24, 39, 0.12);
}

.winPopperMouth {
  position: absolute;
  right: 10px;
  top: 31px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 35%,
    #ffdba3,
    #b85d16 64%,
    #6a3415 100%
  );
  box-shadow: 0 0 14px rgba(255, 180, 0, 0.22);
}

.winPopperBurst {
  position: absolute;
  right: 14px;
  top: 4px;
  width: 120px;
  height: 84px;
}

.winPopperRibbon {
  position: absolute;
  left: 6px;
  top: 52px;
  width: 58px;
  height: 7px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.14);
  transform-origin: 0 50%;
  transform: rotate(calc(var(--i) * 15deg - 52deg)) scaleX(0.08);
  opacity: 0;
  animation: winRibbonBurst 0.72s ease-out forwards;
  animation-delay: var(--delay);
}

/* keyframes */
@keyframes winOverlayHide {
  0%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes winDimPulse {
  0% {
    opacity: 0;
  }
  10%,
  86% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes winTextPop {
  0% {
    opacity: 0;
    transform: scale(0.72) translateY(18px);
  }
  18% {
    opacity: 1;
    transform: scale(1.1) translateY(-4px);
  }
  28% {
    opacity: 1;
    transform: scale(0.98) translateY(0);
  }
  78% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

@keyframes winGlowPulse {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  16% {
    opacity: 1;
    transform: scale(1.02);
  }
  72% {
    opacity: 0.92;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes winPopperShow {
  0%,
  8% {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }
  18%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

@keyframes winRibbonBurst {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 15deg - 52deg)) scaleX(0.08);
  }
  24% {
    opacity: 1;
    transform: rotate(calc(var(--i) * 15deg - 52deg)) scaleX(1.18);
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 15deg - 52deg)) translateX(48px) scaleX(1);
  }
}

@keyframes winFireworkWrap {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  18% {
    opacity: 1;
    transform: scale(1.04);
  }
  60% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes winFireworkRay {
  0% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 25.714deg)) scaleY(0.12);
  }
  22% {
    opacity: 1;
    transform: rotate(calc(var(--i) * 25.714deg)) scaleY(1.08);
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--i) * 25.714deg)) scaleY(0.88);
  }
}

@keyframes winConfettiDrop {
  0% {
    opacity: 0;
    transform: translate3d(0, -8px, 0) rotate(var(--rot)) scale(0.25);
  }
  10% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 320px, 0)
      rotate(calc(var(--rot) + 230deg)) scale(1);
  }
}

@keyframes winSparkleTwinkle {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.08) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.7) rotate(80deg);
  }
}

@media (max-width: 980px) {
  .winCelebrateText {
    font-size: clamp(34px, 9vw, 64px);
  }

  .winPopper {
    width: 102px;
    height: 90px;
    bottom: 36px;
  }

  .winPopper.left {
    left: 10px;
  }

  .winPopper.right {
    right: 10px;
  }

  .winPopperCone {
    width: 84px;
    height: 52px;
  }

  .winPopperBurst {
    width: 96px;
    height: 72px;
  }

  .winPopperRibbon {
    width: 46px;
  }
}
/* ===== NÚT CHƠI TIẾP SAU KHI THẮNG LEVEL ===== */
.resultContinueFloat {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1250;
  width: 214px;
  min-height: 92px;
  border: 0;
  border-radius: 28px;
  padding: 14px 16px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  box-shadow:
    0 22px 48px rgba(59, 130, 246, 0.2),
    0 10px 22px rgba(168, 85, 247, 0.18);
  background: linear-gradient(
    120deg,
    #ff6b6b,
    #f59e0b,
    #22c55e,
    #06b6d4,
    #3b82f6,
    #8b5cf6,
    #ec4899
  );
  background-size: 240% 240%;
  animation:
    resultContinueRainbowShift 5s linear infinite,
    resultContinueFloatBob 2.4s ease-in-out infinite;
}

.resultContinueFloat::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -2;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.46),
    rgba(255, 255, 255, 0.08)
  );
}

.resultContinueFloat::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 27px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.02)
  );
  backdrop-filter: blur(8px);
}

.resultContinueFloatGlow {
  position: absolute;
  inset: -30% -10%;
  z-index: -1;
  background:
    radial-gradient(
      circle at 20% 30%,
      rgba(255, 255, 255, 0.48),
      rgba(255, 255, 255, 0) 30%
    ),
    radial-gradient(
      circle at 80% 50%,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0) 35%
    );
  opacity: 0.85;
  animation: resultContinueGlowMove 3s ease-in-out infinite;
}

.resultContinueFloatIcon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 1000;
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 20px rgba(17, 24, 39, 0.14);
}

.resultContinueFloatTextWrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
}

.resultContinueFloatEyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.92;
}

.resultContinueFloatText {
  font-size: 28px;
  line-height: 1;
  font-weight: 1000;
  letter-spacing: 0.02em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(17, 24, 39, 0.16);
}

.resultContinueFloatSub {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.95;
}

.resultContinueFloat:hover {
  transform: translateY(calc(-50% - 2px)) scale(1.02);
  box-shadow:
    0 28px 56px rgba(59, 130, 246, 0.24),
    0 16px 30px rgba(168, 85, 247, 0.2);
}

.resultContinueFloat:active {
  transform: translateY(-50%) scale(0.985);
}

@keyframes resultContinueRainbowShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes resultContinueGlowMove {
  0%,
  100% {
    transform: translateX(-4%) translateY(0);
  }
  50% {
    transform: translateX(4%) translateY(-2%);
  }
}

@keyframes resultContinueFloatBob {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -6px;
  }
}

@media (max-width: 1280px) {
  .resultContinueFloat {
    right: 14px;
    width: 196px;
  }

  .resultContinueFloatText {
    font-size: 24px;
  }
}

@media (max-width: 980px) {
  .resultContinueFloat {
    top: auto;
    bottom: 18px;
    right: 16px;
    transform: none;
    width: min(220px, calc(100vw - 32px));
  }

  .resultContinueFloat:hover {
    transform: translateY(-2px) scale(1.02);
  }

  .resultContinueFloat:active {
    transform: scale(0.985);
  }
}
/* ===== FIX ĐÁP ÁN NHẬN LATEX ĐẸP ===== */
.answers .ansBtn,
#msqAnswers .ansBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 12px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.ansChoiceInner {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  text-align: center;
}

.ansChoicePrefix {
  font-weight: 1000;
  flex: 0 0 auto;
}

.ansChoiceMath {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.answers .ansBtn mjx-container,
#msqAnswers .ansBtn mjx-container {
  margin: 0 !important;
  max-width: 100%;
}

.answers .ansBtn .MathJax,
#msqAnswers .ansBtn .MathJax {
  display: inline-block !important;
}
.guildPanel.open {
  width: min(1320px, calc(100vw - 64px));
  height: min(780px, calc(100vh - 64px));
}

.guildPanelBody {
  min-height: 0;
}

.guildDiscordShell {
  height: 100%;
  min-height: 560px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 230px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: #f8fafc;
}

.guildDiscordSidebar {
  background: #111827;
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.guildDiscordServerTop {
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guildDiscordServerName {
  width: 100%;
  border: 0;
  color: #ffffff;
  background: transparent;
  font-weight: 950;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.guildDiscordSection {
  padding: 10px 8px 4px;
}

.guildDiscordSectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.guildDiscordSectionHead button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
}

.guildDiscordPlus {
  font-size: 18px;
  color: #d1d5db !important;
}

.guildDiscordChannel {
  width: 100%;
  border: 0;
  border-radius: 10px;
  margin-top: 4px;
  padding: 8px 10px;
  background: transparent;
  color: #d1d5db;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  font-weight: 850;
}

.guildDiscordChannel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.guildDiscordChannel.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.guildDiscordChannelIcon {
  width: 18px;
  text-align: center;
  color: #9ca3af;
}

.guildDiscordEmptyChannel {
  color: #6b7280;
  font-size: 12px;
  padding: 8px 10px;
}

.guildDiscordMain {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.guildDiscordChatTop {
  height: 54px;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
}

.guildDiscordChatTitle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 16px;
  color: #111827;
}

.guildDiscordTools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guildDiscordToolBtn,
.guildDiscordInfoBtn {
  border: 0;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.06);
  color: #374151;
  height: 34px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 900;
}

.guildDiscordToolBtn.active {
  background: rgba(255, 176, 0, 0.22);
  color: #92400e;
}

.guildDiscordInfoBtn {
  background: linear-gradient(180deg, #ffb000, #ff8a00);
  color: #ffffff;
}

.guildDiscordMessages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 12px;
  background: #ffffff;
}

.guildDiscordWelcome {
  text-align: center;
  margin: 80px auto 36px;
  color: #111827;
}

.guildDiscordWelcomeTitle {
  font-size: 30px;
  font-weight: 1000;
  line-height: 1.25;
}

.guildDiscordWelcomeSub {
  margin-top: 8px;
  color: #6b7280;
  font-weight: 800;
}

.guildDiscordDateLine {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  margin: 16px 0 10px;
}

.guildDiscordDateLine::before,
.guildDiscordDateLine::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(17, 24, 39, 0.1);
}

.guildDiscordMessage {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
}

.guildDiscordMessage:hover {
  background: rgba(17, 24, 39, 0.04);
}

.guildDiscordAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #ffffff;
  font-weight: 1000;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.15);
}

.guildDiscordMessageHead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.guildDiscordAuthor {
  font-weight: 1000;
  color: #111827;
}

.guildDiscordTime {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.guildDiscordPinned {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 950;
}

.guildDiscordText {
  margin-top: 2px;
  color: #334155;
  font-weight: 700;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.guildDiscordPinBtn {
  align-self: start;
  border: 0;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.06);
  cursor: pointer;
  padding: 6px 8px;
}

.guildDiscordComposer {
  flex: 0 0 auto;
  margin: 0 14px 14px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid rgba(17, 24, 39, 0.08);
  padding: 8px;
}

.guildDiscordAddBtn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.08);
  cursor: pointer;
  font-weight: 1000;
  color: #475569;
}

.guildDiscordInput {
  width: 100%;
  min-height: 34px;
  max-height: 120px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-weight: 800;
  font-family: inherit;
  padding: 8px 4px;
}

.guildDiscordMembers {
  background: #f8fafc;
  border-left: 1px solid rgba(17, 24, 39, 0.1);
  padding: 14px 10px;
  overflow-y: auto;
  min-height: 0;
}

.guildDiscordMemberGroup {
  margin-bottom: 18px;
}

.guildDiscordMemberGroupTitle {
  color: #64748b;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 1000;
  margin: 0 6px 8px;
}

.guildDiscordMember {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 6px;
  border-radius: 12px;
}

.guildDiscordMember.offline {
  opacity: 0.45;
}

.guildDiscordMemberAvatarWrap {
  position: relative;
}

.guildDiscordMemberAvatarWrap .guildDiscordAvatar {
  width: 34px;
  height: 34px;
}

.guildDiscordMemberDot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid #f8fafc;
}

.guildDiscordMemberDot.online {
  background: #22c55e;
}

.guildDiscordMemberDot.offline {
  background: #94a3b8;
}

.guildDiscordMemberName {
  color: #111827;
  font-weight: 1000;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guildDiscordMemberRole {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.guildDiscordCrown {
  margin-left: 4px;
}

.guildDiscordNoMember {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  padding: 6px;
}

.guildDiscordVoiceRoom {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 30px;
}

.guildDiscordVoiceIcon {
  font-size: 46px;
}

.guildDiscordVoiceTitle {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 1000;
  color: #111827;
}

.guildDiscordVoiceSub {
  max-width: 520px;
  margin-top: 8px;
  color: #64748b;
  font-weight: 800;
  line-height: 1.5;
}

.guildCommunityBackBar {
  margin-bottom: 12px;
}
/* Modal tạo kênh Bang Hội */
.guildChannelModalBackdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.guildChannelModal {
  width: min(430px, calc(100vw - 50px));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
  padding: 22px;
}

.guildChannelModalTitle {
  font-size: 22px;
  font-weight: 1000;
  color: #111827;
}

.guildChannelModalHint {
  margin-top: 4px;
  margin-bottom: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.guildChannelTypePicker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guildChannelTypeBtn {
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  padding: 12px 10px;
  font-weight: 1000;
}

.guildChannelTypeBtn.active {
  color: #ffffff;
  border-color: rgba(255, 138, 0, 0.8);
  background: linear-gradient(180deg, #ffb000, #ff8a00);
  box-shadow: 0 12px 28px rgba(255, 138, 0, 0.22);
}

.guildChannelModalActions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Làm khu vực chat rộng và gọn hơn */
.guildPanel.open {
  width: min(1480px, calc(100vw - 44px));
  height: min(820px, calc(100vh - 44px));
}

.guildDiscordShell {
  grid-template-columns: 240px minmax(620px, 1fr) 220px;
}

.guildDiscordMessages {
  padding-left: 24px;
  padding-right: 24px;
}

/* Ô nhập tin nhắn nổi rõ hơn */
.guildDiscordComposer {
  margin: 0 18px 18px;
  border-radius: 18px;
  background: #eef2f7;
  border: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.guildDiscordInput::placeholder {
  color: #64748b;
  font-weight: 900;
}

/* Nút ghim: bình thường ẩn, rê chuột vào tin nhắn mới hiện */
.guildDiscordPinBtn {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease;
}

.guildDiscordMessage:hover .guildDiscordPinBtn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.guildDiscordPinBtn:hover {
  background: rgba(255, 176, 0, 0.2);
}
/* =========================================================
   FIX TỶ LỆ GIAO DIỆN BANG HỘI
   Mục tiêu:
   - Bang Hội phủ gần toàn bộ màn hình
   - Không còn khoảng trống lớn phía trên
   - Không cần cuộn cả khung Bang Hội để thấy ô chat
   - Chỉ khu vực tin nhắn được cuộn khi có quá nhiều tin
========================================================= */

.guildLayer {
  z-index: 9999 !important;
}

.guildPanel {
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 8px !important;

  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;

  transform: none !important;
  border-radius: 20px !important;

  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.guildPanel.open {
  transform: none !important;
}

.guildPanelTop {
  flex: 0 0 auto !important;
  padding: 10px 14px 8px !important;
}

.guildEyebrow {
  margin-bottom: 2px !important;
}

.guildTitle {
  font-size: 22px !important;
  line-height: 1.05 !important;
}

.guildCloseBtn {
  width: 36px !important;
  height: 36px !important;
}

.guildTabs {
  flex: 0 0 auto !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.guildTabBtn {
  padding: 9px 14px !important;
}

.guildPanelBody {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
}

.guildPanelBody > * {
  min-height: 0 !important;
}

/* Khung Discord Bang Hội chiếm hết phần thân còn lại */
.guildDiscordShell {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;

  border-radius: 0 0 20px 20px !important;
  overflow: hidden !important;

  display: grid !important;
  grid-template-columns: 240px minmax(0, 1fr) 230px !important;
}

/* Cột trái */
.guildDiscordSidebar {
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Vùng chat giữa */
.guildDiscordMain {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;

  display: flex !important;
  flex-direction: column !important;
}

.guildDiscordChatTop {
  flex: 0 0 50px !important;
  height: 50px !important;
  min-height: 50px !important;
}

/* Chỉ vùng tin nhắn được cuộn */
.guildDiscordMessages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;

  padding: 16px 22px 10px !important;
}

/* Ô nhập chat luôn nằm dưới cùng, không bị trôi mất */
.guildDiscordComposer {
  flex: 0 0 auto !important;
  margin: 0 14px 14px !important;
}

/* Cột thành viên bên phải */
.guildDiscordMembers {
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Phòng thoại cũng không làm vỡ chiều cao */
.guildDiscordVoiceRoom {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Các tab cũ như thông tin bang, vào bang, xếp hạng vẫn dùng được */
.guildBrowseLayout,
.guildMineLayout,
.guildRankingWrap,
.guildCreateWrap {
  width: 100% !important;
  min-height: 0 !important;
}

/* Nếu màn hình hẹp thì ẩn cột thành viên để không bị chật */
@media (max-width: 980px) {
  .guildPanel {
    top: 4px !important;
    left: 4px !important;
    right: 4px !important;
    bottom: 4px !important;
    border-radius: 14px !important;
  }

  .guildDiscordShell {
    grid-template-columns: 210px minmax(0, 1fr) !important;
  }

  .guildDiscordMembers {
    display: none !important;
  }
}
/* =========================================================
   FIX CHAT BANG HỘI:
   - Tin nhắn của mình nằm bên phải
   - Tin nhắn người khác nằm bên trái
   - Không giật xuống khi đang xem tin cũ
   - Thông tin Bang Hội có cuộn chuột
========================================================= */

/* Tin nhắn người khác: bên trái */
.guildDiscordMessage.other {
  grid-template-columns: 42px minmax(0, 1fr) auto !important;
  justify-items: start !important;
}

.guildDiscordMessage.other .guildDiscordMessageMain {
  max-width: min(720px, 78%) !important;
  background: transparent !important;
  border-radius: 16px !important;
}

/* Tin nhắn của mình: bên phải */
.guildDiscordMessage.mine {
  grid-template-columns: minmax(0, 1fr) auto !important;
  justify-items: end !important;
  padding-left: 22% !important;
}

.guildDiscordMessage.mine .guildDiscordAvatar {
  display: none !important;
}

.guildDiscordMessage.mine .guildDiscordMessageMain {
  justify-self: end !important;
  max-width: min(720px, 100%) !important;
  padding: 10px 14px !important;
  border-radius: 16px 16px 4px 16px !important;
  background: linear-gradient(180deg, #e8f1ff, #dbeafe) !important;
  border: 1px solid rgba(59, 130, 246, 0.22) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08) !important;
}

.guildDiscordMessage.mine .guildDiscordMessageHead {
  justify-content: flex-end !important;
}

.guildDiscordMessage.mine .guildDiscordText {
  text-align: left !important;
}

/* Tin nhắn người khác hơi tách khối nhẹ để dễ nhìn hơn */
.guildDiscordMessage.other .guildDiscordMessageMain {
  padding: 4px 0 !important;
}

/* Nút ghim chỉ hiện khi rê chuột vào tin nhắn */
.guildDiscordPinBtn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-2px) !important;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease !important;
}

.guildDiscordMessage:hover .guildDiscordPinBtn {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

/* Khu vực Thông Tin Bang Hội có cuộn riêng */
.guildPanelBody {
  min-height: 0 !important;
  overflow: hidden !important;
}

.guildCommunityBackBar {
  flex: 0 0 auto !important;
  padding: 12px 14px !important;
}

.guildInfoScrollArea {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 14px !important;
  box-sizing: border-box !important;
}

.guildInfoScrollArea .guildMineLayout {
  min-height: auto !important;
}

/* Khi ở màn thông tin, không để phần nội dung bị cắt mất */
.guildInfoScrollArea .guildMineSide,
.guildInfoScrollArea .guildMineMembersCard {
  min-height: 0 !important;
}
.guildVoiceBox {
  width: min(520px, 100%);
  margin: 22px auto 0;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
  overflow: hidden;
  text-align: left;
}

.guildVoiceBoxHead {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.guildVoiceBoxHead b {
  display: block;
  color: #111827;
  font-size: 16px;
}

.guildVoiceBoxHead span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-weight: 800;
  font-size: 12px;
}

.guildVoiceStatusPill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 1000;
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  white-space: nowrap;
}

.guildVoiceStatusPill.on {
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
}

.guildVoiceMiniList {
  min-height: 96px;
  padding: 12px;
}

.guildVoiceMiniEmpty {
  color: #64748b;
  font-weight: 800;
  text-align: center;
  padding: 24px 10px;
}

.guildVoiceMiniMember {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 14px;
}

.guildVoiceMiniMember:hover {
  background: rgba(17, 24, 39, 0.04);
}

.guildVoiceMiniInfo {
  min-width: 0;
}

.guildVoiceMiniName {
  color: #111827;
  font-weight: 1000;
  font-size: 13px;
}

.guildVoiceMiniState {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.guildVoiceYou {
  margin-left: 6px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 1000;
}

.guildVoiceActions {
  padding: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.guildVoiceBtn {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 1000;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.14);
}

.guildVoiceBtn.join {
  background: linear-gradient(180deg, #22c55e, #16a34a);
}

.guildVoiceBtn.muted {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
}

.guildVoiceBtn.leave {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}
.casio580FloatingBtn {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 85;
  border: 0;
  border-radius: 999px;
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 1000;
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
}

.casio580FloatingBtn span {
  font-size: 14px;
}

.casio580Overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.casio580Overlay.open {
  display: flex;
}

.casio580Window {
  width: min(470px, calc(100vw - 24px));
  height: min(820px, calc(100vh - 24px));
  border-radius: 26px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
}

.casio580Header {
  flex: 0 0 auto;
  min-height: 70px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.94)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.casio580Title {
  font-weight: 1000;
  color: #111827;
  font-size: 18px;
}

.casio580Sub {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.casio580Actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.casio580MiniBtn,
.casio580CloseBtn {
  border: 0;
  cursor: pointer;
  font-weight: 1000;
  border-radius: 999px;
}

.casio580MiniBtn {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.casio580CloseBtn {
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
  color: #111827;
  background: rgba(15, 23, 42, 0.08);
}

.casio580Body {
  flex: 1;
  min-height: 0;
  background: #a7a7a7;
  overflow: hidden;
}
.casio580Frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #a7a7a7;
}
/* =========================
   Cửa sổ nổi Máy Tính 580
   ========================= */

.casio580FloatingBtn {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 150;
  border: 0;
  border-radius: 999px;
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 1000;
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
}

.casio580FloatingBtn span {
  font-size: 14px;
}

.casio580FloatingWindow {
  position: fixed;
  z-index: 260;
  width: 470px;
  height: 820px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  display: none;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow:
    0 28px 80px rgba(15, 23, 42, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.casio580FloatingWindow.open {
  display: flex;
}

.casio580FloatingWindow.dragging {
  opacity: 0.94;
  box-shadow:
    0 34px 90px rgba(15, 23, 42, 0.42),
    0 0 0 2px rgba(37, 99, 235, 0.28) inset;
}

.casio580DragHeader {
  flex: 0 0 auto;
  min-height: 66px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.94)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  user-select: none;
}

.casio580FloatingWindow.dragging .casio580DragHeader {
  cursor: grabbing;
}

.casio580HeaderText {
  min-width: 0;
}

.casio580Title {
  font-weight: 1000;
  color: #111827;
  font-size: 17px;
  white-space: nowrap;
}

.casio580Sub {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.casio580Actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.casio580MiniBtn,
.casio580IconBtn {
  border: 0;
  cursor: pointer;
  font-weight: 1000;
  border-radius: 999px;
}

.casio580MiniBtn {
  min-height: 34px;
  padding: 0 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.casio580IconBtn {
  width: 38px;
  height: 38px;
  font-size: 22px;
  line-height: 1;
  color: #111827;
  background: rgba(15, 23, 42, 0.08);
}

.casio580MiniBtn:hover,
.casio580IconBtn:hover {
  filter: brightness(0.96);
}

.casio580Body {
  flex: 1;
  min-height: 0;
  background: #a7a7a7;
  overflow: hidden;
}

.casio580Frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #a7a7a7;
}

.casio580FloatingWindow.minimized {
  height: 66px;
  overflow: hidden;
}

.casio580FloatingWindow.minimized .casio580Body {
  display: none;
}

@media (max-width: 640px) {
  .casio580FloatingWindow {
    width: min(430px, calc(100vw - 12px));
    height: min(760px, calc(100vh - 12px));
  }

  .casio580FloatingBtn {
    right: 14px;
    bottom: 82px;
  }
}
/* =========================
   Tối ưu cửa sổ Casio: không cuộn, gọn thanh đầu
   ========================= */

.casio580FloatingWindow {
  width: 430px !important;
  height: min(720px, calc(100vh - 14px)) !important;
  max-width: calc(100vw - 12px) !important;
  max-height: calc(100vh - 12px) !important;
}

.casio580DragHeader {
  min-height: 46px !important;
  padding: 6px 10px !important;
}

.casio580Title {
  font-size: 14px !important;
  line-height: 1.1 !important;
}

.casio580Sub {
  font-size: 10px !important;
  margin-top: 1px !important;
}

.casio580Actions {
  gap: 5px !important;
}

.casio580MiniBtn {
  min-height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

.casio580IconBtn {
  width: 32px !important;
  height: 32px !important;
  font-size: 20px !important;
}

.casio580Body {
  overflow: hidden !important;
  background: #a7a7a7 !important;
}

.casio580Frame {
  overflow: hidden !important;
  background: #a7a7a7 !important;
}
/* =========================
   Vị trí nút Máy Tính 580 chỉ trong màn làm bài
   ========================= */

#calculator580Root {
  display: none;
}

#calculator580Root.casio580RootVisible {
  display: block;
}

.casio580FloatingBtn {
  position: fixed !important;
  left: 32px !important;
  top: 118px !important;
  right: auto !important;
  bottom: auto !important;

  z-index: 190 !important;

  width: 182px !important;
  height: 94px !important;
  min-height: 0 !important;
  padding: 0 14px !important;

  border: 3px solid rgba(239, 68, 68, 0) !important;
  border-radius: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;

  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28) !important;
}

.casio580FloatingBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.34) !important;
}

.casio580BtnIcon {
  font-size: 22px;
  line-height: 1;
}

.casio580BtnText {
  font-size: 16px;
  font-weight: 1000;
  line-height: 1.15;
  text-align: left;
}

/* Khi màn hình hẹp, tránh che quá nhiều câu hỏi */
@media (max-width: 900px) {
  .casio580FloatingBtn {
    left: 14px !important;
    top: 112px !important;
    width: 150px !important;
    height: 74px !important;
  }

  .casio580BtnText {
    font-size: 14px;
  }
}
/* =====================================================
   FIX VỊ TRÍ NÚT MÁY TÍNH 580 TRONG MÀN BÀI LÀM
   - Đưa nút tới vị trí dưới "Lời giải" + "Bản đồ"
   - Vẫn nằm trên khung đề bài
   - Không còn nằm bên trái màn hình
   ===================================================== */

.casio580FloatingBtn {
  position: fixed !important;

  /*
    Vị trí mới:
    - top: đưa nút xuống dưới hàng Gợi ý / Lời giải / Bản đồ
    - right: đưa nút vào vùng ô đỏ bên phải
  */
  top: 148px !important;
  right: 190px !important;
  left: auto !important;
  bottom: auto !important;

  z-index: 220 !important;

  width: 238px !important;
  height: 60px !important;
  min-height: 0 !important;

  padding: 0 18px !important;

  border: 0 !important;
  border-radius: 18px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;

  cursor: pointer !important;

  color: #ffffff !important;
  font-weight: 1000 !important;

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.34),
      transparent 34%
    ),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 48%, #38bdf8 100%) !important;

  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;

  transform: none !important;
}

.casio580FloatingBtn:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 22px 44px rgba(37, 99, 235, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

.casio580BtnIcon {
  font-size: 22px !important;
  line-height: 1 !important;
}

.casio580BtnText {
  font-size: 16px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Khi màn hình hơi hẹp, nút tự thu nhỏ để không đè vào nút Bản đồ */
@media (max-width: 1280px) {
  .casio580FloatingBtn {
    right: 180px !important;
    top: 208px !important;
    width: 210px !important;
    height: 56px !important;
  }

  .casio580BtnText {
    font-size: 14px !important;
  }
}

/* Khi màn hình rất hẹp, đưa nút thấp xuống một chút cho an toàn */
@media (max-width: 980px) {
  .casio580FloatingBtn {
    right: 24px !important;
    top: 232px !important;
    width: 180px !important;
    height: 52px !important;
  }

  .casio580BtnIcon {
    font-size: 18px !important;
  }

  .casio580BtnText {
    font-size: 13px !important;
  }
}
/* =========================
   KHIÊU CHIẾN - THANH CÔNG CỤ TRONG ĐỊNH LƯỢNG
   ========================= */

.challengeToolbarSlot {
  margin-top: 22px;
  margin-bottom: 12px;
}

.challengeToolbarCard {
  width: 100%;
  min-height: 168px;
  border-radius: 30px;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 243, 214, 0.96),
    rgba(255, 251, 239, 0.96)
  );
  border: 1px solid rgba(232, 190, 84, 0.32);
  box-shadow: 0 18px 42px rgba(194, 153, 57, 0.12);
}

.challengeToolbarLeft {
  flex: 1 1 auto;
  min-width: 0;
}

.challengeToolbarBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 166, 0, 0.14);
  color: #9a6200;
  font-size: 13px;
  font-weight: 1000;
  margin-bottom: 12px;
}

.challengeToolbarTitle {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  color: #0f2147;
  font-weight: 1000;
}

.challengeToolbarDesc {
  margin: 12px 0 14px;
  color: #66748f;
  font-size: 16px;
  line-height: 1.55;
  max-width: 760px;
  font-weight: 800;
}

.challengeToolbarTags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.challengeToolbarTag {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #2c3e63;
  border: 1px solid rgba(44, 62, 99, 0.08);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 33, 71, 0.06);
}

.challengeToolbarRight {
  width: 320px;
  max-width: 100%;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 0;
}

.challengeToolbarMainBtn,
.challengeToolbarGhostBtn {
  border: 0;
  cursor: pointer;
  font-weight: 1000;
  border-radius: 18px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.challengeToolbarMainBtn:hover,
.challengeToolbarGhostBtn:hover {
  transform: translateY(-1px);
}

.challengeToolbarMainBtn {
  min-height: 56px;
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  color: #ffffff;
  font-size: 17px;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.26);
}
.challengeToolbarSingleBtn {
  min-height: 72px;
  font-size: 20px;
  border-radius: 22px;
}
.challengeToolbarGhostBtn {
  min-height: 48px;
  background: #ffffff;
  color: #314569;
  font-size: 15px;
  border: 1px solid rgba(49, 69, 105, 0.1);
}

.challengeToolbarPicked {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: #60708d;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

/* =========================
   KHIÊU CHIẾN - CỬA SỔ CHỌN CHẾ ĐỘ
   ========================= */

.challengeWindowOverlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.22);
}

.challengeWindowOverlay.open {
  display: flex;
}

.challengeWindowCard {
  width: min(1160px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fffdf7;
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeWindowHeader {
  padding: 26px 28px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.challengeWindowEyebrow {
  font-size: 13px;
  font-weight: 1000;
  color: #ff971c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.challengeWindowTitle {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 1000;
  color: #102042;
}

.challengeWindowSub {
  margin-top: 8px;
  color: #66748f;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 800;
  max-width: 760px;
}

.challengeWindowClose {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: #f2f4f8;
  color: #152347;
  font-size: 30px;
  font-weight: 700;
  flex: 0 0 auto;
}

.challengeModeColumns {
  padding: 22px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.challengeModeColumn {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.challengeModeColumnTop {
  margin-bottom: 16px;
}

.challengeModeColumnTitle {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 1000;
  color: #12244a;
}

.challengeModeColumnSub {
  margin-top: 6px;
  color: #6b7990;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.challengeModeColumnList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challengeModeItem {
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  border-radius: 20px;
  padding: 16px 16px 15px;
  background: #f7f9fc;
  color: #18284b;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.challengeModeItem:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.challengeModeItem.active {
  background: linear-gradient(135deg, #fff0c7, #ffe1a0);
  box-shadow: 0 14px 28px rgba(255, 177, 51, 0.18);
}

.challengeModeItemTitle {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 1000;
  margin-bottom: 6px;
}

.challengeModeItemDesc {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 800;
  color: #62708a;
}

.challengeWindowFooter {
  padding: 0 28px 28px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
}

.challengePickedBox {
  flex: 1 1 auto;
  min-height: 112px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 18px 20px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.challengePickedLabel {
  font-size: 12px;
  color: #f39200;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.challengePickedTitle {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 1000;
  color: #112348;
}

.challengePickedDesc {
  margin-top: 8px;
  color: #65738c;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 800;
}

.challengeWindowActions {
  width: 240px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challengeWindowGhostBtn,
.challengeWindowMainBtn {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 1000;
}

.challengeWindowGhostBtn {
  background: #eef2f7;
  color: #314569;
}

.challengeWindowMainBtn {
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.26);
}

@media (max-width: 980px) {
  .challengeToolbarCard {
    flex-direction: column;
    align-items: stretch;
  }

  .challengeToolbarRight {
    width: 100%;
  }

  .challengeModeColumns {
    grid-template-columns: 1fr;
  }

  .challengeWindowFooter {
    flex-direction: column;
  }

  .challengeWindowActions {
    width: 100%;
  }
}
/* =========================
   KHIÊU CHIẾN - bỏ khu chọn phụ bên dưới
   ========================= */

.challengeWindowFooter {
  display: none !important;
}

.challengeModeColumns {
  padding-bottom: 30px !important;
}

.challengeModeItem {
  position: relative;
  padding-right: 128px !important;
}

.challengeModeItem::after {
  content: "Bấm để chọn";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 10px 20px rgba(255, 143, 21, 0.18);
}

.challengeModeItem:hover::after {
  filter: brightness(1.04);
}

@media (max-width: 720px) {
  .challengeModeItem {
    padding-right: 16px !important;
  }

  .challengeModeItem::after {
    position: static;
    transform: none;
    margin-top: 10px;
    width: fit-content;
  }
}
/* =========================
   KHIÊU CHIẾN - PHÒNG CHỜ
   ========================= */

.challengeLobbyOverlay {
  position: fixed;
  inset: 0;
  z-index: 470;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.24);
}

.challengeLobbyOverlay.open {
  display: flex;
}

.challengeLobbyCard {
  width: min(1260px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fffdf7;
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeLobbyHeader {
  padding: 26px 28px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.challengeLobbyTitle {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 1000;
  color: #102042;
}

.challengeLobbySub {
  margin-top: 8px;
  color: #66748f;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 800;
  max-width: 800px;
}

.challengeLobbyHeaderActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.challengeLobbyTopBtn {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  cursor: pointer;
  background: #eef2f7;
  color: #314569;
  font-size: 14px;
  font-weight: 1000;
}

.challengeLobbyBody {
  padding: 24px 28px 28px;
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 22px;
}

.challengeLobbyPanel {
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
  padding: 22px;
}

.challengeLobbyPanelTitle {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 1000;
  color: #112348;
}

.challengeLobbyPanelSub {
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.challengeLobbyPanelTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.challengeRoomModeCard {
  margin-top: 16px;
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(135deg, #fff0c7, #ffe2a4);
  border: 1px solid rgba(255, 177, 51, 0.32);
}

.challengeRoomModeBadge {
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 143, 21, 0.16);
  color: #a25f00;
  font-size: 12px;
  font-weight: 1000;
  margin-bottom: 10px;
}

.challengeRoomModeTitle {
  color: #102042;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 1000;
}

.challengeRoomModeDesc {
  margin-top: 8px;
  color: #65738c;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 800;
}

.challengeRoomCodeBox {
  margin-top: 16px;
  border-radius: 22px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f7f9fc;
}

.challengeRoomCodeLabel {
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.challengeRoomCode {
  margin-top: 5px;
  color: #102042;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 1000;
}

.challengeRoomCodeBox button {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  background: #1f2937;
  color: #ffffff;
  font-weight: 1000;
}

.challengeRoomSettingGrid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.challengeRoomSettingGrid div {
  min-height: 74px;
  border-radius: 18px;
  padding: 13px 14px;
  background: #f7f9fc;
}

.challengeRoomSettingGrid span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
}

.challengeRoomSettingGrid b {
  display: block;
  margin-top: 7px;
  color: #102042;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 1000;
}

.challengeInviteNote {
  margin-top: 14px;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.09);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.challengeMapList {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.challengeMapItem {
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  background: #f7f9fc;
  color: #102042;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.challengeMapItem:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.challengeMapItem.active {
  background: linear-gradient(135deg, #e8f3ff, #dbeafe);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.challengeMapLabel {
  min-height: 54px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 1000;
}

.challengeMapTitle {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 1000;
  color: #102042;
}

.challengeMapDesc {
  margin-top: 5px;
  color: #65738c;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.challengeSelectedMapBox {
  margin-top: 16px;
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 143, 21, 0.09);
  border: 1px solid rgba(255, 143, 21, 0.16);
}

.challengeSelectedMapLabel {
  color: #ff8f15;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.challengeSelectedMapTitle {
  margin-top: 7px;
  color: #102042;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 1000;
}

.challengeSelectedMapDesc {
  margin-top: 6px;
  color: #65738c;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 800;
}

.challengePlayersList {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challengePlayerItem {
  min-height: 72px;
  border-radius: 20px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7f9fc;
}

.challengePlayerItem.isReady {
  background: rgba(34, 197, 94, 0.1);
}

.challengePlayerItem.isEmpty {
  opacity: 0.72;
  border: 1px dashed rgba(100, 116, 139, 0.28);
}

.challengePlayerAvatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  font-weight: 1000;
}

.challengePlayerItem.isEmpty .challengePlayerAvatar {
  background: #cbd5e1;
}

.challengePlayerInfo {
  min-width: 0;
}

.challengePlayerName {
  color: #102042;
  font-size: 15px;
  font-weight: 1000;
}

.challengePlayerName span {
  color: #ff8f15;
  font-size: 12px;
  margin-left: 5px;
}

.challengePlayerStatus {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.challengeLobbyActionStack {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.challengeInviteBtn,
.challengeReadyBtn,
.challengeStartBtn {
  border: 0;
  min-height: 52px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 1000;
}

.challengeInviteBtn {
  background: #eef2f7;
  color: #314569;
}

.challengeReadyBtn {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(34, 197, 94, 0.18);
}

.challengeReadyBtn.isReady {
  background: linear-gradient(180deg, #64748b, #475569);
}

.challengeStartBtn {
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.24);
}

.challengeStartNote {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 1100px) {
  .challengeLobbyBody {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .challengeLobbyOverlay {
    padding: 10px;
  }

  .challengeLobbyCard {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 24px;
  }

  .challengeLobbyHeader {
    flex-direction: column;
  }

  .challengeLobbyHeaderActions {
    width: 100%;
    justify-content: space-between;
  }

  .challengeMapItem {
    grid-template-columns: 1fr;
  }

  .challengeRoomSettingGrid {
    grid-template-columns: 1fr;
  }
}
/* =========================
   KHIÊU CHIẾN - SẮP XẾP LẠI PHÒNG CHỜ
   Người chơi giữa, chọn bản đồ ở góc phải bằng popup nhỏ
   ========================= */

.challengeLobbyBodyRedesign {
  grid-template-columns: 0.9fr 1.35fr 0.9fr !important;
  align-items: stretch !important;
}

.challengePlayersPanelCenter {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2px solid rgba(255, 177, 51, 0.18);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 177, 51, 0.12),
      transparent 42%
    ),
    #ffffff;
}

.challengeCenterHead {
  text-align: center;
  margin-bottom: 16px;
}

.challengePlayersListCenter {
  max-width: 560px;
  width: 100%;
  margin: 18px auto 0;
}

.challengePlayersListCenter .challengePlayerItem {
  min-height: 86px;
  border-radius: 24px;
}

.challengePlayersListCenter .challengePlayerItem.isHost {
  background: linear-gradient(135deg, #fff0c7, #ffe2a4);
  border: 1px solid rgba(255, 177, 51, 0.34);
  box-shadow: 0 16px 32px rgba(255, 177, 51, 0.12);
}

.challengePlayersListCenter .challengePlayerItem.isHost .challengePlayerAvatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.challengeLobbyActionStackCenter {
  max-width: 420px;
  width: 100%;
  margin: 22px auto 0;
}

.challengeStartBtnCenter {
  min-height: 64px;
  font-size: 18px;
  border-radius: 22px;
}

.challengeMapPanelCompact {
  position: relative;
  overflow: visible;
}

.challengeMapCornerCard {
  position: sticky;
  top: 12px;
}

.challengeMapCornerTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.challengeMapSmallToolBtn {
  border: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  font-weight: 1000;
  white-space: nowrap;
  box-shadow: 0 12px 22px rgba(255, 143, 21, 0.18);
}

.challengeSelectedMapBoxCompact {
  margin-top: 18px;
}

.challengeMapPickerShell {
  position: relative;
}

.challengeMapMiniPopup {
  position: absolute;
  right: 0;
  top: 14px;
  width: min(420px, 86vw);
  z-index: 30;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.challengeMapMiniPopupTop {
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.challengeMapMiniPopupTitle {
  color: #102042;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.15;
}

.challengeMapMiniPopupSub {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.challengeMapMiniPopupTop button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: #eef2f7;
  color: #102042;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.challengeMapMiniPopupList {
  max-height: 430px;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.challengeMapMiniPopupList .challengeMapItem {
  grid-template-columns: 76px 1fr;
  padding: 12px;
}

.challengeMapMiniPopupList .challengeMapLabel {
  min-height: 50px;
}

@media (max-width: 1100px) {
  .challengeLobbyBodyRedesign {
    grid-template-columns: 1fr !important;
  }

  .challengePlayersPanelCenter {
    min-height: auto;
  }

  .challengeMapCornerCard {
    position: relative;
    top: auto;
  }

  .challengeMapMiniPopup {
    position: relative;
    right: auto;
    top: 12px;
    width: 100%;
  }
}
/* =========================
   KHIÊU CHIẾN - PHÒNG CHỜ KIỂU GAME
   ========================= */

.challengeLobbyCard {
  width: min(1320px, calc(100vw - 36px)) !important;
  height: min(760px, calc(100vh - 36px)) !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  background: #111827 !important;
}

.challengeGameLobby {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #f8fafc;
  background:
    radial-gradient(
      circle at 24% 18%,
      rgba(56, 189, 248, 0.28),
      transparent 34%
    ),
    radial-gradient(
      circle at 55% 58%,
      rgba(59, 130, 246, 0.24),
      transparent 40%
    ),
    linear-gradient(135deg, #162238, #0f172a 58%, #111827);
  position: relative;
  overflow: hidden;
}

.challengeGameLobby::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05),
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.04)
    ),
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 16px
    );
  pointer-events: none;
}

.challengeGameTopbar {
  position: relative;
  z-index: 2;
  height: 74px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.48);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.challengeGameBackGroup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.challengeGameBackBtn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  color: #fde68a;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.challengeGameTitle {
  color: #fde68a;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 1000;
}

.challengeGameSub {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
  font-weight: 850;
}

.challengeGameTopMeta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: rgba(226, 232, 240, 0.92);
  font-size: 12px;
  font-weight: 900;
}

.challengeGameTopMeta span {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challengeGameClose {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

.challengeGameMain {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 360px;
}

.challengeGameArena {
  position: relative;
  min-width: 0;
  padding: 28px 30px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.challengeArenaModePill {
  width: fit-content;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  color: #fde68a;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(253, 230, 138, 0.2);
  font-size: 13px;
  font-weight: 950;
}

.challengeStageWrap {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.challengeVsStage {
  position: relative;
  width: min(720px, 100%);
  height: 420px;
}

.challengeVsStage.isSolo {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  place-items: center;
  gap: 12px;
}

.challengeVsText {
  font-size: 58px;
  font-weight: 1000;
  color: #fde68a;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.challengeSoloPlayer,
.challengeMultiSlot,
.challengePveBossSlot {
  width: 210px;
  min-height: 158px;
  border-radius: 24px;
  padding: 16px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.challengeSoloPlayer.self,
.challengeMultiSlot.self {
  background: linear-gradient(
    180deg,
    rgba(255, 231, 169, 0.16),
    rgba(15, 23, 42, 0.48)
  );
  border-color: rgba(253, 230, 138, 0.36);
}

.challengeSoloPlayer.empty,
.challengeMultiSlot.empty {
  opacity: 0.82;
}

.challengeBattleAvatar {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  font-size: 28px;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.challengeSoloPlayer.empty .challengeBattleAvatar,
.challengeMultiSlot.empty .challengeBattleAvatar {
  color: rgba(226, 232, 240, 0.55);
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(226, 232, 240, 0.24);
}

.challengeBattleName {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 1000;
}

.challengeBattleRole {
  margin-top: 3px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
  font-weight: 850;
}

.challengeBattleMiniActions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.challengeBattleMiniActions span {
  width: 28px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.challengeTinyInvite {
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  color: #ffffff;
  background: rgba(59, 130, 246, 0.9);
  font-weight: 1000;
  cursor: pointer;
}

.challengeVsStage.isMulti {
  width: min(780px, 100%);
  height: 420px;
  position: relative;
}

.challengeMultiSlot {
  position: absolute;
}

.challengeMultiSlot.slot1 {
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
}

.challengeMultiSlot.slot2 {
  left: 8%;
  top: 20%;
}

.challengeMultiSlot.slot3 {
  right: 8%;
  top: 20%;
}

.challengeMultiSlot.slot4 {
  left: 14%;
  bottom: 6%;
}

.challengeMultiSlot.slot5 {
  right: 14%;
  bottom: 6%;
}

.challengeVsStage.isPve {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 28px;
}

.challengePveBossIcon {
  font-size: 54px;
}

.challengePveBossTitle {
  margin-top: 10px;
  color: #fde68a;
  font-size: 22px;
  font-weight: 1000;
}

.challengePveBossSub {
  margin-top: 5px;
  color: rgba(226, 232, 240, 0.7);
  font-size: 13px;
  font-weight: 850;
}

.challengeGameChatBar {
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.challengeChatInputFake {
  color: rgba(226, 232, 240, 0.86);
  font-size: 14px;
  font-weight: 850;
}

.challengeChatTools {
  display: flex;
  gap: 10px;
  color: #cbd5e1;
}

.challengeGameSide {
  min-width: 0;
  background: rgba(15, 23, 42, 0.62);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.challengeSideTabs {
  height: 64px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.challengeSideTabs button {
  border: 0;
  background: transparent;
  color: rgba(226, 232, 240, 0.75);
  font-size: 24px;
  cursor: pointer;
}

.challengeSideTabs button.active {
  color: #fde68a;
  background: linear-gradient(180deg, rgba(253, 230, 138, 0.18), transparent);
  border-bottom: 3px solid #fde68a;
}

.challengeSideBlock {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.challengeSideHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.challengeSideTitle {
  color: #f8fafc;
  font-size: 18px;
  font-weight: 1000;
}

.challengeSideSub {
  margin-top: 5px;
  color: rgba(226, 232, 240, 0.66);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 800;
}

.challengeSideMapBox {
  margin-top: 12px;
  border-radius: 18px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challengeSideMapIcon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(253, 230, 138, 0.14);
  font-size: 24px;
}

.challengeSideMapTitle {
  color: #fde68a;
  font-size: 14px;
  font-weight: 1000;
}

.challengeSideMapDesc {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.66);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.challengeFriendBlock {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.challengeSideFriendList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challengeSideFriend {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.challengeSideFriend.offline {
  opacity: 0.45;
}

.challengeSideAvatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  color: #ffffff;
  font-weight: 1000;
}

.challengeSideFriendInfo {
  min-width: 0;
  flex: 1;
}

.challengeSideFriendName {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeSideFriendStatus {
  margin-top: 3px;
  color: #facc15;
  font-size: 11px;
  font-weight: 850;
}

.challengeSideInviteBtn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #0f172a;
  background: #e2e8f0;
  font-size: 20px;
  font-weight: 1000;
}

.challengeSideBottom {
  flex: 0 0 auto;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.58);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.challengeSideFullBtn,
.challengeSideReadyBtn,
.challengeSideStartBtn {
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
}

.challengeSideReadyBtn {
  min-height: 64px;
  font-size: 22px;
  border-radius: 0;
  background: linear-gradient(90deg, #f97316, #fbbf24) !important;
  box-shadow: 0 16px 32px rgba(249, 115, 22, 0.25) !important;
}

.challengeSideReadyBtn.isReady {
  background: linear-gradient(90deg, #22c55e, #16a34a) !important;
}

.challengeSideStartBtn {
  min-height: 58px;
  font-size: 20px;
  background: linear-gradient(90deg, #fbbf24, #d97706) !important;
}

.challengeMapPickerShell {
  position: relative;
}

.challengeMapMiniPopup {
  position: absolute;
  right: 0;
  top: 12px;
  width: 330px;
  z-index: 60;
  border-radius: 18px;
  background: #ffffff;
  color: #102042;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.challengeMapMiniPopupList {
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 1050px) {
  .challengeLobbyCard {
    height: min(820px, calc(100vh - 24px)) !important;
    overflow: auto !important;
  }

  .challengeGameMain {
    grid-template-columns: 1fr;
  }

  .challengeGameSide {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .challengeVsStage.isMulti,
  .challengeVsStage {
    height: 500px;
  }
}
/* =========================
   FIX PHÒNG CHỜ KHIÊU CHIẾN - HIỂN THỊ TRỌN 100%, KHÔNG CUỘN
   ========================= */

.challengeLobbyOverlay {
  padding: 10px !important;
  align-items: center !important;
  justify-content: center !important;
}

.challengeLobbyCard {
  width: min(1320px, calc(100vw - 20px)) !important;
  height: calc(100vh - 20px) !important;
  max-height: calc(100vh - 20px) !important;
  overflow: hidden !important;
  border-radius: 22px !important;
}

/* Thu gọn thanh đầu */
.challengeGameTopbar {
  height: 56px !important;
  padding: 8px 14px !important;
}

.challengeGameBackBtn {
  width: 40px !important;
  height: 40px !important;
  font-size: 28px !important;
}

.challengeGameTitle {
  font-size: 24px !important;
}

.challengeGameSub {
  margin-top: 1px !important;
  font-size: 11px !important;
}

.challengeGameTopMeta {
  gap: 6px !important;
}

.challengeGameTopMeta span {
  padding: 5px 9px !important;
  font-size: 11px !important;
}

.challengeGameClose {
  width: 42px !important;
  height: 42px !important;
  font-size: 26px !important;
}

/* Phần chính phải ăn toàn bộ phần còn lại */
.challengeGameMain {
  height: calc(100% - 56px) !important;
  min-height: 0 !important;
  grid-template-columns: 1fr 340px !important;
}

/* Bên trái: bỏ khoảng trống, đưa người chơi lên vừa đủ */
.challengeGameArena {
  padding: 14px 22px 12px !important;
  min-height: 0 !important;
}

.challengeStageWrap {
  min-height: 0 !important;
  align-items: center !important;
}

/* Ẩn chắc vùng nhãn thừa nếu còn sót trong code */
.challengeArenaModePill {
  display: none !important;
}

/* Thu nhỏ sân đấu để không tràn đáy */
.challengeVsStage {
  height: 350px !important;
}

.challengeVsStage.isSolo {
  gap: 6px !important;
}

.challengeVsText {
  font-size: 48px !important;
  line-height: 1 !important;
}

.challengeSoloPlayer,
.challengeMultiSlot,
.challengePveBossSlot {
  width: 188px !important;
  min-height: 136px !important;
  padding: 12px !important;
  border-radius: 20px !important;
}

.challengeBattleAvatar {
  width: 62px !important;
  height: 62px !important;
  border-radius: 18px !important;
  font-size: 24px !important;
}

.challengeBattleName {
  margin-top: 7px !important;
  font-size: 14px !important;
}

.challengeBattleRole {
  margin-top: 2px !important;
  font-size: 11px !important;
}

.challengeBattleMiniActions {
  margin-top: 7px !important;
}

/* Hàng chat dưới cùng thu gọn */
.challengeGameChatBar {
  height: 44px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
}

/* Bên phải: bỏ thanh icon thừa */
.challengeSideTabs {
  display: none !important;
}

/* Bên phải: thu gọn các khối */
.challengeGameSide {
  min-height: 0 !important;
}

.challengeSideBlock {
  padding: 12px 14px !important;
}

.challengeSideTitle {
  font-size: 17px !important;
}

.challengeSideSub {
  font-size: 11px !important;
}

.challengeSideMapBox {
  margin-top: 9px !important;
  padding: 9px !important;
  border-radius: 15px !important;
}

.challengeSideMapIcon {
  width: 40px !important;
  height: 40px !important;
  font-size: 21px !important;
}

.challengeSideMapTitle {
  font-size: 13px !important;
}

.challengeSideMapDesc {
  font-size: 10px !important;
}

/* Danh sách bạn bè không đẩy tràn nút dưới */
.challengeFriendBlock {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.challengeSideFriendList {
  margin-top: 10px !important;
  gap: 8px !important;
  max-height: 250px !important;
  overflow: auto !important;
  padding-right: 3px !important;
}

.challengeSideFriend {
  min-height: 50px !important;
  padding: 7px !important;
  border-radius: 13px !important;
}

.challengeSideAvatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 11px !important;
}

.challengeSideFriendName {
  font-size: 12px !important;
}

.challengeSideFriendStatus {
  font-size: 10px !important;
}

/* Nút dưới cùng luôn nằm trong màn hình */
.challengeSideBottom {
  padding: 10px 14px 12px !important;
  gap: 8px !important;
}

.challengeSideFullBtn,
.challengeSideReadyBtn,
.challengeSideStartBtn {
  min-height: 44px !important;
}

.challengeSideReadyBtn {
  min-height: 50px !important;
  font-size: 18px !important;
}

.challengeSideStartBtn {
  min-height: 46px !important;
  font-size: 17px !important;
}

/* Popup chọn bản đồ gọn hơn */
.challengeMapMiniPopup {
  width: 315px !important;
  max-height: 410px !important;
}

.challengeMapMiniPopupTop {
  padding: 12px 14px !important;
}

.challengeMapMiniPopupTitle {
  font-size: 18px !important;
}

.challengeMapMiniPopupList {
  max-height: 315px !important;
  padding: 10px !important;
}

.challengeMapMiniPopupList .challengeMapItem {
  padding: 10px !important;
  grid-template-columns: 68px 1fr !important;
}

/* Nếu là chế độ nhiều người, thu gọn các slot */
.challengeVsStage.isMulti {
  height: 350px !important;
}

.challengeMultiSlot.slot2 {
  left: 7% !important;
  top: 12% !important;
}

.challengeMultiSlot.slot3 {
  right: 7% !important;
  top: 12% !important;
}

.challengeMultiSlot.slot4 {
  left: 13% !important;
  bottom: 0 !important;
}

.challengeMultiSlot.slot5 {
  right: 13% !important;
  bottom: 0 !important;
}

/* Màn nhỏ */
@media (max-height: 760px) {
  .challengeVsStage {
    height: 300px !important;
  }

  .challengeSoloPlayer,
  .challengeMultiSlot,
  .challengePveBossSlot {
    width: 170px !important;
    min-height: 122px !important;
  }

  .challengeBattleAvatar {
    width: 54px !important;
    height: 54px !important;
  }

  .challengeVsText {
    font-size: 42px !important;
  }

  .challengeSideFriendList {
    max-height: 210px !important;
  }
}
/* ===== FIX HIỆN LẠI NGƯỜI CHƠI TRONG PHÒNG CHỜ KHIÊU CHIẾN ===== */

.challengeGameArena {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.challengeStageWrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  place-items: center !important;
}

.challengeVsStage {
  display: grid !important;
}

.challengeVsStage.isSolo {
  display: grid !important;
  grid-template-rows: 1fr auto 1fr !important;
  place-items: center !important;
}

.challengeVsStage.isPve {
  display: grid !important;
}

.challengeVsStage.isMulti {
  display: block !important;
  position: relative !important;
}
/* =====================================================
   FIX PHÒNG CHỜ KHIÊU CHIẾN:
   1) Ẩn Bang Hội / Nhiệm Vụ khi phòng chờ đang mở
   2) Tách rõ 2 thẻ Solo để chữ VS không bị che
   ===================================================== */

/* Ẩn nút Bang Hội và Nhiệm Vụ của màn hình chính khi đang mở phòng chờ */
body.challengeLobbyIsOpen #guildRoot,
body.challengeLobbyIsOpen #dailyMissionsRoot {
  display: none !important;
}

/* Phòng chờ nằm cao hơn mọi nút nổi khác */
.challengeLobbyOverlay {
  z-index: 6000 !important;
}

/* Khu vực sân đấu phải có đủ chỗ cho 2 thẻ + chữ VS */
.challengeStageWrap {
  display: grid !important;
  place-items: center !important;
  min-height: 0 !important;
}

/* Riêng Solo 1 vs 1: không dùng khoảng cách quá sát nữa */
.challengeVsStage.isSolo {
  height: 440px !important;
  max-height: calc(100% - 8px) !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;

  gap: 24px !important;
  overflow: visible !important;
}

/* Không cho 2 thẻ co kéo đè lên VS */
.challengeVsStage.isSolo .challengeSoloPlayer {
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Chữ VS nằm một hàng riêng, luôn nổi trên nền */
.challengeVsStage.isSolo .challengeVsText {
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 5 !important;

  display: block !important;
  margin: 0 !important;
  padding: 0 18px !important;

  font-size: 54px !important;
  line-height: 1 !important;
  color: #fde68a !important;
  text-shadow:
    0 4px 0 rgba(15, 23, 42, 0.72),
    0 14px 34px rgba(0, 0, 0, 0.45) !important;
}

/* Đưa thẻ trên lên một chút, thẻ dưới xuống một chút */
.challengeVsStage.isSolo .challengeSoloPlayer.self {
  transform: translateY(-8px) !important;
}

.challengeVsStage.isSolo .challengeSoloPlayer.enemy {
  transform: translateY(8px) !important;
}

/* Nếu màn hình hơi thấp thì vẫn giữ khoảng cách, chỉ giảm kích thước một chút */
@media (max-height: 760px) {
  .challengeVsStage.isSolo {
    height: 390px !important;
    gap: 18px !important;
  }

  .challengeVsStage.isSolo .challengeVsText {
    font-size: 48px !important;
  }

  .challengeVsStage.isSolo .challengeSoloPlayer.self {
    transform: translateY(-6px) !important;
  }

  .challengeVsStage.isSolo .challengeSoloPlayer.enemy {
    transform: translateY(6px) !important;
  }
}
/* =====================================================
   KHIÊU CHIẾN - GIAO DIỆN BÀI LÀM
   ===================================================== */

.challengeBattleWindow {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(56, 189, 248, 0.12),
      transparent 35%
    ),
    linear-gradient(180deg, #fffaf0, #fff6e4);
  color: #102042;
}

.challengeBattleTop {
  min-height: 76px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.challengeBattleTitleBox {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.challengeBattleBackBtn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: #eef2f7;
  color: #102042;
  font-size: 24px;
  font-weight: 1000;
}

.challengeBattleTitle {
  font-size: 25px;
  line-height: 1.12;
  font-weight: 1000;
  color: #102042;
}

.challengeBattleSub {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 850;
  color: #64748b;
}

.challengeBattleTopRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.challengeBattleTimer {
  min-height: 46px;
  min-width: 98px;
  padding: 0 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff2c2;
  color: #102042;
  font-size: 16px;
  font-weight: 1000;
  border: 1px solid rgba(255, 176, 0, 0.28);
}

.challengeBattleTimer.danger {
  background: #fee2e2;
  color: #b91c1c;
  animation: challengeTimerPulse 0.75s infinite alternate;
}

@keyframes challengeTimerPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.04);
  }
}

.challengeBattleHearts {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.challengeHeart {
  font-size: 21px;
  line-height: 1;
}

.challengeHeart.alive {
  color: #ef4444;
  text-shadow: 0 6px 12px rgba(239, 68, 68, 0.18);
}

.challengeHeart.dead {
  color: #cbd5e1;
}

.challengeDuelProgress {
  padding: 14px 22px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.42);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.challengeDuelRow {
  display: grid;
  grid-template-columns: 140px 1fr 54px;
  gap: 12px;
  align-items: center;
}

.challengeDuelName {
  min-width: 0;
  color: #102042;
  font-size: 14px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeDuelTrack {
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.1);
}

.challengeDuelFill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.challengeDuelRow.self .challengeDuelFill {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.challengeDuelRow.enemy .challengeDuelFill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.challengeDuelNum {
  color: #64748b;
  font-size: 13px;
  font-weight: 1000;
  text-align: right;
}

.challengeBattleMain {
  flex: 1;
  min-height: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.challengeBattleQuestionCard {
  width: min(1180px, 100%);
  min-height: 430px;
  border-radius: 28px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

.challengeQuestionTopLine {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.challengeQuestionLabel {
  color: #102042;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 1000;
}

.challengeQuestionSmall {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.challengeQuestionType {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.challengeQuestionContent {
  min-height: 130px;
  display: grid;
  place-items: center;
  padding: 10px 0 24px;
  color: #102042;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.65;
  text-align: center;
}

.challengeQuestionText {
  width: 100%;
}

.challengeLatexBlock {
  width: 100%;
  font-size: 22px;
  text-align: center;
}

.challengeQuestionImageWrap {
  width: 100%;
  display: grid;
  place-items: center;
}

.challengeQuestionImageWrap img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 16px;
}

.challengeBattleAnswers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.challengeBattleAnswerBtn {
  min-height: 66px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  cursor: pointer;
  background: #ffffff;
  color: #111827;
  font-size: 17px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.challengeBattleAnswerBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.challengeBattleAnswerBtn.isCorrect {
  color: #065f46;
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.35);
}

.challengeBattleAnswerBtn.isWrong {
  color: #991b1b;
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.35);
}

.challengeBattleAnswerBtn:disabled {
  cursor: default;
}

.challengeBattleFeedback {
  min-height: 32px;
  margin-top: 16px;
  color: #475569;
  font-size: 15px;
  font-weight: 950;
  text-align: center;
}

.challengeBattleResult {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(255, 176, 0, 0.24),
      transparent 36%
    ),
    linear-gradient(135deg, #102042, #0f172a);
}

.challengeBattleResultCard {
  width: min(760px, 100%);
  border-radius: 30px;
  padding: 34px;
  background: #ffffff;
  color: #102042;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.challengeResultEyebrow {
  color: #ff8f15;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challengeResultTitle {
  margin-top: 10px;
  font-size: 42px;
  line-height: 1.1;
  font-weight: 1000;
}

.challengeResultSub {
  margin-top: 8px;
  color: #64748b;
  font-size: 15px;
  font-weight: 850;
}

.challengeResultStats {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.challengeResultStats div {
  border-radius: 20px;
  padding: 16px;
  background: #f7f9fc;
}

.challengeResultStats span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
}

.challengeResultStats b {
  display: block;
  margin-top: 7px;
  color: #102042;
  font-size: 18px;
  font-weight: 1000;
}

.challengeResultStats strong {
  display: block;
  margin-top: 6px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 1000;
}

.challengeResultActions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.challengeResultBtn {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 1000;
}

.challengeResultBtn.secondary {
  background: #eef2f7;
  color: #314569;
}

.challengeResultBtn.primary {
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.24);
}

@media (max-width: 760px) {
  .challengeBattleTop {
    flex-direction: column;
    align-items: stretch;
  }

  .challengeBattleTopRight {
    justify-content: space-between;
  }

  .challengeDuelRow {
    grid-template-columns: 92px 1fr 44px;
  }

  .challengeBattleAnswers {
    grid-template-columns: 1fr;
  }

  .challengeResultStats {
    grid-template-columns: 1fr;
  }

  .challengeResultActions {
    flex-direction: column;
  }
}
/* =====================================================
   KHIÊU CHIẾN - BÀI LÀM FULL MÀN HÌNH
   ===================================================== */

body.challengeFullPlayBody #guildRoot,
body.challengeFullPlayBody #dailyMissionsRoot,
body.challengeFullPlayBody #worldChatRoot,
body.challengeFullPlayBody .serverSwitch {
  display: none !important;
}

.challengeFullPlay {
  width: 100%;
  min-height: calc(100vh - 92px);
  padding: 18px 16px 48px;
  background: linear-gradient(
    180deg,
    rgba(255, 250, 240, 0.92),
    rgba(255, 238, 198, 0.92)
  );
}

.challengeFullTop {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.challengeFullTitle {
  color: #102042;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 1000;
}

.challengeFullSub {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.challengeFullTopActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.challengeFullTimer {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff2c2;
  color: #102042;
  border: 1px solid rgba(255, 176, 0, 0.32);
  font-size: 15px;
  font-weight: 1000;
}

.challengeFullTimer.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.challengeFullHearts {
  min-height: 42px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

.challengeFullHeart {
  font-size: 20px;
  line-height: 1;
}

.challengeFullHeart.alive {
  color: #ef4444;
}

.challengeFullHeart.dead {
  color: #cbd5e1;
}

.challengeFullDuel {
  max-width: 1240px;
  margin: 14px auto 0;
  display: grid;
  gap: 8px;
}

.challengeFullDuelRow {
  display: grid;
  grid-template-columns: 140px 1fr 52px;
  align-items: center;
  gap: 10px;
}

.challengeFullDuelName {
  color: #102042;
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeFullDuelTrack {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.1);
}

.challengeFullDuelFill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.challengeFullDuelRow.self .challengeFullDuelFill {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.challengeFullDuelRow.enemy .challengeFullDuelFill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.challengeFullDuelNum {
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
  text-align: right;
}

.challengeFullQuestionWrap {
  max-width: 1240px;
  margin: 18px auto 0;
  padding-left: 0;
}

.challengeFullQuestionCard {
  width: 100%;
  min-height: 360px;
  border-radius: 28px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

.challengeFullQuestionHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.challengeFullQuestionType {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #3730a3;
  background: #eef2ff;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.challengeFullQuestionContent {
  min-height: 120px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px 0 22px;
  color: #102042;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.65;
}

.challengeFullLatex {
  width: 100%;
  font-size: 22px;
}

.challengeFullImgWrap {
  width: 100%;
  display: grid;
  place-items: center;
}

.challengeFullImgWrap img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 16px;
}

.challengeFullAnswers {
  margin-top: 6px;
}

.challengeFullAnswerBtn.isCorrect {
  background: #dcfce7 !important;
  color: #065f46 !important;
  border-color: rgba(22, 163, 74, 0.42) !important;
}

.challengeFullAnswerBtn.isWrong {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: rgba(220, 38, 38, 0.42) !important;
}

.challengeFullFeedback {
  margin-top: 14px;
  min-height: 30px;
  color: #475569;
  text-align: center;
  font-size: 15px;
  font-weight: 1000;
}

.challengeFullResult {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(255, 176, 0, 0.24),
      transparent 38%
    ),
    linear-gradient(135deg, #102042, #0f172a);
}

.challengeFullResultCard {
  width: min(760px, 100%);
  padding: 34px;
  border-radius: 30px;
  background: #ffffff;
  color: #102042;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

@media (max-width: 900px) {
  .challengeFullTop {
    flex-direction: column;
  }

  .challengeFullDuelRow {
    grid-template-columns: 90px 1fr 44px;
  }

  .challengeFullQuestionCard {
    padding: 18px;
  }
}
/* =====================================================
   FIX MÀN TỔNG KẾT KHIÊU CHIẾN
   - Không cần cuộn chuột
   - Nút Đấu lại dễ bấm
   ===================================================== */

body.challengeFullPlayBody {
  overflow: hidden !important;
}

body.challengeFullPlayBody #app {
  height: calc(100vh - 104px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.challengeFullPlayBody .challengeFullResult {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 18px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 0, 0.2), transparent 36%),
    linear-gradient(135deg, #102042, #0f172a) !important;
}

body.challengeFullPlayBody .challengeFullResultCard {
  width: min(780px, 92vw) !important;
  max-height: calc(100vh - 150px) !important;
  padding: 26px 30px !important;
  border-radius: 28px !important;
  background: #ffffff !important;
  color: #102042 !important;
  text-align: center !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26) !important;
  overflow: hidden !important;
}

.challengeResultCup {
  font-size: 34px !important;
  line-height: 1 !important;
  margin-bottom: 6px !important;
}

body.challengeFullPlayBody .challengeResultEyebrow {
  color: #ff8f15 !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

body.challengeFullPlayBody .challengeResultTitle {
  margin-top: 6px !important;
  font-size: clamp(34px, 4.5vw, 54px) !important;
  line-height: 1.05 !important;
  font-weight: 1000 !important;
}

body.challengeFullPlayBody .challengeResultSub {
  margin-top: 8px !important;
  color: #64748b !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

body.challengeFullPlayBody .challengeResultStats {
  margin-top: 22px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body.challengeFullPlayBody .challengeResultStats div {
  min-height: 100px !important;
  padding: 14px !important;
  border-radius: 20px !important;
  background: #f7f9fc !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

body.challengeFullPlayBody .challengeResultStats span {
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}

body.challengeFullPlayBody .challengeResultStats b {
  margin-top: 6px !important;
  color: #102042 !important;
  font-size: 24px !important;
  line-height: 1 !important;
  font-weight: 1000 !important;
}

body.challengeFullPlayBody .challengeResultStats strong {
  margin-top: 8px !important;
  color: #2563eb !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}

body.challengeFullPlayBody .challengeResultActions {
  margin-top: 24px !important;
  display: flex !important;
  justify-content: center !important;
  gap: 14px !important;
}

body.challengeFullPlayBody .challengeResultBtn {
  position: relative !important;
  z-index: 10 !important;
  min-width: 150px !important;
  min-height: 54px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 18px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  font-size: 16px !important;
  font-weight: 1000 !important;
}

body.challengeFullPlayBody .challengeResultBtn.secondary {
  background: #eef2f7 !important;
  color: #314569 !important;
}

body.challengeFullPlayBody .challengeResultBtn.primary {
  background: linear-gradient(180deg, #ffb133, #ff8f15) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.24) !important;
}

body.challengeFullPlayBody .challengeResultBtn:hover {
  transform: translateY(-1px) !important;
}

@media (max-height: 720px) {
  body.challengeFullPlayBody .challengeFullResultCard {
    padding: 20px 24px !important;
  }

  .challengeResultCup {
    font-size: 28px !important;
  }

  body.challengeFullPlayBody .challengeResultTitle {
    font-size: 38px !important;
  }

  body.challengeFullPlayBody .challengeResultStats div {
    min-height: 84px !important;
  }

  body.challengeFullPlayBody .challengeResultActions {
    margin-top: 16px !important;
  }
}

@media (max-width: 760px) {
  body.challengeFullPlayBody .challengeResultStats {
    grid-template-columns: 1fr !important;
  }

  body.challengeFullPlayBody .challengeFullResultCard {
    max-height: calc(100vh - 130px) !important;
  }
}
/* =====================================================
   FIX NÚT ĐẤU LẠI KHIÊU CHIẾN - ÉP BẤM ĐƯỢC
   ===================================================== */

body.challengeFullPlayBody #challengeFullResult {
  position: relative !important;
  z-index: 3000 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody .challengeFullResultCard {
  position: relative !important;
  z-index: 3010 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody .challengeResultActions {
  position: relative !important;
  z-index: 3020 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody #btnBackChallengeLobby,
body.challengeFullPlayBody #btnReplayChallenge {
  position: relative !important;
  z-index: 3030 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none !important;
}
/* =====================================================
   FIX CỨNG 2 NÚT TỔNG KẾT KHIÊU CHIẾN
   ===================================================== */

body.challengeFullPlayBody #challengeFullResult {
  position: relative !important;
  z-index: 8000 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody .challengeFullResultCard {
  position: relative !important;
  z-index: 8010 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody .challengeResultActions {
  position: relative !important;
  z-index: 8020 !important;
  pointer-events: auto !important;
}

body.challengeFullPlayBody #btnBackChallengeLobby,
body.challengeFullPlayBody #btnReplayChallenge {
  position: relative !important;
  z-index: 8030 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none !important;
}
/* =====================================================
   FIX DỨT ĐIỂM MÀN TỔNG KẾT KHIÊU CHIẾN
   - Không render nút trong #app nữa
   - Tạo lớp riêng trên body
   - Chống mọi lớp khác che nút
   ===================================================== */

body.challengeResultIsOpen {
  overflow: hidden !important;
}

/* Ẩn toàn bộ nút nổi có thể chen lên màn tổng kết */
body.challengeResultIsOpen #guildRoot,
body.challengeResultIsOpen #dailyMissionsRoot,
body.challengeResultIsOpen #worldChatRoot,
body.challengeResultIsOpen #calculator580Root,
body.challengeResultIsOpen .serverSwitch {
  display: none !important;
}

/* Nền nằm trong app, chỉ để giữ màn tối phía sau */
.challengeResultAppBg {
  width: 100%;
  height: calc(100vh - 104px);
  min-height: 560px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 0, 0.18), transparent 36%),
    linear-gradient(135deg, #102042, #0f172a);
}

/* Lớp tổng kết thật nằm trực tiếp trên body */
.challengeResultLayer {
  position: fixed !important;

  /*
    104px là chiều cao topbar hiện tại của web bạn.
    Nếu sau này topbar thấp/cao hơn, chỉ chỉnh số này.
  */
  left: 0 !important;
  right: 0 !important;
  top: 104px !important;
  bottom: 0 !important;

  z-index: 2147483000 !important;

  display: grid !important;
  place-items: center !important;

  padding: 18px !important;
  overflow: hidden !important;

  pointer-events: auto !important;

  background:
    radial-gradient(circle at 50% 0%, rgba(255, 176, 0, 0.18), transparent 36%),
    linear-gradient(135deg, #102042, #0f172a) !important;
}

.challengeResultLayerCard {
  position: relative !important;
  z-index: 2147483001 !important;

  width: min(780px, 92vw) !important;
  max-height: calc(100vh - 150px) !important;

  padding: 26px 30px !important;
  border-radius: 28px !important;

  background: #ffffff !important;
  color: #102042 !important;
  text-align: center !important;

  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28) !important;
  overflow: hidden !important;

  pointer-events: auto !important;
}

.challengeResultLayer .challengeResultCup {
  font-size: 34px !important;
  line-height: 1 !important;
  margin-bottom: 6px !important;
}

.challengeResultLayer .challengeResultEyebrow {
  color: #ff8f15 !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

.challengeResultLayer .challengeResultTitle {
  margin-top: 6px !important;
  font-size: clamp(34px, 4.5vw, 54px) !important;
  line-height: 1.05 !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultSub {
  margin-top: 8px !important;
  color: #64748b !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.challengeResultLayer .challengeResultStats {
  margin-top: 22px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.challengeResultLayer .challengeResultStats div {
  min-height: 100px !important;
  padding: 14px !important;
  border-radius: 20px !important;
  background: #f7f9fc !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.challengeResultLayer .challengeResultStats span {
  color: #64748b !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultStats b {
  margin-top: 6px !important;
  color: #102042 !important;
  font-size: 24px !important;
  line-height: 1 !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultStats strong {
  margin-top: 8px !important;
  color: #2563eb !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultActions {
  position: relative !important;
  z-index: 2147483002 !important;

  margin-top: 24px !important;

  display: flex !important;
  justify-content: center !important;
  gap: 14px !important;

  pointer-events: auto !important;
}

.challengeResultLayer .challengeResultBtn {
  position: relative !important;
  z-index: 2147483003 !important;

  min-width: 150px !important;
  min-height: 54px !important;

  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 18px !important;

  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none !important;

  font-size: 16px !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultBtn.secondary {
  background: #eef2f7 !important;
  color: #314569 !important;
}

.challengeResultLayer .challengeResultBtn.primary {
  background: linear-gradient(180deg, #ffb133, #ff8f15) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 28px rgba(255, 143, 21, 0.24) !important;
}

.challengeResultLayer .challengeResultBtn:hover {
  transform: translateY(-1px) !important;
}

.challengeResultLayer .challengeResultBtn:active {
  transform: scale(0.98) !important;
}

@media (max-height: 720px) {
  .challengeResultLayerCard {
    padding: 20px 24px !important;
  }

  .challengeResultLayer .challengeResultCup {
    font-size: 28px !important;
  }

  .challengeResultLayer .challengeResultTitle {
    font-size: 38px !important;
  }

  .challengeResultLayer .challengeResultStats div {
    min-height: 84px !important;
  }

  .challengeResultLayer .challengeResultActions {
    margin-top: 16px !important;
  }
}

@media (max-width: 760px) {
  .challengeResultLayer .challengeResultStats {
    grid-template-columns: 1fr !important;
  }

  .challengeResultLayerCard {
    max-height: calc(100vh - 130px) !important;
  }
}
/* =====================================================
   FIX KẸT NỀN TỔNG KẾT KHI VÀO LẠI KHIÊU CHIẾN
   ===================================================== */

body.challengeFullPlayBody:not(.challengeResultIsOpen) .challengeResultAppBg {
  display: none !important;
}

body.challengeFullPlayBody:not(.challengeResultIsOpen) .challengeFullPlay {
  display: block !important;
  min-height: calc(100vh - 104px) !important;
}

body.challengeFullPlayBody:not(.challengeResultIsOpen) #app {
  background: transparent !important;
}
/* =====================================================
   KHIÊU CHIẾN - ĐẤU TIẾP + CHỌN BẢN ĐỒ TỔNG KẾT
   ===================================================== */

.challengeResultActionsNew {
  align-items: center !important;
  flex-wrap: wrap !important;
}

.challengeContinueGroup {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.challengeResultMapBtn {
  min-height: 54px !important;
  max-width: 260px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 18px !important;
  background: #eef2f7 !important;
  color: #314569 !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.challengeResultBtn.continue {
  background: linear-gradient(180deg, #22c55e, #16a34a) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 28px rgba(22, 163, 74, 0.24) !important;
}

.challengeResultMapPopup {
  position: absolute !important;
  right: 0 !important;
  bottom: calc(100% + 12px) !important;
  width: 360px !important;
  max-height: 420px !important;
  padding: 14px !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  color: #102042 !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28) !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  z-index: 2147483010 !important;
  overflow: hidden !important;
}

.challengeResultMapPopupTitle {
  font-size: 18px !important;
  font-weight: 1000 !important;
  color: #102042 !important;
  text-align: left !important;
}

.challengeResultMapPopupSub {
  margin-top: 4px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-align: left !important;
}

.challengeResultMapPopupList {
  margin-top: 12px !important;
  max-height: 310px !important;
  overflow: auto !important;
  display: grid !important;
  gap: 8px !important;
  padding-right: 4px !important;
}

.challengeResultMapItem {
  width: 100% !important;
  min-height: 74px !important;
  padding: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 16px !important;
  background: #f8fafc !important;
  cursor: pointer !important;
  display: grid !important;
  grid-template-columns: 74px 1fr !important;
  align-items: center !important;
  gap: 12px !important;
  text-align: left !important;
}

.challengeResultMapItem.active {
  background: #fff7df !important;
  border-color: rgba(255, 143, 21, 0.45) !important;
}

.challengeResultMapItemLabel {
  height: 50px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  background: #ffffff !important;
  color: #2563eb !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
}

.challengeResultMapItemTitle {
  color: #102042 !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
}

.challengeResultMapItemDesc {
  margin-top: 4px !important;
  color: #64748b !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  font-weight: 800 !important;
}
/* =====================================================
   KHIÊU CHIẾN - CHAT PHÒNG LOCAL
   ===================================================== */

.challengeRoomChatShell {
  position: relative !important;
  overflow: visible !important;
}

.challengeRoomChatToggle {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 1000;
}

.challengeRoomChatToggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.challengeChatLatestPreview {
  min-width: 0;
  flex: 1 1 auto;
}

.challengeChatLatest {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(226, 232, 240, 0.92);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
}

.challengeChatLatestName {
  color: #ffffff;
  font-weight: 1000;
}

.challengeChatLatestText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeChatLatestTime {
  flex: 0 0 auto;
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.challengeChatMiniTool {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
}

.challengeChatMiniTool:hover {
  background: rgba(255, 255, 255, 0.18);
}

.challengeRoomChatPanel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: min(440px, calc(100vw - 48px));
  max-height: 430px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  z-index: 6200;
}

.challengeRoomChatPanelTop {
  min-height: 58px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.challengeRoomChatTitle {
  color: #ffffff;
  font-size: 16px;
  font-weight: 1000;
}

.challengeRoomChatSub {
  margin-top: 3px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 12px;
  font-weight: 850;
}

#btnCloseChallengeRoomChat {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  font-size: 22px;
  font-weight: 1000;
}

#btnCloseChallengeRoomChat:hover {
  background: rgba(255, 255, 255, 0.18);
}

.challengeRoomChatList {
  max-height: 260px;
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.challengeRoomChatEmpty {
  padding: 18px 12px;
  border-radius: 14px;
  text-align: center;
  color: rgba(203, 213, 225, 0.72);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 850;
}

.challengeRoomChatMsg {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
}

.challengeRoomChatAvatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  font-size: 16px;
  font-weight: 1000;
}

.challengeRoomChatBubble {
  min-width: 0;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.challengeRoomChatMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.challengeRoomChatMeta span {
  min-width: 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challengeRoomChatMeta em {
  flex: 0 0 auto;
  color: rgba(203, 213, 225, 0.62);
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
}

.challengeRoomChatText {
  margin-top: 5px;
  color: rgba(226, 232, 240, 0.94);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  word-break: break-word;
}

.challengeRoomChatInputWrap {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#challengeRoomChatInput {
  width: 100%;
  min-height: 48px;
  max-height: 92px;
  resize: none;
  border: 0;
  outline: none;
  border-radius: 14px;
  padding: 10px 12px;
  color: #102042;
  background: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

#btnSendChallengeRoomChat {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  font-size: 14px;
  font-weight: 1000;
}

#btnSendChallengeRoomChat:hover {
  filter: brightness(1.04);
}
/* =====================================================
   KHIÊU CHIẾN ONLINE - VÀO PHÒNG + THÀNH VIÊN
   ===================================================== */

.challengeJoinRoomBox {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.challengeJoinRoomTitle {
  font-size: 18px;
  font-weight: 1000;
  color: #102042;
}

.challengeJoinRoomSub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
}

.challengeJoinRoomControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.challengeJoinRoomInput {
  width: 220px;
  height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 0 14px;
  outline: none;
  color: #102042;
  background: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.challengeJoinRoomInput:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.challengeJoinRoomBtn {
  height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb133, #ff8f15);
  font-size: 14px;
  font-weight: 1000;
}

.challengeOnlineMember {
  min-height: 62px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
}

.challengeOnlineMember + .challengeOnlineMember {
  margin-top: 8px;
}

.challengeOnlineMember.me {
  background: rgba(37, 99, 235, 0.16);
}

.challengeOnlineMember.offline {
  opacity: 0.55;
}

.challengeOnlineAvatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  font-size: 18px;
  font-weight: 1000;
}

.challengeOnlineInfo {
  min-width: 0;
}

.challengeOnlineName {
  color: #ffffff;
  font-size: 14px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeOnlineSub {
  margin-top: 3px;
  color: #facc15;
  font-size: 12px;
  font-weight: 900;
}

.challengeOnlineEmpty {
  padding: 14px;
  border-radius: 14px;
  color: rgba(226, 232, 240, 0.76);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.challengeStartBtn.disabled,
.challengeSideStartBtn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
/* =====================================================
   KHIÊU CHIẾN ONLINE - TỔNG KẾT THẬT
   ===================================================== */

.challengeOnlineResultBox {
  margin-top: 20px !important;
  padding: 16px !important;
  border-radius: 22px !important;
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.challengeOnlineWinner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 12px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #fff7df, #ffffff) !important;
  border: 1px solid rgba(255, 143, 21, 0.2) !important;
}

.challengeOnlineWinnerCup {
  width: 46px !important;
  height: 46px !important;
  border-radius: 16px !important;
  display: grid !important;
  place-items: center !important;
  background: #ffffff !important;
  font-size: 26px !important;
}

.challengeOnlineWinnerLabel {
  color: #ff8f15 !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

.challengeOnlineWinnerName {
  margin-top: 2px !important;
  color: #102042 !important;
  font-size: 20px !important;
  font-weight: 1000 !important;
}

.challengeOnlineResultList {
  margin-top: 12px !important;
  display: grid !important;
  gap: 8px !important;
  max-height: 260px !important;
  overflow: auto !important;
}

.challengeOnlineResultRow {
  min-height: 68px !important;
  padding: 10px !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  display: grid !important;
  grid-template-columns: 54px 1fr 86px 62px 62px !important;
  align-items: center !important;
  gap: 10px !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.challengeOnlineResultRow.me {
  background: #eef6ff !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
}

.challengeOnlineResultRank {
  color: #102042 !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
}

.challengeOnlineResultPlayer {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 42px 1fr !important;
  align-items: center !important;
  gap: 10px !important;
}

.challengeOnlineResultAvatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #38bdf8, #2563eb) !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
}

.challengeOnlineResultName {
  color: #102042 !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.challengeOnlineResultSub {
  margin-top: 3px !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

.challengeOnlineResultScore,
.challengeOnlineResultMini {
  text-align: center !important;
}

.challengeOnlineResultScore b,
.challengeOnlineResultMini b {
  display: block !important;
  color: #102042 !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
}

.challengeOnlineResultScore span,
.challengeOnlineResultMini span {
  display: block !important;
  margin-top: 2px !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.challengeOnlineResultEmpty {
  margin-top: 16px !important;
  padding: 16px !important;
  border-radius: 16px !important;
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}
/* =====================================================
   FIX HIỂN THỊ NÚT TỔNG KẾT KHIÊU CHIẾN ONLINE
   - Nút nằm ngay dưới thống kê
   - Bảng xếp hạng nằm dưới nút
   - Không bị cắt mất nút
   ===================================================== */

.challengeResultLayerCard {
  width: min(940px, 92vw) !important;
  max-height: calc(100vh - 135px) !important;
  padding: 20px 28px !important;
  overflow: hidden !important;

  display: flex !important;
  flex-direction: column !important;
}

.challengeResultLayer .challengeResultCup {
  font-size: 26px !important;
  margin-bottom: 4px !important;
}

.challengeResultLayer .challengeResultEyebrow {
  font-size: 11px !important;
}

.challengeResultLayer .challengeResultTitle {
  margin-top: 4px !important;
  font-size: clamp(30px, 4vw, 46px) !important;
  line-height: 1 !important;
}

.challengeResultLayer .challengeResultSub {
  margin-top: 6px !important;
  font-size: 14px !important;
}

.challengeResultLayer .challengeResultStats {
  margin-top: 16px !important;
  gap: 12px !important;
}

.challengeResultLayer .challengeResultStats div {
  min-height: 82px !important;
  padding: 10px !important;
}

.challengeResultLayer .challengeResultStats b {
  font-size: 22px !important;
}

.challengeResultLayer .challengeResultStats strong {
  margin-top: 5px !important;
  font-size: 12px !important;
}

.challengeResultLayer .challengeResultActions,
.challengeResultActionsNew {
  margin-top: 14px !important;
  margin-bottom: 12px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;

  flex: 0 0 auto !important;
  z-index: 2147483005 !important;
}

.challengeResultLayer .challengeResultBtn,
.challengeResultLayer .challengeResultMapBtn {
  min-height: 46px !important;
  height: 46px !important;
  min-width: 132px !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  border-radius: 15px !important;
}

.challengeResultLayer .challengeResultMapBtn {
  max-width: 220px !important;
}

.challengeContinueGroup {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Bảng kết quả online nằm dưới nút, gọn hơn */
.challengeOnlineResultBox {
  margin-top: 0 !important;
  padding: 12px !important;
  border-radius: 18px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.challengeOnlineWinner {
  padding: 8px !important;
}

.challengeOnlineWinnerCup {
  width: 38px !important;
  height: 38px !important;
  font-size: 22px !important;
}

.challengeOnlineWinnerLabel {
  font-size: 11px !important;
}

.challengeOnlineWinnerName {
  font-size: 18px !important;
}

.challengeOnlineResultList {
  margin-top: 8px !important;
  max-height: 180px !important;
  overflow: auto !important;
  gap: 7px !important;
}

.challengeOnlineResultRow {
  min-height: 58px !important;
  padding: 8px !important;
  grid-template-columns: 44px 1fr 70px 52px 52px !important;
  gap: 8px !important;
}

.challengeOnlineResultAvatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  font-size: 16px !important;
}

.challengeOnlineResultScore b,
.challengeOnlineResultMini b {
  font-size: 16px !important;
}

/* Popup chọn bản đồ phải nổi lên trên cụm nút */
.challengeResultMapPopup {
  z-index: 2147483010 !important;
}
/* =====================================================
   KHIÊU CHIẾN ONLINE - CHỜ ĐỐI THỦ + QUAN SÁT
   ===================================================== */

.challengeWaitingPlay,
.challengeObservePlay {
  min-height: calc(100vh - 110px);
}

.challengeObserveCenter {
  min-height: 430px;
  display: grid;
  place-items: center;
  padding: 28px;
}

.challengeObserveCard {
  width: min(760px, 92vw);
  padding: 34px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.challengeObserveIcon {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dbeafe, #ffffff);
  font-size: 34px;
}

.challengeObserveTitle {
  color: #102042;
  font-size: 30px;
  font-weight: 1000;
}

.challengeObserveSub {
  max-width: 560px;
  margin: 8px auto 0;
  color: #64748b;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
}

.challengeObserveInfoGrid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.challengeObserveInfoGrid div {
  min-height: 96px;
  padding: 14px;
  border-radius: 20px;
  background: #f8fafc;
  display: grid;
  place-items: center;
}

.challengeObserveInfoGrid span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.challengeObserveInfoGrid b {
  color: #102042;
  font-size: 28px;
  font-weight: 1000;
}

.challengeObserveInfoGrid em {
  color: #2563eb;
  font-style: normal;
  font-size: 12px;
  font-weight: 1000;
}

.challengeObserveActions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.challengeObserveBtn {
  min-width: 150px;
  height: 54px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 1000;
}

.challengeObserveBtn.primary {
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.24);
}

.challengeObserveBtn.secondary {
  color: #102042;
  background: #eef2f7;
}

.challengeObserveBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.challengeObserveBanner {
  margin: 14px auto 0;
  width: min(980px, 92vw);
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff7df;
  color: #8a5a00;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  border: 1px solid rgba(255, 143, 21, 0.24);
}

.challengeFullTimer.done {
  background: #dcfce7;
  color: #166534;
}

.challengeFullTimer.observe {
  background: #dbeafe;
  color: #1d4ed8;
}

.challengeFullAnswerBtn.isObserve {
  opacity: 0.82;
  cursor: not-allowed;
}
/* Khiêu Chiến - nút Đấu Tiếp bị khóa với người không phải chủ phòng */
.challengeResultBtn.disabled,
.challengeResultBtn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.35) !important;
}
/* Khiêu Chiến - trạng thái đang đổi Sẵn Sàng */
.challengeReadyBtn.isLoading,
.challengeReadyBtn:disabled {
  opacity: 0.72 !important;
  cursor: wait !important;
  filter: grayscale(0.15) !important;
}

.challengeReadyBtn.isLoading {
  position: relative;
}
/* =====================================================
   KHIÊU CHIẾN - MỜI BẠN BÈ VÀO PHÒNG
   ===================================================== */

.challengeInviteLayer {
  position: fixed;
  inset: 0;
  z-index: 2147483100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(7px);
}

.challengeInviteLayer.incoming {
  background: rgba(15, 23, 42, 0.28);
}

.challengeInviteCard {
  width: min(620px, 94vw);
  max-height: min(720px, 90vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeInviteHead {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeInviteEyebrow {
  color: #ff8f15;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challengeInviteTitle {
  margin-top: 4px;
  color: #102042;
  font-size: 26px;
  font-weight: 1000;
}

.challengeInviteSub {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.challengeInviteClose {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #102042;
  background: #f1f5f9;
  font-size: 28px;
  font-weight: 1000;
}

.challengeInviteMessageBox {
  padding: 18px 24px 12px;
}

.challengeInviteMessageBox label {
  display: block;
  margin-bottom: 8px;
  color: #102042;
  font-size: 14px;
  font-weight: 1000;
}

.challengeInviteMessageBox textarea {
  width: 100%;
  resize: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
  color: #102042;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 800;
}

.challengeInviteMessageBox textarea:focus {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.09);
}

.challengeInviteFriendList {
  padding: 0 24px 24px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.challengeInviteFriendItem {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.challengeInviteFriendAvatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  font-size: 20px;
  font-weight: 1000;
}

.challengeInviteFriendName {
  color: #102042;
  font-size: 15px;
  font-weight: 1000;
}

.challengeInviteFriendSub {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.challengeInviteSendBtn {
  min-width: 88px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb12a, #ff8f15);
  font-size: 14px;
  font-weight: 1000;
}

.challengeInviteSendBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.challengeInviteEmpty {
  padding: 22px;
  border-radius: 18px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

/* Popup người nhận lời mời */

.challengeIncomingCard {
  width: min(500px, 94vw);
  padding: 28px;
  border-radius: 32px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.34);
  text-align: center;
  border: 1px solid rgba(255, 143, 21, 0.18);
}

.challengeIncomingIcon {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(135deg, #fff7df, #ffffff);
  font-size: 36px;
}

.challengeIncomingTitle {
  color: #102042;
  font-size: 30px;
  font-weight: 1000;
}

.challengeIncomingSub {
  margin-top: 8px;
  color: #64748b;
  font-size: 15px;
  font-weight: 850;
}

.challengeIncomingRoom {
  width: fit-content;
  margin: 14px auto 0;
  padding: 9px 16px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 15px;
  font-weight: 1000;
}

.challengeIncomingInfo {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.challengeIncomingInfo span {
  padding: 7px 11px;
  border-radius: 999px;
  color: #102042;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 950;
}

.challengeIncomingMessage {
  margin-top: 20px;
  padding: 16px;
  border-radius: 20px;
  background: #fff7df;
  border: 1px solid rgba(255, 143, 21, 0.18);
  text-align: left;
}

.challengeIncomingMessageLabel {
  color: #ff8f15;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challengeIncomingMessageText {
  margin-top: 6px;
  color: #102042;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.challengeIncomingActions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.challengeIncomingBtn {
  height: 54px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 1000;
}

.challengeIncomingBtn.decline {
  color: #102042;
  background: #eef2f7;
}

.challengeIncomingBtn.accept {
  color: #ffffff;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow: 0 16px 34px rgba(22, 163, 74, 0.25);
}
/* =====================================================
   KHIÊU CHIẾN - THÔNG BÁO CHO NGƯỜI GỬI LỜI MỜI
   ===================================================== */

#challengeInviteNoticeRoot {
  position: fixed;
  right: 24px;
  top: 104px;
  z-index: 2147483200;
  pointer-events: none;
}

.challengeInviteNoticeToast {
  width: min(420px, calc(100vw - 36px));
  min-height: 96px;
  display: grid;
  grid-template-columns: 54px 1fr 42px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26);
  border: 1px solid rgba(255, 143, 21, 0.2);
  pointer-events: auto;
  animation: challengeInviteNoticeIn 0.22s ease-out;
}

.challengeInviteNoticeIcon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff7df, #ffffff);
  font-size: 26px;
}

.challengeInviteNoticeTitle {
  color: #ff8f15;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challengeInviteNoticeText {
  margin-top: 4px;
  color: #102042;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.35;
}

.challengeInviteNoticeRoom {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.challengeInviteNoticeClose {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #102042;
  background: #eef2f7;
  font-size: 24px;
  font-weight: 1000;
}

@keyframes challengeInviteNoticeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* =====================================================
   KHIÊU CHIẾN - TRẠNG THÁI LỜI MỜI TRONG POPUP MỜI BẠN
   ===================================================== */

.challengeInviteHeadActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.challengeInviteRefresh {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #102042;
  background: #f1f5f9;
  font-size: 23px;
  font-weight: 1000;
}

.challengeInviteRefresh:hover,
.challengeInviteClose:hover {
  background: #e2e8f0;
}

.challengeInviteFriendItem.pending {
  background: #fff7df;
  border-color: rgba(255, 143, 21, 0.24);
}

.challengeInviteFriendItem.accepted {
  background: #ecfdf5;
  border-color: rgba(22, 163, 74, 0.24);
}

.challengeInviteFriendItem.declined {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.18);
}

.challengeInviteFriendItem.expired {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.18);
}

.challengeInviteFriendItem.inRoom {
  background: #eef6ff;
  border-color: rgba(37, 99, 235, 0.22);
}

.challengeInviteStatusLine {
  width: fit-content;
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
}

.challengeInviteStatusLine.none {
  color: #2563eb;
  background: #dbeafe;
}

.challengeInviteStatusLine.pending {
  color: #8a5a00;
  background: #fff0bd;
}

.challengeInviteStatusLine.accepted {
  color: #166534;
  background: #dcfce7;
}

.challengeInviteStatusLine.declined {
  color: #991b1b;
  background: #fee2e2;
}

.challengeInviteStatusLine.expired,
.challengeInviteStatusLine.cancelled {
  color: #475569;
  background: #e2e8f0;
}

.challengeInviteStatusLine.inRoom {
  color: #1d4ed8;
  background: #dbeafe;
}

.challengeInviteSendBtn.pending,
.challengeInviteSendBtn.accepted,
.challengeInviteSendBtn.inRoom {
  background: #cbd5e1;
  color: #334155;
  cursor: not-allowed;
  box-shadow: none;
}

.challengeInviteSendBtn.declined,
.challengeInviteSendBtn.expired,
.challengeInviteSendBtn.cancelled,
.challengeInviteSendBtn.none {
  background: linear-gradient(180deg, #ffb12a, #ff8f15);
  color: #ffffff;
}
/* =====================================================
   KHIÊU CHIẾN - NÚT MỜI NHANH TRONG CỘT BẠN ONLINE
   ===================================================== */

.challengeSideFriendDivider {
  margin: 12px 4px 6px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.challengeOnlineInviteFriend {
  grid-template-columns: 44px 1fr 76px !important;
}

.challengeSideMiniInviteBtn {
  width: 70px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb12a, #ff8f15);
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(255, 143, 21, 0.2);
}

.challengeSideMiniInviteBtn:hover {
  transform: translateY(-1px);
}

.challengeSideMiniInviteBtn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.3);
}

.challengeSideMiniInviteBtn.pending,
.challengeSideMiniInviteBtn.accepted {
  color: #334155;
  background: #cbd5e1;
}

.challengeOnlineInviteFriend.pending {
  background: rgba(255, 247, 223, 0.08) !important;
  border-color: rgba(255, 143, 21, 0.2) !important;
}

.challengeOnlineInviteFriend.accepted {
  background: rgba(34, 197, 94, 0.08) !important;
  border-color: rgba(34, 197, 94, 0.18) !important;
}

.challengeOnlineInviteFriend.declined,
.challengeOnlineInviteFriend.expired {
  background: rgba(255, 255, 255, 0.04) !important;
}
/* =====================================================
   KHIÊU CHIẾN - GHÉP TRẬN SOLO 1 VS 1
   ===================================================== */

.challengeSoloPlayer.enemy.isSearching {
  border-color: rgba(255, 177, 42, 0.65) !important;
  box-shadow:
    0 0 0 1px rgba(255, 177, 42, 0.22),
    0 18px 42px rgba(255, 143, 21, 0.18);
}

.challengeSoloPlayer.enemy.isSearching .challengeBattleAvatar {
  background: linear-gradient(135deg, #ffb12a, #ff8f15);
  color: #ffffff;
}

.challengeMatchmakingPulse {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #102042;
  background: linear-gradient(180deg, #fff7df, #ffe6a3);
  font-size: 13px;
  font-weight: 1000;
  animation: challengeMatchmakingPulse 1.05s infinite ease-in-out;
}

@keyframes challengeMatchmakingPulse {
  0% {
    opacity: 0.55;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 0.55;
    transform: scale(0.98);
  }
}
/* =====================================================
   KHIÊU CHIẾN - HỦY GHÉP TRẬN
   ===================================================== */

.challengeCancelMatchmakingBtn {
  margin-top: 10px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.24);
}

.challengeCancelMatchmakingBtn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.challengeStartBtn.cancel,
.challengeSideStartBtn.cancel {
  color: #ffffff !important;
  background: linear-gradient(180deg, #ef4444, #dc2626) !important;
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.25) !important;
}

.challengeStartBtn.cancel:disabled,
.challengeSideStartBtn.cancel:disabled {
  opacity: 0.65 !important;
  cursor: wait !important;
  filter: grayscale(0.2) !important;
}
/* =====================================================
   KHIÊU CHIẾN - XEM LẠI BÀI LÀM KHI ĐANG CHỜ ĐỐI THỦ
   ===================================================== */

.challengeObserveBtn.review {
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
}

.challengeReviewPlay {
  min-height: calc(100vh - 94px);
  padding: 28px 7vw 42px;
  background: linear-gradient(180deg, #fff8e8 0%, #ffedbf 100%);
}

.challengeReviewTop {
  align-items: flex-start;
}

.challengeReviewTopActions .btn.active {
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.challengeReviewLayout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.challengeReviewMain {
  min-width: 0;
}

.challengeReviewMenu {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.challengeReviewMenuTitle {
  margin-bottom: 12px;
  color: #102042;
  font-size: 18px;
  font-weight: 1000;
}

.challengeReviewMenuGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.challengeReviewMenuItem {
  min-height: 62px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  background: #f1f5f9;
  color: #102042;
  font-weight: 950;
  display: grid;
  gap: 4px;
  place-items: center;
}

.challengeReviewMenuItem span {
  font-size: 12px;
  color: #64748b;
}

.challengeReviewMenuItem.correct {
  background: #dcfce7;
}

.challengeReviewMenuItem.correct span {
  color: #15803d;
}

.challengeReviewMenuItem.wrong {
  background: #fee2e2;
}

.challengeReviewMenuItem.wrong span {
  color: #b91c1c;
}

.challengeReviewMenuItem.active {
  outline: 3px solid rgba(37, 99, 235, 0.32);
}

.challengeReviewSidePanel {
  position: sticky;
  top: 112px;
  padding: 20px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.1);
}

.challengeReviewSideTitle {
  margin-bottom: 12px;
  color: #102042;
  font-size: 24px;
  font-weight: 1000;
}

.challengeReviewText,
.challengeReviewEmpty {
  color: #334155;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

.challengeReviewEmpty {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.challengeReviewCorrectBox {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 1000;
}

.challengeReviewAnswers .challengeFullAnswerBtn.isReview {
  cursor: default;
}

.challengeReviewAnswers .challengeFullAnswerBtn.isSelected {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.challengeReviewAnswerNote {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.challengeReviewAnswerNote > div {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #102042;
  font-size: 14px;
  font-weight: 950;
}

.challengeReviewAnswerNote b {
  color: #2563eb;
}

.challengeReviewNav {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 1100px) {
  .challengeReviewLayout {
    grid-template-columns: 1fr;
  }

  .challengeReviewSidePanel {
    position: static;
  }
}
/* =====================================================
   KHIÊU CHIẾN - TỔNG KẾT MỚI + BẢNG XẾP HẠNG
   ===================================================== */

.challengeResultLayerCard {
  width: min(980px, 92vw);
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.challengeResultStatsBetter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 20px;
}

.challengeResultStatCard {
  min-height: 118px;
  border-radius: 22px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px 12px;
}

.challengeResultStatCard span {
  color: #64748b;
  font-size: 14px;
  font-weight: 1000;
}

.challengeResultStatCard b {
  color: #102042;
  font-size: 34px;
  line-height: 1;
  font-weight: 1000;
}

.challengeResultStatCard strong {
  color: #2563eb;
  font-size: 13px;
  font-weight: 1000;
}

.challengeResultStatCard.correct {
  background: linear-gradient(180deg, #dcfce7, #f0fdf4);
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.challengeResultStatCard.correct b,
.challengeResultStatCard.correct strong {
  color: #16a34a;
}

.challengeResultStatCard.wrong {
  background: linear-gradient(180deg, #fee2e2, #fff1f2);
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.challengeResultStatCard.wrong b,
.challengeResultStatCard.wrong strong {
  color: #dc2626;
}

.challengeResultStatCard.hearts {
  background: linear-gradient(180deg, #fff7ed, #fffbeb);
  border: 1px solid rgba(249, 115, 22, 0.22);
}

.challengeResultHeartsVisual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 28px;
  line-height: 1;
}

.challengeResultHeartsVisual span {
  display: inline-grid;
  place-items: center;
  font-size: 28px;
  filter: drop-shadow(0 5px 8px rgba(15, 23, 42, 0.12));
}

.challengeResultHeartsVisual span.lost {
  opacity: 0.28;
  filter: grayscale(1);
}

.challengeResultBtn.review {
  color: #ffffff;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}

.challengeOnlineResultBox {
  margin-top: 18px;
  padding: 14px;
  border-radius: 24px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeOnlineWinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 72px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff7df, #fffaf0);
  border: 1px solid rgba(255, 177, 42, 0.35);
}

.challengeOnlineWinnerCup {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-size: 28px;
}

.challengeOnlineWinnerLabel {
  color: #ff8f15;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.challengeOnlineWinnerName {
  color: #102042;
  font-size: 24px;
  font-weight: 1000;
}

.challengeOnlineResultList {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.challengeOnlineResultRow {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 90px 70px 120px;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.challengeOnlineResultRow.me {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.25);
}

.challengeOnlineResultRank {
  color: #102042;
  font-size: 22px;
  font-weight: 1000;
  text-align: center;
}

.challengeOnlineResultPlayer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.challengeOnlineResultAvatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  font-size: 22px;
  font-weight: 1000;
}

.challengeOnlineResultName {
  color: #102042;
  font-size: 16px;
  font-weight: 1000;
}

.challengeOnlineResultSub {
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.challengeOnlineResultCorrect,
.challengeOnlineResultWrong,
.challengeOnlineResultHearts {
  text-align: center;
  display: grid;
  gap: 3px;
  justify-items: center;
}

.challengeOnlineResultCorrect b {
  color: #16a34a;
  font-size: 22px;
  font-weight: 1000;
}

.challengeOnlineResultWrong b {
  color: #dc2626;
  font-size: 22px;
  font-weight: 1000;
}

.challengeOnlineResultCorrect span,
.challengeOnlineResultWrong span,
.challengeOnlineResultHearts span {
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
}

.challengeOnlineResultHearts .challengeResultHeartsVisual {
  font-size: 18px;
}

.challengeOnlineResultHearts .challengeResultHeartsVisual span {
  font-size: 18px;
}

@media (max-width: 900px) {
  .challengeResultStatsBetter {
    grid-template-columns: 1fr;
  }

  .challengeOnlineResultRow {
    grid-template-columns: 44px 1fr;
  }

  .challengeOnlineResultCorrect,
  .challengeOnlineResultWrong,
  .challengeOnlineResultHearts {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
  }
}
/* =====================================================
   KHIÊU CHIẾN - TỔNG KẾT SOLO COMPACT 100% MÀN HÌNH
   ===================================================== */

/* Lớp ngoài: giữ cố định, không cho cuộn cả màn */
.challengeResultLayer {
  top: 104px !important;
  bottom: 0 !important;
  padding: 10px 14px !important;
  overflow: hidden !important;
  place-items: center !important;
}

/* Card tổng kết solo: phải vừa 100% màn hình */
.challengeResultLayerCard.soloCompactResult {
  width: min(880px, 92vw) !important;
  max-height: calc(100vh - 128px) !important;
  padding: 18px 22px !important;
  border-radius: 26px !important;
  overflow: hidden !important;
}

/* Card nhiều người: cho phép bảng xếp hạng cuộn */
.challengeResultLayerCard.multiResult {
  width: min(980px, 94vw) !important;
  max-height: calc(100vh - 128px) !important;
  padding: 18px 22px !important;
  border-radius: 26px !important;
  overflow: hidden !important;
}

/* Bỏ tác dụng của title cũ nếu CSS cũ còn sót */
.challengeResultLayer .challengeResultCup,
.challengeResultLayer .challengeResultEyebrow,
.challengeResultLayer .challengeResultTitle,
.challengeResultLayer .challengeResultSub {
  display: none !important;
}

/* Chỉ hiện VICTORY hoặc DEFEAT */
.challengeResultBigStatus {
  margin: 0 auto 14px !important;
  text-align: center !important;
  font-size: clamp(46px, 6vw, 76px) !important;
  line-height: 0.95 !important;
  font-weight: 1000 !important;
  letter-spacing: 0.06em !important;
}

.challengeResultLayerCard.victory .challengeResultBigStatus {
  color: #16a34a !important;
  text-shadow: 0 12px 34px rgba(22, 163, 74, 0.22) !important;
}

.challengeResultLayerCard.defeat .challengeResultBigStatus {
  color: #dc2626 !important;
  text-shadow: 0 12px 34px rgba(220, 38, 38, 0.22) !important;
}

/* 3 ô thống kê thu gọn */
.challengeResultLayer .challengeResultStats.compact,
.challengeResultStatsBetter.compact {
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.challengeResultLayer .challengeResultStats.compact .challengeResultStatCard {
  min-height: 118px !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
}

.challengeResultLayer
  .challengeResultStats.compact
  .challengeResultStatCard
  span {
  font-size: 12px !important;
  font-weight: 1000 !important;
}

.challengeResultLayer .challengeResultStats.compact .challengeResultStatCard b {
  margin-top: 3px !important;
  font-size: 28px !important;
  line-height: 1 !important;
  font-weight: 1000 !important;
}

.challengeResultLayer
  .challengeResultStats.compact
  .challengeResultStatCard
  strong {
  margin-top: 5px !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
}

/* Đúng màu xanh */
.challengeResultLayer .challengeResultStatCard.correct {
  background: linear-gradient(180deg, #ecfdf5, #f0fdf4) !important;
  border: 1px solid rgba(22, 163, 74, 0.28) !important;
}

.challengeResultLayer .challengeResultStatCard.correct b,
.challengeResultLayer .challengeResultStatCard.correct strong {
  color: #16a34a !important;
}

/* Sai màu đỏ */
.challengeResultLayer .challengeResultStatCard.wrong {
  background: linear-gradient(180deg, #fff1f2, #fef2f2) !important;
  border: 1px solid rgba(220, 38, 38, 0.28) !important;
}

.challengeResultLayer .challengeResultStatCard.wrong b,
.challengeResultLayer .challengeResultStatCard.wrong strong {
  color: #dc2626 !important;
}

/* Tim nằm ngang, to hơn 50% */
.challengeResultHeartsVisual {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  min-height: 42px !important;
}

.challengeResultHeartsVisual span {
  display: inline-flex !important;
  width: auto !important;
  height: auto !important;
  font-size: 42px !important;
  line-height: 1 !important;
  color: #ef4444 !important;
  filter: drop-shadow(0 7px 9px rgba(239, 68, 68, 0.2)) !important;
}

.challengeResultHeartsVisual span.lost {
  color: #9ca3af !important;
  opacity: 0.35 !important;
  filter: grayscale(1) !important;
}

/* Riêng tim trong bảng xếp hạng nhỏ hơn một chút để không vỡ hàng */
.challengeOnlineResultHearts .challengeResultHeartsVisual {
  gap: 4px !important;
  min-height: 20px !important;
}

.challengeOnlineResultHearts .challengeResultHeartsVisual span {
  font-size: 22px !important;
}

/* Cụm nút thu nhỏ và sát nhau hơn */
.challengeResultLayer .challengeResultActions,
.challengeResultLayer .challengeResultActionsNew {
  margin-top: 14px !important;
  gap: 10px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.challengeResultLayer .challengeResultBtn {
  min-width: 138px !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
}

/* Bảng xếp hạng: bỏ khối Winner cũ hoàn toàn */
.challengeOnlineWinner {
  display: none !important;
}

/* Khung bảng xếp hạng thu gọn */
.challengeOnlineResultBox {
  margin-top: 14px !important;
  padding: 10px !important;
  border-radius: 20px !important;
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Solo 1v1: không cuộn, phải hiện hết */
.challengeOnlineResultBox.soloRankBox {
  max-height: none !important;
  overflow: hidden !important;
}

/* Map đông người: chỉ phần danh sách được cuộn */
.challengeOnlineResultBox.multiRankBox .challengeOnlineResultList {
  max-height: min(250px, calc(100vh - 520px)) !important;
  overflow-y: auto !important;
  padding-right: 4px !important;
}

.challengeOnlineResultList {
  display: grid !important;
  gap: 8px !important;
}

/* Dòng xếp hạng thấp hơn để vừa màn */
.challengeOnlineResultRow {
  min-height: 58px !important;
  padding: 7px 10px !important;
  border-radius: 15px !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) 74px 58px 92px !important;
  gap: 8px !important;
  align-items: center !important;
}

/* Avatar nhỏ hơn một chút */
.challengeOnlineResultAvatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 13px !important;
  font-size: 18px !important;
}

.challengeOnlineResultRank {
  font-size: 18px !important;
}

.challengeOnlineResultName {
  font-size: 14px !important;
  line-height: 1.1 !important;
}

.challengeOnlineResultSub {
  margin-top: 1px !important;
  font-size: 11px !important;
}

.challengeOnlineResultCorrect b,
.challengeOnlineResultWrong b {
  font-size: 20px !important;
  line-height: 1 !important;
}

.challengeOnlineResultCorrect b {
  color: #16a34a !important;
}

.challengeOnlineResultWrong b {
  color: #dc2626 !important;
}

.challengeOnlineResultCorrect span,
.challengeOnlineResultWrong span,
.challengeOnlineResultHearts span {
  font-size: 10px !important;
  font-weight: 1000 !important;
}

/* Nếu màn hình thấp hơn, nén thêm một chút */
@media (max-height: 760px) {
  .challengeResultLayer {
    padding: 6px 12px !important;
  }

  .challengeResultLayerCard.soloCompactResult {
    padding: 14px 18px !important;
    max-height: calc(100vh - 120px) !important;
  }

  .challengeResultBigStatus {
    margin-bottom: 10px !important;
    font-size: clamp(40px, 5.4vw, 62px) !important;
  }

  .challengeResultLayer .challengeResultStats.compact .challengeResultStatCard {
    min-height: 100px !important;
    padding: 8px 10px !important;
  }

  .challengeResultHeartsVisual span {
    font-size: 36px !important;
  }

  .challengeResultLayer .challengeResultActions,
  .challengeResultLayer .challengeResultActionsNew {
    margin-top: 10px !important;
  }

  .challengeOnlineResultBox {
    margin-top: 10px !important;
  }

  .challengeOnlineResultRow {
    min-height: 52px !important;
    padding: 6px 9px !important;
  }
}

/* Màn nhỏ theo chiều ngang */
@media (max-width: 900px) {
  .challengeResultLayer .challengeResultStats.compact {
    grid-template-columns: 1fr !important;
  }

  .challengeResultLayerCard.soloCompactResult {
    overflow-y: auto !important;
  }

  .challengeOnlineResultRow {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }

  .challengeOnlineResultCorrect,
  .challengeOnlineResultWrong,
  .challengeOnlineResultHearts {
    grid-column: 2 !important;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }
}
/* =====================================================
   KHIÊU CHIẾN - FIX CUỘN POPUP CHỌN BẢN ĐỒ
   ===================================================== */

.challengeMapMiniPopupList {
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}
/* =====================================================
   KHIÊU CHIẾN - POPUP XÁC NHẬN GHÉP TRẬN 20 GIÂY
   ===================================================== */

.challengeMatchConfirmLayer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(3px);
}

.challengeMatchConfirmCard {
  width: min(430px, calc(100vw - 32px));
  padding: 26px 24px 22px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  text-align: center;
  border: 1px solid rgba(255, 176, 0, 0.3);
}

.challengeMatchConfirmIcon {
  width: 70px;
  height: 70px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  font-size: 34px;
}

.challengeMatchConfirmTitle {
  color: #0f2147;
  font-size: 28px;
  font-weight: 1000;
}

.challengeMatchConfirmSub {
  margin-top: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.challengeMatchConfirmTimer {
  width: 86px;
  height: 86px;
  margin: 18px auto 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #f97316, #ea580c);
  font-size: 30px;
  font-weight: 1000;
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.28);
}

.challengeMatchConfirmCount {
  color: #0f2147;
  font-size: 15px;
  font-weight: 950;
}

.challengeMatchConfirmPlayers {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.challengeMatchConfirmPlayer {
  min-height: 58px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 18px;
  background: #f1f5f9;
  text-align: left;
}

.challengeMatchConfirmPlayer.accepted {
  background: #dcfce7;
}

.challengeMatchConfirmAvatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  font-size: 20px;
  font-weight: 1000;
}

.challengeMatchConfirmName {
  min-width: 0;
  color: #0f2147;
  font-size: 15px;
  font-weight: 1000;
}

.challengeMatchConfirmState {
  color: #64748b;
  font-size: 12px;
  font-weight: 1000;
}

.challengeMatchConfirmPlayer.accepted .challengeMatchConfirmState {
  color: #16a34a;
}

.challengeMatchConfirmReadyBtn {
  width: 100%;
  height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  font-size: 18px;
  font-weight: 1000;
  box-shadow: 0 18px 38px rgba(34, 197, 94, 0.26);
}

.challengeMatchConfirmReadyBtn:disabled {
  cursor: default;
  opacity: 0.7;
  box-shadow: none;
}
/* =====================================================
   KHIÊU CHIẾN - TIẾN ĐỘ NHIỀU NGƯỜI CHO SINH TỬ / HỖN LOẠN
   ===================================================== */

.challengeFullDuelMulti {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
}

.challengeFullDuelMulti .challengeFullDuelRow {
  grid-template-columns: 180px minmax(0, 1fr) 54px 110px;
  gap: 10px;
  align-items: center;
}

.challengeFullDuelMulti .challengeFullDuelName {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeFullDuelMiniHearts {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  font-size: 16px;
  line-height: 1;
}

.challengeFullDuelMiniHearts span.alive {
  color: #ef4444;
}

.challengeFullDuelMiniHearts span.dead {
  color: #94a3b8;
  opacity: 0.35;
  filter: grayscale(1);
}

.challengeFullDuelRow.eliminated {
  opacity: 0.56;
}

.challengeFullDuelRow.eliminated .challengeFullDuelName::after {
  content: " • Bị loại";
  color: #ef4444;
  font-weight: 900;
}

@media (max-width: 900px) {
  .challengeFullDuelMulti .challengeFullDuelRow {
    grid-template-columns: 1fr;
  }

  .challengeFullDuelMiniHearts {
    justify-content: flex-start;
  }
}
/* =====================================================
   KHIÊU CHIẾN - CHUYỂN THANH TIẾN ĐỘ SANG BÊN PHẢI
   - Áp dụng cho Solo, Hỗn Loạn, Sinh Tử, màn chờ, màn quan sát
   - Thanh tiến độ chuyển từ ngang sang dọc
   ===================================================== */

.challengeFullPlay {
  position: relative;
  padding-right: 190px;
}

.challengeFullTop,
.challengeFullQuestionWrap,
.challengeObserveBanner {
  width: calc(100% - 190px);
  max-width: 1240px;
}

.challengeSideProgress {
  position: absolute;
  top: 112px;
  right: 22px;
  width: 150px;
  max-width: none;
  margin: 0;
  padding: 12px 10px;
  border-radius: 24px;
  display: block;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 176, 0, 0.28);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.challengeSideProgressTitle {
  margin-bottom: 10px;
  color: #102042;
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
}

.challengeSideProgressList {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.challengeSideProgress .challengeFullDuelRow,
.challengeSideProgress.challengeFullDuelMulti .challengeFullDuelRow {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px 38px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 5px 8px;
}

.challengeSideProgress .challengeFullDuelName,
.challengeSideProgress.challengeFullDuelMulti .challengeFullDuelName {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  max-width: 72px;
  color: #102042;
  font-size: 11px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeSideProgress .challengeFullDuelTrack {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 16px;
  height: 70px;
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.12);
}

.challengeSideProgress .challengeFullDuelFill {
  width: 100%;
  height: 0;
  border-radius: 999px;
  transition: height 0.25s ease;
}

.challengeSideProgress .challengeFullDuelRow.self .challengeFullDuelFill {
  background: linear-gradient(180deg, #38bdf8, #2563eb);
}

.challengeSideProgress .challengeFullDuelRow.enemy .challengeFullDuelFill {
  background: linear-gradient(180deg, #f97316, #ef4444);
}

.challengeSideProgress .challengeFullDuelNum {
  grid-column: 3;
  grid-row: 1;
  color: #102042;
  font-size: 11px;
  font-weight: 1000;
  text-align: left;
}

.challengeSideProgress .challengeFullDuelMiniHearts {
  grid-column: 1 / span 3;
  grid-row: 2;
  display: flex;
  justify-content: flex-start;
  gap: 3px;
  font-size: 11px;
  line-height: 1;
}

.challengeSideProgress .challengeFullDuelMiniHearts span.alive {
  color: #ef4444;
}

.challengeSideProgress .challengeFullDuelMiniHearts span.dead {
  color: #cbd5e1;
  opacity: 0.55;
  filter: grayscale(1);
}

.challengeSideProgress .challengeFullDuelRow.eliminated {
  opacity: 0.55;
}

.challengeSideProgress
  .challengeFullDuelRow.eliminated
  .challengeFullDuelName::after {
  content: " • Bị loại";
  color: #ef4444;
  font-weight: 1000;
}

/* Màn chờ và màn quan sát cũng dùng cùng vị trí tiến độ bên phải */
.challengeWaitingPlay,
.challengeObservePlay {
  position: relative;
}

/* Màn hình nhỏ: không để thanh tiến độ che đề bài */
@media (max-width: 1100px) {
  .challengeFullPlay {
    padding-right: 16px;
  }

  .challengeFullTop,
  .challengeFullQuestionWrap,
  .challengeObserveBanner {
    width: 100%;
    max-width: 1240px;
  }

  .challengeSideProgress {
    position: static;
    width: min(100%, 1240px);
    margin: 14px auto 0;
  }

  .challengeSideProgressList {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
/* =====================================================
   KHIÊU CHIẾN - NÚT CHUYỂN NGƯỜI QUAN SÁT
   Dạng: ‹| Tên người chơi |›
   ===================================================== */

.challengeObserveSwitcher {
  min-width: 220px;
  max-width: 320px;
  height: 48px;
  padding: 6px;
  border-radius: 999px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 176, 0, 0.35);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.challengeObserveSwitchBtn {
  width: 38px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #102042;
  background: linear-gradient(180deg, #fff7d6, #ffd166);
  font-size: 17px;
  font-weight: 1000;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.challengeObserveSwitchBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.challengeObserveSwitchBtn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(1);
}

.challengeObserveSwitchName {
  min-width: 0;
  color: #102042;
  font-size: 15px;
  font-weight: 1000;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeObserveBanner b {
  color: #2563eb;
}
/* =====================================================
   KHIÊU CHIẾN - ĐẤU HỖN LOẠN 4 NGƯỜI
   Bố cục 4 góc: Tây Bắc - Đông Bắc - Tây Nam - Đông Nam
   ===================================================== */

.challengeVsStage.isMulti.isFourPlayers {
  width: min(860px, 96%);
  height: min(460px, 64vh);
  position: relative;
}

.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot {
  width: 210px;
  min-height: 150px;
  position: absolute;
}

/* Slot 1: Tây Bắc */
.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot.slot1 {
  left: 6%;
  top: 6%;
  right: auto;
  bottom: auto;
  transform: none;
}

/* Slot 2: Đông Bắc */
.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot.slot2 {
  right: 6%;
  top: 6%;
  left: auto;
  bottom: auto;
  transform: none;
}

/* Slot 3: Tây Nam */
.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot.slot3 {
  left: 6%;
  bottom: 6%;
  right: auto;
  top: auto;
  transform: none;
}

/* Slot 4: Đông Nam */
.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot.slot4 {
  right: 6%;
  bottom: 6%;
  left: auto;
  top: auto;
  transform: none;
}

/* Nếu còn CSS cũ của slot5 thì ẩn đi trong layout 4 người */
.challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot.slot5 {
  display: none !important;
}

@media (max-width: 980px) {
  .challengeVsStage.isMulti.isFourPlayers {
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .challengeVsStage.isMulti.isFourPlayers .challengeMultiSlot {
    position: static;
    width: 100%;
    min-height: 140px;
    transform: none !important;
  }
}
/* =========================================================
   ĐẤU HỖN LOẠN 4 NGƯỜI - BỐ CỤC 4 GÓC
   ========================================================= */

.challengeChaosBoard {
  width: 100%;
  min-height: 560px;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 44px 72px;
  padding: 38px 54px;
  box-sizing: border-box;
}

.challengeChaosSeatWrap {
  display: flex;
  min-width: 0;
  min-height: 0;
}

.challengeChaosSeatWrap.northWest {
  justify-content: flex-start;
  align-items: flex-start;
}

.challengeChaosSeatWrap.northEast {
  justify-content: flex-end;
  align-items: flex-start;
}

.challengeChaosSeatWrap.southWest {
  justify-content: flex-start;
  align-items: flex-end;
}

.challengeChaosSeatWrap.southEast {
  justify-content: flex-end;
  align-items: flex-end;
}

.challengeChaosSeat {
  width: 230px;
  min-height: 166px;
  border-radius: 28px;
  padding: 20px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #eef4ff;
  background: linear-gradient(
    180deg,
    rgba(26, 56, 101, 0.92) 0%,
    rgba(11, 24, 53, 0.95) 100%
  );
  border: 1px solid rgba(140, 180, 255, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 10px 28px rgba(0, 0, 0, 0.22);
}

.challengeChaosSeat.self {
  background: linear-gradient(
    180deg,
    rgba(73, 102, 110, 0.96) 0%,
    rgba(28, 51, 82, 0.98) 100%
  );
  border: 1px solid rgba(247, 216, 120, 0.38);
}

.challengeChaosSeat.empty {
  background: linear-gradient(
    180deg,
    rgba(14, 31, 67, 0.95) 0%,
    rgba(8, 18, 43, 0.97) 100%
  );
  opacity: 0.96;
}

.challengeChaosSeat .challengeBattleAvatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(180deg, #49c5ff 0%, #2f67ff 100%);
  box-shadow: 0 10px 22px rgba(37, 121, 255, 0.28);
}

.challengeChaosSeat.empty .challengeBattleAvatar {
  background: rgba(14, 29, 62, 0.92);
  border: 2px dashed rgba(150, 180, 255, 0.22);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.9);
}

.challengeChaosSeat .challengeBattleName {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  color: #f5f7ff;
  word-break: break-word;
}

.challengeChaosSeat .challengeBattleRole {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: rgba(226, 235, 255, 0.82);
}

.challengeChaosSeat .challengeBattleMiniActions {
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.challengeChaosSeat .challengeBattleMiniActions span {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 15px;
}

@media (max-width: 1180px) {
  .challengeChaosBoard {
    gap: 28px 36px;
    padding: 28px 26px;
  }

  .challengeChaosSeat {
    width: 210px;
    min-height: 154px;
  }
}

@media (max-width: 920px) {
  .challengeChaosBoard {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 18px;
    min-height: auto;
    padding: 20px;
  }

  .challengeChaosSeatWrap.northWest,
  .challengeChaosSeatWrap.northEast,
  .challengeChaosSeatWrap.southWest,
  .challengeChaosSeatWrap.southEast {
    justify-content: center;
    align-items: center;
  }

  .challengeChaosSeat {
    width: min(260px, 100%);
  }
}
/* =====================================================
   ĐẤU HỖN LOẠN - NGƯỜI CHƠI THẬT HIỆN TRONG 4 Ô TRUNG TÂM
   ===================================================== */

.challengeChaosSeat.filled {
  opacity: 1;
}

.challengeChaosSeat.filled.online {
  border-color: rgba(80, 200, 255, 0.28);
}

.challengeChaosSeat.filled.ready {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(34, 197, 94, 0.14),
    0 12px 32px rgba(34, 197, 94, 0.14);
}

.challengeChaosSeat.filled.ready .challengeBattleRole {
  color: #86efac;
}

.challengeChaosSeat .challengeBattleAvatar {
  overflow: hidden;
}

.challengeChaosSeat .challengeBattleAvatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.challengeChaosSideNote {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 18px;
  color: rgba(226, 235, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
/* =====================================================
   SOLO 1 VS 1 - NGƯỜI CHƠI THẬT HIỆN Ở Ô TRUNG TÂM
   ===================================================== */

.challengeVsStage.isSolo.isSoloOnlineSeats {
  min-height: 560px;
  grid-template-rows: minmax(160px, 1fr) auto minmax(160px, 1fr);
  gap: 18px;
}

.challengeVsStage.isSolo.isSoloOnlineSeats .challengeSoloPlayer {
  width: 240px;
  min-height: 170px;
  border-radius: 28px;
}

.challengeSoloPlayer.filled {
  opacity: 1;
}

.challengeSoloPlayer.filled.online {
  border-color: rgba(80, 200, 255, 0.28);
}

.challengeSoloPlayer.filled.ready {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(34, 197, 94, 0.14),
    0 12px 32px rgba(34, 197, 94, 0.14);
}

.challengeSoloPlayer.filled.ready .challengeBattleRole {
  color: #86efac;
}

.challengeSoloPlayer.enemy.filled {
  background: linear-gradient(
    180deg,
    rgba(23, 47, 91, 0.92),
    rgba(12, 23, 51, 0.96)
  );
}

.challengeSoloPlayer .challengeBattleAvatar {
  overflow: hidden;
}

.challengeSoloPlayer .challengeBattleAvatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.challengeSoloPlayer.bottom.empty .challengeBattleName {
  color: rgba(248, 250, 252, 0.9);
}

.challengeSoloPlayer.bottom.empty .challengeBattleRole {
  color: rgba(226, 232, 240, 0.68);
}

.challengeVsStage.isSolo.isSoloOnlineSeats .challengeVsText {
  margin: -4px 0;
  line-height: 0.9;
}

@media (max-height: 780px) {
  .challengeVsStage.isSolo.isSoloOnlineSeats {
    min-height: 480px;
    gap: 10px;
  }

  .challengeVsStage.isSolo.isSoloOnlineSeats .challengeSoloPlayer {
    width: 220px;
    min-height: 150px;
    padding: 14px;
  }

  .challengeVsStage.isSolo.isSoloOnlineSeats .challengeBattleAvatar {
    width: 62px;
    height: 62px;
  }

  .challengeVsStage.isSolo.isSoloOnlineSeats .challengeVsText {
    font-size: 48px;
  }
}
/* =====================================================
   KHIÊU CHIẾN - VÒNG TRÒN 8 NGƯỜI
   Dùng cho Đấu Hỗn Loạn và Sinh Tử
   ===================================================== */

.challengeCircleBoard {
  position: relative;
  width: min(920px, 100%);
  height: min(560px, 68vh);
  min-height: 500px;
  margin: 0 auto;
}

.challengeCircleCenterBadge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  min-height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  color: #f8fafc;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(253, 230, 138, 0.16),
      transparent 62%
    ),
    rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(253, 230, 138, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.challengeCircleMode {
  color: #fde68a;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1.15;
}

.challengeCircleCount {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.challengeCircleSeat {
  position: absolute;
  width: 178px;
  min-height: 136px;
}

/* 8 vị trí tạo vòng tròn */
.challengeCircleSeat.pos1 {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.challengeCircleSeat.pos2 {
  right: 10%;
  top: 9%;
}

.challengeCircleSeat.pos3 {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.challengeCircleSeat.pos4 {
  right: 10%;
  bottom: 9%;
}

.challengeCircleSeat.pos5 {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.challengeCircleSeat.pos6 {
  left: 10%;
  bottom: 9%;
}

.challengeCircleSeat.pos7 {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.challengeCircleSeat.pos8 {
  left: 10%;
  top: 9%;
}

.challengeCirclePlayer {
  width: 100%;
  min-height: 136px;
  border-radius: 24px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #eef4ff;
  background: linear-gradient(
    180deg,
    rgba(20, 43, 87, 0.94),
    rgba(9, 20, 49, 0.97)
  );
  border: 1px solid rgba(140, 180, 255, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 30px rgba(0, 0, 0, 0.25);
}

.challengeCirclePlayer.self {
  background: linear-gradient(
    180deg,
    rgba(77, 105, 112, 0.98),
    rgba(24, 46, 80, 0.98)
  );
  border-color: rgba(253, 230, 138, 0.45);
}

.challengeCirclePlayer.filled.online {
  border-color: rgba(80, 200, 255, 0.32);
}

.challengeCirclePlayer.filled.ready {
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(34, 197, 94, 0.14),
    0 14px 34px rgba(34, 197, 94, 0.16);
}

.challengeCirclePlayer.empty {
  opacity: 0.92;
}

.challengeCircleAvatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(180deg, #49c5ff 0%, #2f67ff 100%);
  box-shadow: 0 10px 22px rgba(37, 121, 255, 0.28);
  font-size: 28px;
  font-weight: 1000;
}

.challengeCircleAvatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.challengeCirclePlayer.empty .challengeCircleAvatar {
  background: rgba(14, 29, 62, 0.92);
  border: 2px dashed rgba(150, 180, 255, 0.24);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.88);
}

.challengeCircleName {
  max-width: 150px;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challengeCircleRole {
  max-width: 150px;
  color: rgba(226, 235, 255, 0.78);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.challengeCirclePlayer.ready .challengeCircleRole {
  color: #86efac;
}

/* Riêng Sinh Tử có viền đỏ nhẹ để khác Hỗn Loạn */
.challengeCircleBoard.survival .challengeCirclePlayer.filled {
  border-color: rgba(248, 113, 113, 0.28);
}

.challengeCircleBoard.survival .challengeCircleCenterBadge {
  border-color: rgba(248, 113, 113, 0.32);
}

/* Màn hình thấp thì thu nhỏ lại để không vỡ */
@media (max-height: 760px) {
  .challengeCircleBoard {
    height: 480px;
    min-height: 460px;
  }

  .challengeCircleSeat {
    width: 158px;
    min-height: 120px;
  }

  .challengeCirclePlayer {
    min-height: 120px;
    padding: 10px;
    border-radius: 20px;
  }

  .challengeCircleAvatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 24px;
  }

  .challengeCircleName {
    font-size: 13px;
  }

  .challengeCircleRole {
    font-size: 10px;
  }

  .challengeCircleCenterBadge {
    width: 160px;
    min-height: 78px;
  }

  .challengeCircleMode {
    font-size: 17px;
  }
}

/* Màn nhỏ: chuyển thành lưới 2 cột, không cho chồng slot */
@media (max-width: 980px) {
  .challengeCircleBoard {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 12px;
  }

  .challengeCircleCenterBadge {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 72px;
    order: -1;
  }

  .challengeCircleSeat,
  .challengeCircleSeat.pos1,
  .challengeCircleSeat.pos2,
  .challengeCircleSeat.pos3,
  .challengeCircleSeat.pos4,
  .challengeCircleSeat.pos5,
  .challengeCircleSeat.pos6,
  .challengeCircleSeat.pos7,
  .challengeCircleSeat.pos8 {
    position: static;
    transform: none;
    width: 100%;
    min-height: 120px;
  }
}
/* =====================================================
   KHIÊU CHIẾN - AVATAR BẠN BÈ ONLINE TRONG THANH MỜI
   ===================================================== */

.challengeOnlineAvatar {
  overflow: hidden;
}

.challengeOnlineAvatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.challengeSideMiniInviteBtn.pending {
  background: linear-gradient(180deg, #64748b, #475569);
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.95;
}

.challengeSideMiniInviteBtn.accepted:not(:disabled),
.challengeSideMiniInviteBtn.declined:not(:disabled),
.challengeSideMiniInviteBtn.expired:not(:disabled),
.challengeSideMiniInviteBtn.cancelled:not(:disabled) {
  background: linear-gradient(180deg, #ffb020, #fb8500);
  color: #ffffff;
}
/* =====================================================
   KHIÊU CHIẾN - TRẠNG THÁI TẢI BẠN BÈ ONLINE KHÔNG LÀM ĐƠ THANH MỜI
   ===================================================== */

.challengeInviteRefreshingLine {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  color: rgba(226, 232, 240, 0.9);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.18);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.challengeInviteErrorLine {
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.18);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.challengeSideMiniInviteBtn.pending {
  background: linear-gradient(180deg, #64748b, #475569);
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.95;
}

.challengeOnlineAvatar {
  overflow: hidden;
}

.challengeOnlineAvatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* =====================================================
   KHIÊU CHIẾN - THÔNG BÁO TOÀN SERVER: TIẾP NHẬN KHIÊU CHIẾN
   ===================================================== */

#challengeGlobalMatchmakingRoot {
  position: fixed;
  right: 150px;
  top: 380px;
  z-index: 9990;
  pointer-events: none;
}

.challengeGlobalMatchmakingToast {
  width: 360px;
  min-height: 132px;
  position: relative;
  display: flex;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 26px;
  pointer-events: auto;
  color: #102042;
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 220, 120, 0.95),
      rgba(255, 255, 255, 0.96) 45%
    ),
    linear-gradient(180deg, #ffffff, #fff7e8);
  border: 1px solid rgba(255, 176, 0, 0.42);
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.18),
    0 0 0 8px rgba(255, 176, 0, 0.06);
  animation: challengeGlobalMatchmakingPop 0.22s ease-out;
}

@keyframes challengeGlobalMatchmakingPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.challengeGlobalMatchmakingIcon {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 28px;
  background: linear-gradient(180deg, #fff0c2, #ffd166);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.challengeGlobalMatchmakingBody {
  min-width: 0;
  flex: 1;
}

.challengeGlobalMatchmakingEyebrow {
  color: #ff8a00;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challengeGlobalMatchmakingTitle {
  margin-top: 5px;
  color: #102042;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 1000;
}

.challengeGlobalMatchmakingSub {
  margin-top: 6px;
  color: rgba(15, 23, 42, 0.68);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.challengeGlobalMatchmakingAccept {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #ffb020, #fb8500);
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 14px 28px rgba(251, 133, 0, 0.24);
}

.challengeGlobalMatchmakingAccept:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.challengeGlobalMatchmakingAccept:disabled {
  cursor: wait;
  opacity: 0.72;
}

.challengeGlobalMatchmakingClose {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #64748b;
  background: rgba(15, 23, 42, 0.06);
  font-size: 18px;
  font-weight: 1000;
}

.challengeGlobalMatchmakingClose:hover {
  color: #102042;
  background: rgba(15, 23, 42, 0.1);
}

@media (max-width: 1100px) {
  #challengeGlobalMatchmakingRoot {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 110px;
  }

  .challengeGlobalMatchmakingToast {
    width: auto;
  }
}
/* =====================================================
   KHIÊU CHIẾN - SỬA TỔNG KẾT: TIM NGANG, THỜI GIAN, BỎ CỘT SAI
   ===================================================== */

/* Tim nằm ngang, có màu, phóng to thêm khoảng 50% */
.challengeResultLayer .challengeResultHeartsVisual,
.challengeOnlineResultHearts .challengeResultHeartsVisual {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
}

.challengeResultLayer .challengeResultHeartsVisual span,
.challengeOnlineResultHearts .challengeResultHeartsVisual span {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  line-height: 1;
  font-size: 30px !important;
  font-weight: 1000;
}

.challengeResultLayer .challengeResultHeartsVisual span.alive,
.challengeOnlineResultHearts .challengeResultHeartsVisual span.alive {
  color: #ef4444 !important;
  text-shadow: 0 5px 14px rgba(239, 68, 68, 0.28);
}

.challengeResultLayer .challengeResultHeartsVisual span.lost,
.challengeOnlineResultHearts .challengeResultHeartsVisual span.lost {
  color: #cbd5e1 !important;
  opacity: 0.65;
  filter: grayscale(1);
  text-shadow: none;
}

/* Ô thời gian thay thế ô số câu đúng */
.challengeResultLayer .challengeResultStatCard.time {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(240, 253, 244, 0.9);
}

.challengeResultLayer .challengeResultStatCard.time b,
.challengeResultLayer .challengeResultStatCard.time strong {
  color: #16a34a;
}

/* Bảng xếp hạng: bỏ cột Sai, đổi cột Đúng thành Thời gian */
.challengeOnlineResultRow {
  grid-template-columns: 54px minmax(0, 1fr) 108px 126px !important;
}

.challengeOnlineResultWrong {
  display: none !important;
}

.challengeOnlineResultTime,
.challengeOnlineResultHearts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.challengeOnlineResultTime b {
  color: #0f766e;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.challengeOnlineResultTime span,
.challengeOnlineResultHearts > span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.challengeOnlineResultRow.winner .challengeOnlineResultName {
  color: #0f172a;
  font-weight: 1000;
}

.challengeOnlineResultRow.winner {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(
    180deg,
    rgba(240, 253, 244, 0.95),
    rgba(255, 255, 255, 0.96)
  );
}

@media (max-width: 900px) {
  .challengeOnlineResultRow {
    grid-template-columns: 42px minmax(0, 1fr) 86px 100px !important;
  }

  .challengeOnlineResultTime b {
    font-size: 18px;
  }

  .challengeResultLayer .challengeResultHeartsVisual span,
  .challengeOnlineResultHearts .challengeResultHeartsVisual span {
    font-size: 25px !important;
  }
}
/* =====================================================
   KHIÊU CHIẾN - TRẢ LẠI CỘT SỐ CÂU ĐÚNG, THAY CỘT SAI BẰNG THỜI GIAN
   ===================================================== */

.challengeOnlineResultRow {
  grid-template-columns: 54px minmax(0, 1fr) 92px 112px 126px !important;
}

.challengeOnlineResultCorrect,
.challengeOnlineResultTime,
.challengeOnlineResultHearts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.challengeOnlineResultCorrect b {
  color: #16a34a;
  font-size: 22px;
  font-weight: 1000;
  line-height: 1;
}

.challengeOnlineResultTime b {
  color: #0f766e;
  font-size: 20px;
  font-weight: 1000;
  line-height: 1;
}

.challengeOnlineResultCorrect span,
.challengeOnlineResultTime span,
.challengeOnlineResultHearts > span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

/* Nếu còn CSS cũ của cột sai thì ép ẩn luôn */
.challengeOnlineResultWrong {
  display: none !important;
}

@media (max-width: 900px) {
  .challengeOnlineResultRow {
    grid-template-columns: 42px minmax(0, 1fr) 70px 86px 100px !important;
  }

  .challengeOnlineResultCorrect b,
  .challengeOnlineResultTime b {
    font-size: 18px;
  }
}
/* =====================================================
   FIX CUỐI CÙNG - TIM Ở Ô "TIM CÒN LẠI" PHẢI NẰM NGANG
   ===================================================== */

/* Chỉ ép riêng ô Tim còn lại ở phần tổng kết trên cùng */
.challengeResultLayer .challengeResultStatCard.hearts {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  justify-items: center !important;
  align-items: center !important;
}

/* Khung chứa 3 tim: bắt buộc nằm ngang */
.challengeResultLayer
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  gap: 14px !important;
  width: 100% !important;
  min-height: 52px !important;
  margin: 8px 0 6px !important;
}

/* Từng trái tim */
.challengeResultLayer
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  justify-content: center !important;
  align-items: center !important;
  width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 42px !important; /* tăng khoảng 50% */
  font-weight: 1000 !important;
  vertical-align: middle !important;
}

/* Tim còn lại: tô màu đỏ */
.challengeResultLayer
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span.alive {
  color: #ef4444 !important;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: 0 6px 12px rgba(239, 68, 68, 0.28) !important;
}

/* Tim đã mất: không tô màu */
.challengeResultLayer
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span.lost {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  filter: grayscale(1) !important;
  text-shadow: none !important;
}

/* Dòng chữ dưới tim */
.challengeResultLayer .challengeResultStatCard.hearts strong {
  margin-top: 2px !important;
}
/* =====================================================
   RPG INVENTORY - TÚI ĐỒ 8x4
   ===================================================== */

#rpgInventoryRoot {
  position: relative;
  z-index: 8000;
}

.rpgInventoryLauncher {
  position: fixed;
  right: 438px;
  bottom: 24px;
  z-index: 7000;
  min-width: 156px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9, #2563eb 48%, #7c3aed);
  box-shadow:
    0 18px 40px rgba(37, 99, 235, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 1000;
}

.rpgInventoryLauncher:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.rpgInventoryLauncherIcon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.activityMode .rpgInventoryLauncher,
.challengeBattleIsOpen .rpgInventoryLauncher,
.challengeResultIsOpen .rpgInventoryLauncher {
  display: none !important;
}

.rpgInventoryOverlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 16px;
}

.rpgInventoryBackdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(37, 99, 235, 0.18),
      transparent 42%
    ),
    rgba(4, 10, 26, 0.72);
  backdrop-filter: blur(8px);
}

.rpgInventoryWindow {
  position: relative;
  width: min(1120px, 96vw);
  height: min(760px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  color: #eaf2ff;
  background:
    linear-gradient(135deg, rgba(20, 43, 87, 0.98), rgba(11, 23, 51, 0.99)),
    radial-gradient(
      circle at top left,
      rgba(56, 189, 248, 0.2),
      transparent 44%
    );
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rpgInventoryHeader {
  flex: 0 0 auto;
  padding: 22px 28px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.rpgInventoryEyebrow {
  color: #facc15;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpgInventoryTitle {
  margin-top: 4px;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
  font-weight: 1000;
}

.rpgInventorySub {
  margin-top: 8px;
  color: #a9b8d8;
  font-size: 14px;
  font-weight: 800;
}

.rpgInventoryCloseBtn {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 34px;
  font-weight: 1000;
}

.rpgInventoryCloseBtn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.rpgInventoryWallet {
  flex: 0 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.rpgInventoryCurrencyPill {
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.rpgInventoryCurrencyIcon {
  font-size: 22px;
}

.rpgInventoryCurrencyName {
  color: #a9b8d8;
  font-size: 13px;
  font-weight: 900;
}

.rpgInventoryCurrencyPill b {
  color: #ffffff;
  font-size: 18px;
  font-weight: 1000;
}

.rpgInventoryBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 18px 28px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.rpgInventoryGridWrap {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.58),
    rgba(15, 23, 42, 0.82)
  );
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.rpgInventoryGrid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.rpgInventorySlot {
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 18px;
  cursor: pointer;
  color: #eaf2ff;
  background: linear-gradient(
    180deg,
    rgba(30, 55, 100, 0.94),
    rgba(9, 20, 49, 0.98)
  );
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
}

.rpgInventorySlot:hover,
.rpgInventorySlot.selected {
  border-color: rgba(250, 204, 21, 0.78);
  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.16),
    0 14px 28px rgba(0, 0, 0, 0.2);
}

.rpgInventorySlot.empty {
  background: linear-gradient(
    180deg,
    rgba(15, 31, 66, 0.76),
    rgba(8, 18, 43, 0.88)
  );
}

.rpgInventoryEmptyPlus {
  color: rgba(203, 213, 225, 0.26);
  font-size: 28px;
  font-weight: 1000;
}

.rpgInventoryItemIcon {
  font-size: 36px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22));
}

.rpgInventoryItemQty {
  position: absolute;
  right: 8px;
  bottom: 7px;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.72);
  font-size: 12px;
  font-weight: 1000;
}

.rpgInventoryGridNote {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.rpgInventoryInspect {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.68),
    rgba(15, 23, 42, 0.92)
  );
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.rpgInventoryInspectEmpty,
.rpgInventoryInspectItem {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 10px;
  padding-top: 8px;
}

.rpgInventoryInspectIcon,
.rpgInventoryInspectBigIcon {
  width: 86px;
  height: 86px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 42px;
}

.rpgInventoryInspectEmpty b,
.rpgInventoryInspectName {
  color: #ffffff;
  font-size: 22px;
  font-weight: 1000;
}

.rpgInventoryInspectEmpty span,
.rpgInventoryInspectType,
.rpgInventoryInspectItem p {
  color: #a9b8d8;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.rpgInventoryFutureBox {
  margin-top: auto;
  padding: 16px;
  border-radius: 20px;
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.13);
  font-size: 13px;
  font-weight: 850;
}

.rpgInventoryFutureBox b {
  color: #facc15;
  font-size: 15px;
}

.rpgInventorySlot.rarity-rare {
  border-color: rgba(59, 130, 246, 0.5);
}

.rpgInventorySlot.rarity-epic {
  border-color: rgba(168, 85, 247, 0.58);
}

.rpgInventorySlot.rarity-legendary {
  border-color: rgba(250, 204, 21, 0.7);
}

@media (max-width: 1100px) {
  .rpgInventoryLauncher {
    right: 24px;
    bottom: 112px;
  }

  .rpgInventoryWindow {
    width: min(96vw, 1000px);
    height: min(90vh, calc(100vh - 24px));
  }

  .rpgInventoryBody {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .rpgInventoryInspect {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .rpgInventoryHeader,
  .rpgInventoryWallet,
  .rpgInventoryBody {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rpgInventoryGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rpgInventoryTitle {
    font-size: 34px;
  }
}
/* =====================================================
   RPG SHOP - CỬA HÀNG NGOÀI TRANG CHỦ
   ===================================================== */

#rpgShopRoot {
  position: relative;
  z-index: 8000;
}

.rpgShopLauncher {
  position: fixed;
  right: 616px;
  bottom: 24px;
  z-index: 7000;
  min-width: 138px;
  height: 72px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #fb8500 50%, #facc15);
  box-shadow:
    0 18px 40px rgba(251, 133, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 1000;
}

.rpgShopLauncher:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.rpgShopLauncherIcon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.activityMode .rpgShopLauncher,
.challengeBattleIsOpen .rpgShopLauncher,
.challengeResultIsOpen .rpgShopLauncher {
  display: none !important;
}

.rpgShopOverlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: grid;
  place-items: center;
  padding: 16px;
}

.rpgShopBackdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 20%,
      rgba(251, 133, 0, 0.16),
      transparent 42%
    ),
    rgba(4, 10, 26, 0.72);
  backdrop-filter: blur(8px);
}

.rpgShopWindow {
  position: relative;
  width: min(1080px, 96vw);
  height: min(720px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  color: #eaf2ff;
  background:
    linear-gradient(135deg, rgba(51, 28, 12, 0.98), rgba(13, 22, 45, 0.99)),
    radial-gradient(circle at top left, rgba(251, 133, 0, 0.2), transparent 44%);
  border: 1px solid rgba(251, 191, 36, 0.28);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.rpgShopHeader {
  flex: 0 0 auto;
  padding: 22px 28px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
}

.rpgShopEyebrow {
  color: #facc15;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rpgShopTitle {
  margin-top: 4px;
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
  font-weight: 1000;
}

.rpgShopSub {
  margin-top: 8px;
  color: #fed7aa;
  font-size: 14px;
  font-weight: 800;
}

.rpgShopCloseBtn {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 34px;
  font-weight: 1000;
}

.rpgShopCloseBtn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.rpgShopWallet {
  flex: 0 0 auto;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.14);
}

.rpgShopDiamondPill {
  width: fit-content;
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.rpgShopDiamondPill span {
  font-size: 22px;
}

.rpgShopDiamondPill b {
  color: #fed7aa;
  font-size: 14px;
  font-weight: 900;
}

.rpgShopDiamondPill strong {
  color: #ffffff;
  font-size: 20px;
  font-weight: 1000;
}

.rpgShopBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 18px 28px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.rpgShopProductList {
  min-height: 0;
  overflow: auto;
  padding: 4px 8px 4px 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.rpgShopProductCard {
  min-height: 136px;
  padding: 16px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  text-align: left;
  color: #eaf2ff;
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.74),
    rgba(15, 23, 42, 0.92)
  );
  border: 1px solid rgba(251, 191, 36, 0.16);
}

.rpgShopProductCard:hover,
.rpgShopProductCard.selected {
  border-color: rgba(250, 204, 21, 0.78);
  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.12),
    0 16px 30px rgba(0, 0, 0, 0.22);
}

.rpgShopProductIcon {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: rgba(255, 255, 255, 0.08);
}

.rpgShopProductInfo {
  min-width: 0;
  flex: 1;
}

.rpgShopProductTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rpgShopProductTop span {
  color: #facc15;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.rpgShopProductTop b {
  color: #ffffff;
  font-size: 15px;
  font-weight: 1000;
}

.rpgShopProductName {
  margin-top: 8px;
  color: #ffffff;
  font-size: 19px;
  font-weight: 1000;
}

.rpgShopProductDesc {
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 800;
}

.rpgShopRightPanel {
  min-height: 0;
  overflow: auto;
  border-radius: 26px;
  padding: 18px;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.68),
    rgba(15, 23, 42, 0.94)
  );
  border: 1px solid rgba(251, 191, 36, 0.16);
}

.rpgShopDetail {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.rpgShopDetailIcon {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: rgba(255, 255, 255, 0.08);
}

.rpgShopDetailName {
  color: #ffffff;
  font-size: 24px;
  font-weight: 1000;
}

.rpgShopDetailPrice {
  color: #fed7aa;
  font-size: 15px;
  font-weight: 900;
}

.rpgShopDetailPrice b {
  color: #ffffff;
}

.rpgShopDetail p,
.rpgShopDetailNote {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.rpgShopDetailNote {
  padding: 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.28);
}

.rpgShopBuyBtn {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow: 0 16px 34px rgba(34, 197, 94, 0.24);
  font-size: 20px;
  font-weight: 1000;
}

.rpgShopBuyBtn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: linear-gradient(180deg, #64748b, #475569);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .rpgShopLauncher {
    right: 200px;
    bottom: 112px;
  }

  .rpgShopBody {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .rpgShopProductList {
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .rpgShopProductList {
    grid-template-columns: 1fr;
  }

  .rpgShopTitle {
    font-size: 34px;
  }
}
/* =====================================================
   RPG DIAMOND REWARD - PHẦN THƯỞNG KIM CƯƠNG
   ===================================================== */

.rpgDiamondRewardBox,
.challengeDiamondRewardBox {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(circle at left, rgba(56, 189, 248, 0.18), transparent 44%),
    linear-gradient(
      180deg,
      rgba(239, 246, 255, 0.96),
      rgba(255, 255, 255, 0.98)
    );
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.12);
}

.challengeDiamondRewardBox {
  width: min(760px, 100%);
  margin: 14px auto 0;
}

.rpgDiamondRewardBox.hasReward,
.challengeDiamondRewardBox.hasReward {
  border-color: rgba(59, 130, 246, 0.42);
}

.rpgDiamondRewardBox.noReward,
.challengeDiamondRewardBox.noReward {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.96);
}

.rpgDiamondRewardIcon,
.challengeDiamondRewardIcon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  box-shadow:
    inset 0 -4px 0 rgba(37, 99, 235, 0.12),
    0 10px 20px rgba(37, 99, 235, 0.16);
}

.rpgDiamondRewardInfo,
.challengeDiamondRewardInfo {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rpgDiamondRewardTitle,
.challengeDiamondRewardTitle {
  color: #0f172a;
  font-size: 16px;
  font-weight: 1000;
}

.rpgDiamondRewardText,
.challengeDiamondRewardText {
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 900;
}

.rpgDiamondRewardText b,
.challengeDiamondRewardText b {
  color: #2563eb;
  font-size: 18px;
}

.rpgDiamondRewardSub,
.challengeDiamondRewardSub {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}
/* =====================================================
   RPG BATTLE POWER REWARD - THÔNG BÁO TĂNG LỰC CHIẾN
   ===================================================== */

.battlePowerRewardBox,
.challengeBattlePowerRewardBox {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background:
    radial-gradient(circle at left, rgba(251, 191, 36, 0.18), transparent 44%),
    linear-gradient(
      180deg,
      rgba(255, 251, 235, 0.98),
      rgba(255, 255, 255, 0.98)
    );
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.13);
}

.challengeBattlePowerRewardBox {
  width: min(760px, 100%);
  margin: 14px auto 0;
}

.battlePowerRewardBox.hasReward,
.challengeBattlePowerRewardBox.hasReward {
  border-color: rgba(245, 158, 11, 0.48);
}

.battlePowerRewardBox.noReward,
.challengeBattlePowerRewardBox.noReward {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(248, 250, 252, 0.96);
}

.battlePowerRewardIcon,
.challengeBattlePowerRewardIcon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: linear-gradient(180deg, #fef3c7, #facc15);
  box-shadow:
    inset 0 -4px 0 rgba(180, 83, 9, 0.14),
    0 10px 20px rgba(245, 158, 11, 0.18);
}

.battlePowerRewardInfo,
.challengeBattlePowerRewardInfo {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.battlePowerRewardTitle,
.challengeBattlePowerRewardTitle {
  color: #0f172a;
  font-size: 16px;
  font-weight: 1000;
}

.battlePowerRewardText,
.challengeBattlePowerRewardText {
  color: #92400e;
  font-size: 15px;
  font-weight: 900;
}

.battlePowerRewardText b,
.challengeBattlePowerRewardText b {
  color: #d97706;
  font-size: 18px;
}

.battlePowerRewardSub,
.challengeBattlePowerRewardSub {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.battlePowerRewardSub b,
.challengeBattlePowerRewardSub b {
  color: #0f172a;
}
/* =====================================================
   FIX TỔNG KẾT KHIÊU CHIẾN - GỘP KIM CƯƠNG + LỰC CHIẾN 1 HÀNG
   ===================================================== */

/* Lớp phủ tổng kết không cho nội dung bị đẩy ra ngoài màn hình */
.challengeResultLayer {
  padding: 10px 12px !important;
  overflow: hidden !important;
}

/* Riêng tổng kết solo 1vs1 phải nằm gọn trong màn hình */
.challengeFullResultCard.challengeResultLayerCard.soloCompactResult {
  width: min(920px, 94vw) !important;
  max-height: calc(100vh - 150px) !important;
  padding: 18px 24px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow: hidden !important;
}

/* Chữ VICTORY / DEFEAT gọn lại để không chiếm quá nhiều chiều cao */
.challengeFullResultCard.soloCompactResult .challengeResultBigStatus {
  margin: 0 0 4px !important;
  font-size: clamp(46px, 6vw, 66px) !important;
  line-height: 0.92 !important;
}

/* 3 ô Tim - Đúng - Thời gian gọn hơn */
.challengeFullResultCard.soloCompactResult .challengeResultStatsBetter {
  margin: 0 !important;
  gap: 10px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard {
  min-height: 108px !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard > span {
  font-size: 13px !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard b {
  font-size: 30px !important;
  line-height: 1 !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard strong {
  font-size: 12px !important;
}

/* Tim vẫn nằm ngang, to và có màu */
.challengeFullResultCard.soloCompactResult .challengeResultHeartsVisual {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 42px !important;
  margin: 4px 0 !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultHeartsVisual > span {
  display: inline-flex !important;
  width: 34px !important;
  height: 34px !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 38px !important;
  line-height: 1 !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeResultHeartsVisual
  > span.alive {
  color: #ef4444 !important;
  filter: none !important;
  opacity: 1 !important;
  text-shadow: 0 8px 16px rgba(239, 68, 68, 0.28) !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeResultHeartsVisual
  > span.lost {
  color: #d1d5db !important;
  filter: grayscale(1) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Hàng ngang mới: Kim Cương bên trái, Lực Chiến bên phải */
.challengeRewardInlineRow {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 6px 0 0 !important;
}

.challengeRewardInlineItem {
  min-width: 0 !important;
}

/* Ép 2 hộp phần thưởng nằm gọn trong hàng ngang */
.challengeRewardInlineRow .challengeDiamondRewardBox,
.challengeRewardInlineRow .challengeBattlePowerRewardBox {
  width: 100% !important;
  min-height: 82px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

/* Icon nhỏ lại để tiết kiệm chiều cao */
.challengeRewardInlineRow .challengeDiamondRewardIcon,
.challengeRewardInlineRow .challengeBattlePowerRewardIcon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  font-size: 28px !important;
}

/* Chữ trong hộp phần thưởng gọn lại */
.challengeRewardInlineRow .challengeDiamondRewardTitle,
.challengeRewardInlineRow .challengeBattlePowerRewardTitle {
  font-size: 14px !important;
  line-height: 1.1 !important;
}

.challengeRewardInlineRow .challengeDiamondRewardText,
.challengeRewardInlineRow .challengeBattlePowerRewardText {
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.challengeRewardInlineRow .challengeDiamondRewardSub,
.challengeRewardInlineRow .challengeBattlePowerRewardSub {
  font-size: 11.5px !important;
  line-height: 1.25 !important;
}

/* Hàng nút gọn hơn */
.challengeFullResultCard.soloCompactResult .challengeResultActionsNew {
  margin: 8px auto 0 !important;
  gap: 10px !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultBtn {
  min-height: 52px !important;
  padding: 0 22px !important;
  border-radius: 18px !important;
  font-size: 18px !important;
}

/* Bảng xếp hạng luôn còn chỗ hiện trong màn hình */
.challengeFullResultCard.soloCompactResult .challengeOnlineResultBox {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin-top: 8px !important;
  padding: 10px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultList {
  gap: 8px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultRow {
  min-height: 56px !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultAvatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 14px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultName {
  font-size: 13px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultSub {
  font-size: 11px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultCorrect b,
.challengeFullResultCard.soloCompactResult .challengeOnlineResultTime b {
  font-size: 18px !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultHearts
  .challengeResultHeartsVisual
  > span {
  font-size: 24px !important;
  width: 24px !important;
  height: 24px !important;
}
/* =====================================================
   FIX TỔNG KẾT CHÍNH TUYẾN - KIM CƯƠNG + LỰC CHIẾN 1 HÀNG
   ===================================================== */

.resultRewardInlineRow {
  width: 100%;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resultRewardInlineItem {
  min-width: 0;
}

.resultRewardInlineRow .rpgDiamondRewardBox,
.resultRewardInlineRow .battlePowerRewardBox {
  width: 100% !important;
  min-height: 92px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.resultRewardInlineRow .rpgDiamondRewardIcon,
.resultRewardInlineRow .battlePowerRewardIcon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 18px !important;
  font-size: 30px !important;
}

.resultRewardInlineRow .rpgDiamondRewardTitle,
.resultRewardInlineRow .battlePowerRewardTitle {
  font-size: 15px !important;
}

.resultRewardInlineRow .rpgDiamondRewardText,
.resultRewardInlineRow .battlePowerRewardText {
  font-size: 14px !important;
}

.resultRewardInlineRow .rpgDiamondRewardSub,
.resultRewardInlineRow .battlePowerRewardSub {
  font-size: 12px !important;
}

@media (max-width: 850px) {
  .challengeRewardInlineRow,
  .resultRewardInlineRow {
    grid-template-columns: 1fr !important;
  }
}
/* =====================================================
   FIX CUỐI: TỔNG KẾT SOLO 1VS1 KHÔNG SCROLL - HIỆN ĐỦ BẢNG XẾP HẠNG
   ===================================================== */

/* Lớp phủ tổng kết: không cho sinh thanh cuộn phụ */
.challengeResultLayer {
  padding: 6px 10px !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Card tổng kết solo phải tự gói gọn trong màn hình */
.challengeFullResultCard.challengeResultLayerCard.soloCompactResult {
  width: min(940px, 94vw) !important;
  height: auto !important;
  max-height: calc(100vh - 128px) !important;
  padding: 14px 22px 14px !important;
  border-radius: 24px !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Giảm chiều cao chữ VICTORY / DEFEAT */
.challengeFullResultCard.soloCompactResult .challengeResultBigStatus {
  margin: 0 !important;
  padding: 0 !important;
  font-size: clamp(38px, 5.1vw, 58px) !important;
  line-height: 0.88 !important;
  letter-spacing: 0.04em !important;
}

/* 3 ô Tim - Đúng - Thời gian thấp hơn */
.challengeFullResultCard.soloCompactResult .challengeResultStatsBetter,
.challengeFullResultCard.soloCompactResult .challengeResultStatsBetter.compact {
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard {
  min-height: 86px !important;
  height: 86px !important;
  padding: 8px 10px !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard > span {
  font-size: 12px !important;
  line-height: 1 !important;
  margin: 0 !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard b {
  font-size: 28px !important;
  line-height: 1 !important;
  margin: 2px 0 !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultStatCard strong {
  font-size: 11.5px !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

/* Tim trong ô thống kê vẫn nằm ngang, nhưng không làm ô bị cao */
.challengeFullResultCard.soloCompactResult .challengeResultStatCard.hearts {
  justify-content: center !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultHeartsVisual {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 32px !important;
  margin: 2px 0 !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultHeartsVisual > span {
  width: 30px !important;
  height: 30px !important;
  font-size: 32px !important;
  line-height: 1 !important;
}

/* Hàng Kim Cương + Lực Chiến thấp hơn */
.challengeFullResultCard.soloCompactResult .challengeRewardInlineRow {
  margin: 4px 0 0 !important;
  gap: 8px !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeDiamondRewardBox,
.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeBattlePowerRewardBox {
  min-height: 66px !important;
  height: 66px !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-radius: 16px !important;
  gap: 9px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeDiamondRewardIcon,
.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeBattlePowerRewardIcon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  font-size: 25px !important;
  flex: 0 0 42px !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeDiamondRewardTitle,
.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeBattlePowerRewardTitle {
  font-size: 13px !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeDiamondRewardText,
.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeBattlePowerRewardText {
  font-size: 12px !important;
  line-height: 1.1 !important;
  margin: 0 !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeDiamondRewardSub,
.challengeFullResultCard.soloCompactResult
  .challengeRewardInlineRow
  .challengeBattlePowerRewardSub {
  font-size: 10.5px !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

/* Nút bấm thấp hơn và sát hơn */
.challengeFullResultCard.soloCompactResult .challengeResultActionsNew {
  margin: 5px auto 0 !important;
  gap: 8px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.challengeFullResultCard.soloCompactResult .challengeResultBtn {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 20px !important;
  border-radius: 16px !important;
  font-size: 17px !important;
  line-height: 1 !important;
}

/* Quan trọng nhất: bảng xếp hạng solo không được có scroll */
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox {
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: none !important;

  margin-top: 5px !important;
  padding: 8px !important;
  border-radius: 16px !important;

  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Tắt scroll bên trong danh sách */
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox
  .challengeOnlineResultList {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;

  display: grid !important;
  gap: 6px !important;
}

/* Mỗi hàng người chơi thấp hơn để đủ hiện 2 người */
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox
  .challengeOnlineResultRow {
  min-height: 48px !important;
  height: 48px !important;
  padding: 6px 9px !important;
  border-radius: 13px !important;

  display: grid !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

/* Avatar và chữ trong bảng nhỏ lại */
.challengeFullResultCard.soloCompactResult .challengeOnlineResultAvatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  font-size: 17px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultRank {
  font-size: 16px !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultName {
  font-size: 12px !important;
  line-height: 1.05 !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultSub {
  font-size: 10px !important;
  line-height: 1.05 !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultCorrect b,
.challengeFullResultCard.soloCompactResult .challengeOnlineResultTime b {
  font-size: 17px !important;
  line-height: 1 !important;
}

.challengeFullResultCard.soloCompactResult .challengeOnlineResultCorrect span,
.challengeFullResultCard.soloCompactResult .challengeOnlineResultTime span,
.challengeFullResultCard.soloCompactResult .challengeOnlineResultHearts > span {
  font-size: 10px !important;
  line-height: 1 !important;
}

/* Tim trong bảng xếp hạng nhỏ hơn để không làm hàng bị cao */
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultHearts
  .challengeResultHeartsVisual {
  gap: 6px !important;
  min-height: 22px !important;
  margin: 0 !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultHearts
  .challengeResultHeartsVisual
  > span {
  width: 20px !important;
  height: 20px !important;
  font-size: 22px !important;
}

/* Ẩn mọi thanh cuộn nhỏ còn sót lại trong bảng solo */
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox,
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox
  * {
  scrollbar-width: none !important;
}

.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox::-webkit-scrollbar,
.challengeFullResultCard.soloCompactResult
  .challengeOnlineResultBox.soloRankBox
  *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
/* =====================================================
   FIX Ô TIM CÒN LẠI - KHÔNG ĐỂ "MÁU CHIẾN ĐẤU" TỤT XUỐNG
   ===================================================== */

/*
  Đè lại CSS cũ đang ép ô tim thành grid 3 hàng.
  Dùng flex để 3 phần:
  Tim còn lại / 3 trái tim / Máu chiến đấu
  luôn nằm cân giữa theo chiều dọc.
*/
.challengeFullResultCard.soloCompactResult .challengeResultStatCard.hearts {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
}

/* Chữ "Tim còn lại" không chiếm quá nhiều chiều cao */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  > span {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* Khung 3 tim: nằm ngang, không đẩy chữ dưới xuống */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;

  width: auto !important;
  min-height: 0 !important;
  height: 34px !important;

  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

/* Từng trái tim */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span {
  flex: 0 0 auto !important;
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  margin: 0 !important;
  padding: 0 !important;

  font-size: 34px !important;
  line-height: 1 !important;
}

/* Chữ "Máu chiến đấu" kéo lên cân đối */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  strong {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.05 !important;
  transform: translateY(-1px) !important;
}

/* Tim còn lại có màu đỏ */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span.alive {
  color: #ef4444 !important;
  opacity: 1 !important;
  filter: none !important;
  text-shadow: 0 6px 12px rgba(239, 68, 68, 0.28) !important;
}

/* Tim đã mất không tô màu */
.challengeFullResultCard.soloCompactResult
  .challengeResultStatCard.hearts
  .challengeResultHeartsVisual
  > span.lost {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  filter: grayscale(1) !important;
  text-shadow: none !important;
}
/* =====================================================
   HEADER KIM CƯƠNG - HIỂN THỊ TẠI VÙNG TRỐNG TRÊN HEADER
   ===================================================== */

.topDiamondWallet {
  height: 58px;
  min-width: 250px;
  padding: 8px 18px;
  border-radius: 22px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  border: 1px solid rgba(59, 130, 246, 0.24);
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(125, 211, 252, 0.36),
      transparent 42%
    ),
    linear-gradient(
      180deg,
      rgba(239, 246, 255, 0.96),
      rgba(255, 255, 255, 0.92)
    );

  box-shadow:
    0 14px 26px rgba(37, 99, 235, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  color: #0f172a;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.topDiamondWallet:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.topDiamondWalletIcon {
  width: 42px;
  height: 42px;
  border-radius: 16px;

  display: grid;
  place-items: center;

  font-size: 25px;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  box-shadow:
    inset 0 -4px 0 rgba(37, 99, 235, 0.1),
    0 8px 16px rgba(37, 99, 235, 0.16);
}

.topDiamondWalletText {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.topDiamondWalletLabel {
  font-size: 11px;
  font-weight: 1000;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.topDiamondWalletText b {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 1000;
  color: #1d4ed8;
}

/* Header đang có nhiều nút, nên giảm nhẹ kích thước ở màn nhỏ */
@media (max-width: 1250px) {
  .topDiamondWallet {
    min-width: 190px;
    padding-inline: 14px;
  }

  .topDiamondWalletLabel {
    font-size: 10px;
  }

  .topDiamondWalletText b {
    font-size: 17px;
  }
}

@media (max-width: 980px) {
  .topDiamondWallet {
    min-width: 150px;
    height: 50px;
  }

  .topDiamondWalletIcon {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }
}
/* =====================================================
   FIX VỊ TRÍ SHOP + TÚI ĐỒ - ĐƯA SANG BÊN PHẢI, CHỈ HIỆN ICON
   ===================================================== */

/* Nút công cụ RPG nhỏ bên phải màn hình */
.rpgSideToolBtn,
.rpgShopLauncher,
.rpgInventoryLauncher {
  position: fixed !important;
  right: 24px !important;
  left: auto !important;
  bottom: auto !important;

  width: 74px !important;
  height: 74px !important;
  min-width: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 24px !important;

  display: grid !important;
  place-items: center !important;

  cursor: pointer !important;
  z-index: 7100 !important;

  color: #ffffff !important;
  font-size: 0 !important;

  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease !important;
}

/* Shop nằm ở ô đỏ phía trên */
.rpgShopLauncher.rpgSideToolShop,
.rpgShopLauncher {
  top: 330px !important;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.28),
      transparent 36%
    ),
    linear-gradient(135deg, #ff9f1c, #ff7a00 55%, #f97316) !important;
  box-shadow:
    0 18px 34px rgba(249, 115, 22, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22) !important;
}

/* Túi Đồ nằm ở ô đỏ phía dưới */
.rpgInventoryLauncher.rpgSideToolInventory,
.rpgInventoryLauncher {
  top: 440px !important;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.26),
      transparent 36%
    ),
    linear-gradient(135deg, #38bdf8, #2563eb 52%, #7c3aed) !important;
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22) !important;
}

/* Ẩn mọi chữ còn sót lại trong nút */
.rpgShopLauncher > span:not(.rpgShopLauncherIcon),
.rpgInventoryLauncher > span:not(.rpgInventoryLauncherIcon) {
  display: none !important;
}

/* Icon nằm giữa nút, to vừa đủ */
.rpgShopLauncherIcon,
.rpgInventoryLauncherIcon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 18px !important;

  display: grid !important;
  place-items: center !important;

  font-size: 27px !important;
  line-height: 1 !important;

  background: rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.08),
    0 8px 14px rgba(15, 23, 42, 0.12) !important;
}

/* Hiệu ứng khi rê chuột */
.rpgShopLauncher:hover,
.rpgInventoryLauncher:hover {
  transform: translateY(-2px) scale(1.04) !important;
  filter: brightness(1.05) !important;
}

/* Hiệu ứng khi bấm */
.rpgShopLauncher:active,
.rpgInventoryLauncher:active {
  transform: translateY(0) scale(0.96) !important;
}

/* Giữ nguyên: đang làm bài hoặc đang Khiêu Chiến thì không hiện nút */
.activityMode .rpgShopLauncher,
.activityMode .rpgInventoryLauncher,
.challengeBattleIsOpen .rpgShopLauncher,
.challengeBattleIsOpen .rpgInventoryLauncher,
.challengeResultIsOpen .rpgShopLauncher,
.challengeResultIsOpen .rpgInventoryLauncher {
  display: none !important;
}

/* Màn hình thấp thì kéo 2 nút lên một chút để không bị cắt */
@media (max-height: 760px) {
  .rpgShopLauncher {
    top: 285px !important;
  }

  .rpgInventoryLauncher {
    top: 375px !important;
  }
}

/* Màn hình nhỏ ngang thì thu nút lại */
@media (max-width: 900px) {
  .rpgShopLauncher,
  .rpgInventoryLauncher {
    right: 14px !important;
    width: 62px !important;
    height: 62px !important;
    border-radius: 20px !important;
  }

  .rpgShopLauncherIcon,
  .rpgInventoryLauncherIcon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 15px !important;
    font-size: 24px !important;
  }
}
/* =========================================
   CĂN LẠI SHOP + TÚI ĐỒ
   SÁT MÉP PHẢI HƠN VÀ NHÍCH LÊN TRÊN
   ========================================= */

.rpgSideToolBtn,
.rpgShopLauncher,
.rpgInventoryLauncher {
  position: fixed !important;
  right: 6px !important; /* sát mép phải hơn */
  left: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  z-index: 7100 !important;
}

/* Nút Shop */
.rpgShopLauncher,
.rpgShopLauncher.rpgSideToolShop {
  top: 312px !important; /* kéo lên trên */
}

/* Nút Túi Đồ */
.rpgInventoryLauncher,
.rpgInventoryLauncher.rpgSideToolInventory {
  top: 418px !important; /* kéo lên trên */
}

/* Nếu màn hình thấp thì kéo lên thêm một chút */
@media (max-height: 760px) {
  .rpgShopLauncher,
  .rpgShopLauncher.rpgSideToolShop {
    top: 286px !important;
  }

  .rpgInventoryLauncher,
  .rpgInventoryLauncher.rpgSideToolInventory {
    top: 386px !important;
  }
}
/* =====================================================
   RPG DAILY CHECKIN - ĐIỂM DANH MỖI NGÀY
   ===================================================== */

/* Nút Điểm Danh cùng cột với Shop và Túi Đồ */
.rpgCheckinLauncher {
  position: fixed !important;
  right: 6px !important;
  top: 206px !important;
  left: auto !important;
  bottom: auto !important;

  width: 74px !important;
  height: 74px !important;
  min-width: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 24px !important;

  display: grid !important;
  place-items: center !important;

  cursor: pointer !important;
  z-index: 7100 !important;

  color: #ffffff !important;
  font-size: 0 !important;

  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.28),
      transparent 36%
    ),
    linear-gradient(135deg, #facc15, #f97316 55%, #ea580c) !important;

  box-shadow:
    0 18px 34px rgba(249, 115, 22, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22) !important;

  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease !important;
}

.rpgCheckinLauncher:hover {
  transform: translateY(-2px) scale(1.04) !important;
  filter: brightness(1.05) !important;
}

.rpgCheckinLauncher:active {
  transform: translateY(0) scale(0.96) !important;
}

.rpgCheckinLauncherIcon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 18px !important;

  display: grid !important;
  place-items: center !important;

  font-size: 27px !important;
  line-height: 1 !important;

  background: rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.08),
    0 8px 14px rgba(15, 23, 42, 0.12) !important;
}

/* Đặt lại 3 nút thành 1 cột: Điểm Danh - Shop - Túi Đồ */
.rpgCheckinLauncher,
.rpgShopLauncher,
.rpgInventoryLauncher {
  right: 6px !important;
}

.rpgCheckinLauncher {
  top: 206px !important;
}

.rpgShopLauncher,
.rpgShopLauncher.rpgSideToolShop {
  top: 316px !important;
}

.rpgInventoryLauncher,
.rpgInventoryLauncher.rpgSideToolInventory {
  top: 426px !important;
}

/* Ẩn khi đang làm bài hoặc Khiêu Chiến */
.activityMode .rpgCheckinLauncher,
.challengeBattleIsOpen .rpgCheckinLauncher,
.challengeResultIsOpen .rpgCheckinLauncher {
  display: none !important;
}

/* Popup */
.rpgCheckinOverlay {
  position: fixed;
  inset: 0;
  z-index: 9700;
  display: grid;
  place-items: center;
  padding: 16px;
}

.rpgCheckinBackdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(250, 204, 21, 0.18),
      transparent 42%
    ),
    rgba(4, 10, 26, 0.72);
  backdrop-filter: blur(8px);
}

.rpgCheckinWindow {
  position: relative;
  width: min(560px, 94vw);
  max-height: calc(100vh - 32px);
  overflow: hidden;

  padding: 24px;
  border-radius: 32px;

  color: #fff7ed;
  background:
    radial-gradient(
      circle at top left,
      rgba(250, 204, 21, 0.24),
      transparent 42%
    ),
    linear-gradient(135deg, rgba(70, 36, 8, 0.98), rgba(18, 24, 44, 0.99));

  border: 1px solid rgba(251, 191, 36, 0.38);

  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.rpgCheckinCloseBtn {
  position: absolute;
  top: 16px;
  right: 16px;

  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;

  cursor: pointer;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);

  font-size: 28px;
  font-weight: 1000;
}

.rpgCheckinCloseBtn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rpgCheckinHeader {
  padding-right: 54px;
}

.rpgCheckinEyebrow {
  color: #facc15;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.12em;
}

.rpgCheckinTitle {
  margin-top: 4px;
  color: #ffffff;
  font-size: 38px;
  line-height: 1;
  font-weight: 1000;
}

.rpgCheckinSub {
  margin-top: 8px;
  color: #fed7aa;
  font-size: 14px;
  font-weight: 850;
}

.rpgCheckinRewardBanner {
  margin-top: 18px;
  padding: 14px;
  border-radius: 22px;

  display: flex;
  align-items: center;
  gap: 12px;

  background:
    radial-gradient(circle at left, rgba(56, 189, 248, 0.18), transparent 42%),
    rgba(15, 23, 42, 0.5);

  border: 1px solid rgba(251, 191, 36, 0.22);
}

.rpgCheckinRewardIcon {
  width: 54px;
  height: 54px;
  border-radius: 18px;

  display: grid;
  place-items: center;

  font-size: 30px;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.rpgCheckinRewardBanner b {
  display: block;
  color: #ffffff;
  font-size: 17px;
  font-weight: 1000;
}

.rpgCheckinRewardBanner span {
  display: block;
  margin-top: 3px;
  color: #fed7aa;
  font-size: 13px;
  font-weight: 850;
}

/* Lịch */
.rpgCheckinCalendar {
  margin-top: 16px;

  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.rpgCheckinDay {
  position: relative;

  min-height: 58px;
  border-radius: 16px;

  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;

  color: #fff7ed;
  background: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.72),
    rgba(15, 23, 42, 0.92)
  );

  border: 1px solid rgba(251, 191, 36, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.rpgCheckinDay.today {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow:
    0 0 0 3px rgba(250, 204, 21, 0.12),
    0 14px 28px rgba(250, 204, 21, 0.12);
}

.rpgCheckinDay.claimed {
  background:
    radial-gradient(circle at center, rgba(34, 197, 94, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(20, 83, 45, 0.86), rgba(15, 23, 42, 0.92));

  border-color: rgba(34, 197, 94, 0.52);
}

.rpgCheckinDayNumber {
  color: #ffffff;
  font-size: 15px;
  font-weight: 1000;
}

.rpgCheckinDayReward {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 1000;
}

.rpgCheckinDayMark {
  position: absolute;
  top: 5px;
  right: 7px;

  color: #86efac;
  font-size: 14px;
  font-weight: 1000;
}

.rpgCheckinDayToday {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);

  color: #facc15;
  font-size: 9px;
  font-weight: 1000;
  white-space: nowrap;
}

/* Nút nhận thưởng */
.rpgCheckinClaimBtn {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;

  border: 0;
  border-radius: 20px;

  cursor: pointer;
  color: #ffffff;

  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow:
    0 18px 38px rgba(34, 197, 94, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  font-size: 18px;
  font-weight: 1000;
}

.rpgCheckinClaimBtn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.rpgCheckinClaimBtn.claimed,
.rpgCheckinClaimBtn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: linear-gradient(180deg, #64748b, #475569);
  box-shadow: none;
  transform: none;
}

/* Màn hình thấp thì kéo cột nút lên */
@media (max-height: 760px) {
  .rpgCheckinLauncher {
    top: 178px !important;
  }

  .rpgShopLauncher,
  .rpgShopLauncher.rpgSideToolShop {
    top: 278px !important;
  }

  .rpgInventoryLauncher,
  .rpgInventoryLauncher.rpgSideToolInventory {
    top: 378px !important;
  }

  .rpgCheckinWindow {
    padding: 18px;
  }

  .rpgCheckinTitle {
    font-size: 32px;
  }

  .rpgCheckinDay {
    min-height: 48px;
  }
}
/* =====================================================
   FIX VỊ TRÍ NÚT ĐIỂM DANH - ĐƯA XUỐNG DƯỚI TÚI ĐỒ
   ===================================================== */

/* Giữ Shop và Túi Đồ ở vị trí hiện tại */
.rpgShopLauncher,
.rpgShopLauncher.rpgSideToolShop {
  top: 316px !important;
}

.rpgInventoryLauncher,
.rpgInventoryLauncher.rpgSideToolInventory {
  top: 426px !important;
}

/* Đưa Điểm Danh xuống ô đỏ phía dưới Túi Đồ */
.rpgCheckinLauncher,
.rpgCheckinLauncher.rpgSideToolCheckin {
  top: 606px !important;
  right: 6px !important;
}

/* Nếu màn hình thấp thì kéo nhẹ lên để không bị cắt đáy */
@media (max-height: 760px) {
  .rpgShopLauncher,
  .rpgShopLauncher.rpgSideToolShop {
    top: 278px !important;
  }

  .rpgInventoryLauncher,
  .rpgInventoryLauncher.rpgSideToolInventory {
    top: 378px !important;
  }

  .rpgCheckinLauncher,
  .rpgCheckinLauncher.rpgSideToolCheckin {
    top: 478px !important;
  }
}
/* =====================================================
   RPG PLAYER LEADERBOARD - BẠN BÈ / THẾ GIỚI / GUILD
   ===================================================== */

.playerRankRpgPanel {
  width: min(680px, 94vw) !important;
  max-height: min(760px, calc(100vh - 44px)) !important;
  overflow: hidden !important;
  border-radius: 34px !important;
  background:
    radial-gradient(
      circle at 16% 0%,
      rgba(250, 204, 21, 0.18),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(255, 248, 232, 0.98)
    ) !important;
  border: 1px solid rgba(251, 191, 36, 0.28) !important;
  box-shadow:
    0 30px 90px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.playerRankRpgTop {
  padding-bottom: 16px !important;
}

.playerRankRpgDesc {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
}

.playerRankRpgCard {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

.playerRankTabs {
  padding: 8px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.playerRankTab {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #64748b;
  background: transparent;
  font-size: 14px;
  font-weight: 1000;
}

.playerRankTab span {
  width: 32px;
  height: 32px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
}

.playerRankTab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed, #2563eb 48%, #0ea5e9);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.playerRankTab.active span {
  background: rgba(255, 255, 255, 0.22);
}

.playerRankRpgHeader {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 190px;
  align-items: center;
  color: #8a5a10;
  background: linear-gradient(180deg, #fff7d6, #ffedb6);
  border: 1px solid rgba(245, 158, 11, 0.22);
  font-size: 13px;
  font-weight: 1000;
}

.playerRankRpgList {
  min-height: 0;
  max-height: 410px;
  overflow: auto;
  display: grid;
  gap: 9px;
  padding-right: 4px;
}

.playerRankRpgRow {
  min-height: 74px;
  padding: 10px 14px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 190px;
  align-items: center;
  gap: 10px;
  color: #102042;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(248, 250, 252, 0.98)
  );
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.playerRankRpgRow.mine {
  border-color: rgba(37, 99, 235, 0.34);
  background:
    radial-gradient(circle at left, rgba(59, 130, 246, 0.12), transparent 46%),
    linear-gradient(180deg, #eff6ff, #ffffff);
}

.playerRankRpgRow.rank-1 {
  border-color: rgba(245, 158, 11, 0.42);
  background:
    radial-gradient(circle at left, rgba(250, 204, 21, 0.16), transparent 46%),
    linear-gradient(180deg, #fffbeb, #ffffff);
}

.playerRankRpgRank {
  font-size: 18px;
  font-weight: 1000;
  color: #0f172a;
}

.playerRankRpgPlayer {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.playerRankRpgAvatar {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #38bdf8, #2563eb 56%, #7c3aed);
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.18),
    inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  font-size: 18px;
  font-weight: 1000;
}

.playerRankRpgNameWrap {
  min-width: 0;
}

.playerRankRpgName {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #102042;
  font-size: 15px;
  font-weight: 1000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playerRankMeBadge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: #16a34a;
  font-size: 10px;
  font-weight: 1000;
}

.playerRankRpgSub {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.playerRankRpgPower {
  text-align: right;
  display: grid;
  gap: 3px;
}

.playerRankRpgPower b {
  color: #dc2626;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
}

.playerRankRpgPower span {
  color: #7c2d12;
  font-size: 12px;
  font-weight: 950;
}

.playerRankRpgFooter {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 10px;
}

.playerRankRpgFooterBox {
  min-height: 66px;
  padding: 10px 14px;
  border-radius: 20px;
  display: grid;
  align-content: center;
  gap: 4px;
  background:
    radial-gradient(circle at left, rgba(250, 204, 21, 0.13), transparent 48%),
    rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.playerRankRpgFooterBox span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.playerRankRpgFooterBox b {
  color: #0f172a;
  font-size: 16px;
  font-weight: 1000;
}

.playerRankLoading,
.playerRankEmpty {
  min-height: 180px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #64748b;
  background: rgba(255, 255, 255, 0.68);
  border: 1px dashed rgba(100, 116, 139, 0.28);
  font-weight: 900;
  text-align: center;
}

@media (max-width: 760px) {
  .playerRankRpgHeader,
  .playerRankRpgRow {
    grid-template-columns: 54px minmax(0, 1fr) 126px;
  }

  .playerRankRpgPower b {
    font-size: 15px;
  }

  .playerRankRpgPower span {
    font-size: 10px;
  }

  .playerRankRpgFooter {
    grid-template-columns: 1fr;
  }

  .playerRankTab b {
    display: none;
  }
}
/* =====================================================
   FIX BẢNG XẾP HẠNG RPG
   1) Popup bám sát mép trên/dưới
   2) Chỉ danh sách người chơi được cuộn
   3) Footer cố định ở đáy popup
   4) Ẩn nút phụ phía sau khi popup đang mở
   ===================================================== */

/* Khi mở bảng xếp hạng thì không cho nền phía sau cuộn */
body.playerRankIsOpen {
  overflow: hidden !important;
}

/* Lớp phủ phải cao hơn toàn bộ nút nổi RPG */
.playerRankLayer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 12000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.playerRankLayer.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Nền mờ mạnh hơn, các nút phía sau không còn cảm giác nổi lên */
.playerRankLayer::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.42) !important;
  backdrop-filter: blur(8px) saturate(0.8) !important;
}

/* Popup không nằm lơ lửng nữa: bám gần sát trên/dưới màn hình */
.playerRankPanel.playerRankRpgPanel,
.playerRankRpgPanel,
.playerRankPanel {
  position: absolute !important;

  top: 14px !important;
  bottom: 14px !important;
  right: 86px !important;

  width: min(690px, calc(100vw - 120px)) !important;
  height: auto !important;
  max-height: none !important;

  display: flex !important;
  flex-direction: column !important;

  overflow: hidden !important;
  border-radius: 30px !important;
  box-sizing: border-box !important;

  background:
    radial-gradient(
      circle at 16% 0%,
      rgba(250, 204, 21, 0.18),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.99),
      rgba(255, 248, 232, 0.99)
    ) !important;

  border: 1px solid rgba(251, 191, 36, 0.34) !important;
  box-shadow:
    0 34px 100px rgba(15, 23, 42, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;

  transform: translateY(0) scale(1) !important;
}

/* Header cố định, không bị danh sách đẩy mất */
.playerRankPanelTop.playerRankRpgTop,
.playerRankRpgTop,
.playerRankPanelTop {
  flex: 0 0 auto !important;
  padding: 14px 18px 12px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Thân popup chiếm phần còn lại */
.playerRankPanelBody {
  flex: 1 1 auto !important;
  min-height: 0 !important;

  display: flex !important;
  flex-direction: column !important;

  padding: 14px 18px 16px !important;
  overflow: hidden !important;
}

/* Card bên trong cũng phải là cột, để footer nằm đáy */
.playerRankRpgCard,
.playerRankCard {
  flex: 1 1 auto !important;
  min-height: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;

  overflow: hidden !important;
}

/* Tabs Bạn Bè / Thế Giới / Guild đứng yên */
.playerRankTabs {
  flex: 0 0 auto !important;
}

/* Hàng tiêu đề bảng đứng yên */
.playerRankRpgHeader,
.playerRankHeadRow {
  flex: 0 0 auto !important;
}

/* Quan trọng nhất: chỉ danh sách người chơi được cuộn */
.playerRankRpgList,
.playerRankList {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  padding-right: 6px !important;
  overscroll-behavior: contain !important;
}

/* Footer cố định ở đáy popup */
.playerRankRpgFooter,
.playerRankFooter {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Giảm nhẹ chiều cao mỗi dòng để nhìn được nhiều người hơn */
.playerRankRpgRow {
  min-height: 64px !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
}

.playerRankRpgAvatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 15px !important;
}

.playerRankRpgName {
  font-size: 14px !important;
}

.playerRankRpgSub {
  font-size: 10.5px !important;
}

.playerRankRpgPower b {
  font-size: 17px !important;
}

.playerRankRpgPower span {
  font-size: 11px !important;
}

/* Footer gọn hơn để không bị che */
.playerRankRpgFooterBox,
.playerRankFooterBox {
  min-height: 58px !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
}

.playerRankRpgFooterBox span,
.playerRankFooterLabel {
  font-size: 10px !important;
}

.playerRankRpgFooterBox b,
.playerRankFooterValue {
  font-size: 15px !important;
}

/* Scrollbar riêng của danh sách: nhỏ, không chiếm quá nhiều chỗ */
.playerRankRpgList::-webkit-scrollbar,
.playerRankList::-webkit-scrollbar {
  width: 8px;
}

.playerRankRpgList::-webkit-scrollbar-track,
.playerRankList::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
}

.playerRankRpgList::-webkit-scrollbar-thumb,
.playerRankList::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.36);
  border-radius: 999px;
}

.playerRankRpgList,
.playerRankList {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.36) rgba(15, 23, 42, 0.05);
}
/* =====================================================
   KHI MỞ BẢNG XẾP HẠNG: ẨN TOÀN BỘ NÚT PHỤ PHÍA SAU
   ===================================================== */

/* Shop / Túi Đồ / Điểm Danh */
body.playerRankIsOpen .rpgShopLauncher,
body.playerRankIsOpen .rpgInventoryLauncher,
body.playerRankIsOpen .rpgCheckinLauncher,

/* Bang Hội / Nhiệm Vụ */
body.playerRankIsOpen .guildLauncher,
body.playerRankIsOpen .dailyMissionLauncher,

/* Nếu có wrapper riêng thì cũng làm mờ và không cho bấm */
body.playerRankIsOpen #rpgShopRoot,
body.playerRankIsOpen #rpgInventoryRoot,
body.playerRankIsOpen #rpgDailyCheckinRoot,
body.playerRankIsOpen #guildRoot,
body.playerRankIsOpen #dailyMissionsRoot {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Nhưng không được ẩn chính bảng xếp hạng */
body.playerRankIsOpen #playerLeaderboardRoot,
body.playerRankIsOpen .playerRankWidget,
body.playerRankIsOpen .playerRankLayer,
body.playerRankIsOpen .playerRankPanel {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Đảm bảo bảng xếp hạng nằm trên tất cả */
body.playerRankIsOpen #playerLeaderboardRoot {
  position: relative !important;
  z-index: 12000 !important;
}
@media (max-height: 760px) {
  .playerRankPanel.playerRankRpgPanel,
  .playerRankRpgPanel,
  .playerRankPanel {
    top: 8px !important;
    bottom: 8px !important;
    right: 72px !important;
    border-radius: 24px !important;
  }

  .playerRankPanelTop.playerRankRpgTop,
  .playerRankRpgTop,
  .playerRankPanelTop {
    padding: 10px 14px 8px !important;
  }

  .playerRankPanelBody {
    padding: 10px 14px 12px !important;
  }

  .playerRankTitle {
    font-size: 22px !important;
    line-height: 1.05 !important;
  }

  .playerRankRpgDesc {
    font-size: 11px !important;
  }

  .playerRankTabs {
    padding: 6px !important;
    gap: 6px !important;
  }

  .playerRankTab {
    min-height: 44px !important;
    border-radius: 14px !important;
  }

  .playerRankRpgHeader {
    min-height: 36px !important;
  }

  .playerRankRpgRow {
    min-height: 56px !important;
  }

  .playerRankRpgFooterBox {
    min-height: 50px !important;
  }
}
/* =====================================================
   FIX AN TOÀN: KHÔNG ẨN NÚT BẢNG XẾP HẠNG KHI POPUP ĐANG ĐÓNG
   ===================================================== */

body:not(.playerRankIsOpen) #playerLeaderboardRoot,
body:not(.playerRankIsOpen) .playerRankWidget,
body:not(.playerRankIsOpen) .playerRankLauncher {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
/* =====================================================
   MAIN STORY RESULT RPG 2026
   Tổng kết màn chơi chính tuyến
   ===================================================== */

.mainResultRpgScreen {
  height: calc(100vh - 104px);
  min-height: 620px;
  padding: 14px 18px;
  overflow: hidden;

  display: flex;
  align-items: stretch;
  justify-content: center;

  background:
    radial-gradient(circle at top, rgba(255, 203, 87, 0.28), transparent 42%),
    linear-gradient(180deg, #fff1cf 0%, #f4dfab 100%);
}

.mainResultRpgShell {
  width: min(1440px, 100%);
  height: 100%;
  min-height: 0;

  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;

  padding: 14px;
  border-radius: 30px;

  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.92),
      transparent 38%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 247, 231, 0.96)
    );

  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow:
    0 26px 70px rgba(120, 53, 15, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);

  overflow: hidden;
}

.mainResultRpgTop {
  text-align: center;
}

.mainResultRpgStatus {
  font-size: clamp(42px, 5.2vw, 76px);
  line-height: 0.92;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mainResultRpgStatus.victory {
  color: #16a34a;
  text-shadow:
    0 0 28px rgba(34, 197, 94, 0.22),
    0 8px 0 rgba(22, 101, 52, 0.08);
}

.mainResultRpgStatus.defeat {
  color: #dc2626;
  text-shadow:
    0 0 28px rgba(239, 68, 68, 0.2),
    0 8px 0 rgba(127, 29, 29, 0.08);
}

.mainResultRpgSubTitle {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.mainResultRpgStats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.mainResultRpgStatCard {
  min-height: 66px;
  padding: 9px 10px;
  border-radius: 18px;

  display: grid;
  align-content: center;
  gap: 3px;

  background: linear-gradient(180deg, #ffffff, #fff7e8);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.mainResultRpgStatCard span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.mainResultRpgStatCard b {
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  font-weight: 1000;
}

.mainResultRpgStatCard.correct b {
  color: #16a34a;
}

.mainResultRpgStatCard.wrong b {
  color: #dc2626;
}

.mainResultRpgRewardRow {
  min-height: 0;
}

.mainResultRpgRewardRow .resultRewardInlineRow {
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.mainResultRpgRewardRow .rpgDiamondRewardBox,
.mainResultRpgRewardRow .battlePowerRewardBox {
  min-height: 74px !important;
  padding: 10px 12px !important;
  border-radius: 20px !important;
}

.mainResultRpgRewardRow .rpgDiamondRewardIcon,
.mainResultRpgRewardRow .battlePowerRewardIcon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 16px !important;
  font-size: 25px !important;
}

.mainResultRpgRewardRow .rpgDiamondRewardTitle,
.mainResultRpgRewardRow .battlePowerRewardTitle {
  font-size: 14px !important;
}

.mainResultRpgRewardRow .rpgDiamondRewardText,
.mainResultRpgRewardRow .battlePowerRewardText,
.mainResultRpgRewardRow .rpgDiamondRewardSub,
.mainResultRpgRewardRow .battlePowerRewardSub {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

.mainResultRpgBoardPanel {
  min-height: 0;
  padding: 12px;
  border-radius: 24px;

  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;

  background: linear-gradient(180deg, #ffffff, #fff7e8);
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);

  overflow: hidden;
}

.mainResultRpgBoardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mainResultRpgBoardTitle {
  color: #111827;
  font-size: 20px;
  font-weight: 1000;
}

.mainResultRpgBoardDesc {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.mainResultRpgLegend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.mainResultRpgLegend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mainResultRpgLegend i {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
}

.mainResultRpgLegend .blue {
  background: #2563eb;
}

.mainResultRpgLegend .red {
  background: #ef4444;
}

.mainResultRpgLegend .gray {
  background: #94a3b8;
}

.mainResultRpgBoard {
  min-height: 0;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(64px, 1fr);
  gap: 10px;

  overflow: hidden;
}

.mainResultTile {
  border: 0;
  border-radius: 18px;
  cursor: pointer;

  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;

  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(15, 23, 42, 0.1);

  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.mainResultTile:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.04);
}

.mainResultTile.correct {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.mainResultTile.wrong {
  background: linear-gradient(180deg, #fb7185, #dc2626);
}

.mainResultTile.empty {
  color: #475569;
  background: linear-gradient(180deg, #e2e8f0, #cbd5e1);
}

.mainResultTileNumber {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1;
  font-weight: 1000;
}

.mainResultTileLabel {
  font-size: 12px;
  font-weight: 1000;
}

.mainResultRpgActions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mainResultRpgActions .btn {
  min-height: 42px;
  border-radius: 16px;
  padding: 10px 18px;
}

.mainResultNextLevelBtn {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #ffffff !important;
}

/* Popup xem từng câu */

.mainResultDetailBackdrop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
}

.mainResultDetailLayer {
  position: fixed;
  inset: 0;
  z-index: 9801;
  padding: 18px;

  display: grid;
  place-items: center;
}

.mainResultDetailCard {
  position: relative;

  width: min(1180px, 96vw);
  height: min(720px, calc(100vh - 36px));

  padding: 18px;
  border-radius: 30px;

  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;

  background:
    radial-gradient(circle at top, rgba(250, 204, 21, 0.2), transparent 36%),
    linear-gradient(180deg, #fffdf7, #f8ecd1);

  border: 1px solid rgba(245, 158, 11, 0.32);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);

  overflow: hidden;
}

.mainResultDetailClose {
  position: absolute;
  top: 14px;
  right: 14px;

  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;

  cursor: pointer;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.08);

  font-size: 28px;
  font-weight: 1000;
}

.mainResultDetailTop {
  padding-right: 54px;
}

.mainResultDetailEyebrow {
  color: #b45309;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mainResultDetailTitle {
  margin-top: 4px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
  font-weight: 1000;
}

.mainResultDetailBody {
  min-height: 0;

  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.mainResultDetailLeft,
.mainResultDetailRight {
  min-height: 0;
  padding: 14px;
  border-radius: 24px;

  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(245, 158, 11, 0.18);

  overflow: hidden;
}

.mainResultDetailLeft {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}

.mainResultDetailRight {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
}

.mainResultDetailSectionTitle {
  color: #111827;
  font-size: 16px;
  font-weight: 1000;
}

.mainResultQuestionContent {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.mainResultAnswerCompare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mainResultAnswerCompare > div {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;

  display: grid;
  gap: 4px;

  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.mainResultAnswerCompare span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.mainResultAnswerCompare b {
  color: #0f172a;
  font-size: 18px;
  font-weight: 1000;
}

.mainResultRevealButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mainResultRevealBtn {
  min-height: 44px;
  border: 0;
  border-radius: 16px;

  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);

  font-size: 14px;
  font-weight: 1000;
}

.mainResultRevealBtn.solution {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.mainResultRevealBox {
  min-height: 0;
  overflow: hidden;

  border-radius: 20px;
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.18);
}

.mainResultRevealPlaceholder {
  height: 100%;
  min-height: 260px;

  display: grid;
  place-items: center;

  padding: 18px;
  color: #64748b;
  text-align: center;
  font-weight: 900;
}

.mainResultRevealContent {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

body.mainResultDetailOpen {
  overflow: hidden;
}

/* Màn hình thấp: giảm chiều cao các khối để không cần cuộn */
@media (max-height: 760px) {
  .mainResultRpgScreen {
    height: calc(100vh - 88px);
    min-height: 560px;
    padding: 8px 12px;
  }

  .mainResultRpgShell {
    padding: 10px;
    gap: 7px;
    border-radius: 24px;
  }

  .mainResultRpgStatus {
    font-size: clamp(34px, 4.2vw, 56px);
  }

  .mainResultRpgSubTitle {
    font-size: 11px;
  }

  .mainResultRpgStats {
    gap: 6px;
  }

  .mainResultRpgStatCard {
    min-height: 54px;
    padding: 7px 8px;
    border-radius: 14px;
  }

  .mainResultRpgStatCard span {
    font-size: 9px;
  }

  .mainResultRpgStatCard b {
    font-size: 19px;
  }

  .mainResultRpgRewardRow .rpgDiamondRewardBox,
  .mainResultRpgRewardRow .battlePowerRewardBox {
    min-height: 60px !important;
    padding: 8px 10px !important;
  }

  .mainResultRpgBoardPanel {
    padding: 9px;
    gap: 7px;
  }

  .mainResultRpgBoardTitle {
    font-size: 17px;
  }

  .mainResultRpgBoardDesc {
    display: none;
  }

  .mainResultRpgBoard {
    gap: 7px;
    grid-auto-rows: minmax(50px, 1fr);
  }

  .mainResultTileNumber {
    font-size: 22px;
  }

  .mainResultTileLabel {
    font-size: 10px;
  }

  .mainResultRpgActions .btn {
    min-height: 36px;
    padding: 8px 14px;
  }
}
/* =====================================================
   FIX MAIN RESULT REVIEW POPUP
   Sửa lỗi X không đóng được + giảm vùng trống
   ===================================================== */

.mainResultDetailBackdrop[hidden],
.mainResultDetailLayer[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.mainResultDetailBackdrop {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
}

.mainResultDetailLayer {
  position: fixed;
  inset: 0;
  z-index: 9801;

  display: grid;
  align-items: start;
  justify-items: center;

  padding: 14px 18px;
  overflow: hidden;
}

.mainResultDetailCard {
  position: relative;

  width: min(1360px, calc(100vw - 48px));
  height: min(690px, calc(100vh - 132px));
  margin-top: 4px;

  padding: 16px;
  border-radius: 28px;

  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(250, 204, 21, 0.28),
      transparent 36%
    ),
    linear-gradient(180deg, #fffdf7 0%, #f8ecd1 100%);

  border: 1px solid rgba(245, 158, 11, 0.36);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.34);

  overflow: hidden;
}

.mainResultDetailClose {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;

  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;

  cursor: pointer;
  color: #0f172a;
  background: rgba(15, 23, 42, 0.1);

  font-size: 28px;
  font-weight: 1000;

  display: grid;
  place-items: center;
}

.mainResultDetailClose:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.mainResultDetailTop {
  padding-right: 58px;
}

.mainResultDetailEyebrow {
  color: #b45309;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mainResultDetailTitle {
  margin-top: 4px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  font-weight: 1000;
}

.mainResultDetailBody {
  min-height: 0;

  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
}

.mainResultDetailLeft,
.mainResultDetailRight {
  min-height: 0;
  padding: 14px;
  border-radius: 24px;

  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(245, 158, 11, 0.18);

  overflow: hidden;
}

.mainResultDetailLeft {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.mainResultDetailRight {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.mainResultQuestionContent {
  min-height: 0;
  overflow: auto;

  padding: 12px;
  border-radius: 18px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 247, 237, 0.86)
  );
  border: 1px solid rgba(245, 158, 11, 0.14);
}

.mainResultQuestionContent .contentTextBlock {
  font-size: 17px !important;
  line-height: 1.55 !important;
  color: #111827 !important;
}

.mainResultQuestionContent .contentLatex {
  font-size: 19px !important;
}

.mainResultQuestionContent .qImgWrap {
  margin-top: 8px !important;
  box-shadow: none;
}

.mainResultAnswerCompare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mainResultAnswerCompare > div {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;

  display: grid;
  align-content: center;
  gap: 4px;

  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.mainResultAnswerCompare span {
  color: #64748b;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.mainResultAnswerCompare b {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 1000;
}

.mainResultRevealButtons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mainResultRevealBtn {
  min-height: 44px;
  border: 0;
  border-radius: 16px;

  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);

  font-size: 14px;
  font-weight: 1000;
}

.mainResultRevealBtn.solution {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.mainResultRevealBox {
  min-height: 0;
  overflow: hidden;

  border-radius: 20px;
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.mainResultRevealPlaceholder {
  height: 100%;
  min-height: 150px;

  display: grid;
  place-items: center;

  padding: 18px;
  color: #64748b;
  text-align: center;
  font-weight: 900;
}

.mainResultRevealContent {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.mainResultRevealPlaceholder[hidden],
.mainResultRevealContent[hidden] {
  display: none !important;
}

.mainResultRevealContent .contentTextBlock {
  font-size: 16px !important;
  line-height: 1.5 !important;
}

.mainResultRevealBtn.active {
  transform: translateY(-1px);
  filter: saturate(1.12) brightness(1.04);
  box-shadow:
    0 10px 22px rgba(79, 70, 229, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.46);
}

.mainResultRevealBtn.solution.active {
  box-shadow:
    0 10px 22px rgba(234, 88, 12, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.46);
}

.mainResultEmptySupport {
  min-height: 150px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #92400e;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.mainResultEmptyQuestion {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;

  padding: 18px;
  border-radius: 18px;

  color: #92400e;
  background: rgba(251, 191, 36, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.45);

  font-size: 15px;
  font-weight: 900;
  line-height: 1.55;
}

body.mainResultDetailOpen {
  overflow: hidden;
}

/* Màn hình thấp thì popup tự gọn lại */
@media (max-height: 760px) {
  .mainResultDetailLayer {
    padding: 8px 14px;
  }

  .mainResultDetailCard {
    height: calc(100vh - 104px);
    padding: 12px;
    border-radius: 24px;
    gap: 8px;
  }

  .mainResultDetailTitle {
    font-size: 24px;
  }

  .mainResultDetailBody {
    gap: 10px;
  }

  .mainResultDetailLeft,
  .mainResultDetailRight {
    padding: 10px;
    border-radius: 20px;
  }

  .mainResultRevealBtn {
    min-height: 38px;
  }

  .mainResultAnswerCompare > div {
    min-height: 48px;
  }
}
/* =====================================================
   RESULT SCREEN 2026 - NÂNG CẤP KHUNG "TỪNG CÂU HỎI"
   + BỎ THANH CUỘN TOÀN TRANG TỔNG KẾT
   ===================================================== */

/* Khi đang ở màn tổng kết thì khóa cuộn toàn trang */
body:has(.mainResultRpgScreen) {
  overflow: hidden !important;
}

/* Vùng app không được cao quá màn hình */
body:has(.mainResultRpgScreen) #app {
  height: calc(100dvh - 108px) !important;
  max-height: calc(100dvh - 108px) !important;
  overflow: hidden !important;
}

/* Màn tổng kết phải nằm gọn dưới header, không sinh scroll ngoài */
body:has(.mainResultRpgScreen) .mainResultRpgScreen {
  height: calc(100dvh - 108px) !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 108px) !important;

  padding: 8px 12px 6px !important;
  overflow: hidden !important;

  align-items: center !important;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.72),
      transparent 26%
    ),
    radial-gradient(
      circle at 18% 14%,
      rgba(96, 165, 250, 0.18),
      transparent 28%
    ),
    radial-gradient(
      circle at 82% 16%,
      rgba(250, 204, 21, 0.24),
      transparent 30%
    ),
    linear-gradient(180deg, #fff2ca 0%, #f5d99c 100%) !important;
}

/* Khung tổng kết gọn hơn để không đẩy nội dung xuống */
body:has(.mainResultRpgScreen) .mainResultRpgShell {
  width: min(1430px, 100%) !important;
  height: 100% !important;
  min-height: 0 !important;

  padding: 10px 12px !important;
  gap: 7px !important;

  border-radius: 24px !important;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94),
      rgba(255, 248, 226, 0.96)
    ),
    radial-gradient(
      circle at 50% 0%,
      rgba(255, 255, 255, 0.88),
      transparent 38%
    ) !important;

  border: 1px solid rgba(255, 196, 87, 0.5) !important;

  box-shadow:
    0 18px 46px rgba(92, 49, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;

  overflow: hidden !important;
}

/* Giảm nhẹ phần VICTORY để nhường chỗ cho bảng câu hỏi */
body:has(.mainResultRpgScreen) .mainResultRpgStatus {
  font-size: clamp(44px, 4.4vw, 68px) !important;
  line-height: 0.86 !important;
  letter-spacing: 0.075em !important;
}

/* Thu gọn hàng thống kê */
body:has(.mainResultRpgScreen) .mainResultRpgStats {
  gap: 7px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgStatCard {
  min-height: 54px !important;
  padding: 7px 10px !important;
  border-radius: 15px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgStatCard span {
  font-size: 10px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgStatCard b {
  font-size: 21px !important;
}

/* Thu gọn phần thưởng để bảng câu hỏi có nhiều đất hơn */
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardBox,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardBox {
  min-height: 62px !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardIcon,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardIcon {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  font-size: 23px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardTitle,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardTitle {
  font-size: 13px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardText,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardText,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardSub,
body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardSub {
  font-size: 11.5px !important;
  line-height: 1.25 !important;
}

/* Khung "Từng câu hỏi" mới: giống bảng nhiệm vụ trong game RPG */
body:has(.mainResultRpgScreen) .mainResultRpgBoardPanel {
  position: relative;

  min-height: 0 !important;
  padding: 12px !important;
  border-radius: 24px !important;

  display: grid !important;
  grid-template-rows: auto 1fr !important;
  gap: 10px !important;

  overflow: hidden !important;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.86),
      rgba(255, 246, 221, 0.88)
    ),
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.14), transparent 34%),
    radial-gradient(
      circle at 100% 0%,
      rgba(250, 204, 21, 0.22),
      transparent 34%
    ) !important;

  border: 1px solid rgba(245, 158, 11, 0.38) !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 28px rgba(120, 53, 15, 0.08) !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgBoardPanel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: translateX(-120%);
  animation: resultBoardLightSweep 5.5s ease-in-out infinite;
}

@keyframes resultBoardLightSweep {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }

  38% {
    opacity: 0;
  }

  55% {
    opacity: 1;
  }

  78% {
    opacity: 0;
  }

  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Header của phần từng câu hỏi */
body:has(.mainResultRpgScreen) .mainResultRpgBoardHead {
  position: relative;
  z-index: 1;

  min-height: 34px !important;
  padding: 0 2px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgBoardTitle {
  font-size: 21px !important;
  line-height: 1 !important;
  font-weight: 1000 !important;
  color: #101827 !important;

  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

body:has(.mainResultRpgScreen) .mainResultRpgBoardDesc {
  display: none !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgLegend {
  padding: 7px 10px !important;
  border-radius: 999px !important;

  gap: 11px !important;

  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(245, 158, 11, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);

  font-size: 11px !important;
}

/* Lưới câu hỏi: giữ 5 cột và cuộn riêng để luôn xem đủ toàn bộ câu */
body:has(.mainResultRpgScreen) .mainResultRpgBoard {
  position: relative;
  z-index: 1;

  min-height: 0 !important;
  height: 100% !important;

  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-template-rows: none !important;
  grid-auto-rows: 64px !important;
  align-content: start !important;

  gap: 10px !important;
  padding: 2px 8px 4px 2px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.78) rgba(255, 255, 255, 0.58);
}

body:has(.mainResultRpgScreen) .mainResultRpgBoard::-webkit-scrollbar {
  width: 10px;
}

body:has(.mainResultRpgScreen) .mainResultRpgBoard::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

body:has(.mainResultRpgScreen) .mainResultRpgBoard::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

body:has(.mainResultRpgScreen) .mainResultRpgBoard::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

/* Ô câu hỏi - kiểu thẻ nhiệm vụ hiện đại 2026 */
body:has(.mainResultRpgScreen) .mainResultTile {
  position: relative;
  isolation: isolate;

  min-width: 0 !important;
  min-height: 0 !important;

  border: 0 !important;
  border-radius: 22px !important;
  cursor: pointer !important;

  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  gap: 3px !important;

  overflow: hidden !important;

  transform: translateZ(0);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease !important;
}

/* Viền sáng bên trong */
body:has(.mainResultRpgScreen) .mainResultTile::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;

  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.42);

  pointer-events: none;
}

/* Ánh sáng xiên trên ô */
body:has(.mainResultRpgScreen) .mainResultTile::after {
  content: "";
  position: absolute;
  inset: -40% -30%;
  z-index: -1;

  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 34%,
    rgba(255, 255, 255, 0.32) 45%,
    transparent 56%,
    transparent 100%
  );

  transform: translateX(-55%) rotate(4deg);
  opacity: 0.8;
  pointer-events: none;
}

body:has(.mainResultRpgScreen) .mainResultTile:hover {
  transform: translateY(-3px) scale(1.018) !important;
  filter: saturate(1.12) brightness(1.04) !important;
}

/* Đúng: xanh dương rực, có glow */
body:has(.mainResultRpgScreen) .mainResultTile.correct {
  color: #ffffff !important;

  background:
    radial-gradient(
      circle at 30% 14%,
      rgba(255, 255, 255, 0.42),
      transparent 28%
    ),
    linear-gradient(135deg, #5cc8ff 0%, #2f7df6 42%, #244ee9 100%) !important;

  box-shadow:
    0 13px 24px rgba(37, 99, 235, 0.24),
    0 0 0 1px rgba(147, 197, 253, 0.36),
    inset 0 -10px 22px rgba(30, 64, 175, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
}

/* Sai: đỏ rực nhưng vẫn đẹp */
body:has(.mainResultRpgScreen) .mainResultTile.wrong {
  color: #ffffff !important;

  background:
    radial-gradient(
      circle at 30% 14%,
      rgba(255, 255, 255, 0.38),
      transparent 28%
    ),
    linear-gradient(135deg, #ff9b7b 0%, #ef4444 48%, #be123c 100%) !important;

  box-shadow:
    0 13px 24px rgba(220, 38, 38, 0.24),
    0 0 0 1px rgba(252, 165, 165, 0.38),
    inset 0 -10px 22px rgba(127, 29, 29, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* Chưa làm: xám bạc, không bị quá buồn */
body:has(.mainResultRpgScreen) .mainResultTile.empty {
  color: #334155 !important;

  background:
    radial-gradient(
      circle at 30% 14%,
      rgba(255, 255, 255, 0.7),
      transparent 30%
    ),
    linear-gradient(135deg, #eef4ff 0%, #cbd5e1 54%, #aeb9ca 100%) !important;

  box-shadow:
    0 11px 20px rgba(100, 116, 139, 0.18),
    0 0 0 1px rgba(203, 213, 225, 0.75),
    inset 0 -10px 20px rgba(100, 116, 139, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

/* Số câu nổi bật hơn */
body:has(.mainResultRpgScreen) .mainResultTileNumber {
  position: relative;
  z-index: 1;

  font-size: clamp(24px, 2.45vw, 36px) !important;
  line-height: 0.9 !important;
  font-weight: 1000 !important;
  letter-spacing: -0.04em !important;

  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

body:has(.mainResultRpgScreen) .mainResultTile.empty .mainResultTileNumber {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 16px rgba(100, 116, 139, 0.12);
}

/* Nhãn Đúng / Sai / Chưa làm */
body:has(.mainResultRpgScreen) .mainResultTileLabel {
  position: relative;
  z-index: 1;

  padding: 3px 10px !important;
  border-radius: 999px !important;

  font-size: 11px !important;
  line-height: 1 !important;
  font-weight: 1000 !important;

  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);

  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

body:has(.mainResultRpgScreen) .mainResultTile.empty .mainResultTileLabel {
  background: rgba(255, 255, 255, 0.44);
  color: #334155 !important;
  text-shadow: none !important;
}

/* Nút phía dưới gọn hơn để không tạo scroll */
body:has(.mainResultRpgScreen) .mainResultRpgActions {
  gap: 8px !important;
  min-height: 42px !important;
}

body:has(.mainResultRpgScreen) .mainResultRpgActions .btn {
  min-height: 38px !important;
  padding: 8px 18px !important;
  border-radius: 16px !important;
  font-size: 14px !important;
}

/* Màn hình thấp hơn thì tự ép gọn thêm */
@media (max-height: 820px) {
  body:has(.mainResultRpgScreen) #app {
    height: calc(100dvh - 104px) !important;
    max-height: calc(100dvh - 104px) !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgScreen {
    height: calc(100dvh - 104px) !important;
    max-height: calc(100dvh - 104px) !important;
    padding: 5px 10px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgShell {
    padding: 8px 10px !important;
    gap: 5px !important;
    border-radius: 20px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgStatus {
    font-size: clamp(36px, 4vw, 56px) !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgSubTitle {
    font-size: 10px !important;
    margin-top: 2px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgStatCard {
    min-height: 46px !important;
    padding: 6px 9px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgStatCard b {
    font-size: 18px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .rpgDiamondRewardBox,
  body:has(.mainResultRpgScreen) .mainResultRpgRewardRow .battlePowerRewardBox {
    min-height: 54px !important;
    padding: 6px 10px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgBoardPanel {
    padding: 9px !important;
    gap: 7px !important;
    border-radius: 20px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgBoardTitle {
    font-size: 18px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgLegend {
    padding: 5px 8px !important;
    font-size: 10px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgBoard {
    gap: 7px !important;
    grid-auto-rows: 54px !important;
    padding-right: 6px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultTile {
    border-radius: 17px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultTile::before {
    border-radius: 16px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultTileNumber {
    font-size: clamp(21px, 2.15vw, 30px) !important;
  }

  body:has(.mainResultRpgScreen) .mainResultTileLabel {
    font-size: 10px !important;
    padding: 2px 8px !important;
  }

  body:has(.mainResultRpgScreen) .mainResultRpgActions .btn {
    min-height: 34px !important;
    padding: 7px 14px !important;
    font-size: 13px !important;
  }
} /* =====================================================
   KHI MỞ BẠN BÈ: ẨN SHOP / TÚI ĐỒ / ĐIỂM DANH PHÍA SAU
   ===================================================== */

/* Đưa popup Bạn Bè lên trên các nút RPG */
body.friendsPanelIsOpen .friendsLayer {
  z-index: 12000 !important;
}

body.friendsPanelIsOpen .friendsPanel {
  z-index: 12001 !important;
}

/* Ẩn 3 nút nổi đang đè lên popup Bạn Bè */
body.friendsPanelIsOpen .rpgShopLauncher,
body.friendsPanelIsOpen .rpgInventoryLauncher,
body.friendsPanelIsOpen .rpgCheckinLauncher,
body.friendsPanelIsOpen .rpgSideToolBtn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(30px) scale(0.86) !important;
}

/* Ẩn luôn wrapper nếu nút nằm trong root riêng */
body.friendsPanelIsOpen #rpgShopRoot,
body.friendsPanelIsOpen #rpgInventoryRoot,
body.friendsPanelIsOpen #rpgDailyCheckinRoot,
body.friendsPanelIsOpen #rpgCheckinRoot {
  pointer-events: none !important;
}

/* Đảm bảo khi đóng Bạn Bè thì các nút hiện lại bình thường */
body:not(.friendsPanelIsOpen) .rpgShopLauncher,
body:not(.friendsPanelIsOpen) .rpgInventoryLauncher,
body:not(.friendsPanelIsOpen) .rpgCheckinLauncher,
body:not(.friendsPanelIsOpen) .rpgSideToolBtn {
  visibility: visible;
  pointer-events: auto;
}
/* =====================================================
   DAILY MISSIONS RPG 2026 - FIX NÚT NỔI + PHẦN THƯỞNG
   ===================================================== */

/* Khi mở Nhiệm Vụ, đưa popup lên trên cùng */
body.dailyMissionPanelIsOpen #dailyMissionsRoot {
  z-index: 13000 !important;
}

/* Ẩn Shop / Túi Đồ / Điểm Danh đang nổi bên phải */
body.dailyMissionPanelIsOpen .rpgShopLauncher,
body.dailyMissionPanelIsOpen .rpgInventoryLauncher,
body.dailyMissionPanelIsOpen .rpgCheckinLauncher,
body.dailyMissionPanelIsOpen .rpgSideToolBtn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(34px) scale(0.84) !important;
}

/* Nếu các nút nằm trong root riêng thì cũng không cho bấm */
body.dailyMissionPanelIsOpen #rpgShopRoot,
body.dailyMissionPanelIsOpen #rpgInventoryRoot,
body.dailyMissionPanelIsOpen #rpgDailyCheckinRoot,
body.dailyMissionPanelIsOpen #rpgCheckinRoot {
  pointer-events: none !important;
}

/* Popup nhiệm vụ: hiện đại hơn, không bị nút bên phải chen vào */
body.dailyMissionPanelIsOpen .dailyMissionPanel.open {
  position: fixed !important;
  top: 250px !important;
  right: 28px !important;
  bottom: auto !important;

  width: min(720px, calc(100vw - 56px)) !important;
  max-height: calc(100dvh - 300px) !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;

  padding: 18px !important;
  border-radius: 28px !important;
  overflow: hidden !important;

  background:
    radial-gradient(
      circle at 16% 0%,
      rgba(255, 255, 255, 0.95),
      transparent 32%
    ),
    radial-gradient(
      circle at 86% 8%,
      rgba(250, 204, 21, 0.22),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      rgba(255, 253, 247, 0.98),
      rgba(255, 246, 231, 0.98)
    ) !important;

  border: 1px solid rgba(245, 158, 11, 0.28) !important;

  box-shadow:
    0 34px 90px rgba(92, 49, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Danh sách nhiệm vụ cuộn riêng trong panel, không đẩy tràn popup */
body.dailyMissionPanelIsOpen .dailyMissionList {
  min-height: 0 !important;
  overflow: auto !important;
  padding: 12px 4px 4px !important;
}

/* Làm lại cột bảng để phần thưởng đủ chỗ hiển thị */
body.dailyMissionPanelIsOpen .dailyMissionHeadRow,
body.dailyMissionPanelIsOpen .dailyMissionItem {
  grid-template-columns: minmax(0, 1.45fr) 110px 210px !important;
}

/* Card nhiệm vụ sáng hơn kiểu RPG */
body.dailyMissionPanelIsOpen .dailyMissionItem {
  border-radius: 22px !important;
  padding: 13px 14px !important;

  background:
    radial-gradient(circle at 0% 0%, rgba(96, 165, 250, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff, #fff6df) !important;

  border: 1px solid rgba(245, 158, 11, 0.18) !important;

  box-shadow:
    0 14px 26px rgba(120, 53, 15, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Cột phần thưởng mới */
.dailyMissionRewardCard {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.dailyMissionRewardPrizes {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.dailyMissionPrizeChip {
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  font-size: 12px;
  font-weight: 1000;
  line-height: 1;

  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dailyMissionPrizeChip.battle {
  color: #8a3d00;
  background: linear-gradient(135deg, #fff7ad, #fbbf24);
}

.dailyMissionPrizeChip.diamond {
  color: #075985;
  background: linear-gradient(135deg, #dff6ff, #60a5fa);
}

/* Nút nhận thưởng mới */
body.dailyMissionPanelIsOpen .dailyMissionRewardBtn {
  min-width: 104px !important;
  min-height: 36px !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;

  font-size: 13px !important;
  font-weight: 1000 !important;
}

body.dailyMissionPanelIsOpen .dailyMissionRewardBtn.ready {
  color: #ffffff !important;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.28),
      transparent 34%
    ),
    linear-gradient(135deg, #22c55e, #16a34a) !important;

  box-shadow:
    0 12px 24px rgba(34, 197, 94, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32) !important;
}

body.dailyMissionPanelIsOpen .dailyMissionRewardBtn.claimed {
  color: #ffffff !important;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8) !important;
}

/* Scroll bên trong danh sách đẹp hơn */
body.dailyMissionPanelIsOpen .dailyMissionList::-webkit-scrollbar {
  width: 8px;
}

body.dailyMissionPanelIsOpen .dailyMissionList::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
}

body.dailyMissionPanelIsOpen .dailyMissionList::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 999px;
}

@media (max-width: 780px) {
  body.dailyMissionPanelIsOpen .dailyMissionPanel.open {
    top: 92px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
  }

  body.dailyMissionPanelIsOpen .dailyMissionHeadRow,
  body.dailyMissionPanelIsOpen .dailyMissionItem {
    grid-template-columns: 1fr !important;
  }

  body.dailyMissionPanelIsOpen .dailyMissionHeadRow {
    display: none !important;
  }
}
/* =====================================================
   FIX: MỞ NHIỆM VỤ THÌ NÚT NHIỆM VỤ VẪN HIỆN
   ===================================================== */

body.dailyMissionPanelIsOpen .dailyMissionLauncher {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
  z-index: 13020 !important;
}

/* Chỉ ẩn Shop / Túi Đồ / Điểm Danh, không ẩn Nhiệm Vụ */
body.dailyMissionPanelIsOpen .rpgShopLauncher,
body.dailyMissionPanelIsOpen .rpgInventoryLauncher,
body.dailyMissionPanelIsOpen .rpgCheckinLauncher,
body.dailyMissionPanelIsOpen .rpgSideToolBtn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(34px) scale(0.84) !important;
}

/* Nếu nút Nhiệm Vụ bị dính chung class rpgSideToolBtn thì ép hiện lại */
body.dailyMissionPanelIsOpen .dailyMissionLauncher.rpgSideToolBtn {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none !important;
}
/* =====================================================
   FIX POPUP KHIÊU CHIẾN:
   - Không còn thanh cuộn trong popup
   - Đưa "Vào phòng bằng mã" lên trên
   - Ẩn Shop / Túi Đồ / Điểm Danh / Bang Hội / Nhiệm Vụ
   ===================================================== */

body.challengeModeChooserOpen {
  overflow: hidden !important;
}

body.challengeModeChooserOpen .challengeWindowOverlay {
  z-index: 16000 !important;
  padding: 14px !important;
  align-items: center !important;
  justify-content: center !important;
}

body.challengeModeChooserOpen .challengeModeCompactCard {
  width: min(1380px, calc(100vw - 36px)) !important;
  height: calc(100dvh - 28px) !important;
  max-height: calc(100dvh - 28px) !important;

  overflow: hidden !important;

  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;

  border-radius: 30px !important;
}

/* Phần đầu popup: tiêu đề bên trái, mã phòng bên phải */
body.challengeModeChooserOpen .challengeModeCompactHeader {
  padding: 24px 28px 16px !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 460px) 54px !important;
  align-items: start !important;
  gap: 18px !important;
}

body.challengeModeChooserOpen .challengeModeHeaderLeft {
  min-width: 0 !important;
}

body.challengeModeChooserOpen .challengeWindowTitle {
  font-size: 38px !important;
  line-height: 1 !important;
}

body.challengeModeChooserOpen .challengeWindowSub {
  margin-top: 8px !important;
  max-width: 700px !important;
}

/* Khối Vào phòng bằng mã ở góc trên phải */
body.challengeModeChooserOpen .challengeModeHeaderJoin {
  width: 100% !important;
  min-width: 0 !important;
}

body.challengeModeChooserOpen .challengeJoinRoomBoxTop {
  margin-top: 0 !important;
  width: 100% !important;

  padding: 14px !important;
  border-radius: 20px !important;

  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;

  background:
    radial-gradient(
      circle at 0% 0%,
      rgba(255, 255, 255, 0.95),
      transparent 45%
    ),
    linear-gradient(135deg, #fff7df, #ffffff) !important;

  border: 1px solid rgba(255, 160, 35, 0.32) !important;
  box-shadow: 0 14px 28px rgba(255, 153, 0, 0.1) !important;
}

body.challengeModeChooserOpen .challengeJoinRoomTitle {
  font-size: 16px !important;
}

body.challengeModeChooserOpen .challengeJoinRoomSub {
  font-size: 12px !important;
}

body.challengeModeChooserOpen .challengeJoinRoomControls {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 104px !important;
  gap: 8px !important;
}

body.challengeModeChooserOpen .challengeJoinRoomInput {
  width: 100% !important;
  height: 42px !important;
  border-radius: 14px !important;
}

body.challengeModeChooserOpen .challengeJoinRoomBtn {
  height: 42px !important;
  border-radius: 14px !important;
  padding: 0 12px !important;
}

/* Phần 2 cột PvP / PvE */
body.challengeModeChooserOpen .challengeModeColumnsCompact {
  min-height: 0 !important;
  height: 100% !important;

  padding: 22px 28px 24px !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 22px !important;

  overflow: hidden !important;
}

body.challengeModeChooserOpen .challengeModeColumn {
  min-height: 0 !important;
  height: 100% !important;

  padding: 20px !important;
  border-radius: 26px !important;

  overflow: hidden !important;
}

body.challengeModeChooserOpen .challengeModeColumnTop {
  margin-bottom: 12px !important;
}

body.challengeModeChooserOpen .challengeModeColumnTitle {
  font-size: 25px !important;
}

body.challengeModeChooserOpen .challengeModeColumnSub {
  font-size: 13px !important;
}

body.challengeModeChooserOpen .challengeModeColumnList {
  gap: 10px !important;
}

body.challengeModeChooserOpen .challengeModeItem {
  min-height: 0 !important;
  padding: 15px 126px 15px 16px !important;
  border-radius: 20px !important;
}

body.challengeModeChooserOpen .challengeModeItemTitle {
  font-size: 18px !important;
  margin-bottom: 5px !important;
}

body.challengeModeChooserOpen .challengeModeItemDesc {
  font-size: 13px !important;
  line-height: 1.38 !important;
}

/* Xóa thanh cuộn xấu trong popup Khiêu Chiến */
body.challengeModeChooserOpen .challengeWindowCard,
body.challengeModeChooserOpen .challengeModeColumns,
body.challengeModeChooserOpen .challengeModeColumn,
body.challengeModeChooserOpen .challengeModeColumnList {
  overflow: hidden !important;
  scrollbar-width: none !important;
}

body.challengeModeChooserOpen .challengeWindowCard::-webkit-scrollbar,
body.challengeModeChooserOpen .challengeModeColumns::-webkit-scrollbar,
body.challengeModeChooserOpen .challengeModeColumn::-webkit-scrollbar,
body.challengeModeChooserOpen .challengeModeColumnList::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Ẩn các nút nổi bên ngoài khi mở popup Khiêu Chiến */
body.challengeModeChooserOpen .rpgShopLauncher,
body.challengeModeChooserOpen .rpgInventoryLauncher,
body.challengeModeChooserOpen .rpgCheckinLauncher,
body.challengeModeChooserOpen .dailyMissionLauncher,
body.challengeModeChooserOpen .guildLauncher,
body.challengeModeChooserOpen .guildPanelLauncher,
body.challengeModeChooserOpen .guildFloatingLauncher,
body.challengeModeChooserOpen .missionLauncher,
body.challengeModeChooserOpen .missionFloatingLauncher,
body.challengeModeChooserOpen .rpgSideToolBtn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(38px) scale(0.86) !important;
}

/* Màn hình thấp thì ép gọn thêm */
@media (max-height: 820px) {
  body.challengeModeChooserOpen .challengeWindowOverlay {
    padding: 8px !important;
  }

  body.challengeModeChooserOpen .challengeModeCompactCard {
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }

  body.challengeModeChooserOpen .challengeModeCompactHeader {
    padding: 18px 24px 12px !important;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px) 50px !important;
  }

  body.challengeModeChooserOpen .challengeWindowTitle {
    font-size: 32px !important;
  }

  body.challengeModeChooserOpen .challengeWindowSub {
    font-size: 13px !important;
  }

  body.challengeModeChooserOpen .challengeJoinRoomBoxTop {
    padding: 12px !important;
  }

  body.challengeModeChooserOpen .challengeJoinRoomSub {
    display: none !important;
  }

  body.challengeModeChooserOpen .challengeModeColumnsCompact {
    padding: 16px 24px 18px !important;
  }

  body.challengeModeChooserOpen .challengeModeColumn {
    padding: 16px !important;
  }

  body.challengeModeChooserOpen .challengeModeItem {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  body.challengeModeChooserOpen .challengeModeItemDesc {
    line-height: 1.3 !important;
  }
}

/* Màn hình hẹp thì vẫn dùng 1 cột, nhưng không bị vỡ */
@media (max-width: 980px) {
  body.challengeModeChooserOpen .challengeModeCompactHeader {
    grid-template-columns: 1fr 50px !important;
  }

  body.challengeModeChooserOpen .challengeModeHeaderJoin {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  body.challengeModeChooserOpen .challengeModeColumnsCompact {
    grid-template-columns: 1fr !important;
  }
}
/* =====================================================
   FIX KHIÊU CHIẾN: PvP / PvE KHÔNG CÒN CAO RỖNG
   - Hai khung PvP / PvE chỉ cao vừa đủ nội dung
   - Phần dưới popup có thanh trang trí game cho đỡ trống
   - Không làm xuất hiện thanh cuộn
   ===================================================== */

body.challengeModeChooserOpen .challengeModeCompactCard {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  align-content: start !important;
}

/* Khung chứa 2 cột PvP / PvE */
body.challengeModeChooserOpen .challengeModeColumnsCompact {
  height: auto !important;
  min-height: 0 !important;

  padding: 18px 28px 10px !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 22px !important;

  align-items: start !important;
  overflow: visible !important;
}

/* Từng khung PvP / PvE chỉ cao vừa đủ nội dung bên trong */
body.challengeModeChooserOpen .challengeModeColumn {
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;

  padding: 18px !important;
  border-radius: 26px !important;

  overflow: hidden !important;

  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(255, 255, 255, 0.95),
      transparent 42%
    ),
    linear-gradient(180deg, #ffffff, #f7faff) !important;

  border: 1px solid rgba(80, 120, 210, 0.12) !important;
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Tiêu đề PvP / PvE gọn hơn */
body.challengeModeChooserOpen .challengeModeColumnTop {
  margin-bottom: 12px !important;
}

body.challengeModeChooserOpen .challengeModeColumnTitle {
  font-size: 24px !important;
  line-height: 1.05 !important;
}

body.challengeModeChooserOpen .challengeModeColumnSub {
  font-size: 13px !important;
  line-height: 1.25 !important;
}

/* Danh sách chế độ trong mỗi cột */
body.challengeModeChooserOpen .challengeModeColumnList {
  display: grid !important;
  gap: 10px !important;
}

/* Từng ô Solo / Hỗn Loạn / Sinh Tử / Luyện tốc độ... */
body.challengeModeChooserOpen .challengeModeItem {
  min-height: 94px !important;
  padding: 14px 126px 14px 16px !important;
  border-radius: 20px !important;

  background:
    radial-gradient(
      circle at 8% 0%,
      rgba(255, 255, 255, 0.92),
      transparent 40%
    ),
    linear-gradient(135deg, #f8fbff, #ffffff) !important;

  border: 1px solid rgba(56, 103, 214, 0.08) !important;
}

body.challengeModeChooserOpen .challengeModeItemTitle {
  font-size: 18px !important;
  line-height: 1.12 !important;
  margin-bottom: 5px !important;
}

body.challengeModeChooserOpen .challengeModeItemDesc {
  font-size: 13px !important;
  line-height: 1.34 !important;
}

/* Phần trang trí dưới 2 khung, để popup không bị trống quê */
body.challengeModeChooserOpen .challengeModeCompactCard::after {
  content: "⚔️ Chọn chế độ • Vào phòng chờ • Chọn bản đồ • Mời bạn bè hoặc ghép trận tự động";
  grid-row: 3;

  margin: 4px 28px 24px !important;
  min-height: 76px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;

  border-radius: 24px !important;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 218, 112, 0.38),
      transparent 34%
    ),
    radial-gradient(
      circle at 82% 28%,
      rgba(79, 172, 254, 0.22),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 248, 222, 0.95),
      rgba(245, 250, 255, 0.95)
    ) !important;

  border: 1px solid rgba(255, 176, 0, 0.22) !important;
  box-shadow:
    0 14px 32px rgba(255, 160, 35, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;

  color: #34415f !important;
  font-size: 15px !important;
  font-weight: 1000 !important;
  letter-spacing: 0.2px !important;
}

/* Màn hình thấp thì thu nhỏ thêm để chắc chắn không có thanh cuộn */
@media (max-height: 820px) {
  body.challengeModeChooserOpen .challengeModeColumnsCompact {
    padding: 14px 24px 8px !important;
    gap: 18px !important;
  }

  body.challengeModeChooserOpen .challengeModeColumn {
    padding: 15px !important;
  }

  body.challengeModeChooserOpen .challengeModeItem {
    min-height: 84px !important;
    padding-top: 11px !important;
    padding-bottom: 11px !important;
  }

  body.challengeModeChooserOpen .challengeModeItemTitle {
    font-size: 17px !important;
  }

  body.challengeModeChooserOpen .challengeModeItemDesc {
    font-size: 12.5px !important;
    line-height: 1.28 !important;
  }

  body.challengeModeChooserOpen .challengeModeCompactCard::after {
    min-height: 52px !important;
    margin: 2px 24px 16px !important;
    font-size: 13px !important;
  }
}

/* Màn hình hẹp thì 2 khung xếp thành 1 cột */
@media (max-width: 980px) {
  body.challengeModeChooserOpen .challengeModeColumnsCompact {
    grid-template-columns: 1fr !important;
  }

  body.challengeModeChooserOpen .challengeModeCompactCard::after {
    display: none !important;
  }
}
/* =====================================================
   KHIÊU CHIẾN EVENT GATE
   Biến ô đỏ dưới PvP/PvE thành nút vào sự kiện
   ===================================================== */

/* Sắp lại popup: header / 2 cột / nút event */
body.challengeModeChooserOpen .challengeModeCompactCard {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  align-content: start !important;
}

/* 2 khung PvP/PvE chỉ cao vừa đủ, không kéo dài trống */
body.challengeModeChooserOpen .challengeModeColumnsCompact {
  height: auto !important;
  min-height: 0 !important;
  padding: 18px 28px 10px !important;
  align-items: start !important;
  overflow: visible !important;
}

body.challengeModeChooserOpen .challengeModeColumn {
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;
}

/* Vùng chứa nút Event */
body.challengeModeChooserOpen .challengeEventSlot {
  padding: 0 28px 24px !important;
}

/* Nút Event lớn nằm đúng vị trí ô đỏ */
.challengeEventGateBtn {
  width: 100%;
  min-height: 132px;

  border: 1px solid rgba(255, 176, 0, 0.28);
  border-radius: 26px;

  padding: 22px 26px;

  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;

  cursor: pointer;

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 215, 105, 0.48),
      transparent 34%
    ),
    radial-gradient(
      circle at 82% 30%,
      rgba(59, 130, 246, 0.22),
      transparent 34%
    ),
    linear-gradient(135deg, #fff8dc, #f7fbff);

  box-shadow:
    0 16px 38px rgba(255, 160, 35, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}

.challengeEventGateBtn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 48px rgba(255, 148, 23, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.challengeEventGateBtn.locked {
  filter: saturate(0.86);
}

.challengeEventGateIcon {
  width: 76px;
  height: 76px;

  display: grid;
  place-items: center;

  border-radius: 24px;
  font-size: 38px;

  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.9),
      transparent 38%
    ),
    linear-gradient(135deg, #ffb020, #ff7a18);

  box-shadow:
    0 12px 26px rgba(255, 138, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.challengeEventGateEyebrow {
  margin-bottom: 5px;

  color: #f97316;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.challengeEventGateTitle {
  color: #101c3d;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1.05;
}

.challengeEventGateDesc {
  margin-top: 7px;

  color: #64748b;
  font-size: 15px;
  font-weight: 800;
}

.challengeEventGateRight {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.challengeEventGateStatus {
  padding: 9px 14px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 1000;
}

.challengeEventGateStatus.open {
  color: #ffffff;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.24);
}

.challengeEventGateStatus.locked {
  color: #9a3412;
  background: linear-gradient(135deg, #fff7ad, #fed7aa);
  border: 1px solid rgba(251, 146, 60, 0.28);
}

.challengeEventGateArrow {
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 1000;
}

/* =====================================================
   POPUP EVENT RIÊNG
   ===================================================== */

body.challengeEventPanelIsOpen {
  overflow: hidden !important;
}

#challengeEventRoot {
  position: relative;
  z-index: 18000;
}

.challengeEventOverlay {
  position: fixed;
  inset: 0;
  z-index: 18000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
}

.challengeEventPanel {
  position: relative;

  width: min(920px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;

  padding: 28px;

  border-radius: 32px;
  border: 1px solid rgba(255, 176, 0, 0.28);

  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 214, 102, 0.35),
      transparent 34%
    ),
    radial-gradient(
      circle at 90% 12%,
      rgba(59, 130, 246, 0.18),
      transparent 34%
    ),
    linear-gradient(180deg, #fffdf6, #fff6e6);

  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.32);
}

.challengeEventCloseBtn {
  position: absolute;
  top: 18px;
  right: 18px;

  width: 48px;
  height: 48px;

  border: none;
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;

  font-size: 30px;
  font-weight: 1000;
  cursor: pointer;
}

.challengeEventHero {
  min-height: 180px;

  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;

  padding: 26px;
  border-radius: 28px;

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.85),
      transparent 34%
    ),
    linear-gradient(135deg, #101c3d, #273c75);

  color: #ffffff;
}

.challengeEventHeroIcon {
  width: 100px;
  height: 100px;

  display: grid;
  place-items: center;

  border-radius: 30px;

  font-size: 54px;

  background: linear-gradient(135deg, #ffb020, #ff7a18);
  box-shadow: 0 18px 34px rgba(255, 138, 0, 0.34);
}

.challengeEventHeroEyebrow {
  color: #facc15;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 1.8px;
}

.challengeEventHero h2 {
  margin: 6px 0 8px;
  font-size: 38px;
  line-height: 1;
}

.challengeEventHero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.challengeEventHeroStatus {
  padding: 10px 14px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
}

.challengeEventHeroStatus.open {
  background: #22c55e;
}

.challengeEventHeroStatus.locked {
  color: #78350f;
  background: #fde68a;
}

.challengeEventContent {
  margin-top: 18px;

  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.challengeEventCard,
.challengeEventComingSoon {
  border-radius: 24px;
  padding: 22px;

  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 176, 0, 0.22);

  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.challengeEventCardLabel {
  margin-bottom: 8px;

  color: #f97316;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.challengeEventCard h3,
.challengeEventComingSoon h3 {
  margin: 0 0 8px;

  color: #101c3d;
  font-size: 24px;
}

.challengeEventCard p,
.challengeEventComingSoon p {
  margin: 0;

  color: #64748b;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.challengeEventComingSoon {
  margin-top: 18px;
  text-align: center;
}

.challengeEventComingIcon {
  margin: 0 auto 12px;

  width: 76px;
  height: 76px;

  display: grid;
  place-items: center;

  border-radius: 24px;
  font-size: 38px;

  background: linear-gradient(135deg, #e2e8f0, #ffffff);
}

.challengeEventTimeBox {
  margin-top: 18px;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.challengeEventTimeBox div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 247, 237, 0.9);
  border: 1px solid rgba(251, 146, 60, 0.18);
}

.challengeEventTimeBox span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.challengeEventTimeBox b {
  display: block;
  margin-top: 4px;
  color: #101c3d;
  font-size: 13px;
}

.challengeEventActions {
  margin-top: 18px;

  display: flex;
  justify-content: center;
}

.challengeEventPrimaryBtn {
  min-width: 220px;
  height: 54px;

  border: none;
  border-radius: 18px;

  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;

  font-size: 17px;
  font-weight: 1000;

  cursor: pointer;
  box-shadow: 0 18px 34px rgba(34, 197, 94, 0.28);
}

/* Màn hình thấp */
@media (max-height: 820px) {
  .challengeEventGateBtn {
    min-height: 104px;
    padding: 16px 22px;
  }

  .challengeEventGateIcon {
    width: 62px;
    height: 62px;
    font-size: 32px;
    border-radius: 20px;
  }

  .challengeEventGateTitle {
    font-size: 23px;
  }

  .challengeEventGateDesc {
    font-size: 13px;
  }

  .challengeEventPanel {
    padding: 22px;
  }

  .challengeEventHero {
    min-height: 145px;
    padding: 20px;
  }

  .challengeEventHero h2 {
    font-size: 30px;
  }
}
/* =====================================================
   FIX LẠI POPUP CHỌN KIỂU CHƠI KHIÊU CHIẾN
   - Bỏ hẳn thanh hướng dẫn cũ
   - Không để PvP/PvE bị kéo cao rỗng
   - Event nằm gọn, đẹp, đúng vị trí bên dưới
   ===================================================== */

/* Popup không bị kéo cao vô lý nữa */
body.challengeModeChooserOpen .challengeModeCompactCard {
  height: auto !important;
  max-height: calc(100dvh - 28px) !important;
  overflow: hidden !important;

  display: grid !important;
  grid-template-rows: auto auto auto !important;
  align-content: start !important;

  border-radius: 30px !important;
}

/* 2 khung PvP/PvE chỉ cao theo nội dung thật, không chiếm hết khoảng trống */
body.challengeModeChooserOpen .challengeModeColumnsCompact {
  height: auto !important;
  min-height: 0 !important;

  padding: 18px 28px 8px !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 22px !important;

  align-items: start !important;
  overflow: visible !important;
}

/* Khung PvP/PvE không tự kéo dài xuống dưới */
body.challengeModeChooserOpen .challengeModeColumn {
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;

  padding: 18px !important;
  border-radius: 26px !important;

  overflow: visible !important;
}

/* Danh sách chế độ gọn lại, không để khoảng trắng thừa */
body.challengeModeChooserOpen .challengeModeColumnList {
  display: grid !important;
  gap: 10px !important;
}

body.challengeModeChooserOpen .challengeModeItem {
  min-height: 88px !important;
  padding: 14px 122px 14px 16px !important;
  border-radius: 20px !important;
}

body.challengeModeChooserOpen .challengeModeItemTitle {
  font-size: 18px !important;
  margin-bottom: 5px !important;
}

body.challengeModeChooserOpen .challengeModeItemDesc {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* Bỏ hẳn thanh hướng dẫn cũ kiểu:
   "Chọn chế độ • Vào phòng chờ • Chọn bản đồ..."
   Dòng này xử lý cả trường hợp thanh đó là thẻ thật hoặc được tạo bằng CSS cũ.
*/
body.challengeModeChooserOpen .challengeModeGuide,
body.challengeModeChooserOpen .challengeModeHint,
body.challengeModeChooserOpen .challengeModeHelp,
body.challengeModeChooserOpen .challengeModeFooter,
body.challengeModeChooserOpen .challengeModeBottomGuide,
body.challengeModeChooserOpen .challengeModeInstruction,
body.challengeModeChooserOpen .challengeModeQuickGuide,
body.challengeModeChooserOpen .challengeModeEntryFooter {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

body.challengeModeChooserOpen .challengeModeCompactCard::after,
body.challengeModeChooserOpen .challengeModeColumnsCompact::after,
body.challengeModeChooserOpen .challengeModeColumn::after {
  content: none !important;
  display: none !important;
}

/* Vùng Event mới nằm ngay dưới PvP/PvE, có khoảng thở vừa phải */
body.challengeModeChooserOpen .challengeEventSlot {
  padding: 8px 28px 24px !important;
  margin: 0 !important;
}

/* Nút Event thiết kế lại: không quá cao, không để khoảng trống to */
body.challengeModeChooserOpen .challengeEventGateBtn {
  width: 100% !important;
  min-height: 112px !important;

  padding: 18px 24px !important;
  border-radius: 26px !important;

  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 18px !important;

  border: 1px solid rgba(255, 176, 0, 0.32) !important;

  background:
    radial-gradient(
      circle at 16% 30%,
      rgba(255, 225, 122, 0.55),
      transparent 32%
    ),
    radial-gradient(
      circle at 88% 22%,
      rgba(56, 189, 248, 0.22),
      transparent 35%
    ),
    linear-gradient(135deg, #fff8dc, #f3f9ff) !important;

  box-shadow:
    0 18px 36px rgba(255, 160, 35, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Icon Event */
body.challengeModeChooserOpen .challengeEventGateIcon {
  width: 66px !important;
  height: 66px !important;

  display: grid !important;
  place-items: center !important;

  border-radius: 22px !important;
  font-size: 34px !important;

  background: linear-gradient(135deg, #ffb020, #ff7a18) !important;
  box-shadow: 0 14px 28px rgba(255, 138, 0, 0.28) !important;
}

/* Chữ Event */
body.challengeModeChooserOpen .challengeEventGateEyebrow {
  margin-bottom: 4px !important;
  color: #f97316 !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
  letter-spacing: 1.6px !important;
}

body.challengeModeChooserOpen .challengeEventGateTitle {
  color: #101c3d !important;
  font-size: 25px !important;
  font-weight: 1000 !important;
  line-height: 1.05 !important;
}

body.challengeModeChooserOpen .challengeEventGateDesc {
  margin-top: 5px !important;
  color: #64748b !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

/* Phần trạng thái Coming Soon / Đang mở */
body.challengeModeChooserOpen .challengeEventGateRight {
  display: grid !important;
  justify-items: end !important;
  gap: 8px !important;
}

body.challengeModeChooserOpen .challengeEventGateStatus {
  padding: 8px 14px !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 1000 !important;
}

body.challengeModeChooserOpen .challengeEventGateArrow {
  color: #1d4ed8 !important;
  font-size: 14px !important;
  font-weight: 1000 !important;
}

/* Màn hình thấp: ép gọn thêm để không sinh thanh cuộn */
@media (max-height: 820px) {
  body.challengeModeChooserOpen .challengeModeCompactHeader {
    padding: 16px 24px 10px !important;
  }

  body.challengeModeChooserOpen .challengeWindowTitle {
    font-size: 32px !important;
  }

  body.challengeModeChooserOpen .challengeModeColumnsCompact {
    padding: 14px 24px 6px !important;
    gap: 18px !important;
  }

  body.challengeModeChooserOpen .challengeModeColumn {
    padding: 15px !important;
  }

  body.challengeModeChooserOpen .challengeModeItem {
    min-height: 76px !important;
    padding-top: 11px !important;
    padding-bottom: 11px !important;
  }

  body.challengeModeChooserOpen .challengeEventSlot {
    padding: 6px 24px 16px !important;
  }

  body.challengeModeChooserOpen .challengeEventGateBtn {
    min-height: 92px !important;
    padding: 14px 18px !important;
    grid-template-columns: 58px minmax(0, 1fr) auto !important;
  }

  body.challengeModeChooserOpen .challengeEventGateIcon {
    width: 54px !important;
    height: 54px !important;
    font-size: 28px !important;
    border-radius: 18px !important;
  }

  body.challengeModeChooserOpen .challengeEventGateTitle {
    font-size: 21px !important;
  }

  body.challengeModeChooserOpen .challengeEventGateDesc {
    font-size: 12px !important;
  }
}
/* =====================================================
   FIX CUỐI CÙNG - KHÓA VỊ TRÍ NÚT CASIO 580
   - Không nằm trong khung Gợi ý / Lời giải nữa
   - Không che nội dung khi cuộn chuột
   - Tự nằm đúng ô đỏ bạn khoanh
   ===================================================== */

#calculator580Root.casio580RootVisible {
  display: block !important;
}

#calculator580Root .casio580FloatingBtn {
  position: fixed !important;

  /*
    top lấy từ casio580-panel.js:
    - Chưa cuộn: khoảng 292px
    - Khi cuộn xuống: khóa ở 146px
  */
  top: var(--casio580-btn-top, 292px) !important;

  /*
    Đưa nút sang ô đỏ bên trái, không còn nằm bên phải
    để tránh che Gợi ý / Lời giải.
  */
  left: clamp(500px, calc(50vw - 385px), 560px) !important;
  right: auto !important;
  bottom: auto !important;

  width: 300px !important;
  height: 62px !important;
  min-height: 0 !important;

  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 18px !important;

  z-index: 260 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;

  cursor: pointer !important;
  user-select: none !important;

  color: #ffffff !important;
  font-weight: 1000 !important;

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.34),
      transparent 34%
    ),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 48%, #38bdf8 100%) !important;

  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;

  transform: none !important;
}

#calculator580Root .casio580FloatingBtn:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 22px 44px rgba(37, 99, 235, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

#calculator580Root .casio580BtnIcon {
  font-size: 22px !important;
  line-height: 1 !important;
}

#calculator580Root .casio580BtnText {
  font-size: 17px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Màn hình nhỏ hơn thì thu gọn để không đè nút Bản đồ */
@media (max-width: 1280px) {
  #calculator580Root .casio580FloatingBtn {
    left: 360px !important;
    width: 250px !important;
    height: 58px !important;
  }

  #calculator580Root .casio580BtnText {
    font-size: 15px !important;
  }
}

@media (max-width: 980px) {
  #calculator580Root .casio580FloatingBtn {
    left: 230px !important;
    width: 210px !important;
    height: 54px !important;
  }

  #calculator580Root .casio580BtnText {
    font-size: 13px !important;
  }
}
/* =====================================================
   CASIO 580 - 2 VỊ TRÍ THEO TRẠNG THÁI BÀI LÀM
   1) Bình thường: ở vị trí hiện tại, đi theo trang
   2) Khi mở Gợi ý / Lời giải: chuyển sang ô đỏ
   ===================================================== */

/* Gốc chứa nút Casio: không chiếm chỗ, không chặn bấm vào bài */
#calculator580Root.casio580RootVisible {
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 0 !important;
  pointer-events: none !important;
  z-index: 230 !important;
}

/* TRẠNG THÁI BÌNH THƯỜNG:
   Nút ở vị trí như hình bạn nói là ok.
   Quan trọng: dùng absolute, KHÔNG dùng fixed.
   Vì vậy khi cuộn xuống, nút sẽ đi theo trang và có thể bị khuất.
*/
#calculator580Root .casio580FloatingBtn {
  position: absolute !important;

  top: 147px !important;
  right: 185px !important;
  left: auto !important;
  bottom: auto !important;

  width: 282px !important;
  height: 70px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;

  pointer-events: auto !important;
  cursor: pointer !important;

  border: 0 !important;
  border-radius: 18px !important;

  color: #ffffff !important;
  font-weight: 1000 !important;

  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(255, 255, 255, 0.34),
      transparent 34%
    ),
    linear-gradient(135deg, #2563eb 0%, #1d4ed8 48%, #38bdf8 100%) !important;

  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;

  transform: none !important;
}

/* KHI BẬT GỢI Ý HOẶC LỜI GIẢI:
   Nút chuyển sang ô đỏ bạn khoanh trong ảnh.
   Vẫn là absolute, nên vẫn đi theo trang, không dính vào màn hình.
*/
body.playSidePanelOpen #calculator580Root .casio580FloatingBtn {
  top: 250px !important;
  left: calc(50vw - 360px) !important;
  right: auto !important;

  width: 304px !important;
  height: 66px !important;
}

/* Chữ và icon */
#calculator580Root .casio580BtnIcon {
  font-size: 22px !important;
  line-height: 1 !important;
}

#calculator580Root .casio580BtnText {
  font-size: 17px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Hiệu ứng rê chuột nhẹ */
#calculator580Root .casio580FloatingBtn:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 22px 44px rgba(37, 99, 235, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.42) !important;
}

/* Màn hình nhỏ hơn */
@media (max-width: 1280px) {
  #calculator580Root .casio580FloatingBtn {
    right: 160px !important;
    width: 240px !important;
    height: 60px !important;
  }

  body.playSidePanelOpen #calculator580Root .casio580FloatingBtn {
    left: 420px !important;
    top: 292px !important;
    width: 260px !important;
  }

  #calculator580Root .casio580BtnText {
    font-size: 15px !important;
  }
}

@media (max-width: 980px) {
  #calculator580Root .casio580FloatingBtn {
    right: 24px !important;
    top: 176px !important;
    width: 210px !important;
    height: 54px !important;
  }

  body.playSidePanelOpen #calculator580Root .casio580FloatingBtn {
    left: 260px !important;
    top: 292px !important;
    width: 210px !important;
    height: 54px !important;
  }

  #calculator580Root .casio580BtnText {
    font-size: 13px !important;
  }
}
/* =====================================================
   FIX CASIO 580 BỊ BẤM X RỒI THOÁT KHỎI BÀI LÀM
   Nguyên nhân: vùng Casio bị pointer-events none,
   làm cú bấm X có thể lọt xuống nút bên dưới.
   ===================================================== */

/* Root vẫn không chặn toàn trang */
#calculator580Root.casio580RootVisible {
  pointer-events: none !important;
}

/* Nhưng nút mở Casio và cửa sổ Casio phải nhận chuột bình thường */
#calculator580Root .casio580FloatingBtn,
#calculator580Root .casio580FloatingWindow,
#calculator580Root .casio580FloatingWindow * {
  pointer-events: auto !important;
}

/* Đảm bảo cửa sổ Casio nằm trên bài làm khi đang mở */
#calculator580Root .casio580FloatingWindow {
  z-index: 9990 !important;
}

/* Đảm bảo nút X / thu nhỏ / tải lại bấm được chắc chắn */
#calculator580Root .casio580IconBtn,
#calculator580Root .casio580MiniBtn {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 9992 !important;
}

/* Nút mở Casio vẫn bấm được */
#calculator580Root .casio580FloatingBtn {
  pointer-events: auto !important;
  z-index: 9980 !important;
}
/* =====================================================
   FIX ĐÁP ÁN A/B/C/D BỊ TRÀN KHI BẬT GỢI Ý / LỜI GIẢI
   - Bình thường: vẫn giữ 4 đáp án trên 1 hàng như cũ
   - Khi bật Gợi ý / Lời giải: chuyển thành 2 hàng, mỗi hàng 2 đáp án
   - Không để đáp án đè sang khung Lời giải bên phải
   ===================================================== */

/* Giữ khung đáp án luôn nằm gọn trong khung đề bài */
.answerArea,
.answers {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

/* TRẠNG THÁI BÌNH THƯỜNG:
   vẫn là 4 đáp án trên 1 hàng, giữ phong cách cũ */
.answers {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  overflow: visible !important;
}

/* Mỗi nút đáp án được phép co lại theo khung,
   không được tự đẩy rộng cả hàng đáp án */
.answers .ansBtn,
#msqAnswers .ansBtn {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-align: center !important;
  line-height: 1.35 !important;
}

/* Không cho phần A/B/C/D tự xuống dòng lung tung */
.ansChoiceInner {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;

  flex-wrap: nowrap !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* Chữ A. B. C. D. không bị ép méo */
.ansChoicePrefix {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* Phần công thức được nằm gọn trong nút */
.ansChoiceMath {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* MathJax không được làm nút đáp án phình ra ngoài */
.answers .ansBtn mjx-container,
#msqAnswers .ansBtn mjx-container {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  margin: 0 !important;
}

/* KHI BẬT GỢI Ý / LỜI GIẢI:
   Chỉ lúc này mới cho hàng đáp án đẩy xuống.
   Tức là 4 đáp án thành 2 cột x 2 hàng.
*/
.playLayout.withSide .answers,
body.playSidePanelOpen .answers {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px 12px !important;
}

/* Khi đang mở Gợi ý / Lời giải, nút đáp án thấp hơn một chút,
   nhìn vẫn gọn, không bị quá cao xấu */
.playLayout.withSide .answers .ansBtn,
body.playSidePanelOpen .answers .ansBtn,
.playLayout.withSide #msqAnswers .ansBtn,
body.playSidePanelOpen #msqAnswers .ansBtn {
  min-height: 56px !important;
  padding: 10px 12px !important;
}

/* Trường hợp công thức quá dài:
   vẫn không được đè sang khung phải.
   Người dùng có thể kéo nhẹ ngang bên trong công thức nếu quá dài.
*/
.playLayout.withSide .answers .ansBtn mjx-container,
body.playSidePanelOpen .answers .ansBtn mjx-container {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

/* Màn nhỏ thì luôn về 1 cột để không tràn */
@media (max-width: 760px) {
  .answers,
  .playLayout.withSide .answers,
  body.playSidePanelOpen .answers {
    grid-template-columns: 1fr !important;
  }
}
/* Khiêu Chiến đang tạm khóa */
.challengeToolbarCard.isLocked {
  opacity: 0.78;
  filter: grayscale(0.18);
}

.challengeToolbarCard.isLocked .challengeToolbarTag {
  opacity: 0.68;
}

.challengeToolbarMainBtn:disabled {
  cursor: not-allowed;
  background: linear-gradient(180deg, #aeb7c7, #8792a6);
  box-shadow: none;
  filter: none;
}

.challengeToolbarMainBtn:disabled:hover {
  transform: none;
}
/* ===== Trạng thái map mở / khóa từ js/map-status.js ===== */
.mapThumbWrap {
  position: relative;
}

.mapCard.isMapLocked {
  cursor: not-allowed;
  opacity: 0.66;
  filter: grayscale(0.42);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
}

.mapCard.isMapLocked:hover {
  transform: none;
}

.mapCard.isMapLocked .mapThumb {
  filter: brightness(0.72);
}

.mapLockOverlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.mapLockBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 1000;
  color: #475569;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(71, 85, 105, 0.18);
  white-space: nowrap;
} /* ===== Giao diện map đang khóa ===== */

.mapThumbWrap {
  position: relative;
}

.mapCard.isMapLocked {
  cursor: not-allowed;
  opacity: 0.62;
  filter: grayscale(0.55);
}

.mapCard.isMapLocked:hover {
  transform: none;
}

.mapCard.isMapLocked .mapThumb {
  filter: brightness(0.65);
}

.mapLockOverlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  font-size: 44px;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
}

.mapLockBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: #475569;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

/* =====================================================
   ĐỀ LUYỆN TRỰC TIẾP - CHỈ GHI NHẬN ĐÁP ÁN KHI ĐANG LÀM
   ===================================================== */

.answers .ansBtn.examSelected {
  color: #1d4ed8 !important;
  border-color: rgba(37, 99, 235, 0.72) !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(180deg, #eff6ff, #dbeafe) !important;
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.14),
    0 14px 28px rgba(37, 99, 235, 0.16) !important;
  transform: translateY(-1px);
}

.mainResultDetailBody.noStudyHelp {
  grid-template-columns: minmax(0, 1fr) !important;
}

/* ===== Cô lập màn Nội Dung Học khỏi các launcher nổi ===== */
body.studyContentMode .rpgInventoryLauncher,
body.studyContentMode .rpgShopLauncher,
body.studyContentMode .rpgCheckinLauncher {
  display: none !important;
}

@media (max-width: 620px) {
  body.studyContentMode .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  body.studyContentMode .brand {
    justify-content: center;
  }

  body.studyContentMode .topActions {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  body.studyContentMode .topActions > * {
    max-width: 100%;
  }

  body.studyContentMode #topStat {
    flex: 1 1 100%;
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}

/* =====================================================
   TOPBAR GỌN TRÊN DESKTOP - GIỮ TOÀN BỘ CÔNG CỤ TRÊN 1 HÀNG
   ===================================================== */
@media (min-width: 1024px) {
  .topbar {
    gap: 8px;
    padding: 9px 12px;
  }

  .topbar .brand {
    flex: 0 0 auto;
  }

  .topActions {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .topDiamondWallet {
    flex: 0 0 132px;
    width: 132px;
    min-width: 132px;
    height: 48px;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 17px;
  }

  .topDiamondWalletIcon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 20px;
  }

  .topDiamondWalletLabel {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .topDiamondWalletText b {
    margin-top: 2px;
    font-size: 16px;
  }

  #topServerProgress {
    order: 0;
    flex: 0 0 auto;
    width: auto;
  }

  .progressWidget.isTop {
    width: 126px;
    min-width: 126px;
    gap: 4px;
    padding: 7px 9px;
    border-radius: 15px;
  }

  .progressWidget.isTop .progressLabel {
    font-size: 10px;
  }

  .progressWidget.isTop .progressTrack {
    height: 8px;
  }

  .progressWidget.isTop .progressPercent {
    font-size: 11px;
  }

  .stat.cultivationStat {
    flex: 1 1 230px;
    min-width: 190px;
    max-width: 350px;
    overflow: hidden;
    padding: 8px 9px;
    font-size: 11px;
    text-overflow: ellipsis;
  }

  .topActions .pillBtn,
  .topActions .pillNavBtn {
    flex: 0 0 auto;
    padding: 8px 9px;
    font-size: 11px;
  }

  .topActions .pillStudyContentBtn {
    gap: 5px;
  }

  .topActions .friendsMiniBtn {
    width: 36px;
    min-width: 36px;
    padding-inline: 0;
  }
}

@media (min-width: 1024px) and (max-width: 1179px) {
  .topbar {
    gap: 6px;
    padding-inline: 10px;
  }

  .topActions {
    gap: 4px;
  }

  .topDiamondWallet {
    flex-basis: 92px;
    width: 92px;
    min-width: 92px;
    height: 44px;
    gap: 6px;
    padding-inline: 7px;
  }

  .topDiamondWalletIcon {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .topDiamondWalletLabel {
    display: none;
  }

  .topDiamondWalletText b {
    margin-top: 0;
    font-size: 15px;
  }

  .progressWidget.isTop {
    width: 108px;
    min-width: 108px;
    padding-inline: 7px;
  }

  .stat.cultivationStat {
    flex-basis: 150px;
    min-width: 120px;
    max-width: 190px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .topActions .pillBtn,
  .topActions .pillNavBtn {
    padding: 7px 7px;
    font-size: 10px;
  }

  .topActions .pillStudyContentBtn {
    gap: 3px;
  }

  .topActions .friendsMiniBtn {
    width: 32px;
    min-width: 32px;
  }
}

/* =====================================================
   ANSWER CARDS - LARGE, WRAPPABLE, AND FLOW-SAFE
   - Hai cột rộng trên desktop để chứa đáp án dài
   - Tự tăng chiều cao, không sinh thanh cuộn trong đáp án
   - Thanh điều hướng luôn nằm trong luồng bên dưới
   ===================================================== */
.answerArea {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.answers,
#msqAnswers {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 14px 16px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.answers .ansBtn,
#msqAnswers .ansBtn {
  position: relative !important;
  display: block !important;
  align-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 58px !important;
  height: auto !important;
  padding: 12px 16px !important;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  text-align: left !important;
  line-height: 1.55 !important;
  font-size: 16px !important;
}

.answers .ansBtn .ansChoiceInner,
#msqAnswers .ansBtn .ansChoiceInner {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  white-space: normal !important;
  text-align: left !important;
}

.answers .ansChoicePrefix,
#msqAnswers .ansChoicePrefix {
  flex: 0 0 auto !important;
  align-self: center !important;
}

.answers .ansChoiceMath,
#msqAnswers .ansChoiceMath {
  flex: 1 1 220px !important;
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  white-space: normal !important;
  text-align: left !important;
}

.answers .ansBtn mjx-container,
#msqAnswers .ansBtn mjx-container {
  display: inline-block !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0.12em !important;
  overflow: visible !important;
  vertical-align: middle !important;
}

.answers .ansBtn mjx-container svg,
#msqAnswers .ansBtn mjx-container svg {
  max-width: 100% !important;
  height: auto !important;
}

/* Ghi de dung do uu tien cao cua che do mo Goi y/Loi giai. */
.playLayout.withSide .answers .ansBtn mjx-container,
body.playSidePanelOpen .answers .ansBtn mjx-container,
.playLayout.withSide #msqAnswers .ansBtn mjx-container,
body.playSidePanelOpen #msqAnswers .ansBtn mjx-container {
  display: inline-block !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0.12em !important;
  overflow: visible !important;
  vertical-align: middle !important;
}

.playLayout.withSide .answers .ansBtn mjx-container svg,
body.playSidePanelOpen .answers .ansBtn mjx-container svg,
.playLayout.withSide #msqAnswers .ansBtn mjx-container svg,
body.playSidePanelOpen #msqAnswers .ansBtn mjx-container svg {
  max-width: 100% !important;
  height: auto !important;
}

.playLayout.withSide .answers,
body.playSidePanelOpen .answers,
.playLayout.withSide #msqAnswers,
body.playSidePanelOpen #msqAnswers {
  grid-template-columns: 1fr !important;
}

.playLayout.withSide .answers .ansBtn,
body.playSidePanelOpen .answers .ansBtn,
.playLayout.withSide #msqAnswers .ansBtn,
body.playSidePanelOpen #msqAnswers .ansBtn {
  min-height: 58px !important;
  padding: 12px 16px !important;
}

.playBottomNav {
  position: relative !important;
  clear: both !important;
  z-index: 1 !important;
  width: 100% !important;
  margin-top: 18px !important;
}

@media (max-width: 900px) {
  .answers,
  #msqAnswers,
  .playLayout.withSide .answers,
  body.playSidePanelOpen .answers,
  .playLayout.withSide #msqAnswers,
  body.playSidePanelOpen #msqAnswers {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .answers .ansBtn,
  #msqAnswers .ansBtn {
    min-height: 58px !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
  }
}

/* =====================================================
   CROPPED MATH ILLUSTRATIONS
   Keep source graphs/tables compact instead of stretching them to the
   full exercise card. The renderer selects a size from the source ratio.
   ===================================================== */
.qImgWrap.qImgWrap--compactIllustration {
  --compact-illustration-width: 380px;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: var(--compact-illustration-width) !important;
  height: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: hidden !important;
}

.qImgWrap.qImgWrap--compactWide {
  --compact-illustration-width: 560px;
}

.qImgWrap.qImgWrap--compactPortrait {
  --compact-illustration-width: 300px;
}

.qImgWrap.qImgWrap--compactIllustration img,
#hintCard .sideBody .qImgWrap--compactIllustration img,
#solCard .sideBody .qImgWrap--compactIllustration img,
.theoryPaneBody .qImgWrap--compactIllustration img,
.mainResultQuestionContent .qImgWrap--compactIllustration img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  transform: none !important;
}

@media (max-width: 640px) {
  .qImgWrap.qImgWrap--compactIllustration {
    --compact-illustration-width: 360px;
  }

  .qImgWrap.qImgWrap--compactPortrait {
    --compact-illustration-width: 280px;
  }
}

/* TSA Math exams: compact, proportional figures across every exam map. */
.qImgWrap.qImgWrap--tsaMathExam {
  max-width: min(100%, var(--tsa-illustration-width, 520px)) !important;
  margin-top: 14px !important;
  margin-bottom: 18px !important;
}

.qImgWrap.qImgWrap--tsaMathExam img {
  max-height: 400px !important;
  object-fit: contain !important;
}

/* HSA Định Tính: phần chữ lời giải đồng bộ với phòng Tư Duy Đọc Hiểu. */
.qualitativeExamLayout #solutionContent,
.qualitativeExamLayout #solutionContent .contentTextBlock,
.qualitativeExamLayout #solutionContent p,
.qualitativeExamLayout #solutionContent li,
.qualitativeExamLayout #solutionContent span {
  color: #202124 !important;
  font-family: Arial, Roboto, "Helvetica Neue", sans-serif !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

.qualitativeExamLayout #solutionContent b,
.qualitativeExamLayout #solutionContent strong,
.qualitativeExamLayout #solutionContent em {
  font-weight: 400 !important;
}

.qualitativeExamLayout #solutionContent .contentLatex,
.qualitativeExamLayout #solutionContent mjx-container {
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

@media (max-width: 1366px) {
  .qualitativeExamLayout #solutionContent,
  .qualitativeExamLayout #solutionContent .contentTextBlock,
  .qualitativeExamLayout #solutionContent p,
  .qualitativeExamLayout #solutionContent li,
  .qualitativeExamLayout #solutionContent span,
  .qualitativeExamLayout #solutionContent .contentLatex,
  .qualitativeExamLayout #solutionContent mjx-container {
    font-size: 16px !important;
  }
}

@media (max-width: 980px) {
  .qualitativeExamLayout #solutionContent,
  .qualitativeExamLayout #solutionContent .contentTextBlock,
  .qualitativeExamLayout #solutionContent p,
  .qualitativeExamLayout #solutionContent li,
  .qualitativeExamLayout #solutionContent span,
  .qualitativeExamLayout #solutionContent .contentLatex,
  .qualitativeExamLayout #solutionContent mjx-container {
    font-size: 14px !important;
  }
}

@media (max-width: 720px) {
  .qualitativeExamLayout #solutionContent,
  .qualitativeExamLayout #solutionContent .contentTextBlock,
  .qualitativeExamLayout #solutionContent p,
  .qualitativeExamLayout #solutionContent li,
  .qualitativeExamLayout #solutionContent span,
  .qualitativeExamLayout #solutionContent .contentLatex,
  .qualitativeExamLayout #solutionContent mjx-container {
    font-size: 13px !important;
  }
}

/* Các đề lưu trữ không có khóa đáp án: ghi nhận bài làm, không giả lập chấm đúng/sai. */
body:has(.mainResultRpgScreen.ungraded) .mainResultRpgStatus.ungraded {
  color: #2563eb;
  letter-spacing: 0.035em;
  text-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
}

body:has(.mainResultRpgScreen) .mainResultTile.recorded {
  color: #1e3a8a !important;
  background:
    radial-gradient(circle at 30% 14%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(135deg, #dbeafe 0%, #bfdbfe 56%, #93c5fd 100%) !important;
  box-shadow:
    0 11px 20px rgba(37, 99, 235, 0.16),
    0 0 0 1px rgba(147, 197, 253, 0.72),
    inset 0 -10px 20px rgba(37, 99, 235, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

/* HSA601: đề bài là nội dung chính, không lặp nhãn nguồn và không đậm cả đoạn. */
.contentTextBlock.hsa601Stem {
  max-width: 94ch;
  color: #16243a !important;
  font-family: "Be Vietnam Pro", Inter, system-ui, sans-serif !important;
  font-size: clamp(17px, 1.15vw, 19px) !important;
  font-weight: 500 !important;
  line-height: 1.68 !important;
  letter-spacing: -0.012em;
  text-wrap: pretty;
  overflow-wrap: break-word;
  margin-bottom: 16px !important;
}

.hsa601Stem .hsa601PromptContext {
  display: block;
}

.hsa601Stem .hsa601PromptQuestion {
  display: block;
  margin-top: 0.45em;
  padding-left: 12px;
  border-left: 2px solid #58708d;
  color: #10253f;
  font-weight: 600;
}

.hsa601Stem .hsa601Key {
  color: #10253f;
  font-weight: 700;
}

.hsa601Stem .hsa601Key--final {
  color: #9b2433;
}

@media (max-width: 700px) {
  .contentTextBlock.hsa601Stem {
    max-width: 100%;
    font-size: 17px !important;
    line-height: 1.62 !important;
  }
}

/* Ôn lại câu sai sau khi hoàn thành Luyện Đề có lời giải. */
.wrongReviewOpen { overflow: hidden; }
.wrongReviewLaunch { background: #173b78 !important; color: #fff !important; }
.wrongReviewLaunch span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: #ffffff2b; }
.wrongReviewLayer { position: fixed; inset: 0; z-index: 9900; overflow-y: auto; background: #f5f7fb; color: #16243a; font-family: Inter, 'Be Vietnam Pro', system-ui, sans-serif; }
.wrongReviewHeader { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px max(24px, calc((100vw - 1120px) / 2)); background: #fff; border-bottom: 1px solid #e1e7f0; }
.wrongReviewEyebrow { color: #45689e; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.wrongReviewHeader h2 { margin: 4px 0; color: #11294b; font-size: clamp(23px, 3vw, 32px); line-height: 1.2; }
.wrongReviewHeader p { margin: 0; color: #65748b; font-size: 14px; }
.wrongReviewClose { flex: none; width: 42px; height: 42px; border: 1px solid #d9e2ee; border-radius: 13px; background: #fff; color: #253e62; font-size: 27px; line-height: 1; cursor: pointer; }
.wrongReviewMain { width: min(1120px, calc(100% - 48px)); margin: 28px auto 52px; }
.wrongReviewList { display: grid; gap: 12px; }
.wrongReviewViewComplete { margin-top: 18px; }
.wrongReviewRow { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto auto; align-items: center; gap: 20px; padding: 16px 18px; background: #fff; border: 1px solid #e1e7f0; border-radius: 17px; box-shadow: 0 6px 22px #18345d08; }
.wrongReviewNumber { color: #143968; font-weight: 800; white-space: nowrap; }
.wrongReviewPreview { min-width: 0; max-height: 4em; overflow: hidden; color: #253852; font-size: 15px; line-height: 1.45; }
.wrongReviewPreview .contentTextBlock { margin: 0 !important; color: inherit !important; font-size: 15px !important; font-weight: 500 !important; }
.wrongReviewState { color: #64748b; font-size: 13px; white-space: nowrap; }
.wrongReviewAction, .wrongReviewBack { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 42px; padding: 9px 17px; border-radius: 12px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 750; text-decoration: none; }
.wrongReviewAction { border: 1px solid #173b78; background: #173b78; color: #fff; }
.wrongReviewAction:hover { background: #235293; }
.wrongReviewBack { border: 1px solid #d5dfeb; background: #fff; color: #24476f; }
.wrongReviewBack:hover, .wrongReviewClose:hover { background: #f0f5fb; }
.wrongReviewGuide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.wrongReviewPanel, .wrongReviewCheck { min-width: 0; padding: 21px 24px; border: 1px solid #e1e7f0; border-radius: 17px; background: #fff; box-shadow: 0 6px 22px #18345d08; }
.wrongReviewPanel:first-child { grid-column: 1 / -1; }
.wrongReviewPanel h3, .wrongReviewCheck h3 { margin: 0 0 13px; color: #153966; font-size: 18px; line-height: 1.3; }
.wrongReviewPanel .contentTextBlock { font-weight: 500 !important; line-height: 1.6 !important; }
.wrongReviewPanel img { max-width: 100%; height: auto; }
.wrongReviewChecks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.wrongReviewCheck p { margin: 0 0 15px; color: #42536e; font-size: 15px; line-height: 1.5; }
.wrongReviewChoices { display: grid; gap: 9px; }
.wrongReviewChoices label { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid #dfe7f1; border-radius: 11px; color: #1b304f; cursor: pointer; line-height: 1.5; }
.wrongReviewChoices label:has(input:checked) { border-color: #3b70bb; background: #f0f6ff; }
.wrongReviewChoices input { margin-top: 5px; accent-color: #21539a; }
.wrongReviewInput { width: min(100%, 320px); padding: 11px 13px; border: 1px solid #becde0; border-radius: 10px; color: #172b4c; font: inherit; }
.wrongReviewCheck .wrongReviewFeedback { min-height: 22px; margin: 12px 0 0; color: #ab3547; font-size: 13px; }
.wrongReviewCheck .wrongReviewFeedback.isCorrect { color: #198257; }
.wrongReviewBottom, .wrongReviewFinishActions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 22px; }
.wrongReviewSuccess { color: #147452; font-size: 16px; font-weight: 750; }
.wrongReviewFinished { padding: 36px; border: 1px solid #e1e7f0; border-radius: 18px; background: #fff; text-align: center; }
.wrongReviewFinished p { margin: 0; color: #50647f; }
.wrongReviewFinished .wrongReviewFinishActions { justify-content: center; }
.wrongReviewLayer [hidden] { display: none !important; }
@media (max-width: 760px) {
  .wrongReviewHeader { padding: 18px 20px; }
  .wrongReviewMain { width: calc(100% - 24px); margin-top: 16px; }
  .wrongReviewRow { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; }
  .wrongReviewPreview { grid-column: 1 / -1; grid-row: 2; }
  .wrongReviewState { grid-column: 1; grid-row: 3; }
  .wrongReviewRow .wrongReviewAction { grid-column: 2; grid-row: 1; }
  .wrongReviewGuide, .wrongReviewChecks { grid-template-columns: 1fr; }
  .wrongReviewPanel:first-child { grid-column: 1; }
  .wrongReviewPanel, .wrongReviewCheck { padding: 17px; }
}

/* HSA Luyện Tập Số 1: regular prose, gentle navy emphasis for math only.
   Scope deliberately excludes solutions, answer summaries and other exams. */
.hsaPractice01Paper :is(#questionContent, #mainResultQuestionContent, [data-wrong-question], .wrongReviewPreview) {
  font-weight: 400 !important;
  color: #111827;
}
.hsaPractice01Paper :is(#questionContent, #mainResultQuestionContent, [data-wrong-question], .wrongReviewPreview) :is(.contentTextBlock, .contentLatex, p, strong, b) {
  font-weight: 400 !important;
}
.hsaPractice01Paper #answerArea .ansBtn,
.hsaPractice01Paper #answerArea :is(.ansChoiceInner, .ansChoicePrefix, .ansChoiceMath) {
  font-weight: 400 !important;
}
.hsaPractice01Paper :is(#questionContent, #mainResultQuestionContent, [data-wrong-question], .wrongReviewPreview, #answerArea) mjx-container {
  color: #173b68 !important;
  font-weight: 500 !important;
}
/* MathJax SVG paths do not respond to font-weight. Eight font units add only
   a fine contour to glyphs; fraction bars and diagram strokes are unaffected. */
.hsaPractice01Paper :is(#questionContent, #mainResultQuestionContent, [data-wrong-question], .wrongReviewPreview, #answerArea) mjx-container[jax="SVG"] :is([data-mml-node="mi"], [data-mml-node="mn"], [data-mml-node="mo"]) > use {
  stroke: currentColor;
  stroke-width: 8;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
