/* =====================================================================
   CloudRO ranking pages - shared "dark fantasy" theme
   Used by: woerank, pvpladder, monkladder, gvgladder, koe_rank
   Art:     ../RagnaArtifacts/img/ranking/{ranking_bg,best_killer_card,longest_card}.png
   Fonts:   Cinzel (headings) + Inter (body), loaded by each view via <link>
   ===================================================================== */
/* =====================================================================
   WoE Ranking - dark fantasy theme
   ===================================================================== */
:root{
  --w-navy:#0a1230; --w-navy-2:#060b1f; --w-panel:rgba(8,16,44,0.74); --w-panel-2:rgba(6,12,34,0.82);
  --w-row:rgba(10,20,52,0.78); --w-row-hover:rgba(18,32,82,0.88);
  --w-line:rgba(120,150,220,0.22); --w-line-2:rgba(255,255,255,0.06);
  --w-text:#eef2ff; --w-muted:#8e9bc0; --w-dim:#5d6a94;
  --w-blue:#2f7bff; --w-blue-2:#1f5fe0; --w-cyan:#5ec8ff; --w-blue-glow:rgba(47,123,255,0.45);
  --w-gold:#f5c542; --w-gold-2:#c98a1a; --w-gold-3:#ffe08a; --w-gold-glow:rgba(245,197,66,0.40);
  --w-alive:#2ee07a; --w-dead:#ff4f6d;
  --w-serif:'Cinzel',Georgia,'Times New Roman',serif;
  --w-sans:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
}

/* ---------- page shell: full-bleed section with its own background ---------- */
.rgh-wrap{
  position:relative; isolation:isolate; overflow:hidden;
  font-family:var(--w-sans); color:var(--w-text);
  background:var(--w-navy);
  width:var(--rgh-vw,100vw);
  margin:-26px 0 -60px calc(50% - var(--rgh-vw,100vw) / 2);
  margin-top:-26px !important;
  padding:40px 24px 80px;
  min-height:calc(100vh - 54px);
}
.rgh-inner{ max-width:1320px; margin:0 auto; position:relative; z-index:1; }

