:root {
    color-scheme: dark;
    --bg-color:#0b1420; --text-color:#f4f3ee; --card-bg:#172330;
    --header-bg:rgba(11,18,25,.94); --header-text:#f5eedb;
    --border-color:rgba(171,191,204,.2); --sub-text:#b2bfcc;
    --gold:#e4bf70; --green:#65cba9; --primary-red:#e4bf70;
    --accent-red-bg:rgba(228,191,112,.1); --path-accent:#e4bf70;
    --blue:#50c6f1; --surface:rgba(18,28,39,.9);
    --rank-background:url('/uploads/background/cultivation-night.webp');
    --rank-banner:url('/uploads/background/cultivation-night.webp');
    --rank-ground:#0b1420;
    --rank-tile-height:calc(min(100vw,724px) * 2);
}
* {box-sizing:border-box}
html {scroll-behavior:smooth;scroll-padding-top:140px}
body {position:relative;min-height:100vh;margin:0;background:var(--rank-ground);color:var(--text-color);font-family:"Noto Sans Myanmar","Myanmar Text",system-ui,sans-serif;line-height:1.8;padding-bottom:100px;isolation:isolate}
/* Bounded-width scenery repeats down the document. No full-page enlargement. */
body::before {content:"";position:absolute;inset:0;z-index:-2;background-color:var(--rank-ground);background-image:repeating-linear-gradient(to bottom,var(--rank-ground) 0,transparent calc(var(--rank-tile-height) * .09),transparent calc(var(--rank-tile-height) * .91),var(--rank-ground) var(--rank-tile-height)),var(--rank-background);background-position:center top;background-size:100% var(--rank-tile-height),min(100%,724px) var(--rank-tile-height);background-repeat:repeat-y;background-attachment:scroll;pointer-events:none}
body::after {content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(5,12,20,.2),rgba(5,12,20,.08) 45%,rgba(5,12,20,.25));pointer-events:none}
button,a,input { -webkit-tap-highlight-color:transparent }
button {font:inherit}
button,a {touch-action:manipulation}
button {cursor:pointer}
button:disabled {cursor:not-allowed}
a {color:inherit}
:focus-visible {outline:3px solid var(--blue);outline-offset:5px}
header {position:sticky;top:0;z-index:40;min-height:64px;padding:12px max(18px,calc((100vw - 820px)/2));display:flex;gap:16px;align-items:center;justify-content:space-between;background:var(--header-bg);border-bottom:1px solid var(--border-color);backdrop-filter:blur(16px)}
.back-btn {display:inline-flex;align-items:center;gap:8px;min-height:40px;text-decoration:none;color:var(--gold);font-size:.8rem;font-weight:650;white-space:nowrap}
.site-title {display:flex;align-items:center;gap:10px;font-family:Georgia,serif;font-size:clamp(.86rem,3vw,1.1rem);font-weight:700;text-align:right;color:var(--header-text)}
.brand-mark {width:27px;height:27px;flex:none;color:var(--gold)}
.container {width:calc(100% - 28px);max-width:680px;margin:22px auto 0;position:relative}
.hero-banner-profile {display:flex;align-items:center;gap:18px;border:1px solid rgba(228,191,112,.38);border-radius:22px;padding:22px;background-color:#13212c;background-image:linear-gradient(90deg,rgba(9,18,26,.92),rgba(9,18,26,.78) 48%,rgba(9,18,26,.12)),var(--rank-banner);background-size:cover;background-position:center,right center;background-repeat:no-repeat;box-shadow:0 16px 40px rgba(0,0,0,.18);margin-bottom:18px;backdrop-filter:blur(8px)}
.hero-avatar-wrapper {width:78px;height:78px;flex:none;border-radius:50%;border:2px solid var(--gold);display:grid;place-items:center;overflow:hidden;background:radial-gradient(circle at 25% 20%,#37637e,#142632 80%);box-shadow:0 0 0 5px rgba(228,191,112,.06)}
.hero-avatar-img {width:100%;height:100%;object-fit:cover;display:none}
.hero-avatar-letter {font:700 2.3rem Georgia,serif;color:#fff3cf}
.hero-info-wrapper {min-width:0;flex:1}
.hero-name-title {font-size:1.35rem;line-height:1.4;font-weight:750;overflow-wrap:anywhere;color:#fff9e9}
/* Long rank names get their own full line under the label. */
.hero-rank-line {align-items:flex-start;margin-top:8px;margin-bottom:5px}
.hero-rank-line > i {margin-top:5px}
.hero-rank-copy {display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.hero-rank-label {display:block;color:var(--sub-text);font-size:.75rem}
.hero-current-rank {display:block;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.9;font-size:.87rem}
.hero-stat-line {font-size:.78rem;display:flex;gap:8px;align-items:baseline;color:var(--sub-text)}
.hero-stat-line i {color:var(--gold);width:14px;flex:none}
.hero-current-rank {color:#f3e6c7;font-weight:650}
.hero-active-days {color:var(--gold);font-weight:700}
.journey-overview {display:none;border:1px solid var(--border-color);border-radius:18px;padding:15px 18px;background:rgba(15,27,38,.84);margin:0 0 16px;backdrop-filter:blur(8px)}
.progress-copy {display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:.76rem;color:var(--sub-text)}
.progress-next {color:#f4f4ef;font-size:.86rem;line-height:1.7;margin:3px 0 9px;font-weight:600}
.journey-overview progress {display:block;width:100%;height:7px;border:0;border-radius:20px;overflow:hidden;background:#314554;accent-color:var(--blue)}
.journey-overview progress::-webkit-progress-bar {background:#314554;border-radius:20px}
.journey-overview progress::-webkit-progress-value {background:linear-gradient(90deg,#2389ba,#6bd9fd);border-radius:20px}
.journey-overview progress::-moz-progress-bar {background:#50c6f1;border-radius:20px}
.journey-toolbar {display:none;position:sticky;top:65px;z-index:20;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(228,191,112,.22);border-radius:14px;background:rgba(11,22,32,.93);backdrop-filter:blur(10px)}
.journey-toolbar h1 {margin:0;font-size:.95rem;color:#ecdcba;font-weight:700}
.jump-current {border:1px solid rgba(228,191,112,.45);background:rgba(228,191,112,.09);color:var(--gold);border-radius:20px;padding:6px 12px;font-size:.72rem;white-space:nowrap;min-height:38px}
.duo-path-container {display:none;flex-direction:column;position:relative;max-width:580px;margin:20px auto 28px;padding:12px 0 0;isolation:isolate}
.journey-connections {position:absolute;inset:0;width:100%;height:100%;z-index:0;overflow:visible;pointer-events:none}
.journey-connection {fill:none;stroke:rgba(166,187,205,.5);stroke-width:4;stroke-linecap:round;stroke-dasharray:6 10}
.journey-connection.achieved {stroke:#49bce7;stroke-width:6;stroke-dasharray:none;filter:drop-shadow(0 0 5px rgba(44,176,228,.25))}
.duo-step-card {--node-x:50%;position:relative;display:block;width:100%;height:218px;flex:none;border:0;background:none;padding:0;margin:0;color:var(--text-color);text-align:center;scroll-margin-top:160px;z-index:1}
.duo-node-wrapper {position:absolute;left:var(--node-x);top:25px;transform:translateX(-50%);width:100px;height:100px;display:grid;place-items:center}
.duo-node {position:relative;display:grid;place-items:center;width:94px;height:94px;border-radius:50%;border:3px solid #9ba7b4;background:radial-gradient(circle at 32% 22%,#657080,#303b49 60%,#1c2733);color:#c3cbd6;box-shadow:0 7px 0 #18212c,0 12px 18px rgba(0,0,0,.36),inset 0 3px 4px rgba(255,255,255,.15);transition:transform .18s,filter .18s}
.duo-node::before {content:"";position:absolute;inset:6px;border:1px solid rgba(255,255,255,.22);border-radius:50%;pointer-events:none}
.duo-node::after {content:"";position:absolute;inset:10px;border:1px solid rgba(8,20,32,.3);border-radius:50%;pointer-events:none}
.rank-symbol {width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 2px 2px rgba(0,0,0,.35))}
.duo-step-card.completed .duo-node {border-color:#8cdcf2;background:radial-gradient(circle at 30% 20%,#6bd6f1,#1678a7 58%,#103c60);color:#effcff;box-shadow:0 7px 0 #103b59,0 10px 22px rgba(1,19,31,.4),inset 0 3px 5px rgba(255,255,255,.26)}
.duo-step-card.current .duo-node {width:106px;height:106px;border-color:#ffe5a0;background:radial-gradient(circle at 32% 20%,#fff2b6,#cf9a36 52%,#745022);color:#fff7d7;box-shadow:0 7px 0 #61451e,0 0 0 6px rgba(228,191,112,.16),0 0 32px rgba(236,185,75,.22),inset 0 3px 6px rgba(255,255,255,.5)}
.duo-step-card.current .rank-symbol {width:44px;height:44px;stroke-width:1.6}
.duo-step-card.current .duo-node::before {inset:7px;border-color:rgba(255,244,203,.85)}
.duo-step-card.peak .duo-node {border-color:#e4bf70}
.duo-step-card.locked.peak .duo-node {border-color:#909eac}
.duo-step-card:hover .duo-node {filter:brightness(1.12);transform:translateY(-2px)}
.duo-step-card:active .duo-node {transform:translateY(4px)}
.duo-step-card:focus-visible {outline:0}
.duo-step-card:focus-visible .duo-node {outline:3px solid #fff4cf;outline-offset:7px}
.current-badge-tag {position:absolute;left:50%;top:-22px;transform:translateX(-50%);padding:3px 12px;border-radius:20px;background:linear-gradient(135deg,#ffdf8b,#c49544);color:#302310;border:1px solid #ffeab1;box-shadow:0 4px 15px #09111d;font-size:.68rem;font-weight:800;white-space:nowrap;z-index:3}
.duo-info-card {position:absolute;left:var(--node-x);top:140px;transform:translateX(-50%);width:min(190px,47vw);border:0;background:none;padding:0;pointer-events:none}
.duo-rank-title {font-size:.84rem;line-height:1.8;font-weight:650;overflow-wrap:anywhere;color:#e9edf0;text-shadow:0 2px 5px #030a13,0 0 12px #030a13}
.duo-step-card.current .duo-rank-title {color:#ffe5a7;font-weight:750}
.duo-step-card.locked .duo-rank-title {color:#bac5d0}
.duo-req-days {display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:0 10px;margin-top:5px;border:1px solid rgba(174,197,216,.3);border-radius:16px;font-size:.7rem;line-height:1.9;background:rgba(10,22,34,.82);color:#d7e2ec}
.duo-step-card.current .duo-req-days {border-color:rgba(228,191,112,.65);color:#f6dfa5}
.rank-state {font-size:.59rem;letter-spacing:.08em;color:#b6d9ed;margin-top:2px}
.duo-step-card.locked .rank-state {color:#929faa}
.default-hero-banner {background:var(--surface);border:1px solid rgba(228,191,112,.4);border-radius:22px;padding:28px 20px;text-align:center;margin-bottom:20px;backdrop-filter:blur(8px)}
.btn-enter-cultivation {display:inline-flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,#e8ca86,#bd9042);color:#211c12;border:1px solid #f8dda5;border-radius:12px;padding:12px 18px;min-height:48px;font-size:.85rem;font-weight:700;margin-top:8px}
.table-card {background:var(--surface);border:1px solid var(--border-color);border-radius:18px;overflow:hidden;backdrop-filter:blur(8px)}
.table-wrapper {width:100%;overflow-x:auto}
table {width:100%;border-collapse:collapse;min-width:850px;text-align:left}
th,td {padding:14px;border-bottom:1px solid var(--border-color);font-size:.82rem;white-space:nowrap}
th {background:#172432;color:var(--gold);font-weight:700}
td.days-col,th.days-col {font-weight:700;color:var(--gold);text-align:center;border-right:1px solid var(--border-color)}
.modal-overlay {position:fixed;inset:0;background:rgba(0,5,12,.78);backdrop-filter:blur(8px);z-index:1000;display:none;align-items:center;justify-content:center;padding:16px}
.modal-box {background:#142332;color:var(--text-color);border:1px solid rgba(228,191,112,.5);border-radius:22px;width:100%;max-width:480px;max-height:85dvh;overflow-y:auto;padding:22px;box-shadow:0 24px 80px #030810}
.modal-top {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;border-bottom:1px solid var(--border-color);padding-bottom:12px}
.modal-top h3 {font-size:1rem;color:var(--gold);margin:0;line-height:1.8}
.close-btn {background:transparent;border:0;color:var(--sub-text);font-size:1.8rem;min-width:44px;min-height:44px}
.tier-info-box {background:#101c28;border:1px solid var(--border-color);border-radius:12px;padding:14px;margin-bottom:14px}
.tier-section-title {font-size:.85rem;font-weight:700;margin-bottom:8px}
.reward-title {color:#7ed7b1}.penalty-title {color:#f4a3a3}
.tier-list-desc {font-size:.8rem;line-height:1.9;color:var(--text-color);padding-left:20px}
.btn-claim-rank {width:100%;padding:12px;border:0;border-radius:12px;font-size:.85rem;font-weight:700;margin-top:10px;min-height:48px}
.btn-claim-active {background:linear-gradient(135deg,#e9cf90,#be9348);color:#201b12}.btn-claim-claimed {background:#273f4b;color:#a8d1c1}.btn-claim-locked {background:#233442;border:1px solid var(--border-color);color:#96a7b5}
.path-list {display:flex;flex-direction:column;gap:10px;margin-top:12px}
.path-option-card {background:#10202f;border:1px solid var(--border-color);border-radius:14px;padding:14px;cursor:pointer}
.path-option-card:hover {border-color:var(--gold)}
.path-title {font-size:.88rem;font-weight:700;color:var(--gold)}.path-desc {font-size:.76rem;color:var(--sub-text)}
.ranking-bottom-nav {position:fixed;bottom:0;left:0;right:0;z-index:60;display:flex;justify-content:center;gap:4px;background:rgba(10,18,25,.96);border-top:1px solid rgba(228,191,112,.2);padding:9px 10px calc(10px + env(safe-area-inset-bottom));backdrop-filter:blur(18px)}
.ranking-bottom-nav a {flex:1;max-width:130px;min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#b7c1cb;text-decoration:none;font-size:.63rem;line-height:1.5}
.ranking-bottom-nav svg {width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.ranking-bottom-nav a[aria-current="page"] {color:var(--gold)}
.ranking-bottom-nav a[aria-current="page"]::after {content:"";width:16px;height:2px;background:var(--gold);border-radius:3px;margin-top:3px}
@media(min-width:760px) {.container{margin-top:30px}.hero-banner-profile{padding:26px}.hero-name-title{font-size:1.65rem}.duo-step-card{height:232px}.duo-rank-title{font-size:.92rem}.duo-info-card{width:220px}.duo-node{width:100px;height:100px}.duo-node-wrapper{height:106px}.duo-info-card{top:150px}}
@media(max-width:370px) {header{padding:9px 12px;gap:8px}.back-btn{font-size:.68rem}.site-title{font-size:.8rem;gap:5px}.brand-mark{width:21px}.container{width:calc(100% - 20px)}.hero-banner-profile{padding:16px 12px;gap:12px}.hero-avatar-wrapper{width:58px;height:58px}.hero-name-title{font-size:1.1rem}.hero-stat-line{font-size:.7rem}.duo-info-card{width:142px}.duo-rank-title{font-size:.77rem}.duo-node{width:84px;height:84px}.duo-step-card.current .duo-node{width:96px;height:96px}.duo-info-card{top:136px}.journey-toolbar h1{font-size:.8rem}.jump-current{font-size:.65rem;padding:5px 8px}.modal-box{padding:16px}}
body.light-mode {color-scheme:light;--text-color:#142638;--card-bg:#f5f3ec;--sub-text:#516272;--border-color:rgba(75,100,120,.22);--surface:rgba(247,247,239,.95)}
body.light-mode .default-hero-banner,body.light-mode .table-card {color:var(--text-color)}
body.light-mode th {background:#e9e8dc;color:#71521e}body.light-mode .modal-box {background:#f3f1e9}body.light-mode .tier-info-box,body.light-mode .path-option-card {background:#e8eceb}body.light-mode .modal-top h3,body.light-mode .path-title {color:#77551f}body.light-mode .tier-list-desc {color:#243442}
@media(prefers-reduced-motion:reduce) {html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}


/* Paths and filenames are intentionally case-sensitive. */
body[data-cultivation-path="swallowed-star"] {
    --rank-background:url('/uploads/background/swallowed-star.webp?v=scroll-scenes-1');
    --rank-tile-height:calc(min(100vw,724px) * 2.00000000);
    --rank-banner:url('/uploads/background/swallowed-star-banner.webp');
    --rank-ground:#071423;
}
body[data-cultivation-path="perfect-world"] {
    --rank-background:url('/uploads/background/perfect-world-background.webp?v=scroll-scenes-1');
    --rank-tile-height:calc(min(100vw,724px) * 2.00000000);
    --rank-banner:url('/uploads/background/perfect-world-banner.webp');
    --rank-ground:#171310;
}
body[data-cultivation-path="the-sacred-ruin"] {
    --rank-background:url('/uploads/background/chu-feng-background.webp?v=scroll-scenes-1');
    --rank-tile-height:calc(min(100vw,724px) * 2.00000000);
    --rank-banner:url('/uploads/background/chu-feng-banner.webp');
    --rank-ground:#100d20;
}
body[data-cultivation-path="renegade-immortal"] {
    --rank-background:url('/uploads/background/renegade-immortal-background.webp?v=scroll-scenes-1');
    --rank-tile-height:calc(min(100vw,724px) * 2.00000000);
    --rank-banner:url('/uploads/background/renegade-immortal-banner.webp');
    --rank-ground:#0b1119;
}
body[data-cultivation-path="tales-of-herding-god"] {
    --rank-background:url('/uploads/background/Qing-Mu-background.webp?v=scroll-scenes-1');
    --rank-tile-height:calc(min(100vw,724px) * 2.00000000);
    --rank-banner:url('/uploads/background/Qing-Mu-banner.webp');
    --rank-ground:#071b15;
}
@media(max-width:370px) {
    .hero-current-rank{font-size:.8rem}
    .hero-rank-label{font-size:.69rem}
    .hero-banner-profile{align-items:flex-start}
    .hero-avatar-wrapper{margin-top:5px}
}
/* Rank detail popup: charcoal surface, typography instead of nested cards. */
#rankDetailModal .modal-box{background:#171a1e;color:#f1eee5;border:1px solid #454a50;border-radius:20px;box-shadow:0 24px 80px #0009;padding:26px;max-width:480px}
#rankDetailModal .modal-top{border:0;padding:0;margin-bottom:16px}
#rankDetailModal .modal-top h3{color:#e4bf70;font-size:1.35rem;font-weight:700}
#rankDetailModal #modalRankReq{color:#eee9dc!important;font-size:1rem!important;font-weight:500!important;margin-bottom:24px!important}
#rankDetailModal .rank-reward-section p,#rankDetailModal .rank-penalty-section p{margin:8px 0;line-height:1.95}
#rankDetailModal .rank-reward-amount{color:#e4bf70;font-size:2.5rem;line-height:1.5;font-weight:750}
#rankDetailModal .rank-muted{color:#a8adb3;font-size:.9rem}
#rankDetailModal .rank-penalty-section{border-top:1px solid #383d43;margin:24px 0;padding-top:18px}
#rankDetailModal .decay-countdown{font-size:1.15rem;color:#eee9dc;line-height:1.9}
#rankDetailModal .decay-countdown strong{color:#00b070;font-size:1.6rem;font-weight:700}
#rankDetailModal .btn-claim-rank{border-radius:13px;min-height:52px;box-shadow:none}
#rankDetailModal .btn-claim-claimed{background:#252a2e;color:#59ba94;border:1px solid #30373d;opacity:1}
#rankDetailModal .btn-claim-active{background:#00b070;color:#fff;border:0}
#rankDetailModal .btn-claim-locked{background:#252a2e;color:#a8adb3;border:1px solid #30373d}
@media(max-width:370px){#rankDetailModal .modal-box{padding:18px}#rankDetailModal .rank-reward-amount{font-size:2.1rem}}