/*
 * Veltrion Web Platform Phase 24
 * Responsive / Mobile UX tuning
 * This stylesheet is additive and intentionally avoids changing payment/reward logic.
 */

:root {
    --v24-safe-top: env(safe-area-inset-top, 0px);
    --v24-safe-bottom: env(safe-area-inset-bottom, 0px);
    --v24-mobile-dock-h: 68px;
    --v24-compact-gap: clamp(10px, 2vw, 18px);
    --v24-panel-bg: rgba(9, 8, 7, 0.86);
    --v24-line: rgba(202, 164, 86, 0.24);
    --v24-line-soft: rgba(255, 255, 255, 0.08);
    --v24-gold: #d8b36a;
    --v24-red: #9d221d;
}

html.veltrion-mobile-open {
    overflow: hidden;
}

body.veltrion-phase24 {
    min-width: 320px;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

.veltrion-phase24 *,
.veltrion-phase24 *::before,
.veltrion-phase24 *::after {
    box-sizing: border-box;
}

.veltrion-phase24 img,
.veltrion-phase24 video,
.veltrion-phase24 canvas,
.veltrion-phase24 svg {
    max-width: 100%;
}

.veltrion-phase24 a,
.veltrion-phase24 button,
.veltrion-phase24 input,
.veltrion-phase24 select,
.veltrion-phase24 textarea {
    -webkit-tap-highlight-color: rgba(216, 179, 106, 0.18);
}

.veltrion-phase24 [data-v24-lazy],
.veltrion-phase24 img[loading="lazy"] {
    content-visibility: auto;
    contain-intrinsic-size: 260px 160px;
}

/* General high-density portal constraints */
.veltrion-phase24 .veltrion-web-shell,
.veltrion-phase24 .v-web-shell,
.veltrion-phase24 .portal-shell,
.veltrion-phase24 .portal-frame-wrap,
.veltrion-phase24 .portal-content-wrap,
.veltrion-phase24 .portal-competition-wrap,
.veltrion-phase24 main {
    width: min(100%, 1480px);
    margin-left: auto;
    margin-right: auto;
}

.veltrion-phase24 .portal-frame,
.veltrion-phase24 .portal-content-hub,
.veltrion-phase24 .portal-competition-hub,
.veltrion-phase24 .content-hub,
.veltrion-phase24 .season-ranking,
.veltrion-phase24 .ranking-preview {
    min-width: 0;
}

/* Header / navigation adaptation */
.veltrion-phase24 .site-header,
.veltrion-phase24 .portal-header,
.veltrion-phase24 .v-web-header,
.veltrion-phase24 header {
    isolation: isolate;
}

.veltrion-phase24 .site-header-inner,
.veltrion-phase24 .portal-header-inner,
.veltrion-phase24 .v-web-header-inner,
.veltrion-phase24 header > .inner,
.veltrion-phase24 header > .container {
    width: min(100%, 1480px);
    margin: 0 auto;
}

.veltrion-phase24 .portal-nav,
.veltrion-phase24 .site-nav,
.veltrion-phase24 .v-web-nav,
.veltrion-phase24 nav ul {
    min-width: 0;
}

.veltrion-phase24 .portal-nav a,
.veltrion-phase24 .site-nav a,
.veltrion-phase24 .v-web-nav a {
    white-space: nowrap;
}

/* Common grid collapse helpers */
.veltrion-phase24 .portal-grid,
.veltrion-phase24 .portal-hero-grid,
.veltrion-phase24 .portal-main-grid,
.veltrion-phase24 .portal-content-grid,
.veltrion-phase24 .portal-ranking-grid,
.veltrion-phase24 .portal-class-grid,
.veltrion-phase24 .portal-event-grid,
.veltrion-phase24 .portal-media-grid,
.veltrion-phase24 .quick-link-grid,
.veltrion-phase24 .class-card-grid,
.veltrion-phase24 .ranking-card-grid,
.veltrion-phase24 .server-grid,
.veltrion-phase24 .dashboard-grid {
    min-width: 0;
}

.veltrion-phase24 .portal-card,
.veltrion-phase24 .portal-panel,
.veltrion-phase24 .v-card,
.veltrion-phase24 .ranking-card,
.veltrion-phase24 .content-card,
.veltrion-phase24 .class-card,
.veltrion-phase24 .event-card,
.veltrion-phase24 .notice-card,
.veltrion-phase24 .media-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Tablet landscape */
@media (max-width: 1280px) {
    .veltrion-phase24 .veltrion-web-shell,
    .veltrion-phase24 .v-web-shell,
    .veltrion-phase24 .portal-shell,
    .veltrion-phase24 .portal-frame-wrap,
    .veltrion-phase24 .portal-content-wrap,
    .veltrion-phase24 .portal-competition-wrap,
    .veltrion-phase24 main {
        width: min(100% - 28px, 1180px);
    }

    .veltrion-phase24 .portal-frame,
    .veltrion-phase24 .portal-hero-grid,
    .veltrion-phase24 .portal-main-grid {
        gap: var(--v24-compact-gap) !important;
    }

    .veltrion-phase24 .portal-side-panel,
    .veltrion-phase24 .portal-login-panel,
    .veltrion-phase24 .account-panel,
    .veltrion-phase24 .game-start-panel {
        width: min(100%, 360px);
    }

    .veltrion-phase24 .portal-title,
    .veltrion-phase24 .hero-title,
    .veltrion-phase24 h1 {
        font-size: clamp(34px, 5vw, 72px) !important;
        line-height: 0.98 !important;
    }
}

/* Tablet portrait */
@media (max-width: 1024px) {
    .veltrion-phase24 body,
    body.veltrion-phase24 {
        overflow-x: hidden;
    }

    .veltrion-phase24 .veltrion-web-shell,
    .veltrion-phase24 .v-web-shell,
    .veltrion-phase24 .portal-shell,
    .veltrion-phase24 .portal-frame-wrap,
    .veltrion-phase24 .portal-content-wrap,
    .veltrion-phase24 .portal-competition-wrap,
    .veltrion-phase24 main {
        width: min(100% - 22px, 940px);
    }

    .veltrion-phase24 .portal-frame,
    .veltrion-phase24 .portal-hero-grid,
    .veltrion-phase24 .portal-main-grid,
    .veltrion-phase24 .hero-with-sidebar,
    .veltrion-phase24 .main-with-sidebar {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .veltrion-phase24 .portal-side-panel,
    .veltrion-phase24 .portal-login-panel,
    .veltrion-phase24 .account-panel,
    .veltrion-phase24 .game-start-panel,
    .veltrion-phase24 aside {
        width: 100% !important;
        max-width: none !important;
        position: relative !important;
        top: auto !important;
    }

    .veltrion-phase24 .portal-server-strip,
    .veltrion-phase24 .server-status-strip,
    .veltrion-phase24 .server-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .veltrion-phase24 .portal-content-grid,
    .veltrion-phase24 .portal-notice-grid,
    .veltrion-phase24 .portal-event-grid,
    .veltrion-phase24 .portal-media-grid,
    .veltrion-phase24 .portal-ranking-grid,
    .veltrion-phase24 .ranking-card-grid,
    .veltrion-phase24 .dashboard-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .veltrion-phase24 .portal-class-grid,
    .veltrion-phase24 .class-card-grid,
    .veltrion-phase24 .quick-link-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .veltrion-phase24 .portal-wide,
    .veltrion-phase24 .span-2,
    .veltrion-phase24 .portal-update-card,
    .veltrion-phase24 .highlight-card {
        grid-column: 1 / -1 !important;
    }

    .veltrion-phase24 .site-header,
    .veltrion-phase24 .portal-header,
    .veltrion-phase24 .v-web-header,
    .veltrion-phase24 header {
        position: sticky;
        top: 0;
        z-index: 80;
        backdrop-filter: blur(14px);
        background: linear-gradient(180deg, rgba(7, 7, 8, 0.94), rgba(7, 7, 8, 0.76));
    }

    .veltrion-phase24 .portal-nav,
    .veltrion-phase24 .site-nav,
    .veltrion-phase24 .v-web-nav,
    .veltrion-phase24 nav ul {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding-bottom: 4px;
    }
}

/* Mobile */
@media (max-width: 760px) {
    body.veltrion-phase24 {
        padding-bottom: calc(var(--v24-mobile-dock-h) + var(--v24-safe-bottom));
    }

    .veltrion-phase24 .veltrion-web-shell,
    .veltrion-phase24 .v-web-shell,
    .veltrion-phase24 .portal-shell,
    .veltrion-phase24 .portal-frame-wrap,
    .veltrion-phase24 .portal-content-wrap,
    .veltrion-phase24 .portal-competition-wrap,
    .veltrion-phase24 main {
        width: min(100% - 16px, 680px);
    }

    .veltrion-phase24 .site-header-inner,
    .veltrion-phase24 .portal-header-inner,
    .veltrion-phase24 .v-web-header-inner,
    .veltrion-phase24 header > .inner,
    .veltrion-phase24 header > .container {
        width: min(100% - 14px, 680px);
        min-height: 58px;
        gap: 8px !important;
    }

    .veltrion-phase24 .portal-logo,
    .veltrion-phase24 .site-logo,
    .veltrion-phase24 .brand-logo,
    .veltrion-phase24 header .logo {
        transform-origin: left center;
        scale: 0.86;
    }

    .veltrion-phase24 .portal-nav,
    .veltrion-phase24 .site-nav,
    .veltrion-phase24 .v-web-nav {
        font-size: 12px;
        gap: 12px !important;
        max-width: 100%;
        mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
    }

    .veltrion-phase24 .portal-nav a,
    .veltrion-phase24 .site-nav a,
    .veltrion-phase24 .v-web-nav a {
        padding: 8px 4px !important;
    }

    .veltrion-phase24 .portal-hero,
    .veltrion-phase24 .hero-section,
    .veltrion-phase24 .main-hero {
        min-height: clamp(420px, 78svh, 620px) !important;
        padding: 24px 16px !important;
        border-radius: 14px !important;
        background-position: center top !important;
    }

    .veltrion-phase24 .portal-kicker,
    .veltrion-phase24 .hero-kicker {
        font-size: 12px !important;
        letter-spacing: 0.12em !important;
    }

    .veltrion-phase24 .portal-title,
    .veltrion-phase24 .hero-title,
    .veltrion-phase24 h1 {
        font-size: clamp(34px, 13vw, 54px) !important;
        letter-spacing: -0.04em !important;
        text-wrap: balance;
    }

    .veltrion-phase24 .portal-lead,
    .veltrion-phase24 .hero-lead,
    .veltrion-phase24 .lead {
        font-size: 14px !important;
        line-height: 1.62 !important;
        max-width: 32em;
    }

    .veltrion-phase24 .portal-actions,
    .veltrion-phase24 .hero-actions,
    .veltrion-phase24 .button-row,
    .veltrion-phase24 .action-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .veltrion-phase24 .portal-actions a,
    .veltrion-phase24 .portal-actions button,
    .veltrion-phase24 .hero-actions a,
    .veltrion-phase24 .hero-actions button,
    .veltrion-phase24 .button-row a,
    .veltrion-phase24 .button-row button {
        min-height: 46px;
        justify-content: center;
        width: 100%;
    }

    .veltrion-phase24 .portal-side-panel,
    .veltrion-phase24 .portal-login-panel,
    .veltrion-phase24 .account-panel,
    .veltrion-phase24 .game-start-panel {
        border-radius: 14px !important;
        padding: 14px !important;
        background: var(--v24-panel-bg) !important;
    }

    .veltrion-phase24 .portal-server-strip,
    .veltrion-phase24 .server-status-strip,
    .veltrion-phase24 .server-grid,
    .veltrion-phase24 .portal-content-grid,
    .veltrion-phase24 .portal-notice-grid,
    .veltrion-phase24 .portal-event-grid,
    .veltrion-phase24 .portal-media-grid,
    .veltrion-phase24 .portal-ranking-grid,
    .veltrion-phase24 .portal-class-grid,
    .veltrion-phase24 .class-card-grid,
    .veltrion-phase24 .ranking-card-grid,
    .veltrion-phase24 .quick-link-grid,
    .veltrion-phase24 .dashboard-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .veltrion-phase24 .portal-section,
    .veltrion-phase24 .content-section,
    .veltrion-phase24 .ranking-section,
    .veltrion-phase24 section {
        margin-top: 14px !important;
    }

    .veltrion-phase24 .portal-section-title,
    .veltrion-phase24 .section-title,
    .veltrion-phase24 h2 {
        font-size: clamp(20px, 7vw, 28px) !important;
        line-height: 1.1 !important;
    }

    .veltrion-phase24 .portal-card,
    .veltrion-phase24 .portal-panel,
    .veltrion-phase24 .v-card,
    .veltrion-phase24 .ranking-card,
    .veltrion-phase24 .content-card,
    .veltrion-phase24 .class-card,
    .veltrion-phase24 .event-card,
    .veltrion-phase24 .notice-card,
    .veltrion-phase24 .media-card {
        border-radius: 13px !important;
        padding: 13px !important;
    }

    .veltrion-phase24 table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .veltrion-phase24 input,
    .veltrion-phase24 select,
    .veltrion-phase24 textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    .veltrion-phase24 .desktop-only,
    .veltrion-phase24 [data-desktop-only="true"] {
        display: none !important;
    }

    .veltrion-phase24 .mobile-only,
    .veltrion-phase24 [data-mobile-only="true"] {
        display: revert !important;
    }
}

/* Narrow phones */
@media (max-width: 420px) {
    .veltrion-phase24 .veltrion-web-shell,
    .veltrion-phase24 .v-web-shell,
    .veltrion-phase24 .portal-shell,
    .veltrion-phase24 .portal-frame-wrap,
    .veltrion-phase24 .portal-content-wrap,
    .veltrion-phase24 .portal-competition-wrap,
    .veltrion-phase24 main {
        width: min(100% - 12px, 390px);
    }

    .veltrion-phase24 .portal-hero,
    .veltrion-phase24 .hero-section,
    .veltrion-phase24 .main-hero {
        padding: 20px 12px !important;
    }

    .veltrion-phase24 .portal-title,
    .veltrion-phase24 .hero-title,
    .veltrion-phase24 h1 {
        font-size: clamp(30px, 14vw, 46px) !important;
    }
}

/* Phase 24 mobile bottom dock */
.veltrion-mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + var(--v24-safe-bottom));
    z-index: 120;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    height: var(--v24-mobile-dock-h);
    padding: 7px;
    border: 1px solid rgba(216, 179, 106, 0.28);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(25, 18, 14, 0.95), rgba(6, 6, 8, 0.95)),
        radial-gradient(circle at 50% 0%, rgba(174, 45, 36, 0.18), transparent 48%);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.veltrion-mobile-dock a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    color: rgba(245, 231, 202, 0.78);
    text-decoration: none;
    font-size: 11px;
    line-height: 1.1;
    border-radius: 13px;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.veltrion-mobile-dock a strong {
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    color: var(--v24-gold);
}

.veltrion-mobile-dock a:active {
    transform: translateY(1px) scale(0.98);
    background: rgba(216, 179, 106, 0.12);
}

.veltrion-mobile-dock a.is-primary {
    color: #fff5d8;
    background: linear-gradient(180deg, rgba(148, 31, 26, 0.88), rgba(91, 15, 12, 0.88));
    border: 1px solid rgba(255, 210, 126, 0.28);
}

@media (max-width: 760px) {
    .veltrion-mobile-dock {
        display: flex;
    }
}

/* Compact mode applied by JS when viewport height is short */
.veltrion-compact-height .portal-hero,
.veltrion-compact-height .hero-section,
.veltrion-compact-height .main-hero {
    min-height: 420px !important;
}

.veltrion-compact-height .portal-lead,
.veltrion-compact-height .hero-lead {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Motion and battery-friendly fallback */
@media (prefers-reduced-motion: reduce) {
    .veltrion-phase24 *,
    .veltrion-phase24 *::before,
    .veltrion-phase24 *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}