.sidebar,
.content {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(3px);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.ip-badge,
.metric-card,
.score-board,
.rank-list,
.challenge {
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  border-radius: 10px;
}

.ip-badge {
  background: #ffffff;
}

.content .metric-card,
.content .score-board,
.content .rank-list,
.content .challenge,
.content .alert-form,
.content .podium-block {
  background: rgba(3, 40, 66, 0.80);
}

.app-panel {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  min-height: calc(100vh - 30px);
}

.sidebar {
  --menu-gap: 10px;
  align-self: start;
  display: flex;
  flex-direction: column;
  /* Espaço final reduzido para aproximar as ações da base da barra. */
  padding: 10px 18px 6px;
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 30px);
  overflow: hidden;
  transition: width .22s ease, padding .22s ease;
  z-index: 10;
}

body.sidebar-collapsed .app-panel { grid-template-columns: 50px minmax(0, 1fr); }
.sidebar-toggle { position:absolute; top:10px; right:10px; z-index:2; width:28px; height:28px; padding:0; border:1px solid var(--line); border-radius:50%; background:rgba(3,40,66,.7); color:var(--text); cursor:pointer; }
.sidebar.collapsed { width:50px; height:calc(100vh - 30px); padding:10px 8px 6px; }
.sidebar.collapsed.hover-expanded { width:250px; padding:10px 18px 6px; overflow:visible; box-shadow:0 10px 40px rgba(0,0,0,.38); }
.sidebar.collapsed.hover-expanded .side-logo { width:min(202px,100%); max-width:100%; transform:none; margin:0 auto 8px; }
.sidebar.collapsed.hover-expanded .side-brand span { font-size:.86rem; }
.sidebar.collapsed.hover-expanded .side-brand span::after { content:none; }
.sidebar.collapsed.hover-expanded #currentNickname, .sidebar.collapsed.hover-expanded .profile-medal, .sidebar.collapsed.hover-expanded .menu-label { display:inline; }
.sidebar.collapsed.hover-expanded .daily-limit:not([hidden]) { display:grid; }
.sidebar.collapsed.hover-expanded .menu-icon { margin-right:30px; }
.sidebar.collapsed:not(.hover-expanded) .side-logo { width:150px; max-width:none; transform:translateX(-50px); margin-left:0; }
.sidebar.collapsed:not(.hover-expanded) .side-brand span { font-size:0; }
.sidebar.collapsed:not(.hover-expanded) .side-brand span::after { content:"CTF"; font-size:.78rem; }
.sidebar.collapsed:not(.hover-expanded) .side-brand { padding-bottom:5px; }
.sidebar.collapsed:not(.hover-expanded) .side-user { justify-content:center; }
.sidebar.collapsed:not(.hover-expanded) .side-avatar { width:24px; height:24px; }
.sidebar.collapsed:not(.hover-expanded) #currentNickname, .sidebar.collapsed:not(.hover-expanded) .profile-medal, .sidebar.collapsed:not(.hover-expanded) .menu-label, .sidebar.collapsed:not(.hover-expanded) .daily-limit { display:none !important; }
.sidebar.collapsed:not(.hover-expanded) .menu-item, .sidebar.collapsed:not(.hover-expanded) .sidebar-settings, .sidebar.collapsed:not(.hover-expanded) .logout { justify-content:center; width:34px; min-width:34px; padding:0; margin-left:auto; margin-right:auto; }
.sidebar.collapsed:not(.hover-expanded) .sidebar-account-actions .menu-entry { width:34px; margin-inline:auto; gap:0; }
.sidebar.collapsed:not(.hover-expanded) .sidebar-account-actions .menu-entry .menu-icon { flex-basis:34px; }
.sidebar.collapsed:not(.hover-expanded) .menu-icon { margin:0; }
.daily-limit[hidden] { display:none !important; }
.menu-entry { display:flex; align-items:center; gap:30px; }
.menu-entry .menu-icon { flex:0 0 18px; text-align:center; }
.menu-entry .menu-item { flex:1; text-align:left; }
.daily-limit { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:baseline; column-gap:8px; margin:10px 0 -12px; padding:3px 10px 8px; border:1px solid var(--line); border-radius:8px; background:rgba(3,40,66,.55); font-size:.75rem; }
.daily-limit span, .daily-limit strong { display:block; }
.daily-limit strong { margin-top:0; white-space:nowrap; }
.daily-limit i { grid-column:1 / -1; display:block; height:5px; margin-top:6px; border-radius:99px; background:rgba(255,255,255,.18); overflow:hidden; }
.daily-limit b { display:block; height:100%; width:0; background:#34b6ff; transition:width .2s ease; }
.scenario-category { display:grid; grid-column:1 / -1; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; margin-bottom:24px; padding:18px; border:1px solid var(--line); border-radius:12px; background:rgba(3,40,66,.42); }
.scenario-category.trail-catalog { grid-template-columns:repeat(5, minmax(0, 1fr)); }
.scenario-category h3 { grid-column:1 / -1; margin:0; text-transform:uppercase; color:var(--muted); letter-spacing:.08em; }

.side-brand {
  padding-bottom: 5px;
}

.side-logo {
  display: block;
  width: min(202px, 100%);
  max-height: 78px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 8px;
}

.side-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.menu {
  display: grid;
  gap: var(--menu-gap);
  margin: 5px 0 0;
}

.menu-item {
  width: 100%;
  min-height: 27px;
  text-align: left;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.menu-item[data-view="access"],
.menu-item[data-view="score"],
.menu-item[data-view="challenges"],
.menu-item[data-view="achievements"],
.topbar h2 {
  font-weight: 800;
  text-transform: uppercase;
}

.logout {
  margin-top: 0;
  color: var(--blue);
  min-height: 29px;
  font-size: 0.78rem;
  padding: 0 10px;
  flex: 1;
}

.content {
  padding: clamp(10px, 2.5vw, 22px) clamp(18px, 4vw, 34px) clamp(18px, 4vw, 34px);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h2 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.view-heading {
  display: grid;
  gap: 4px;
}

.ranking-user-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ip-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 110px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.metric-card span,
.score-board span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.ip-badge span {
  display: inline;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 800;
}

.metric-card strong,
.score-board strong {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.ip-badge strong {
  display: inline;
  margin-top: 0;
  color: var(--blue);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#accessView.active {
  grid-template-columns: 1fr;
}

.content:has(#accessView.active) {
  padding-bottom: clamp(9px, 2vw, 17px);
}

.siem-card {
  display: grid;
  place-items: center;
  min-height: min(72vh, 680px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(rgba(0, 15, 28, 0.42), rgba(0, 15, 28, 0.52)),
    var(--wallpaper-image),
    linear-gradient(135deg, rgba(0, 87, 153, 0.78), rgba(0, 174, 255, 0.18));
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.siem-button {
  min-width: 528px;
  min-height: 102px;
  padding: 0 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 174, 255, 0.90) 0%, rgba(0, 87, 153, 0.90) 52%, rgba(0, 61, 109, 0.90) 100%);
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow:
    0 12px 0 #002a4a,
    0 22px 34px rgba(0, 0, 0, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-6px);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.training-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 25, 43, 0.78);
}

.training-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.training-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.training-button {
  width: fit-content;
  min-width: 220px;
  min-height: 43px;
  display: inline-grid;
  place-items: center;
  padding: 0 26px;
  text-decoration: none;
  border-color: rgba(0, 87, 153, 0.35);
  box-shadow:
    0 5px 0 rgba(0, 42, 74, 0.95),
    0 10px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: translateY(-3px);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.training-button:hover {
  transform: translateY(-5px);
  box-shadow:
    0 7px 0 rgba(0, 42, 74, 0.95),
    0 14px 24px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.training-button:active {
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(0, 42, 74, 0.95),
    0 6px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.siem-button:hover {
  transform: translateY(-9px);
  box-shadow:
    0 15px 0 #002a4a,
    0 28px 42px rgba(0, 0, 0, 0.50),
    inset 0 2px 0 rgba(255, 255, 255, 0.50);
}

.siem-button:active {
  transform: translateY(2px);
  box-shadow:
    0 4px 0 #002a4a,
    0 10px 20px rgba(0, 0, 0, 0.42),
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.metric-card,
.score-board {
  min-height: 170px;
  padding: 22px;
}

.metric-card.wide,
.score-board,
.rank-list {
  grid-column: 1 / -1;
}

.metric-card strong,
.score-board strong {
  font-size: clamp(1.7rem, 4vw, 3rem);
}

.metric-card p,
.score-board p,
.challenge p {
  color: var(--muted);
  line-height: 1.6;
}

.content .rank-list {
  display: grid;
  gap: 8px;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  padding: 8px 0;
}

#scoreView.active {
  /* Laterais 20% menores; o espaço liberado permanece no ranking central. */
  grid-template-columns: minmax(0, calc((100% - 120px) * .19871)) minmax(0, calc((100% - 120px) * .60258)) minmax(0, calc((100% - 120px) * .19871));
  justify-content: space-between;
  gap: 60px;
  align-items: start;
}
.ranking-tabs { grid-column:1/-1;display:flex;gap:10px;justify-content:center; }
.ranking-tabs button { border:1px solid var(--line);border-radius:8px;padding:8px 16px;background:#fff;color:var(--blue);cursor:pointer;font-weight:700; }
.ranking-tabs button.active { background:var(--blue);color:#fff; }
#scoreView.internal.active { grid-template-columns:minmax(0,1fr); }
#scoreView.internal .ranking-toplists,#scoreView.internal .ranking-activity { display:none; }
#scoreView.internal .ranking-main { max-width:850px;margin:auto; }

.ranking-main {
  min-width: 0;
  display: grid;
  width: 100%;
  gap: 16px;
}

.ranking-main .podium,
.ranking-main .rank-list,
.ranking-main .rank-pager {
  grid-column: auto;
}

.ranking-toplists { display:grid; gap:14px; justify-self:start; width:100%; }
.ranking-top-card { min-width:0; padding:8px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.50); color:var(--blue); box-shadow:0 5px 0 rgba(0,42,74,.82),0 10px 18px rgba(0,0,0,.15); }
.ranking-top-card h3, .ranking-activity h3 { margin:0 0 10px; font-size:.85rem; text-transform:uppercase; letter-spacing:.025em; }
.ranking-mini-list { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.ranking-mini-item { display:grid; grid-template-columns:14px 24px minmax(0,1fr) auto; align-items:center; gap:4px; font-size:.72rem; }
.ranking-mini-item strong { text-align:right; }
.ranking-mini-item strong { font-size:.7rem; white-space:nowrap; }
.ranking-mini-position { font-weight:900; color:var(--blue); text-align:center; }
.ranking-mini-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; text-align:left; }
.ranking-mini-avatar { border:1px solid rgba(0,87,153,.25); }
.ranking-mini-empty, .recent-score-empty { margin:0; color:var(--muted); font-size:.75rem; }

.ranking-activity { min-width:0; width:100%; justify-self:end; padding-top:4px; color:var(--text); }
.recent-scores { display:grid; gap:7px; }
.recent-score { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:4px 7px; padding:4px 2px; font-size:.74rem; background:transparent; border:0; }
.recent-score strong { text-align:right; }
.recent-score span { text-align:left; }
.ranking-own-position { padding:12px; text-align:center; color:var(--text); background:rgba(0,42,74,.9); border-radius:8px; font-weight:800; overflow-wrap:anywhere; }
.recent-score span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
.recent-score strong { color:var(--cyan); font-size:.72rem; white-space:nowrap; }
.recent-score-avatar { box-shadow:0 0 0 1px rgba(87,211,223,.36); }

.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* 70% × 0,60 = 42% da área central; limite mínimo preserva a leitura. */
  width: 100%;
  min-width: 0;
  justify-self: center;
  padding: 3px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow:
    0 5px 0 rgba(0, 42, 74, 0.88),
    0 10px 18px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.challenge {
  display: flex;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  background: #ffffff !important;
  color: var(--blue);
}

#challengesView.active {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#achievementsView.active { display:block; }
.achievements-summary, .achievement-trail { border:1px solid var(--line); border-radius:12px; background:rgba(3,40,66,.80); padding:18px; }
.achievements-summary { margin-bottom:16px; }
.achievements-summary h3, .achievement-trail h3 { margin:0; color:var(--text); }
.achievements-summary p, .achievement-trail header p, .achievements-loading { margin:6px 0 0; color:var(--muted); font-size:.84rem; }
.achievement-trail { margin-bottom:16px; }
.achievement-trail header { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.achievement-trail header img { width:64px; height:64px; object-fit:contain; filter:drop-shadow(0 0 4px #fff) drop-shadow(0 0 12px rgba(255,255,255,.8)); }
.achievement-badges { display:grid; grid-template-columns:repeat(auto-fill, minmax(128px, 1fr)); gap:10px; }
.category-badges { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); }
.challenge-badge { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:0; padding:10px; text-align:center; border:1px solid var(--line); border-radius:10px; background:rgba(0,18,34,.68); opacity:.44; filter:grayscale(1); }
.challenge-badge.unlocked { opacity:1; filter:none; border-color:var(--cyan); box-shadow:0 0 0 1px rgba(87,211,223,.25); }
.challenge-badge.unavailable { opacity:.35; }
.challenge-badge img { width:72px; height:72px; object-fit:contain; filter:drop-shadow(0 0 3px #fff) drop-shadow(0 0 9px rgba(255,255,255,.75)); }
.challenge-badge strong { width:100%; color:var(--text); font-size:.73rem; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.challenge-badge span, .challenge-badge small { color:var(--muted); font-size:.68rem; }
.challenge-badge small { font-weight:800; color:#f4c95d; }
.challenge-badge.unlocked small { color:var(--cyan); }
.routine-back { width:30%; min-width:96px; max-width:132px; margin:0 0 12px; border:1px solid var(--blue); border-radius:8px; background:#fff; color:var(--blue); font-weight:800; white-space:nowrap; }
.routine-back:hover { background:#eef8ff; color:var(--blue); }
.achievements-loading.error { color:var(--danger); }

.challenge > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid #8a9199;
  background: #8a9199;
  color: #ffffff;
  font-weight: 800;
  border-radius: 5px;
  font-size: 0.72rem;
}
.menu-item .menu-icon { margin-right: 30px; }
.settings-btn.sidebar-settings .menu-label { display:none; }

.challenge.done {
  border-color: rgba(70, 246, 177, 0.5);
}

.challenge.current > span {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.challenge.done > span {
  border-color: #047857;
  background: #047857;
  color: #ffffff;
}

.challenge strong,
.challenge p {
  color: var(--blue);
}

.challenge strong {
  font-size: 0.82rem;
}

.challenge p {
  margin: 1px 0 0;
  font-size: 0.72rem;
  line-height: 1.2;
}

/* ── topbar right ───────────────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.settings-btn.sidebar-settings {
  width: 44px;
  min-height: 29px;
  text-align: center;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--blue);
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 0;
  flex: 0 0 44px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Seta de expandir/recolher logo abaixo de CONQUISTAS. */
  margin-top: 15px;
  padding-bottom: 1px;
  flex-shrink: 0;
}

.sidebar-ad {
  display: block;
  flex: 0 0 auto;
  /* 15px em todos os lados: compensa padding (18px laterais, 6px base) e borda (1px) da barra. */
  margin: 15px -4px 8px;
}
/* Imagem sempre inteira na largura disponível; a barra cresce se precisar. */
.sidebar-ad-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  opacity: 1;
  transition: opacity .18s ease, transform .22s ease;
}
.sidebar-ad-image.is-changing {
  opacity: 0;
  transform: scale(.98);
}

.sidebar-actions-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20%;
  min-width: 34px;
  margin-inline: auto;
  min-height: 17px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d5e7f5;
  cursor: pointer;
  opacity: .2;
  transition: opacity .2s ease;
}
.sidebar-actions-toggle::before,
.sidebar-actions-toggle::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.sidebar-actions-chevron {
  width: 6px;
  height: 6px;
  margin: 3px 13px 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg);
  transition: transform .22s ease, margin .22s ease;
}
.sidebar-actions.is-collapsed .sidebar-actions-chevron {
  margin-top: 0;
  margin-bottom: 3px;
  transform: rotate(45deg);
}
.sidebar-actions-toggle:hover,
.sidebar-actions-toggle:focus-visible { color: #fff; opacity: 1; }

.sidebar-account-actions {
  display: grid;
  gap: 4px;
  max-height: 220px;
  opacity: 1;
  overflow: visible;
  transform: translateY(0);
  visibility: visible;
  transition: max-height .22s ease, opacity .22s ease, transform .22s ease, visibility 0s;
}
.sidebar-actions.is-collapsed { gap: 0; padding-bottom: 0; }
.sidebar-actions.is-collapsed .sidebar-account-actions {
  max-height: 0;
  opacity: 0;
  transform: translateY(-14px);
  visibility: hidden;
  overflow: hidden;
  transition-delay: 0s, 0s, 0s, .22s;
}
.sidebar-account-actions .menu-entry { width:100%; }
.sidebar-account-actions .sidebar-settings {
  min-height: 21px;
  font-size: 0.81rem;
}
.sidebar-account-actions .logout {
  min-height: 21px;
  font-size: 0.70rem;
}


/* ── sidebar avatar ─────────────────────────────────────────────────── */
.side-user {
  display: grid;
  place-items: center;
  margin-top: 26px;
}

.side-product-name {
  display: block;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.2;
}

.side-avatar {
  width: 131px;
  height: 131px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 3.1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sidebar.collapsed .side-avatar { width:24px; height:24px; font-size:.8rem; }
.sidebar.collapsed .side-avatar .avatar-img { width:24px; height:24px; }
.sidebar.collapsed.hover-expanded .side-avatar { width:131px; height:131px; font-size:3.1rem; }
.sidebar.collapsed.hover-expanded .side-avatar .avatar-img { width:131px; height:131px; }

.side-nickname-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 5px auto 0;
}

.profile-medal {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  object-fit: contain;
}

#currentNickname {
  display: block;
  color: #ffffff;
  font-size: 1.33rem;
  max-width: 164px;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: left;
}

/* ── modal ──────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(100% - 32px, 380px);
  padding: 24px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.40);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 1.26rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  min-height: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

/* ── notifications and player help ─────────────────────────────────── */
.player-notification-center {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 220;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.player-notification-toggle,
.support-fab {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-height: 0;
  border: 1px solid #e5ad22;
  border-radius: 50%;
  background: #ffd54a;
  color: #513600;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  font-size: 1.25rem;
  font-weight: 900;
}

.player-notification-toggle {
  width: 23px;
  height: 23px;
  font-size: 0.7rem;
}

.player-notification-toggle span {
  position: absolute;
  min-width: 4px;
  width: 4px;
  height: 4px;
  padding: 0;
  border-radius: 50%;
  background: var(--danger);
  color: transparent;
  font-size: 0;
  line-height: 4px;
  transform: translate(14px, -14px);
}

.player-notification-toggle span[hidden] { display: none; }

.player-notification-toast {
  width: min(370px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 213, 74, .7);
  border-radius: 12px;
  background: rgba(3, 40, 66, .97);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .36);
}

.player-notification-center.is-collapsed .player-notification-toast { display: none; }
.player-notification-center.is-empty .player-notification-toggle { opacity: .4; }
.player-notification-toast header { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#ffe28a; }
.player-notification-actions { display:flex; align-items:center; gap:6px; }
.player-notification-toast header button { min-height:0; padding:0 5px; border:0; background:transparent; color:var(--text); font-size:1.25rem; box-shadow:none; }
.player-notification-toast .player-notification-read-all { padding:4px 7px; border:1px solid rgba(255,226,138,.55); border-radius:6px; color:#ffe28a; font-size:.72rem; line-height:1.2; }
.player-notification-toast .player-notification-read-all:hover { background:rgba(255,226,138,.12); }
.player-notification-toast article { padding:10px 0; border-top:1px solid rgba(255,255,255,.14); }
.player-notification-toast article:first-child { margin-top:10px; }
.player-notification-toast article.is-read { opacity:.58; }
.player-notification-toast article strong { display:block; color:var(--text); font-size:.9rem; }
.player-notification-toast article p { margin:4px 0 0; color:var(--muted); font-size:.8rem; line-height:1.45; white-space:pre-wrap; }
.player-notification-empty { margin:12px 0 0; color:var(--muted); font-size:.84rem; }

.support-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 210;
  background: var(--blue);
  border-color: #73c4ef;
  color: #fff;
  font-size: 1.45rem;
}

.support-modal-panel { width:min(100% - 32px, 520px); }
.support-modal-panel form { display:grid; gap:11px; }
.support-modal-panel label { display:grid; gap:5px; color:var(--muted); font-size:.82rem; font-weight:700; }
.support-modal-panel input, .support-modal-panel select, .support-modal-panel textarea { width:100%; min-height:40px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.92); color:var(--blue); padding:9px 10px; font:inherit; }
.support-modal-panel textarea { min-height:142px; resize:vertical; }
.support-intro { margin:0 0 16px; color:var(--muted); font-size:.84rem; line-height:1.45; }

#profileForm {
  display: grid;
  gap: 9px;
  margin-top: 6px;
}

#profileForm input {
  min-height: 40px;
}

#profileForm .primary-action {
  min-height: 25px;
}

.avatar-preview {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 3rem;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  cursor: pointer;
}

.avatar-colors {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.avatar-color-btn {
  width: 28px;
  height: 28px;
  min-height: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.avatar-color-btn.active {
  border-color: #ffffff;
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

/* ── podium ─────────────────────────────────────────────────────────── */
.podium {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 36px 0 0;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.podium-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 2.2rem;
  color: #ffffff;
}

.podium-avatar.empty {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed var(--line);
}

.podium-name {
  font-size: 1.64rem;
  color: var(--muted);
  text-align: center;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-block {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 15px 12px;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.50);
}

.podium-block.empty { opacity: 0.3; }

.place-1 .podium-block {
  height: 180px;
  border-color: #ffd700;
  background: linear-gradient(180deg, #ffe680, #d4a900);
  color: #1b1400;
}

.place-2 .podium-block {
  height: 135px;
  border-color: #c0c0c0;
  background: linear-gradient(180deg, #f2f2f2, #a9a9a9);
  color: #111111;
}

.place-3 .podium-block {
  height: 105px;
  border-color: #b87333;
  background: linear-gradient(180deg, #d99a5b, #8f4f20);
  color: #ffffff;
}

.place-4 .podium-avatar, .place-5 .podium-avatar { width:72px; height:72px; font-size:1.45rem; }
.place-4 .podium-name, .place-5 .podium-name { font-size:1rem; max-width:110px; }
.place-4 .podium-block { width:108px; height:80px; background:linear-gradient(180deg,#5c7b92,#375268); color:#fff; }
.place-5 .podium-block { width:108px; height:65px; background:linear-gradient(180deg,#496c85,#29465b); color:#fff; }
.place-4 .podium-medal, .place-5 .podium-medal { font-size:1.35rem; }
.place-4 .podium-pts, .place-5 .podium-pts { font-size:.95rem; }

.podium-medal { font-size: 2.1rem; }

.podium-pts {
  font-size: 1.23rem;
  color: inherit;
}

/* ── rank list (4th+) ───────────────────────────────────────────────── */
.rank-row {
  align-items: center;
}

.rank-position {
  width: 28px;
  text-align: center;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #ffffff;
  flex-shrink: 0;
}

.rank-avatar .avatar-img {
  width: 28px !important;
  height: 28px !important;
}

.rank-name {
  flex: 1;
  color: var(--blue);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-pts {
  color: #d4a900;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.rank-empty {
  padding: 18px 20px;
  color: var(--muted);
}

/* ── challenge points ───────────────────────────────────────────────── */
.challenge-pts {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  color: #d4a900;
  font-weight: 800;
  font-size: 0.76rem;
}


/* ── avatar gallery (settings modal) ───────────────────────────────── */
.avatar-gallery {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  grid-auto-rows: 60px;
  justify-content: center;
  gap: 8px;
  width: 284px;
  max-width: 100%;
  max-height: 196px;
  overflow-y: auto;
  padding: 4px;
  margin: 0 auto 8px;
}

.avatar-gallery-item {
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: none;
  min-height: 0;
}

.avatar-gallery-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.avatar-gallery-item:hover .avatar-gallery-img {
  transform: scale(1.75);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.avatar-gallery-item.active {
  border-color: var(--cyan);
  background: rgba(0, 174, 255, 0.10);
}

.avatar-gallery-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.avatar-gallery-name {
  display: none;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* ── community picker (settings modal) ─────────────────────────────── */
.community-picker {
  width: 284px;
  max-width: 100%;
  margin: 6px auto 14px;
}

.community-picker summary {
  cursor: pointer;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 2px;
}

.community-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 137px;
  overflow-y: auto;
}

.community-scroll-more {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 2px 0;
  margin-top: 2px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  opacity: 0.7;
}

.community-scroll-more:hover {
  opacity: 1;
}

.community-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  text-align: left;
}

.community-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.community-item.active {
  border-color: var(--cyan);
  background: rgba(0, 174, 255, 0.10);
}

.community-logo {
  width: 25.6px;
  height: 25.6px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.community-name {
  font-size: 0.85rem;
  color: #ffffff;
}

.avatar-clear {
  width: fit-content;
  min-width: 106px;
  min-height: 21px;
  font-size: 0.66rem;
  font-weight: 800;
  margin: 0 auto 10px;
  padding: 0 11px;
  display: grid;
  place-items: center;
}

/* ── lightbox ───────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.lightbox-img {
  width: min(620px, 88vw);
  height: min(620px, 88vw);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 40px rgba(0, 174, 255, 0.30);
}

.lightbox-name {
  position: absolute;
  bottom: calc(50% - min(200px, 44vw));
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-top: 16px;
}

/* ── rank pager ─────────────────────────────────────────────────────── */
.rank-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

.rank-pager button {
  min-height: 34px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
}

.rank-pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.rank-pager span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── round avatar images (rank list + podium) ───────────────────────── */
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
/* ── MFA prompt modal ────────────────────────────────────────────────── */
.mfa-prompt-panel {
  text-align: center;
}

.mfa-prompt-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
}

.mfa-prompt-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.mfa-prompt-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.mfa-prompt-cta {
  width: 100%;
  min-height: 42px;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.mfa-prompt-skip {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 0;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

.mfa-prompt-skip:hover {
  color: var(--text);
}

/* ── MFA section (settings modal) ───────────────────────────────────── */
.modal-panel {
  max-height: 90vh;
  overflow-y: auto;
}

.mfa-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.mfa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.mfa-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  text-transform: uppercase;
}

.mfa-badge.active {
  color: var(--ok);
  border-color: rgba(70, 246, 177, 0.4);
  background: rgba(70, 246, 177, 0.08);
}

.mfa-badge.inactive {
  color: var(--muted);
}

.mfa-hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 4px 0 8px;
}

.mfa-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 8px;
  border-radius: 8px;
}

.mfa-secret-line {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 8px;
  text-align: center;
  overflow-wrap: anywhere;
}

.mfa-secret-line code {
  color: var(--cyan);
  user-select: all;
}

.mfa-label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.mfa-input {
  min-height: 36px !important;
}

.mfa-btn {
  min-height: 26px !important;
  font-size: 0.82rem;
}

.mfa-danger {
  color: var(--danger) !important;
}

.mfa-controls {
  display: flex;
  gap: 8px;
}

@media (max-width: 900px) {
  .app-panel {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 28px);
  }

  .sidebar {
    min-height: auto;
    position: relative;
    top: auto;
    height: auto;
    width: auto !important;
  }

  .sidebar-ad { display:none; }

  body.sidebar-collapsed .app-panel { grid-template-columns: 1fr; }
  .sidebar.collapsed .side-logo { width:min(202px,100%); transform:none; margin:0 auto 8px; }
  .sidebar.collapsed .side-brand span { font-size:.86rem; }
  .sidebar.collapsed .side-brand span::after { content:none; }
  .sidebar.collapsed .currentNickname, .sidebar.collapsed .profileMedal, .sidebar.collapsed .menu-label { display:inline; }
.sidebar.collapsed .daily-limit { display:grid; }
  .sidebar.collapsed .menu-item, .sidebar.collapsed .sidebar-settings, .sidebar.collapsed .logout { width:100%; padding:0 14px; }

  .menu {
    grid-template-columns: 1fr;
  }

  .logout {
    margin-top: 0;
  }

  #scoreView.active {
    grid-template-columns: minmax(0, 1fr) minmax(180px, .72fr);
    gap: 20px;
  }

  .ranking-toplists { grid-column:1 / -1; grid-template-columns:repeat(2, minmax(0,1fr)); }
  .ranking-activity { grid-column:2; }
  .rank-row { width:60%; }

  #challengesView.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .achievement-badges { grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); }

  .scenario-category, .scenario-category.trail-catalog { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .view.active {
    grid-template-columns: 1fr;
  }

  #challengesView.active {
    grid-template-columns: 1fr;
  }

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

  .scenario-category, .scenario-category.trail-catalog { grid-template-columns: 1fr; padding: 14px; }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ip-badge {
    min-width: 0;
  }

  .player-notification-center { top: 12px; right: 12px; }
  .support-fab { right: 16px; bottom: 16px; }
}

.sidebar.collapsed:not(.hover-expanded) #currentNickname,
.sidebar.collapsed:not(.hover-expanded) .profile-medal { display:none !important; }

.routine-back.packs-back{width:43.125%;min-width:138px;max-width:189.75px}


#cybergamesView.active {display:block;min-width:0;}
.cyber-games-intro {display:flex;justify-content:space-between;align-items:center;gap:20px;padding:26px;background:linear-gradient(120deg,rgba(0,87,153,.45),rgba(3,40,66,.8));border:1px solid var(--line);border-radius:14px;margin-bottom:20px;}
.cyber-games-intro h3 {font-size:clamp(22px,3vw,34px);margin:0 0 10px;color:var(--text);}
.cyber-games-intro p {color:var(--muted);max-width:65ch;line-height:1.6;}
.cyber-games-intro>span {font-size:70px;}
.cyber-games-kicker {color:var(--cyan)!important;font-size:11px;letter-spacing:.14em;font-weight:700;}
.cyber-games-catalog {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;}
.cyber-game-tile {min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:rgba(3,40,66,.8);transition:transform .2s;}
.cyber-game-tile:hover {transform:translateY(-4px);border-color:var(--cyan);}
.cyber-game-tile img {display:block;width:100%;aspect-ratio:1;object-fit:cover;}
.cyber-game-tile>div {padding:15px;}
.cyber-game-tile h3 {font-size:17px;margin:0 0 10px;min-height:40px;}
.cyber-game-tile p {font-size:12px;color:var(--muted);min-height:55px;line-height:1.5;}
.cyber-game-tile .primary-action,.cyber-game-tile button {min-height:44px;display:flex;justify-content:center;align-items:center;width:100%;text-decoration:none;border-radius:8px;font-size:13px;}
.cyber-game-tile button:disabled {background:rgba(255,255,255,.06);color:var(--muted);border:1px solid var(--line);opacity:.6;}
.cyber-games-note {color:var(--muted);font-size:12px;margin-top:18px;}
.cyber-game-toolbar {display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:14px;}
.cyber-game-toolbar a {color:var(--cyan);font-size:13px;}
.cyber-game-frame {display:block;width:100%;height:calc(100dvh - 150px);min-height:640px;border:1px solid var(--line);border-radius:14px;background:#03121f;}
@media(max-width:1250px){.cyber-games-catalog{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:760px){.cyber-games-catalog{grid-template-columns:repeat(2,minmax(0,1fr));}.cyber-games-intro{padding:18px;}.cyber-games-intro>span{display:none;}.cyber-game-frame{min-height:740px;}.cyber-game-toolbar{flex-wrap:wrap;}}
@media(max-width:420px){.cyber-games-catalog{grid-template-columns:1fr;}.cyber-game-tile{display:grid;grid-template-columns:110px 1fr;}.cyber-game-tile img{height:100%;}.cyber-game-tile h3,.cyber-game-tile p{min-height:0;}.cyber-game-tile>div{padding:12px;}}
@media(prefers-reduced-motion:reduce){.cyber-game-tile{transition:none;}}

/* Cartões de desafios mantêm o texto legível no catálogo com cinco colunas. */
/* Cartões com metade da altura anterior (180 → 90 px), em todas as trilhas. */
#challengesView .playable-challenge {display:grid;grid-template-columns:24px minmax(0,1fr) auto;grid-template-rows:1fr auto;grid-template-areas:"art info number" "points points points";gap:3px 7px;padding:7px 9px;min-width:0;min-height:90px;height:90px;align-content:start;}
#challengesView .playable-challenge .challenge-art {grid-area:art;align-self:start;width:24px;height:24px;object-fit:contain;}
#challengesView .playable-challenge>span {grid-area:number;justify-self:end;width:22px;height:22px;font-size:.65rem;}
#challengesView .playable-challenge>div:not(.challenge-pts) {grid-area:info;min-width:0;overflow:hidden;}
#challengesView .playable-challenge strong {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.15;font-size:.75rem;overflow-wrap:break-word;}
#challengesView .playable-challenge p {margin-top:3px;line-height:1.15;font-size:.62rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#challengesView .playable-challenge .challenge-pts {grid-area:points;justify-self:end;align-self:end;white-space:nowrap;margin:0;color:#906e00;font-size:.7rem;}

/* Resumos dos cenários preservam os cartões compactos de 90 px. */
#challengesView .playable-challenge p.challenge-summary {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
#challengesView .scenario-card-content p.actor-module-summary {
  font-size: calc(1em - 2pt);
}


/* ── Comunidades parceiras (aba Jogar): mesmas medidas do bloco Treinar ── */
.partners-card {
  display: grid;
  gap: 14px;
  /* Espaço superior e inferior reduzido em 50% (18 px → 9 px); laterais mantidas. */
  padding: 9px 18px;
  /* Sem linha de contorno; a borda transparente mantém as medidas do bloco Treinar. */
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

.partners-card > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.partners-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}

.partners-logos img {
  /* 50% maiores que os 37 px iniciais. */
  width: 56px;
  height: 56px;
  object-fit: contain;
  /* Mesmo brilho de fundo das insígnias (.challenge-badge img). */
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 9px rgba(255, 255, 255, .75));
}

/* ── Suporte: confirmação de envio ── */
.support-success {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 4px 4px;
  text-align: center;
  outline: none;
}

.support-success.hidden { display: none; }

.support-success-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ok);
  color: #00301f; /* contraste sobre o verde claro */
  font-size: 2rem;
  font-weight: 900;
  animation: support-success-pop 260ms ease-out;
}

.support-success h3 { margin: 4px 0 0; color: var(--text); font-size: 1.25rem; }
.support-success p { margin: 0; color: var(--muted); }
.support-success .support-success-protocol { font-size: 0.78rem; overflow-wrap: anywhere; }
.support-success .primary-action { margin-top: 8px; min-width: 160px; }

@keyframes support-success-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Insígnias (Conquistas) e imagens de Desafios: +50% no hover ── */
.challenge-badge img,
#challengesView .scenario-card-image {
  position: relative;
  transform-origin: center bottom; /* cresce para cima, sem cobrir o texto do card */
  transition: transform 200ms ease;
}

/* O card em hover sobe na pilha para a imagem ampliada não ficar sob os vizinhos. */
.challenge-badge:hover,
#challengesView .scenario-card:hover,
#challengesView .scenario-card:focus-visible {
  position: relative;
  z-index: 3;
}

.challenge-badge:hover img,
#challengesView .scenario-card:hover .scenario-card-image,
#challengesView .scenario-card:focus-visible .scenario-card-image {
  z-index: 2;
  transform: scale(1.5);
}

@media (prefers-reduced-motion: reduce) {
  .challenge-badge img,
  #challengesView .scenario-card-image,
  .support-success-icon { transition: none; animation: none; }
}

/* Pack sazonal Black Friday: amarelo e preto da arte, com aviso de disponibilidade. */
#challengesView .black-friday-card {
  position: relative;
  border-color: #ffd400;
  background: linear-gradient(160deg, rgba(255, 212, 0, .14), rgba(3, 40, 66, .85) 55%);
}
#challengesView .black-friday-card:hover,
#challengesView .black-friday-card:focus-visible { box-shadow: 0 0 26px rgba(255, 212, 0, .35); }
#challengesView .black-friday-card .scenario-card-content > span { color: #ffd400; }
#challengesView .black-friday-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffd400;
  color: #111;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(255, 212, 0, .55);
  animation: black-friday-pulse 2.4s ease-in-out infinite;
}
#challengesView .black-friday-notice {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 12px 16px;
  border: 1px solid #ffd400;
  border-left-width: 5px;
  border-radius: 10px;
  background: rgba(255, 212, 0, .12);
  color: #ffe766;
  font-weight: 700;
}
@keyframes black-friday-pulse { 50% { box-shadow: 0 0 2px rgba(255, 212, 0, .2); filter: brightness(1.15); } }
@media (prefers-reduced-motion: reduce) { #challengesView .black-friday-ribbon { animation: none; } }
@media (max-width: 700px) {
  #challengesView .black-friday-notice { padding: 9px 10px; border-left-width: 4px; font-size: clamp(10px, 3vw, 13px); letter-spacing: -.01em; }
}
