/* ================================================================
   HAPPYRAN — DHALSIM-INSPIRED PUBLIC THEME
   Visual-only layer. Routes, forms, IDs and server-side features stay intact.
   ================================================================ */

:root {
    --dh-bg: #080806;
    --dh-ink: #f4ead2;
    --dh-muted: #b1aa9c;
    --dh-panel: rgba(12, 11, 9, .94);
    --dh-panel-soft: rgba(20, 17, 13, .94);
    --dh-red: #a80000;
    --dh-red-hot: #d3261f;
    --dh-gold: #d6a437;
    --dh-gold-soft: #8f6a27;
    --dh-line: rgba(214, 164, 55, .42);
    --dh-shadow: 0 18px 45px rgba(0, 0, 0, .48);
    --dh-max: 1320px;
}

/* Global public-page transition. The destination page owns the fade-out, so
   browser back/forward navigation is covered as well as menu clicks. */
.hr-page-transition {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 46%,rgba(126,26,18,.24),transparent 31%),
        linear-gradient(145deg,#040607,#0b0907 50%,#030506);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity .52s ease,visibility 0s linear .52s;
}

.hr-transition-ready:not(.hr-page-leaving) .hr-page-transition {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hr-page-leaving .hr-page-transition {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition-delay: 0s;
}

.hr-page-transition-glow {
    width: min(430px,72vw);
    height: min(430px,72vw);
    position: absolute;
    border: 1px solid rgba(214,164,55,.17);
    border-radius: 50%;
    box-shadow: inset 0 0 75px rgba(169,20,13,.13),0 0 80px rgba(214,164,55,.06);
    animation:hrTransitionHalo 2.4s ease-in-out infinite;
}

.hr-page-transition-logo {
    position: relative;
    filter: drop-shadow(0 8px 17px rgba(0,0,0,.85));
    animation:hrTransitionLogo .9s cubic-bezier(.2,.8,.2,1) both;
}

.hr-page-transition-logo span { font:italic 800 clamp(38px,7vw,68px)/1 Georgia,"Times New Roman",serif; }
.hr-page-transition-logo .happy { color:#f6f0e5; }
.hr-page-transition-logo .ran { color:#df2723; text-shadow:0 0 22px rgba(223,39,35,.28); }
.hr-page-transition-logo small { margin-left:5px; color:#e1b44e; font:900 clamp(11px,1.5vw,17px)/1 "Segoe UI",sans-serif; }
.hr-page-transition-subtitle { position:relative; margin-top:8px; color:#cfa54d; font-size:8px; font-weight:900; letter-spacing:4px; }
.hr-page-transition-line { width:min(310px,62vw); height:2px; position:relative; margin-top:24px; overflow:hidden; background:rgba(214,164,55,.12); }
.hr-page-transition-line i { width:42%; height:100%; position:absolute; background:linear-gradient(90deg,transparent,#d32722,#f1c45d,transparent); animation:hrTransitionLine 1.1s ease-in-out infinite; }

@keyframes hrTransitionLogo { from { opacity:0; transform:translateY(10px) scale(.92); } to { opacity:1; transform:none; } }
@keyframes hrTransitionLine { from { transform:translateX(-115%); } to { transform:translateX(340%); } }
@keyframes hrTransitionHalo { 50% { transform:scale(1.06); opacity:.58; } }

@media (prefers-reduced-motion:reduce) {
    .hr-page-transition-glow,.hr-page-transition-logo,.hr-page-transition-line i { animation:none !important; }
    .hr-page-transition { transition-duration:.15s; }
}

body.classic-public-body {
    background:
        linear-gradient(rgba(7, 6, 4, .72), rgba(7, 6, 4, .90)),
        url('/images/home-v2/hero-ran-classic.png') center top / cover fixed no-repeat !important;
    color: var(--dh-ink) !important;
}

body.classic-public-body::before {
    opacity: 1 !important;
    background:
        linear-gradient(90deg, rgba(96, 28, 13, .12), transparent 28%, transparent 72%, rgba(96, 28, 13, .12)),
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, .008) 4px 5px) !important;
}

body.classic-public-body .container {
    width: min(var(--dh-max), calc(100% - 32px)) !important;
    max-width: var(--dh-max) !important;
}

/* Header follows the centered, framed Dhalsim portal silhouette. */
body.classic-public-body .classic-main-header {
    width: min(var(--dh-max), calc(100% - 32px));
    height: 126px !important;
    margin: 18px auto 0;
    position: relative !important;
    top: auto;
    overflow: visible;
    border: 1px solid var(--dh-line) !important;
    border-radius: 9px 9px 3px 3px;
    background:
        linear-gradient(180deg, rgba(21, 17, 12, .98), rgba(7, 7, 6, .98)) !important;
    box-shadow: var(--dh-shadow), inset 0 1px rgba(255, 225, 151, .06);
    backdrop-filter: blur(10px);
}

body.classic-public-body .classic-main-header::before {
    content: "";
    position: absolute;
    inset: 4px;
    pointer-events: none;
    border: 1px solid rgba(214, 164, 55, .10);
}

body.classic-public-body .classic-main-header::after {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--dh-red), var(--dh-gold), var(--dh-red), transparent);
}

body.classic-public-body .nav-container {
    height: 124px !important;
    padding-top: 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    overflow: visible;
}

body.classic-public-body .classic-brand {
    min-width: 0;
    padding: 0 0 11px;
    transform: none;
    justify-content: center;
    filter: drop-shadow(0 5px 12px rgba(0,0,0,.8));
}

body.classic-public-body .classic-brand::after { display: none; }
body.classic-public-body .classic-brand-happy,
body.classic-public-body .classic-brand-ran {
    font-size: 29px !important;
    font-family: Georgia, "Times New Roman", serif;
}

body.classic-public-body .classic-brand-ran {
    color: #d5221d !important;
    text-shadow: 0 0 18px rgba(211, 38, 31, .30);
}

.dhalsim-brand-subtitle {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    white-space: nowrap;
    color: var(--dh-gold);
    font-family: "Segoe UI", sans-serif;
    font-size: 7px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 2.4px;
}

body.classic-public-body .classic-main-nav {
    width: 100%;
    min-height: 54px;
    gap: 1px !important;
    justify-content: center;
    border-top: 1px solid rgba(214, 164, 55, .16);
}

body.classic-public-body .classic-main-nav > a {
    min-height: 53px;
    padding: 0 13px !important;
    color: #d8d0c2 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px !important;
    letter-spacing: .5px;
}

body.classic-public-body .classic-main-nav > a::after {
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--dh-gold);
    box-shadow: 0 0 12px rgba(214, 164, 55, .42);
}

body.classic-public-body .classic-main-nav > a:hover,
body.classic-public-body .classic-main-nav > a.active {
    color: #fff4d9 !important;
    background: linear-gradient(180deg, rgba(214, 164, 55, .08), rgba(168, 0, 0, .12));
}

body.classic-public-body .classic-main-nav .login-btn {
    min-height: 35px !important;
    height: 35px !important;
    margin-left: 7px;
    border-color: #c43a2c !important;
    background: linear-gradient(180deg, #bd231d, #790b08) !important;
    box-shadow: inset 0 1px rgba(255,255,255,.12), 0 5px 16px rgba(0,0,0,.4);
}

/* Home becomes a framed portal instead of a full-bleed landing page. */
body.classic-public-body:has(.hr2-home) { background-color: var(--dh-bg) !important; }

body.classic-public-body .hr2-home {
    width: min(var(--dh-max), calc(100% - 32px));
    margin: 16px auto 0;
    overflow: hidden;
    border: 1px solid var(--dh-line);
    border-radius: 4px;
    background: rgba(6, 7, 7, .93) !important;
    box-shadow: var(--dh-shadow);
}

body.classic-public-body .hr2-home .container {
    width: min(100%, calc(100% - 32px)) !important;
}

body.classic-public-body .hr2-home .hr2-hero {
    min-height: 510px !important;
    border-bottom-color: var(--dh-line) !important;
    background-position: center 46% !important;
}

body.classic-public-body .hr2-hero-inner { min-height: 510px !important; }
body.classic-public-body .hr2-hero::before {
    background: linear-gradient(90deg, rgba(5,4,3,.48), rgba(5,4,3,.05) 50%, rgba(5,4,3,.42));
}
body.classic-public-body .hr2-hero::after {
    height: 190px;
    background: linear-gradient(180deg, transparent, rgba(8,7,5,.70) 64%, #090806);
}
body.classic-public-body .hr2-kicker { color: #efc35e; font-size: 17px; }
body.classic-public-body .hr2-hero h1 {
    color: #fff3d5 !important;
    font-size: clamp(54px, 7vw, 88px) !important;
    text-shadow: 0 4px #3a160b, 0 0 28px rgba(214,164,55,.20) !important;
}
body.classic-public-body .hr2-hero p { color: #e6c98b !important; }

body.classic-public-body .hr2-btn-red,
body.classic-public-body .btn-primary {
    border-color: #dc3e32 !important;
    background: linear-gradient(180deg, #c52620, #780c09) !important;
}
body.classic-public-body .hr2-btn-gold {
    border-color: var(--dh-gold-soft);
    background: linear-gradient(180deg, #342819, #13100c);
    color: #f4d995;
}

body.classic-public-body .hr2-status {
    border-color: var(--dh-gold-soft);
    border-radius: 5px;
    background: linear-gradient(180deg, rgba(21,17,12,.98), rgba(8,8,7,.98));
}
body.classic-public-body .hr2-status-icon.blue,
body.classic-public-body .hr2-status-icon.green {
    border-color: var(--dh-gold-soft);
    background: rgba(214,164,55,.10);
    color: var(--dh-gold);
}

/* Shared panels across rankings, account, mall, top-up, events and utilities. */
body.classic-public-body :is(
    .hr2-panel, .classic-panel, .ranking-card, .ranking-panel,
    .account-card, .dashboard-card, .mall-card, .product-card,
    .topup-card, .download-card, .contact-card, .event-card,
    .notification-card, .roulette-card, .daily-card,
    .card, .table-responsive
) {
    border-color: var(--dh-line) !important;
    border-radius: 4px !important;
    background: linear-gradient(180deg, var(--dh-panel-soft), var(--dh-panel)) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.32), inset 0 1px rgba(255,225,151,.025) !important;
}

body.classic-public-body :is(.hr2-panel-title, .card-header, .panel-heading) {
    border-bottom-color: rgba(214,164,55,.25) !important;
}

body.classic-public-body :is(h1,h2,h3,h4,h5,h6) { color: #fff4db; }
body.classic-public-body :is(.text-muted, .hr2-muted, small) { color: var(--dh-muted) !important; }
body.classic-public-body :is(a, .hr2-panel-title a) { --bs-link-color-rgb: 214,164,55; }
body.classic-public-body a:not(.btn):not(.hr2-btn):hover { color: #ffd776; }

body.classic-public-body :is(input,select,textarea,.form-control,.form-select) {
    border-color: rgba(214,164,55,.28) !important;
    background-color: rgba(6,6,5,.88) !important;
    color: #f3ead8 !important;
}
body.classic-public-body :is(input,select,textarea,.form-control,.form-select):focus {
    border-color: var(--dh-gold) !important;
    box-shadow: 0 0 0 3px rgba(214,164,55,.10) !important;
}

body.classic-public-body table { --bs-table-bg: transparent; --bs-table-color: var(--dh-ink); }
body.classic-public-body :is(th,thead td) {
    color: #e6bd63 !important;
    border-bottom-color: rgba(214,164,55,.34) !important;
}
body.classic-public-body :is(td,th) { border-color: rgba(214,164,55,.12) !important; }

body.classic-public-body .classic-public-main { padding-bottom: 22px; }

/* Keep every redesigned public page inside the same centered frame as Home. */
body.classic-public-body :is(
    .rv2-page, .dv2-page, .apv2-page, .tuv2-page,
    .cv2-page, .npv2-page, .mdv2-page
) {
    width: min(var(--dh-max), calc(100% - 32px));
    margin: 16px auto 0;
    overflow: hidden;
    border: 1px solid var(--dh-line);
    border-radius: 4px;
    background: rgba(6, 7, 7, .95) !important;
    box-shadow: var(--dh-shadow);
}

/* Readability pass for the five primary feature pages. Their original V2
   styles used 6–8px utility text, which became too small inside the frame. */
body.classic-public-body :is(.rv2-page,.dv2-page,.tuv2-page,.cv2-page,.apv2-page) :is(p,small,label) {
    font-size: clamp(9px, .68vw, 11px) !important;
    line-height: 1.55 !important;
}
body.classic-public-body :is(.rv2-page,.dv2-page,.tuv2-page,.cv2-page,.apv2-page) :is(th,.rv2-eyebrow) {
    font-size: clamp(8px, .58vw, 10px) !important;
}
body.classic-public-body :is(.rv2-page,.dv2-page,.tuv2-page,.cv2-page,.apv2-page) td {
    font-size: clamp(9px, .66vw, 11px) !important;
}
body.classic-public-body :is(.rv2-page,.dv2-page,.tuv2-page,.cv2-page,.apv2-page) :is(button,.btn) {
    font-size: clamp(9px, .64vw, 11px) !important;
}

body.classic-public-body .tuv2-create-panel {
    border-color: var(--dh-line) !important;
    background:
        radial-gradient(circle at top right, rgba(112,67,17,.08), transparent 31%),
        linear-gradient(180deg, rgba(12,19,23,.99), rgba(6,11,14,.995)) !important;
}

body.classic-public-body .tuv2-create-panel .tuv2-panel-header {
    background: linear-gradient(90deg, rgba(91,16,13,.34), transparent 62%) !important;
}

/* Start page content after the hero line instead of overlapping it. */
body.classic-public-body :is(.rv2-container,.dv2-container,.tuv2-container,.cv2-container,.apv2-container) {
    margin-top: 16px !important;
    padding-top: 0 !important;
}

body.classic-public-body :is(.rv2-hero,.dv2-hero,.tuv2-hero,.cv2-hero,.apv2-hero) {
    border-bottom: 1px solid var(--dh-line) !important;
}

body.classic-public-body :is(.rv2-container,.dv2-container,.tuv2-container,.cv2-container,.apv2-container) > :first-child {
    margin-top: 0 !important;
}

/* One border system for Ranking, Download, Top-up, Contact and My Account. */
body.classic-public-body :is(
    .rv2-panel,.rv2-summary-card,.rv2-spender-card,.rv2-detail,.rv2-filter,.rv2-ranking-tabs,
    .dv2-section,.dv2-panel,.dv2-download-card,.dv2-requirement,.dv2-trust,
    .tuv2-account-strip,.tuv2-panel,.tuv2-help-box,.tuv2-summary,.tuv2-payment-cards,.tuv2-trust,
    .cv2-panel,.cv2-contact-card,.cv2-help-card,.cv2-guideline-panel,.cv2-social-strip,
    .apv2-player-summary,.account-dashboard,.dashboard-item,.account-action-card,
    .referral-program-card,.referral-status-item,.security-card,.apv21-security-tips
) {
    border: 1px solid rgba(176,126,38,.52) !important;
    border-radius: 5px !important;
    box-shadow: inset 0 1px rgba(255,225,151,.025) !important;
}

body.classic-public-body :is(
    .rv2-table-wrap,.dv2-download-info,.dv2-mirror-list,
    .tuv2-table-wrap,.tuv2-field input,.tuv2-field select,
    .cv2-guidelines > *,.dashboard-grid,.security-grid
) { border-color: rgba(52,84,107,.72) !important; }

body.classic-public-body :is(
    .rv2-panel-head,.rv2-detail-head,.dv2-section-title,.dv2-panel-title,
    .tuv2-panel-header,.tuv2-history-header,.cv2-panel-header,.dashboard-section-title,
    .account-title,.apv21-security-heading
) { border-bottom: 1px solid rgba(176,126,38,.30) !important; }

body.classic-public-body :is(
    .rv2-summary-row,.rv2-table tr,.dv2-step,.tuv2-step,.tuv2-table tr,
    .cv2-guidelines > *,.dashboard-item
) { border-bottom-color: rgba(52,84,107,.35) !important; }

body.classic-public-body :is(
    .rv2-page, .dv2-page, .apv2-page, .tuv2-page,
    .cv2-page, .npv2-page, .mdv2-page
) > :is(.rv2-hero,.dv2-hero,.apv2-hero,.tuv2-hero,.cv2-hero,.npv2-hero,.mdv2-hero) {
    min-height: 310px !important;
    border-bottom-color: var(--dh-line) !important;
}

body.classic-public-body :is(
    .rv2-page, .dv2-page, .apv2-page, .tuv2-page,
    .cv2-page, .npv2-page, .mdv2-page
) > :is(.rv2-hero,.dv2-hero,.apv2-hero,.tuv2-hero,.cv2-hero,.npv2-hero,.mdv2-hero)::after {
    background: linear-gradient(180deg, transparent, rgba(7, 7, 5, .96)) !important;
}

/* My Account hero is intentionally more compact: the source image has a dark
   lower area which looked like a large empty block at the old 350px height. */
body.classic-public-body .apv2-page > .apv2-hero {
    min-height: 250px !important;
    height: 250px !important;
    background-position: center 38% !important;
}

body.classic-public-body .apv2-page > .apv2-hero::after {
    height: 76px !important;
}

body.classic-public-body .apv2-hero h1 {
    font-size: clamp(48px,5.5vw,70px) !important;
}

body.classic-public-body .apv2-container {
    margin-top: 14px !important;
}

/* Top-Up had the same oversized dark hero as My Account. */
body.classic-public-body .tuv2-page > .tuv2-hero {
    min-height: 250px !important;
    height: 250px !important;
    background-position: center 42% !important;
}

body.classic-public-body .tuv2-page > .tuv2-hero::after {
    height: 76px !important;
}

body.classic-public-body .tuv2-hero h1 {
    font-size: clamp(48px,5.5vw,70px) !important;
}

body.classic-public-body .tuv2-container {
    margin-top: 14px !important;
}

/* Mall uses two adjacent root sections rather than one page wrapper. */
body.classic-public-body .mv2-hero,
body.classic-public-body .mall-page {
    width: min(var(--dh-max), calc(100% - 32px));
    margin-inline: auto;
    box-sizing: border-box;
}
body.classic-public-body .mv2-hero {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--dh-line);
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}
body.classic-public-body .mall-page {
    border-inline: 1px solid var(--dh-line);
    border-bottom: 1px solid var(--dh-line);
    border-radius: 0 0 4px 4px;
    background: rgba(6, 7, 7, .95) !important;
    box-shadow: var(--dh-shadow);
}

/* Legacy/simple public pages receive the same centered canvas and spacing. */
body.classic-public-body .classic-public-main > :is(
    .account-page, .all-news-page, .news-detail-page, .event-page,
    .event-detail-page, .legal-page, .server-status-page, .transaction-page,
    .daily-page, .rcoin-page, .roulette-page, .webpoint-page,
    .pps-page, .pp-page, .public-maintenance-page, .player-feature-off-page,
    .error-page, .tsa-page
) {
    width: min(var(--dh-max), calc(100% - 32px));
    min-height: 520px;
    margin: 16px auto 0 !important;
    padding: 30px 0 48px;
    overflow: hidden;
    border: 1px solid var(--dh-line);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(15,13,10,.97), rgba(6,7,7,.97)) !important;
    box-shadow: var(--dh-shadow);
}

body.classic-public-body .classic-public-main > :is(
    .account-page, .all-news-page, .news-detail-page, .event-page,
    .event-detail-page, .legal-page, .server-status-page, .transaction-page,
    .daily-page, .rcoin-page, .roulette-page, .webpoint-page,
    .pps-page, .pp-page, .public-maintenance-page, .player-feature-off-page,
    .error-page, .tsa-page
) > .container {
    width: min(100% - 32px, 1040px) !important;
}

body.classic-public-body .classic-footer {
    width: min(var(--dh-max), calc(100% - 32px));
    margin: 0 auto 22px;
    border: 1px solid var(--dh-line) !important;
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(17,14,10,.97), rgba(6,6,5,.99)) !important;
    box-shadow: var(--dh-shadow);
}
body.classic-public-body .classic-footer-column > b { color: var(--dh-gold) !important; }

@media (max-width: 1120px) {
    body.classic-public-body .classic-main-nav > a { padding-inline: 9px !important; font-size: 10px !important; }
}

@media (max-width: 900px) {
    body.classic-public-body .classic-main-header {
        width: calc(100% - 20px);
        height: 72px !important;
        margin-top: 10px;
        position: sticky !important;
        top: 8px;
        overflow: visible;
    }
    body.classic-public-body .nav-container {
        height: 70px !important;
        padding: 0 12px;
        flex-direction: row;
        justify-content: space-between;
    }
    body.classic-public-body .classic-brand { padding-bottom: 9px; }
    body.classic-public-body .classic-nav-toggle { display: block; border-color: var(--dh-line); background: #110e0a; }
    body.classic-public-body .classic-main-nav {
        width: auto;
        min-height: 0;
        top: 78px !important;
        left: 0 !important;
        right: 0 !important;
        border: 1px solid var(--dh-line) !important;
        background: rgba(9,8,6,.99) !important;
        box-shadow: var(--dh-shadow);
    }
    body.classic-public-body .classic-main-nav > a { min-height: 46px; }
    body.classic-public-body .hr2-home { width: calc(100% - 20px); margin-top: 10px; }
    body.classic-public-body :is(
        .rv2-page, .dv2-page, .apv2-page, .tuv2-page,
        .cv2-page, .npv2-page, .mdv2-page,
        .mv2-hero, .mall-page
    ) { width: calc(100% - 20px); }
    body.classic-public-body .classic-footer { width: calc(100% - 20px); }
}

@media (max-width: 620px) {
    body.classic-public-body .container { width: calc(100% - 20px) !important; }
    body.classic-public-body .hr2-home .hr2-hero,
    body.classic-public-body .hr2-hero-inner { min-height: 430px !important; }
    body.classic-public-body .hr2-hero-copy { width: 92%; }
    body.classic-public-body .hr2-hero-actions { flex-direction: column; align-items: center; }
    body.classic-public-body .hr2-btn { width: min(100%, 260px); }
    body.classic-public-body .hr2-status { grid-template-columns: 1fr !important; }
    body.classic-public-body .hr2-status-item { border-right: 0; border-bottom: 1px solid rgba(214,164,55,.16); }
    body.classic-public-body :is(
        .rv2-page, .dv2-page, .apv2-page, .tuv2-page,
        .cv2-page, .npv2-page, .mdv2-page
    ) > :is(.rv2-hero,.dv2-hero,.apv2-hero,.tuv2-hero,.cv2-hero,.npv2-hero,.mdv2-hero) {
        min-height: 245px !important;
    }
    body.classic-public-body .apv2-page > .apv2-hero {
        min-height: 205px !important;
        height: 205px !important;
    }
    body.classic-public-body .apv2-hero h1 {
        font-size: clamp(38px,13vw,54px) !important;
    }
    body.classic-public-body .tuv2-page > .tuv2-hero {
        min-height: 205px !important;
        height: 205px !important;
    }
    body.classic-public-body .tuv2-hero h1 {
        font-size: clamp(38px,13vw,54px) !important;
    }
}