.rgh-bg{
  position:absolute; inset:0; z-index:-1; pointer-events:none;
  background:
    linear-gradient(180deg, rgba(6,10,28,0.10) 0%, rgba(6,10,28,0.42) 38%, rgba(6,10,28,0.80) 70%, rgba(5,8,22,0.95) 100%),
    url('../RagnaArtifacts/img/ranking/ranking_bg.png') center top / cover no-repeat,
    radial-gradient(1100px 520px at 50% -5%, rgba(47,123,255,0.28), transparent 62%),
    var(--w-navy);
}
/* CSS starfield (works without JS); the canvas adds floating sparks on top */
.rgh-bg::before{
  content:""; position:absolute; inset:0; opacity:.6;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 120px 90px, rgba(255,255,255,.85) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 200px 160px, #cfe3ff 50%, transparent 51%),
    radial-gradient(1px 1px at 300px 40px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 260px 220px, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 60px 200px, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 340px 130px, #9ec8ff 50%, transparent 51%);
  background-size:380px 260px;
  animation:rghTwinkle 7s ease-in-out infinite alternate;
}
@keyframes rghTwinkle{ from{ opacity:.35; } to{ opacity:.75; } }
.rgh-particles{ position:absolute; inset:0; width:100%; height:100%; display:block; }

/* ---------- global resets for theme buttons/selects inside this page ---------- */
body .rgh-wrap button, body .rgh-modal button{
  appearance:none; -webkit-appearance:none;
  text-transform:none; letter-spacing:0; min-width:0; width:auto; margin:0;
  text-shadow:none; line-height:1.2; font-family:var(--w-sans);
}

/* ---------- header ---------- */
.rgh-header{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:18px; flex-wrap:wrap; margin-bottom:26px;
}
.rgh-heading{ display:flex; flex-direction:column; align-items:flex-start; }
.rgh-ornament{ display:block; margin:0 0 2px 18px; }
.rgh-title{
  font-family:var(--w-serif) !important; font-weight:800; font-size:clamp(42px, 5.6vw, 78px);
  line-height:1.05; margin:0; letter-spacing:.01em; color:#fff;
}
.rgh-title .word{
  color:#fff;
  text-shadow:0 0 18px rgba(170,200,255,0.45), 0 0 40px rgba(120,160,255,0.25), 0 2px 0 rgba(0,0,0,0.45);
}
.rgh-title .accent{
  background:linear-gradient(180deg, var(--w-gold-3) 0%, var(--w-gold) 45%, var(--w-gold-2) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 10px rgba(245,197,66,0.55)) drop-shadow(0 0 26px rgba(245,197,66,0.30));
}
.rgh-divider{ display:block; margin:6px 0 10px 4px; }
.rgh-sub{ color:var(--w-muted); font-size:15px; letter-spacing:.01em; }

.rgh-wrap button.rgh-refresh{
  display:inline-flex; align-items:center; gap:10px;
  padding:12px 22px; border-radius:14px; cursor:pointer;
  background:rgba(10,22,64,0.55); color:#dbe7ff;
  border:1.5px solid var(--w-blue);
  box-shadow:inset 0 0 0 1px rgba(47,123,255,0.25), 0 0 18px var(--w-blue-glow), 0 0 2px var(--w-blue);
  font-weight:600; font-size:15px; transition:all .18s ease; margin-top:28px;
}
.rgh-wrap button.rgh-refresh:hover{ background:rgba(47,123,255,0.18); color:#fff; box-shadow:0 0 26px rgba(47,123,255,0.65), 0 0 3px var(--w-blue); }
.rgh-refresh.spinning .ico{ animation:rghspin .8s linear infinite; }
@keyframes rghspin{ to{ transform:rotate(360deg); } }

/* ---------- spotlight cards (painted art: frame + platform are part of the PNG) ---------- */
.rgh-topcards{ display:grid; grid-template-columns:1fr 1fr; gap:22px; margin-bottom:24px; }
.rgh-topcard{
  position:relative; overflow:hidden; border-radius:12px;
  aspect-ratio:2048 / 768; min-height:0;
  background:#07102b url('../RagnaArtifacts/img/ranking/longest_card.png') center / cover no-repeat;
  box-shadow:0 14px 44px rgba(0,0,0,0.55), 0 0 30px rgba(47,123,255,0.28);
  display:flex; align-items:center;
  padding:5.5% 40% 5.5% 4.6%;
}
.rgh-topcard.killer{
  background:#120d07 url('../RagnaArtifacts/img/ranking/best_killer_card.png') center / cover no-repeat;
  box-shadow:0 14px 44px rgba(0,0,0,0.55), 0 0 30px rgba(245,197,66,0.26);
}
.rgh-topcard-info{ flex:1; min-width:0; position:relative; z-index:1; }

.rgh-badge-row{ display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.rgh-badge-ico{
  width:clamp(44px, 4.2vw, 56px); height:clamp(44px, 4.2vw, 56px); border-radius:50%; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--w-gold); background:radial-gradient(circle at 50% 35%, #2a1d0a, #120d07);
  border:2px solid var(--w-gold);
  box-shadow:0 0 0 3px rgba(245,197,66,0.16), 0 0 20px rgba(245,197,66,0.45), inset 0 0 14px rgba(245,197,66,0.25);
}
.rgh-badge-ico svg{ width:50%; height:50%; }
.rgh-topcard:not(.killer) .rgh-badge-ico{
  color:var(--w-cyan); background:radial-gradient(circle at 50% 35%, #0e2156, #07102b); border-color:var(--w-blue);
  box-shadow:0 0 0 3px rgba(47,123,255,0.16), 0 0 20px rgba(47,123,255,0.55), inset 0 0 14px rgba(47,123,255,0.30);
}
.rgh-topcard .badge-pill{
  display:inline-flex; align-items:center; gap:12px;
  font-family:var(--w-serif) !important; font-size:clamp(11px, 1vw, 13px); font-weight:700;
  letter-spacing:.24em; text-transform:uppercase; color:var(--w-gold);
  text-shadow:0 0 12px rgba(245,197,66,0.55), 0 1px 2px rgba(0,0,0,0.8);
}
.rgh-topcard .badge-pill::before, .rgh-topcard .badge-pill::after{
  content:""; width:34px; height:1px; flex-shrink:0;
  background:linear-gradient(90deg, transparent, currentColor);
}
.rgh-topcard .badge-pill::after{ background:linear-gradient(90deg, currentColor, transparent); }
.rgh-topcard .badge-pill.streak{ color:var(--w-cyan); text-shadow:0 0 12px rgba(94,200,255,0.6), 0 1px 2px rgba(0,0,0,0.8); }

.rgh-topcard .name{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  font-family:var(--w-serif) !important; font-size:clamp(22px, 2.4vw, 34px); font-weight:700; color:#fff;
  line-height:1.1; margin-bottom:8px; text-shadow:0 2px 10px rgba(0,0,0,0.8), 0 0 24px rgba(0,0,0,0.6);
}
.rgh-topcard .class-tag{
  display:inline-block; font-family:var(--w-sans); font-size:13px; font-weight:600; letter-spacing:0;
  color:#8ec5ff; background:rgba(8,18,50,0.65); border:1.5px solid var(--w-blue);
  padding:4px 14px; border-radius:999px; box-shadow:0 0 12px rgba(47,123,255,0.35); text-shadow:none;
}
.rgh-topcard .stat{ color:#d5ddf5; font-size:clamp(14px, 1.25vw, 17px); display:flex; align-items:center; gap:12px; flex-wrap:wrap; text-shadow:0 1px 3px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.6); }
.rgh-topcard .stat strong{ color:#fff; font-weight:800; font-variant-numeric:tabular-nums; }
.rgh-topcard .stat .sep{ color:rgba(255,255,255,0.35); }
.rgh-topcard .stat.sub{ font-size:12px; margin-top:3px; color:#aab4d4; }

.rgh-wrap button.rgh-pm-btn.rgh-cta{
  display:inline-flex; align-items:center; gap:10px; margin-top:12px; cursor:pointer;
  padding:10px 20px; border-radius:12px; font-size:14px; font-weight:600;
  color:#ffe6a3; background:rgba(20,14,4,0.62); border:1.5px solid var(--w-gold);
  box-shadow:0 0 14px rgba(245,197,66,0.30), inset 0 0 12px rgba(245,197,66,0.10);
  transition:all .18s ease;
}
.rgh-wrap button.rgh-pm-btn.rgh-cta:hover{ background:rgba(245,197,66,0.22); color:#fff; box-shadow:0 0 22px rgba(245,197,66,0.5); }
.rgh-wrap .rgh-topcard:not(.killer) button.rgh-pm-btn.rgh-cta{
  color:#cfe3ff; background:rgba(6,14,40,0.62); border-color:var(--w-blue);
  box-shadow:0 0 14px rgba(47,123,255,0.45), inset 0 0 12px rgba(47,123,255,0.12);
}
.rgh-wrap .rgh-topcard:not(.killer) button.rgh-pm-btn.rgh-cta:hover{ background:rgba(47,123,255,0.28); color:#fff; }

/* Sprite stands on the painted platform: its centre sits at ~77.5% x / ~76% y of the artwork. */
.rgh-topcard-sprite{
  position:absolute; z-index:1; left:77.5%; bottom:23%;
  width:34%; height:62%; transform:translateX(-50%);
  display:flex; align-items:flex-end; justify-content:center;
  color:var(--w-dim); overflow:visible; pointer-events:none;
}
.rgh-topcard-sprite img{
  width:auto; height:150%; max-width:none; margin-bottom:0;
  object-fit:contain; image-rendering:pixelated;
  filter:drop-shadow(0 12px 10px rgba(0,0,0,0.75)) drop-shadow(0 0 18px rgba(245,197,66,0.25));
}
.rgh-topcard:not(.killer) .rgh-topcard-sprite img{ filter:drop-shadow(0 12px 10px rgba(0,0,0,0.75)) drop-shadow(0 0 18px rgba(94,200,255,0.30)); }
.rgh-topcard-sprite > svg{ width:36px; height:36px; margin-bottom:8px; }

/* ---------- filter bar ---------- */
.rgh-controls{
  display:flex; flex-direction:column; gap:12px;
  background:var(--w-panel); border:1.5px solid rgba(47,123,255,0.55);
  border-radius:18px; padding:16px; margin-bottom:22px;
  box-shadow:0 0 0 1px rgba(47,123,255,0.12), 0 0 24px rgba(47,123,255,0.22), inset 0 0 30px rgba(47,123,255,0.06);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.rgh-controls-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.rgh-vsep{ width:1px; height:30px; background:rgba(120,150,220,0.30); flex-shrink:0; }
.rgh-tabs{
  display:inline-flex; background:var(--w-panel-2);
  border:1px solid rgba(47,123,255,0.40); border-radius:12px; padding:4px;
}
.rgh-wrap .rgh-tab, .rgh-modal .rgh-tab{
  border:none; background:transparent; color:#aab7dc;
  font-family:var(--w-sans); font-weight:600; font-size:14px;
  padding:10px 22px; border-radius:9px; cursor:pointer; transition:all .18s ease;
  white-space:nowrap; box-shadow:none;
}
.rgh-wrap .rgh-tab:hover, .rgh-modal .rgh-tab:hover{ color:#fff; background:rgba(47,123,255,0.10); }
.rgh-wrap .rgh-tab.active, .rgh-modal .rgh-tab.active{
  background:linear-gradient(180deg, #3d8bff, var(--w-blue-2)); color:#fff;
  box-shadow:0 0 14px rgba(47,123,255,0.60), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.rgh-wrap .rgh-tabs.view .rgh-tab.active{
  background:linear-gradient(180deg, var(--w-gold), var(--w-gold-2)); color:#241a05;
  box-shadow:0 0 14px rgba(245,197,66,0.50), inset 0 0 0 1px rgba(255,255,255,0.22);
}

.rgh-field{
  position:relative; display:flex; align-items:center; gap:10px;
  background:var(--w-panel-2); border:1px solid rgba(47,123,255,0.40);
  border-radius:12px; padding:0 12px 0 14px; flex:1; min-width:200px; max-width:320px;
  transition:border-color .18s ease, box-shadow .18s ease; margin:0; cursor:pointer;
}
.rgh-field:focus-within{ border-color:var(--w-blue); box-shadow:0 0 12px rgba(47,123,255,0.35); }
.rgh-field .ico{ color:#9fb3e6; flex-shrink:0; pointer-events:none; }
.rgh-field .chev{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:#9fb3e6; pointer-events:none; }
.rgh-wrap select.rgh-select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  flex:1; min-width:0; width:100%;
  background:transparent !important; border:none !important; box-shadow:none !important;
  color:#e6ecff !important; font-family:var(--w-sans); font-size:14px; font-weight:600;
  padding:12px 28px 12px 0 !important; border-radius:0; outline:none; cursor:pointer;
}
.rgh-wrap select.rgh-select option{ background:#0b1430; color:#e6ecff; }

.rgh-search-wrap{
  display:flex; align-items:center; gap:12px; width:100%;
  background:var(--w-panel-2); border:1px solid rgba(47,123,255,0.40);
  border-radius:12px; padding:0 16px; transition:border-color .18s ease, box-shadow .18s ease;
}
.rgh-search-wrap:focus-within{ border-color:var(--w-blue); box-shadow:0 0 12px rgba(47,123,255,0.35); }
.rgh-search-ico{ width:18px; height:18px; flex-shrink:0; color:#9fb3e6; pointer-events:none; }
.rgh-wrap input.rgh-search-input{
  flex:1; width:100%; min-width:0; height:auto;
  background:transparent !important; border:none !important; box-shadow:none !important; outline:none !important;
  color:var(--w-text) !important; font-family:var(--w-sans) !important;
  font-size:14px !important; font-weight:500;
  padding:13px 0 !important; margin:0 !important; border-radius:0; cursor:text;
}
.rgh-wrap input.rgh-search-input:focus{ background:transparent !important; border:none !important; box-shadow:none !important; }
.rgh-wrap input.rgh-search-input::placeholder{ color:var(--w-muted) !important; opacity:1; }

/* ---------- table ---------- */
.rgh-card-table{
  background:var(--w-panel); border:1.5px solid rgba(47,123,255,0.50);
  border-radius:18px; padding:6px 12px 12px;
  box-shadow:0 0 0 1px rgba(47,123,255,0.12), 0 0 24px rgba(47,123,255,0.20), 0 14px 40px rgba(0,0,0,0.40), inset 0 0 30px rgba(47,123,255,0.05);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.rgh-table-wrap{ overflow-x:auto; }
.rgh-table{ width:100%; border-collapse:separate; border-spacing:0 8px; min-width:900px; }
.rgh-table thead th{
  background:transparent; border:none;
  font-family:var(--w-sans); font-size:12px; font-weight:700;
  letter-spacing:.18em; text-transform:uppercase; color:var(--w-muted);
  text-align:left; padding:10px 18px 2px; white-space:nowrap;
}
.rgh-table thead th .th-in{ display:inline-flex; align-items:center; gap:8px; }
.rgh-table thead th .th-in svg{ color:#55659a; flex-shrink:0; }
.rgh-table thead th.is-sorted{ color:#d8e2ff; }
.rgh-table thead th.is-sorted .th-in svg{ color:var(--w-gold); filter:drop-shadow(0 0 4px rgba(245,197,66,0.6)); }
.rgh-table thead th[style*="center"] .th-in{ justify-content:center; width:100%; }

.rgh-table tbody td{
  padding:12px 18px; font-size:14px; vertical-align:middle;
  background:var(--w-row);
  border-top:1px solid var(--w-line-2); border-bottom:1px solid var(--w-line-2);
  transition:background .15s ease;
}
.rgh-table tbody td:first-child{ border-left:1px solid var(--w-line-2); border-radius:14px 0 0 14px; }
.rgh-table tbody td:last-child{ border-right:1px solid var(--w-line-2); border-radius:0 14px 14px 0; }
.rgh-table tbody tr:hover td{ background:var(--w-row-hover); }

/* rank #1 row: gold gradient frame + glow */
.rgh-table tbody tr.rgh-rank1 td{
  background:linear-gradient(90deg, rgba(64,44,10,0.88) 0%, rgba(30,24,14,0.88) 55%, rgba(12,18,44,0.88) 100%);
  border-top-color:#f7cf5a; border-bottom-color:#b8801a;
  box-shadow:0 0 18px rgba(245,197,66,0.14), inset 0 0 24px rgba(245,197,66,0.06);
}
.rgh-table tbody tr.rgh-rank1 td:first-child{ border-left-color:var(--w-gold); box-shadow:-2px 0 14px rgba(245,197,66,0.30), inset 0 0 24px rgba(245,197,66,0.06); }
.rgh-table tbody tr.rgh-rank1 td:last-child{ border-right-color:var(--w-gold-2); box-shadow:2px 0 14px rgba(245,197,66,0.22), inset 0 0 24px rgba(245,197,66,0.06); }
.rgh-table tbody tr.rgh-rank1:hover td{ background:linear-gradient(90deg, rgba(76,52,12,0.92) 0%, rgba(36,28,16,0.92) 55%, rgba(16,24,56,0.92) 100%); }

.rgh-pos{ display:flex; align-items:center; gap:10px; font-weight:700; font-size:14px; }
.rgh-pos-medal{
  width:34px; height:34px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800; font-variant-numeric:tabular-nums;
  background:var(--w-panel-2); color:#c7d2f0; border:1px solid rgba(120,150,220,0.35);
}
.rgh-pos-medal.gold{
  background:linear-gradient(135deg, var(--w-gold-3), var(--w-gold) 50%, var(--w-gold-2));
  color:#2a1c05; border-color:var(--w-gold-3);
  box-shadow:0 0 14px rgba(245,197,66,0.55);
}
.rgh-pos-medal.silver{ background:linear-gradient(135deg, #f1f4fb, #b8c0d2 55%, #7f889c); color:#1a1f2e; border-color:#e5ebf5; box-shadow:0 0 10px rgba(200,210,235,0.35); }
.rgh-pos-medal.bronze{ background:linear-gradient(135deg, #f0a872, #c7733c 55%, #8d4f23); color:#1a1308; border-color:#e89260; box-shadow:0 0 10px rgba(232,146,96,0.35); }
.rgh-laurel{ position:relative; width:68px; height:60px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.rgh-laurel > svg{ position:absolute; inset:0; width:100%; height:100%; filter:drop-shadow(0 0 6px rgba(245,197,66,0.5)); }
.rgh-laurel .rgh-pos-medal{ position:relative; z-index:1; margin-top:8px; width:36px; height:36px; font-size:16px; font-family:var(--w-serif); }

.rgh-player{ display:flex; align-items:center; gap:16px; min-width:240px; }
.rgh-avatar{
  width:60px; height:72px; flex-shrink:0;
  display:flex; align-items:flex-end; justify-content:center;
  background:transparent; color:var(--w-dim);
  position:relative; overflow:hidden; border-radius:12px;
}
.rgh-avatar img{
  width:auto; height:200%; max-width:none; margin-bottom:-15%;
  object-fit:none; image-rendering:pixelated;
  filter:drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}
.rgh-player-info .name{ font-family:var(--w-serif); font-weight:700; font-size:17px; color:#fff; line-height:1.2; }
.rgh-player-info .class{ font-size:13px; color:var(--w-muted); margin-top:3px; }

.rgh-guild{ display:flex; align-items:center; gap:12px; }
.rgh-emblem{
  width:40px; height:40px; flex-shrink:0;
  background:rgba(47,123,255,0.10); border:1.5px solid var(--w-blue);
  border-radius:9px; box-shadow:0 0 10px rgba(47,123,255,0.35);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden; padding:3px; color:var(--w-cyan);
}
.rgh-emblem img{ max-width:100%; max-height:100%; image-rendering:pixelated; }
.rgh-emblem.default-emblem{ color:var(--w-cyan); }
.rgh-emblem.empty{ color:var(--w-dim); font-size:11px; border-color:rgba(120,150,220,0.3); box-shadow:none; background:var(--w-panel-2); }
.rgh-guild-name{ font-weight:600; font-size:15px; color:#e6ecff; }

.rgh-pill{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:90px; padding:9px 18px; border-radius:999px;
  background:var(--w-panel-2); border:1px solid rgba(120,150,220,0.35);
  font-family:var(--w-sans); font-size:14px; font-weight:700; color:#fff;
  font-variant-numeric:tabular-nums; box-shadow:inset 0 0 12px rgba(47,123,255,0.08);
}
.rgh-pill.streak-hot{ color:var(--w-gold); border-color:rgba(245,197,66,0.5); box-shadow:0 0 10px rgba(245,197,66,0.25); }
.rgh-muted-dash{ color:var(--w-dim); }

.rgh-empty{ padding:60px 20px; text-align:center; color:var(--w-muted); }
.rgh-empty .big{ font-family:var(--w-serif); font-size:20px; color:#fff; font-weight:700; margin-bottom:8px; }

/* ---------- expandable player rows ---------- */
.rgh-prow{ cursor:pointer; }
.rgh-chev{ display:inline-flex; color:var(--w-muted); transition:transform .2s ease, color .2s ease; }
.rgh-prow.is-open .rgh-chev{ transform:rotate(180deg); color:var(--w-gold); }
.rgh-prow.is-open td{ background:var(--w-row-hover); }

.rgh-detail-row{ display:none; }
.rgh-detail-row.is-open{ display:table-row; }
.rgh-detail-row > td{
  padding:0 !important; background:rgba(6,12,34,0.88) !important;
  border:1px solid rgba(47,123,255,0.35) !important; border-radius:14px !important;
  box-shadow:inset 0 0 30px rgba(47,123,255,0.06);
}
.rgh-detail{ padding:18px; animation:rghDetailIn .22s ease; }
@keyframes rghDetailIn{ from{ opacity:0; transform:translateY(-6px); } to{ opacity:1; transform:none; } }

.rgh-sess-head{
  display:flex; align-items:center; gap:10px; margin-bottom:12px;
  font-family:var(--w-serif); color:var(--w-gold); font-size:12px; font-weight:700;
  letter-spacing:.2em; text-transform:uppercase; text-shadow:0 0 10px rgba(245,197,66,0.4);
}
.rgh-sess-tiles{ display:grid; grid-template-columns:repeat(5,1fr); gap:10px; }
.rgh-tile{
  background:var(--w-row); border:1px solid rgba(47,123,255,0.25);
  border-radius:12px; padding:16px 12px;
  display:flex; flex-direction:column; align-items:center; gap:5px; text-align:center;
}
.rgh-tile .tv{ font-family:var(--w-sans); font-size:22px; font-weight:800; color:#fff; line-height:1; font-variant-numeric:tabular-nums; }
.rgh-tile .tv.pos{ color:var(--w-alive); }
.rgh-tile .tv.neg{ color:var(--w-dead); }
.rgh-tile .tv.warn{ color:var(--w-gold); }
.rgh-tile .tv.info{ color:var(--w-cyan); }
.rgh-tile .tl{ font-size:11px; color:var(--w-muted); text-transform:uppercase; letter-spacing:.08em; }
.rgh-detail-actions{ margin-top:12px; display:flex; justify-content:flex-end; }

/* ---------- player profile modal ---------- */
.rgh-modal{ position:fixed; inset:0; z-index:9999; display:flex; align-items:flex-start; justify-content:center; padding:40px 16px; overflow-y:auto; font-family:var(--w-sans); }
.rgh-modal[hidden]{ display:none; }
.rgh-modal-bg{ position:fixed; inset:0; background:rgba(3,6,18,0.82); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
.rgh-modal-box{
  position:relative; width:100%; max-width:680px;
  background:linear-gradient(180deg, #0c1636 0%, #080f28 100%);
  border:1.5px solid rgba(47,123,255,0.5); border-radius:20px;
  box-shadow:0 30px 80px rgba(0,0,0,0.65), 0 0 30px rgba(47,123,255,0.25);
  color:var(--w-text); animation:rghDetailIn .2s ease;
}
.rgh-modal button.rgh-modal-x{
  position:absolute; top:12px; right:14px; width:36px; height:36px; border-radius:50%;
  border:1px solid rgba(120,150,220,0.35); background:rgba(255,255,255,0.04); color:var(--w-muted);
  font-size:20px; line-height:1; cursor:pointer; z-index:2; padding:0; box-shadow:none;
}
.rgh-modal button.rgh-modal-x:hover{ color:#fff; border-color:var(--w-blue); box-shadow:0 0 10px rgba(47,123,255,0.4); }
.rgh-pm-head{ display:flex; gap:22px; align-items:center; padding:28px 28px 22px; border-bottom:1px solid rgba(120,150,220,0.2); }
.rgh-pm-sprite{ width:120px; height:140px; flex-shrink:0; display:flex; align-items:flex-end; justify-content:center; overflow:visible; }
.rgh-pm-sprite img{ height:150%; width:auto; max-width:none; image-rendering:pixelated; filter:drop-shadow(0 8px 12px rgba(0,0,0,0.6)); }
.rgh-pm-name{ font-family:var(--w-serif); font-size:28px; font-weight:700; line-height:1.15; color:#fff; word-break:break-word; text-shadow:0 2px 10px rgba(0,0,0,0.5); }
.rgh-pm-sub{ margin-top:6px; color:var(--w-muted); font-size:14px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rgh-pm-sub b{ color:#fff; font-weight:600; }
.rgh-pm-sub .rgh-emblem{ width:26px; height:26px; border-radius:6px; padding:2px; }
.rgh-pm-actions{ display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.rgh-modal button.rgh-pm-btn, .rgh-wrap button.rgh-pm-btn{
  border:1.5px solid rgba(120,150,220,0.40); background:rgba(47,123,255,0.08); color:#dbe7ff;
  font-family:var(--w-sans); font-weight:600; font-size:13px;
  padding:9px 15px; border-radius:10px; cursor:pointer; box-shadow:none; transition:all .18s ease;
}
.rgh-modal button.rgh-pm-btn:hover, .rgh-wrap button.rgh-pm-btn:hover{ border-color:var(--w-blue); background:rgba(47,123,255,0.18); color:#fff; box-shadow:0 0 12px rgba(47,123,255,0.4); }
.rgh-modal button.rgh-pm-btn.primary, .rgh-wrap button.rgh-pm-btn.primary{
  background:linear-gradient(180deg, var(--w-gold), var(--w-gold-2)); color:#241a05; border-color:var(--w-gold-3);
  box-shadow:0 0 14px rgba(245,197,66,0.35);
}
.rgh-modal button.rgh-pm-btn.primary:hover, .rgh-wrap button.rgh-pm-btn.primary:hover{ filter:brightness(1.08); color:#241a05; box-shadow:0 0 20px rgba(245,197,66,0.5); }
.rgh-modal button.rgh-pm-btn.is-done, .rgh-wrap button.rgh-pm-btn.is-done{ border-color:var(--w-alive); color:var(--w-alive); }
.rgh-pm-body{ padding:20px 28px 28px; }
.rgh-pm-sech{
  display:flex; justify-content:space-between; align-items:baseline; gap:12px;
  font-family:var(--w-serif); font-size:12px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; color:#d8e2ff; margin:22px 0 10px;
}
.rgh-pm-sech:first-child{ margin-top:0; }
.rgh-pm-sech .r{ font-family:var(--w-sans); font-weight:500; letter-spacing:0; text-transform:none; color:var(--w-muted); font-size:12px; }
.rgh-pm-sech .r b{ color:var(--w-gold); }
.rgh-pm-records{ display:flex; flex-wrap:wrap; gap:10px; }
.rgh-pm-record{
  min-width:120px; padding:12px 14px; border-radius:12px;
  background:linear-gradient(180deg, rgba(245,197,66,0.16), rgba(201,138,26,0.05)); border:1px solid rgba(245,197,66,0.40);
  box-shadow:0 0 12px rgba(245,197,66,0.12);
}
.rgh-pm-record .v{ font-size:20px; font-weight:800; color:#fff; font-variant-numeric:tabular-nums; }
.rgh-pm-record .l{ font-size:12px; color:var(--w-muted); margin-top:2px; }
.rgh-pm-record .l em{ font-style:normal; color:var(--w-gold); }
.rgh-pm-tabs{ margin-bottom:12px; }
.rgh-pm-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:10px; }
.rgh-pm-grid.small{ grid-template-columns:repeat(3,1fr); }
.rgh-pm-grid .rgh-tile{ padding:14px 10px; align-items:flex-start; text-align:left; gap:3px; }
.rgh-pm-grid .rgh-tile .tv{ font-size:19px; }
.rgh-pm-grid .rgh-tile .tl{ text-transform:none; letter-spacing:0; font-size:12px; }
.rgh-pm-grid .rgh-tile .tr{ font-size:11px; color:var(--w-gold); font-weight:700; }
.rgh-pm-bars{ display:flex; flex-direction:column; gap:10px; }
.rgh-pm-bar{ display:grid; grid-template-columns:150px 1fr 70px; align-items:center; gap:12px; font-size:13px; }
.rgh-pm-bar .n{ color:var(--w-text); font-weight:500; }
.rgh-pm-bar .t{ height:6px; background:rgba(255,255,255,0.06); border-radius:99px; overflow:hidden; }
.rgh-pm-bar .t i{ display:block; height:100%; background:linear-gradient(90deg, var(--w-blue-2), var(--w-cyan)); border-radius:99px; }
.rgh-pm-bar.enemy .t i{ background:linear-gradient(90deg, #c0233f, var(--w-dead)); }
.rgh-pm-bar.ally .t i{ background:linear-gradient(90deg, #17a85a, var(--w-alive)); }
.rgh-pm-bar .c{ text-align:right; font-weight:700; color:var(--w-text); font-variant-numeric:tabular-nums; }
.rgh-pm-empty{ color:var(--w-muted); font-size:13px; padding:8px 0; }
.rgh-pm-loading{ padding:60px 20px; text-align:center; color:var(--w-muted); }
.rgh-pm-shot{ padding:20px 28px 28px; }
.rgh-pm-shot canvas{ width:100%; height:auto; border-radius:14px; border:1px solid rgba(120,150,220,0.3); display:block; }
.rgh-pm-shot-actions{ display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; }
.rgh-player-link{ cursor:pointer; border-radius:10px; }
.rgh-player-link:hover .name{ color:var(--w-gold); text-decoration:underline; text-underline-offset:3px; }

/* ---------- responsive ---------- */
@media (max-width:1000px){
  .rgh-topcards{ grid-template-columns:1fr; }
}
@media (max-width:760px){
  .rgh-wrap{ padding:28px 16px 60px; }
  .rgh-title{ font-size:40px; }
  .rgh-ornament{ margin-left:8px; }
  .rgh-sub{ font-size:13px; }
  .rgh-wrap button.rgh-refresh{ margin-top:0; width:100%; justify-content:center; }
  .rgh-topcard{ aspect-ratio:auto; min-height:230px; padding:22px 42% 22px 20px; background-position:right center; background-size:cover; }
  .rgh-topcard-sprite{ left:auto; right:6%; transform:none; width:36%; height:60%; bottom:18%; }
  .rgh-topcard .name{ font-size:24px; }
  .rgh-controls-row{ flex-direction:column; align-items:stretch; }
  .rgh-vsep{ display:none; }
  .rgh-tabs{ width:100%; }
  .rgh-wrap .rgh-tab{ flex:1; text-align:center; padding:10px 8px; }
  .rgh-field{ max-width:none; width:100%; }
  .rgh-avatar{ width:60px; height:60px; }
  .rgh-sess-tiles{ grid-template-columns:repeat(2,1fr); }
  .rgh-modal{ padding:16px 8px; }
  .rgh-pm-head{ flex-direction:column; align-items:flex-start; padding:22px 18px 18px; }
  .rgh-pm-body, .rgh-pm-shot{ padding:16px 18px 22px; }
  .rgh-pm-grid{ grid-template-columns:repeat(2,1fr); }
  .rgh-pm-grid.small{ grid-template-columns:repeat(3,1fr); }
  .rgh-pm-bar{ grid-template-columns:110px 1fr 60px; }
}
@media (prefers-reduced-motion: reduce){
  .rgh-bg::before{ animation:none; }
  .rgh-refresh.spinning .ico{ animation:none; }
}

/* =====================================================================
   Shared additions (pages whose rank badge is not server-rendered)
   ===================================================================== */
/* CSS-only laurel: any element with .rgh-laurel-css gets the wreath + crown behind it. */
.rgh-laurel-css{ position:relative; margin:10px 17px 4px; }
.rgh-laurel-css::before{
  content:""; position:absolute; left:-17px; right:-17px; top:-14px; bottom:-10px; z-index:-1;
  background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 60'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffe08a'/%3E%3Cstop offset='1' stop-color='%23c98a1a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23g)' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M31 56C16 52 7 40 9 20'/%3E%3Cpath d='M37 56C52 52 61 40 59 20'/%3E%3C/g%3E%3Cg fill='url(%23g)'%3E%3Cellipse cx='25' cy='53' rx='2.6' ry='5.6' transform='rotate(-72 25 53)'/%3E%3Cellipse cx='18' cy='48' rx='2.6' ry='5.6' transform='rotate(-55 18 48)'/%3E%3Cellipse cx='13' cy='41' rx='2.6' ry='5.6' transform='rotate(-35 13 41)'/%3E%3Cellipse cx='10' cy='33' rx='2.6' ry='5.6' transform='rotate(-15 10 33)'/%3E%3Cellipse cx='9' cy='24' rx='2.6' ry='5.6'/%3E%3Cellipse cx='43' cy='53' rx='2.6' ry='5.6' transform='rotate(72 43 53)'/%3E%3Cellipse cx='50' cy='48' rx='2.6' ry='5.6' transform='rotate(55 50 48)'/%3E%3Cellipse cx='55' cy='41' rx='2.6' ry='5.6' transform='rotate(35 55 41)'/%3E%3Cellipse cx='58' cy='33' rx='2.6' ry='5.6' transform='rotate(15 58 33)'/%3E%3Cellipse cx='59' cy='24' rx='2.6' ry='5.6'/%3E%3Cpath d='M25.5 10.5l4 4.5 4.5-7 4.5 7 4-4.5-2 9.5h-13z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter:drop-shadow(0 0 6px rgba(245,197,66,0.5));
}
.rgh-pos-medal.rgh-laurel-css{ width:36px; height:36px; font-size:16px; font-family:var(--w-serif); z-index:0; }

/* three spotlight cards in a row (GvG) */
.rgh-topcards.three{ grid-template-columns:repeat(3,1fr); gap:18px; }
.rgh-topcards.three .rgh-topcard{ padding:4.5% 38% 4.5% 4.6%; }
.rgh-topcards.three .rgh-topcard .name{ font-size:clamp(18px, 1.55vw, 24px); margin-bottom:4px; }
.rgh-topcards.three .rgh-badge-row{ margin-bottom:8px; }
.rgh-topcards.three .rgh-badge-ico{ width:clamp(36px, 3vw, 44px); height:clamp(36px, 3vw, 44px); }
.rgh-topcards.three .rgh-topcard .badge-pill{ font-size:clamp(10px, .8vw, 12px); letter-spacing:.18em; }
.rgh-topcards.three .rgh-topcard .badge-pill::before, .rgh-topcards.three .rgh-topcard .badge-pill::after{ width:18px; }
.rgh-topcards.three .rgh-topcard .stat{ font-size:clamp(12px, 1vw, 14px); }
.rgh-topcard-sprite .rgh-emblem-big{
  width:42%; max-width:96px; height:auto; image-rendering:pixelated; margin-bottom:12%;
  filter:drop-shadow(0 10px 12px rgba(0,0,0,0.7)) drop-shadow(0 0 16px rgba(94,200,255,0.35));
}
@media (max-width:1199px){
  .rgh-topcards.three{ grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); }
  .rgh-topcards.three .rgh-topcard{ aspect-ratio:auto; min-height:200px; padding:20px 40% 20px 20px; background-position:right center; }
  .rgh-topcards.three .rgh-topcard-sprite{ left:auto; right:6%; transform:none; width:36%; height:60%; bottom:18%; }
}

/* header-click sorting arrows injected by page scripts (GvG) */
.rgh-table thead th[data-sort]{ cursor:pointer; user-select:none; transition:color .15s ease; }
.rgh-table thead th[data-sort]:hover{ color:#d8e2ff; }
.rgh-table thead th .arr{ color:var(--w-gold); font-size:9px; margin-left:6px; text-shadow:0 0 6px rgba(245,197,66,0.6); }
.rgh-table thead th.num, .rgh-table tbody td.num{ text-align:center; }
.rgh-table thead th.asc .th-in svg, .rgh-table thead th.desc .th-in svg{ color:var(--w-gold); filter:drop-shadow(0 0 4px rgba(245,197,66,0.6)); }

/* pagination buttons created by page scripts (KoE) */
.rgh-pagination{ display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:18px; }
body .rgh-wrap .rgh-pagination button{
  min-width:40px; padding:9px 14px; border-radius:10px; cursor:pointer;
  background:var(--w-panel-2); border:1px solid rgba(47,123,255,0.40); color:#dbe7ff;
  font-family:var(--w-sans); font-weight:600; font-size:13px; box-shadow:none; transition:all .18s ease;
}
body .rgh-wrap .rgh-pagination button:hover{ border-color:var(--w-blue); background:rgba(47,123,255,0.18); color:#fff; box-shadow:0 0 12px rgba(47,123,255,0.4); }
body .rgh-wrap .rgh-pagination button.disabled{
  background:linear-gradient(180deg, var(--w-gold), var(--w-gold-2)); color:#241a05; border-color:var(--w-gold-3);
  box-shadow:0 0 12px rgba(245,197,66,0.35); cursor:default;
}
.rgh-muted-text{ color:var(--w-muted); font-size:13px; white-space:nowrap; }
.rgh-note{ color:var(--w-dim); font-size:12.5px; margin-top:6px; }
.rgh-pill.kd-good, .rgh-pill.kills-hot{ color:var(--w-alive); border-color:rgba(46,224,122,0.45); box-shadow:0 0 10px rgba(46,224,122,0.2); }
.rgh-pill.kills-hot{ color:var(--w-gold); border-color:rgba(245,197,66,0.5); box-shadow:0 0 10px rgba(245,197,66,0.25); }
.rgh-pill.kd-bad{ color:var(--w-dead); border-color:rgba(255,79,109,0.45); }
.rgh-pill.dmg{ color:var(--w-cyan); border-color:rgba(94,200,255,0.45); }
