/* ==================================================================
   Ranking — "Salão dos Heróis" (alpha.85) — prefixo rk-
   Visual medieval/jogo: pedra escura, ouro, tochas e brasões.
   Sempre escuro, independente do tema do site, para manter o clima.
   ================================================================== */
.rk-page { padding-top: 8px; }

.rk {
  --rk-bg: #14100d;
  --rk-stone: #241d18;
  --rk-stone-2: #30261f;
  --rk-line: #4a3a2c;
  --rk-gold: #e8b64a;
  --rk-gold-2: #ffd978;
  --rk-gold-d: #8a6420;
  --rk-silver: #cfd6e2;
  --rk-bronze: #d98b4f;
  --rk-ink: #f5ead6;
  --rk-mute: #b9a98f;
  --rk-red: #8e2a2a;
  --rk-serif: "Bodoni Moda", "Palatino Linotype", Georgia, serif;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0 auto;
  padding: 26px 16px 22px;
  border: 2px solid var(--rk-gold-d);
  border-radius: 22px;
  color: var(--rk-ink);
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 170, 60, .22), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .22) 0 2px, transparent 2px 92px),
    linear-gradient(180deg, #1c1511, var(--rk-bg) 40%);
  box-shadow: 0 0 0 4px #0d0a08, 0 0 0 5px var(--rk-gold-d), 0 30px 60px -28px rgba(0, 0, 0, .8), inset 0 0 90px rgba(0, 0, 0, .55);
}
.rk::before, .rk::after { content: ""; position: absolute; left: 10px; right: 10px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--rk-gold-d), var(--rk-gold), var(--rk-gold-d), transparent); opacity: .55; pointer-events: none; }
.rk::before { top: 6px; }
.rk::after { bottom: 6px; }
.rk a { color: inherit; text-decoration: none; }
.rk a:focus-visible { outline: 3px solid var(--rk-gold-2); outline-offset: 3px; border-radius: 10px; }
.rk > * { position: relative; z-index: 1; }

/* Tochas nas laterais */
.rk-torch { position: absolute !important; top: 18px; z-index: 0 !important; width: 10px; height: 78px; border-radius: 4px; background: linear-gradient(90deg, #4b3320, #7a5530, #4b3320); display: none; }
.rk-torch--l { left: 18px; }
.rk-torch--r { right: 18px; }
.rk-torch i { position: absolute; left: 50%; top: -34px; width: 26px; height: 40px; transform: translateX(-50%); border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; background: radial-gradient(closest-side at 50% 70%, #fff3b0, #ffb73a 55%, #e2551b 85%, transparent); filter: blur(.4px) drop-shadow(0 0 18px rgba(255, 150, 40, .85)); transform-origin: 50% 90%; animation: rk-flame 1.6s ease-in-out infinite; }
@keyframes rk-flame { 0%, 100% { transform: translateX(-50%) scale(1, 1) rotate(-2deg); } 50% { transform: translateX(-50%) scale(.92, 1.12) rotate(3deg); } }

/* Cabeçalho */
.rk-head { display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: 18px; }
.rk-emblem { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: var(--rk-gold-2); background: radial-gradient(circle at 50% 35%, #3b2c1f, #1a130e); border: 2px solid var(--rk-gold); box-shadow: 0 0 0 4px #0d0a08, 0 0 24px rgba(232, 182, 74, .45); }
.rk-swords { width: 36px; height: 36px; }
.rk-kicker { margin: 4px 0 0; font-family: var(--rk-serif); font-size: .78rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--rk-gold); }
.rk-title { margin: 0; font-family: var(--rk-serif); font-weight: 800; font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1.05; letter-spacing: 0; text-transform: none; background: linear-gradient(180deg, #fff1bf, var(--rk-gold) 55%, #a8731c); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .6)); }
.rk-sub { margin: 0; max-width: 46ch; color: var(--rk-mute); font-size: .9rem; line-height: 1.5; }

/* Abas = placas de madeira */
.rk-toolbar { display: grid; gap: 10px; margin-bottom: 22px; justify-items: center; }
.rk-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--rk-line); max-width: 100%; }
.rk-tab { padding: 8px 15px; border-radius: 10px; font-family: var(--rk-serif); font-weight: 700; font-size: .8rem; letter-spacing: 0; text-transform: none; color: var(--rk-mute); border: 1px solid transparent; transition: color .15s, background .15s, transform .15s; white-space: nowrap; }
.rk-tab:hover { color: var(--rk-ink); background: rgba(255, 255, 255, .05); }
.rk-tab.is-active { color: #2a1b05; background: linear-gradient(180deg, var(--rk-gold-2), var(--rk-gold) 60%, #b98424); border-color: #6a4a12; box-shadow: 0 2px 0 #6a4a12, 0 6px 14px -6px rgba(232, 182, 74, .7); }
.rk-tabs--metric .rk-tab.is-active { background: linear-gradient(180deg, #e9eef8, var(--rk-silver) 60%, #8f98ab); border-color: #4c5568; box-shadow: 0 2px 0 #4c5568, 0 6px 14px -6px rgba(207, 214, 226, .6); }

/* Pódio */
.rk-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; margin: 12px 0 22px; }
.rk-place { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; --rk-c: var(--rk-gold); }
.rk-place--2 { --rk-c: var(--rk-silver); }
.rk-place--3 { --rk-c: var(--rk-bronze); }
.rk-crown { width: 44px; height: 36px; color: var(--rk-gold-2); filter: drop-shadow(0 0 12px rgba(255, 217, 120, .8)); animation: rk-bob 3s ease-in-out infinite; }
@keyframes rk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.rk-hero { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.rk-avatar { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; font-family: var(--rk-serif); font-weight: 800; font-size: 1.15rem; color: var(--rk-ink); background: var(--rk-stone-2); border: 3px solid var(--rk-c); box-shadow: 0 0 0 3px #0d0a08, 0 0 22px -2px var(--rk-c); }
.rk-place--1 .rk-avatar { width: 84px; height: 84px; font-size: 1.4rem; }
.rk-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-ribbon { position: relative; max-width: 100%; padding: 4px 14px; font-family: var(--rk-serif); font-weight: 700; font-size: .78rem; color: #1d1305; background: linear-gradient(180deg, color-mix(in srgb, var(--rk-c) 60%, #fff), var(--rk-c)); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%, 8px 50%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-hero:hover .rk-ribbon { filter: brightness(1.1); }
.rk-rankname { color: var(--rk-mute); font-size: .7rem; text-align: center; line-height: 1.25; }
.rk-pedestal { position: relative; display: grid; align-content: start; justify-items: center; gap: 2px; width: 100%; padding: 10px 6px 12px; border-radius: 10px 10px 4px 4px; color: var(--rk-ink); text-align: center; background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #4a3c30, #2c2219);
  border: 2px solid var(--rk-c); border-bottom-width: 5px; box-shadow: inset 0 0 18px rgba(0, 0, 0, .5), 0 14px 24px -14px var(--rk-c); }
.rk-place--1 .rk-pedestal { min-height: 118px; }
.rk-place--2 .rk-pedestal { min-height: 92px; }
.rk-place--3 .rk-pedestal { min-height: 76px; }
.rk-pedestal b { font-family: var(--rk-serif); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--rk-c); text-shadow: 0 2px 0 rgba(0, 0, 0, .7), 0 0 16px color-mix(in srgb, var(--rk-c) 60%, transparent); }
.rk-pedestal span { font-weight: 800; font-size: .86rem; }
.rk-pedestal small { color: var(--rk-mute); font-weight: 700; font-size: .7rem; }
.rk-place.is-me .rk-avatar { box-shadow: 0 0 0 3px #0d0a08, 0 0 0 6px var(--rk-gold-2), 0 0 26px var(--rk-gold); }
.rk-place--empty { visibility: hidden; }

/* Sua posição = pergaminho */
.rk-me { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; color: #3a2a12; background: linear-gradient(180deg, #f3e4c1, #dcc18d); border: 2px solid #8a6420; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .8), inset 0 0 22px rgba(120, 80, 20, .35); }
.rk-me-seal { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #f5ead6; background: radial-gradient(circle at 40% 30%, #b83a3a, var(--rk-red)); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .15), 0 3px 6px rgba(0, 0, 0, .4); }
.rk-me-seal .rk-swords { width: 26px; height: 26px; }
.rk-me small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: #6b5127; }
.rk-me strong { font-family: var(--rk-serif); font-weight: 800; font-size: 1.35rem; line-height: 1.1; }
.rk-me-score { margin-left: auto; text-align: right; }
.rk-note { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; text-align: center; color: var(--rk-mute); background: rgba(0, 0, 0, .3); border: 1px dashed var(--rk-line); font-size: .9rem; }

/* Lista = plaquetas heráldicas */
.rk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rk-row { --rk-c: #7b6a58; position: relative; display: grid; grid-template-columns: 46px 46px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px 10px 8px; border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, .03), transparent 40%), linear-gradient(180deg, var(--rk-stone-2), var(--rk-stone)); border: 1px solid var(--rk-line); border-left: 4px solid var(--rk-c); box-shadow: 0 6px 14px -10px #000; transition: transform .18s, border-color .18s, box-shadow .18s; animation: rk-in .45s both; animation-delay: calc(var(--rk-i, 1) * 35ms); }
.rk-row:hover { transform: translateX(3px); border-color: var(--rk-c); }
.rk-row--gold { --rk-c: var(--rk-gold); }
.rk-row--silver { --rk-c: var(--rk-silver); }
.rk-row--bronze { --rk-c: var(--rk-bronze); }
.rk-row.is-me { border-color: var(--rk-gold-2); border-left-color: var(--rk-gold-2); background: linear-gradient(90deg, rgba(232, 182, 74, .22), rgba(232, 182, 74, .05) 60%), linear-gradient(180deg, var(--rk-stone-2), var(--rk-stone)); box-shadow: 0 0 0 1px var(--rk-gold), 0 0 24px -6px rgba(232, 182, 74, .7); }
@keyframes rk-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Posição = escudo */
.rk-pos { display: grid; place-items: center; width: 40px; height: 46px; margin-left: 4px; color: var(--rk-ink); background: linear-gradient(180deg, color-mix(in srgb, var(--rk-c) 55%, #2a2018), color-mix(in srgb, var(--rk-c) 20%, #1a130e)); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.rk-pos b { font-family: var(--rk-serif); font-weight: 800; font-size: .95rem; margin-top: -6px; text-shadow: 0 1px 0 rgba(0, 0, 0, .7); }
.rk-row--gold .rk-pos b, .rk-row--silver .rk-pos b, .rk-row--bronze .rk-pos b { color: #1d1305; text-shadow: none; }
.rk-row-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; font-family: var(--rk-serif); font-weight: 800; color: var(--rk-ink); background: var(--rk-stone); border: 2px solid var(--rk-c); box-shadow: 0 0 0 2px #0d0a08; }
.rk-row-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rk-row-main { display: grid; gap: 2px; min-width: 0; }
.rk-row-name { font-weight: 800; font-size: .98rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-row-name:hover { color: var(--rk-gold-2); }
.rk-you { justify-self: start; padding: 1px 8px; border-radius: 6px; font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: 0; text-transform: none; color: #2a1b05; background: var(--rk-gold); }
.rk-row-main > small { color: var(--rk-mute); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-bar { display: block; height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--rk-gold-d), var(--rk-c)); }
.rk-row--iron .rk-bar i { background: linear-gradient(90deg, #5a4a3a, #a58f73); }
.rk-score { display: grid; justify-items: end; text-align: right; line-height: 1.1; }
.rk-score strong { font-family: var(--rk-serif); font-weight: 800; font-size: 1.1rem; color: var(--rk-gold-2); }
.rk-score small { color: var(--rk-mute); font-weight: 700; font-size: .68rem; text-transform: none; letter-spacing: 0; }

/* Vazio */
.rk-empty { display: grid; justify-items: center; gap: 6px; padding: 34px 16px; text-align: center; border: 1px dashed var(--rk-line); border-radius: 14px; background: rgba(0, 0, 0, .25); }
.rk-empty .rk-swords { width: 54px; height: 54px; color: var(--rk-gold-d); }
.rk-empty strong { font-family: var(--rk-serif); font-size: 1.1rem; color: var(--rk-gold); }
.rk-empty span { color: var(--rk-mute); font-size: .9rem; }

/* Decreto (link para o torneio do mês) */
.rk-decree { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; color: var(--rk-ink); background: linear-gradient(180deg, rgba(142, 42, 42, .35), rgba(60, 20, 20, .35)); border: 1px solid #7a3030; transition: transform .18s, border-color .18s; }
.rk-decree:hover { transform: translateY(-2px); border-color: var(--rk-gold); }
.rk-seal { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #f5ead6; background: radial-gradient(circle at 40% 30%, #b83a3a, var(--rk-red)); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .15); }
.rk-seal .icon { width: 20px; height: 20px; }
.rk-decree > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.rk-decree strong { font-family: var(--rk-serif); font-size: .98rem; letter-spacing: 0; }
.rk-decree small { color: var(--rk-mute); font-size: .8rem; line-height: 1.35; }
.rk-decree > .icon { flex: none; width: 20px; height: 20px; color: var(--rk-gold); }

/* Telas maiores */
@media (min-width: 640px) {
  .rk { padding: 32px 28px 26px; }
  .rk-torch { display: block; }
  .rk-avatar { width: 78px; height: 78px; }
  .rk-place--1 .rk-avatar { width: 104px; height: 104px; font-size: 1.7rem; }
  .rk-ribbon { font-size: .9rem; padding: 5px 18px; }
  .rk-pedestal b { font-size: 2.6rem; }
  .rk-place--1 .rk-pedestal { min-height: 140px; }
  .rk-place--2 .rk-pedestal { min-height: 108px; }
  .rk-place--3 .rk-pedestal { min-height: 88px; }
  .rk-row { grid-template-columns: 52px 52px minmax(0, 1fr) auto; padding: 12px 16px 12px 10px; gap: 14px; }
  .rk-row-avatar { width: 50px; height: 50px; }
  .rk-pos { width: 44px; height: 52px; }
  .rk-pos b { font-size: 1.05rem; }
  .rk-score strong { font-size: 1.3rem; }
}
@media (min-width: 900px) {
  .rk { max-width: 920px; }
  .rk-torch { top: 26px; height: 100px; }
  .rk-torch--l { left: 30px; }
  .rk-torch--r { right: 30px; }
}
@media (max-width: 380px) {
  .rk { padding-left: 10px; padding-right: 10px; }
  .rk-row { grid-template-columns: 38px 38px minmax(0, 1fr) auto; gap: 8px; }
  .rk-pos { width: 34px; height: 42px; margin-left: 2px; }
  .rk-row-avatar { width: 38px; height: 38px; }
  .rk-tab { padding: 7px 11px; font-size: .74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-torch i, .rk-crown, .rk-row { animation: none; }
  .rk-row, .rk-decree, .rk-tab { transition: none; }
}

/* ------------------------------------------------------------------
   Torneio do mês (season.php) — mesma identidade medieval, sobre os
   blocos já existentes (panel, tabela, pódio, prêmios).
   ------------------------------------------------------------------ */
.rk-skin { --rk-gold: #e8b64a; --rk-gold-2: #ffd978; --rk-gold-d: #8a6420; --rk-stone: #241d18; --rk-stone-2: #30261f; --rk-line: #4a3a2c; --rk-ink: #f5ead6; --rk-mute: #b9a98f; --rk-serif: "Bodoni Moda", "Palatino Linotype", Georgia, serif; }
.rk-skin .panel { color: var(--rk-ink); background: linear-gradient(180deg, #1f1813, #15100c); border: 2px solid var(--rk-gold-d); border-radius: 18px; box-shadow: 0 0 0 3px #0d0a08, 0 18px 36px -22px #000, inset 0 0 60px rgba(0, 0, 0, .45); }
.rk-skin .panel-head { border-bottom: 1px solid var(--rk-line); }
.rk-skin .panel-title { font-family: var(--rk-serif); font-weight: 800; letter-spacing: 0; color: var(--rk-gold-2); }
.rk-skin .panel-sub, .rk-skin .gm-muted { color: var(--rk-mute); }
.rk-skin .gm-me { padding: 10px 14px; border-radius: 10px; color: #3a2a12; background: linear-gradient(180deg, #f3e4c1, #dcc18d); border: 2px solid #8a6420; }
.rk-skin .gm-me .icon { color: #8e2a2a; }
.rk-skin .gm-season-countdown { color: var(--rk-mute); }
.rk-skin .gm-season-countdown strong { font-family: var(--rk-serif); color: var(--rk-gold-2); }
.rk-skin .table-wrap { border-color: var(--rk-line); background: rgba(0, 0, 0, .25); }
.rk-skin .table th { font-family: var(--rk-serif); letter-spacing: 0; text-transform: none; color: var(--rk-gold); background: rgba(0, 0, 0, .35); border-color: var(--rk-line); }
.rk-skin .table td { color: var(--rk-ink); border-color: var(--rk-line); }
.rk-skin .table tr.is-me td { background: rgba(232, 182, 74, .16); }
.rk-skin .gm-season-place { color: var(--rk-ink); background: linear-gradient(180deg, #3a2e24, #231b15); border: 2px solid var(--rk-gold-d); box-shadow: inset 0 0 20px rgba(0, 0, 0, .45); }
.rk-skin .gm-season-place.place-1 { border-color: var(--rk-gold); box-shadow: 0 0 26px -6px rgba(232, 182, 74, .7), inset 0 0 20px rgba(0, 0, 0, .45); }
.rk-skin .gm-season-place.place-2 { border-color: #cfd6e2; }
.rk-skin .gm-season-place.place-3 { border-color: #d98b4f; }
.rk-skin .gm-season-place small { color: var(--rk-mute); }
.rk-skin .gm-milestones li { color: var(--rk-ink); background: rgba(0, 0, 0, .3); border-color: var(--rk-line); }
.rk-skin .gm-milestones li.is-reached { border-color: var(--rk-gold); background: rgba(232, 182, 74, .14); }
.rk-skin .gm-milestones li > span { color: var(--rk-gold-2); }
.rk-skin .callout { background: rgba(0, 0, 0, .35); border-color: var(--rk-line); color: var(--rk-ink); }
.rk-skin .callout a { color: var(--rk-gold-2); }

/* Ajustes finos (celular) */
.rk-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; max-width: 460px; }
.rk-tabs--metric { max-width: 360px; }
.rk-tab { text-align: center; padding: 8px 6px; font-size: .72rem; letter-spacing: .03em; }
@media (min-width: 640px) { .rk-tabs { width: auto; } .rk-tab { padding: 8px 15px; font-size: .8rem; letter-spacing: 0; } }
.rk-me-score strong { white-space: nowrap; }
.rk-row--gold .rk-pos, .rk-row--silver .rk-pos, .rk-row--bronze .rk-pos { background: linear-gradient(180deg, color-mix(in srgb, var(--rk-c) 92%, #fff), color-mix(in srgb, var(--rk-c) 65%, #3a2a12)); }
