/*
  Design system — hướng "Dark Luxury / Premium Gaming" cho Ngọc Rồng Online.
  Nền sâu gần đen, một accent cam-vàng "năng lượng" (khí công), glow tinh tế,
  bề mặt glass. Toàn bộ token gom về đây làm NGUỒN CHÂN LÝ DUY NHẤT — mọi trang
  tái sử dụng cùng biến thay vì tự chế màu. Cấp cả 2 cách đặt tên token
  (bộ mới --color-primary/--color-text-primary... và bộ cũ --color-accent/--color-bg...)
  để không trang nào bị vỡ khi đổi theme.
*/

:root {
    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: var(--font-sans);
    --font-body: var(--font-sans);

    /* ---- Accent: cam-vàng năng lượng (255,175,77 = #ffaf4d, khớp rgba đang dùng) ---- */
    --color-primary: #ffaf4d;
    --color-primary-hover: #ff9a1f;
    --color-primary-soft: rgba(255, 175, 77, 0.12);
    --color-primary-glow: rgba(255, 175, 77, 0.38);

    /* Legacy alias (các trang cam-sáng cũ tham chiếu tên này) */
    --color-accent: var(--color-primary);
    --color-accent-hover: var(--color-primary-hover);
    --color-accent-soft: var(--color-primary-soft);

    /* ---- Nền tối theo tầng ---- */
    --color-bg: #0c0e13;
    --color-bg-secondary: #11141b;
    --color-bg-tertiary: #191d26;
    --color-surface: #161a22;
    --color-surface-2: #1d2230;

    /* ---- Chữ ---- */
    --color-text-primary: #f5f3ef;
    --color-text: #ecebe7;
    --color-text-secondary: #a9afbd;
    --color-text-tertiary: #767d8c;

    /* ---- Viền ---- */
    --color-border: #2a303d;
    --color-border-light: #202531;

    /* Bộ gradient cam (giữ để mọi chỗ tham chiếu vẫn chạy) */
    --color-orange-deep: #f76707;
    --color-orange-mid: #ff922b;
    --color-orange-light: #ffc078;

    /* ---- Trạng thái ---- */
    --color-success: #4ade80;
    --color-danger: #f87171;
    --color-warning: #fbbf24;
    --color-info: #60a5fa;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Radius */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadow (tối → cần đậm hơn) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.62);
    --shadow-light: rgba(0, 0, 0, 0.35);
    --shadow-hover: rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 8px 26px var(--color-primary-glow);

    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: #1a1625;
    background-color: #f8db91;
    background-image:
        radial-gradient(1100px 620px at 50% -8%, rgba(255, 146, 43, 0.28), transparent 60%),
        radial-gradient(900px 700px at 100% 0%, rgba(255, 100, 0, 0.15), transparent 55%),
        linear-gradient(180deg, #f8db91 0%, #ffe4a0 40%, #ffcda5 100%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
}

.ds-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* ============ Nav ============ */
.ds-nav {
    position: sticky;
    top: 16px;
    z-index: 100;
    max-width: 1140px;
    width: calc(100% - 32px);
    margin: 16px auto 0;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: saturate(180%) blur(26px);
    -webkit-backdrop-filter: saturate(180%) blur(26px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(80, 20, 120, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.ds-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ds-nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 900;
    font-size: 22px;
    color: #e8480c;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.ds-nav-brand img {
    height: 52px;
    width: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 95%;
    display: block;
    border: 3px solid #ff8c00;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.65);
}

.ds-nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ds-nav-links a {
    color: #b83a08;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 999px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-nav-links a:hover {
    color: #e8480c;
    background: rgba(255, 255, 255, 0.4);
}

.ds-nav-links a.is-active {
    background: linear-gradient(135deg, #ffc266 0%, #ff8a1e 55%, #ef5a0c 100%);
    color: #2a1a06;
    font-weight: 800;
    box-shadow: 0 3px 12px rgba(239, 90, 12, 0.35);
}

.ds-nav-cta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Mobile Dock defaults to hidden on desktop */
.ds-mobile-dock {
    display: none;
}

/* ============ Buttons ============ */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.ds-btn:active {
    transform: scale(0.97);
}

.ds-btn-primary {
    background: linear-gradient(135deg, #ffc266 0%, var(--color-primary) 50%, var(--color-orange-mid) 100%);
    color: #2a1a06;
    box-shadow: var(--shadow-glow);
}

.ds-btn-primary:hover {
    box-shadow: 0 10px 32px var(--color-primary-glow);
    transform: translateY(-1px);
}

.ds-btn-secondary {
    background: var(--color-surface-2);
    color: var(--color-text-primary);
    border-color: var(--color-border);
}

.ds-btn-secondary:hover {
    background: #232937;
    border-color: var(--color-primary);
}

.ds-btn-ghost {
    color: var(--color-text-primary);
    border-color: var(--color-border);
    background: transparent;
}

.ds-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary);
}

/* Nút "Đăng nhập" (ghost) tông Dragon Ball: viền + chữ cam */
.ds-nav-cta .ds-btn-ghost {
    color: #b83a08;
    border-color: rgba(232, 72, 12, 0.55);
}

.ds-nav-cta .ds-btn-ghost:hover {
    color: #e8480c;
    background: rgba(255, 255, 255, 0.4);
    border-color: #e8480c;
}

.ds-btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

/* ============ Hero ============ */
.ds-hero {
    position: relative;
    padding: var(--space-9) var(--space-5) var(--space-7);
    text-align: center;
    background: transparent;
    color: #1a1625;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    overflow: hidden;
}

.ds-hero-eyebrow {
    font-size: 15px;
    font-weight: 900;
    color: #ff6a00;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 var(--space-3);
}

.ds-hero h1 {
    font-size: clamp(2.8rem, 5.5vw, 4.6rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0 0 var(--space-4);
    color: #ff4800;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-shadow: 0 4px 16px rgba(255, 80, 0, 0.22);
}

.ds-hero p {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    color: #3b354d;
    max-width: 640px;
    margin: 0 auto var(--space-6);
    font-weight: 500;
}

.ds-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ============ Sections ============ */
.ds-section {
    padding: var(--space-8) var(--space-5);
}

.ds-section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-7);
}

.ds-section-header h2 {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-3);
    color: #1a1625;
}

.ds-section-header p {
    font-size: 1.15rem;
    color: #3b354d;
    margin: 0;
    font-weight: 500;
}

.ds-section-alt {
    background: rgba(255, 255, 255, 0.2);
}

/* ============ Card grid ============ */
.ds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    max-width: var(--max-width);
    margin: 0 auto;
}

.ds-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
}

.ds-card {
    position: relative;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: 0 12px 36px rgba(255, 140, 0, 0.15);
    color: #1a1625;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.ds-card:hover {
    box-shadow: 0 16px 40px rgba(255, 140, 0, 0.28);
    transform: translateY(-3px);
    border-color: #ff8c00;
}

.ds-card-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: var(--space-4);
    border: 1px solid rgba(255, 175, 77, 0.28);
}

.ds-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
}

.ds-card p {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* ============ Media showcase row ============ */
.ds-media-row {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    max-width: var(--max-width);
    margin: 0 auto;
}

.ds-media-row img {
    height: 96px;
    width: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ============ Download row ============ */
.ds-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    max-width: 720px;
    margin: 0 auto;
}

.ds-download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ds-download-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.ds-download-card img {
    height: 32px;
    width: auto;
}

.ds-download-card span {
    font-size: 13px;
    font-weight: 600;
}

/* ============ Footer ============ */
.ds-footer {
    border-top: 1px solid var(--color-border-light);
    padding: var(--space-7) var(--space-5) var(--space-6);
    background: var(--color-bg-secondary);
}

.ds-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.ds-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-5);
    font-size: 12px;
}

.ds-footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.ds-footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.ds-footer-meta {
    font-size: 12px;
    color: var(--color-text-tertiary);
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-5);
    line-height: 1.7;
}

/* ==========================================
   ADVANCED & PREMIUM COMPONENT SYSTEM
   ========================================== */

/* Glass & Avatar */
.ds-glass {
    background: rgba(22, 26, 34, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
}

.ds-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    object-fit: contain;
    object-position: center;
    background: #ffffff;
    padding: 2px;
    box-shadow: 0 2px 10px var(--color-primary-glow);
    flex-shrink: 0;
}

.ds-avatar-sm {
    width: 36px;
    height: 36px;
    border-width: 1.5px;
    padding: 1.5px;
}

.ds-avatar-lg {
    width: 68px;
    height: 68px;
    border-width: 3px;
    padding: 4px;
}

/* Badges & Chips */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.ds-badge-admin {
    background: linear-gradient(135deg, #ff5b5b 0%, #e03131 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224, 49, 49, 0.4);
}

.ds-badge-pro {
    background: linear-gradient(135deg, #ffc266 0%, var(--color-orange-deep) 100%);
    color: #2a1a06;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.ds-badge-success {
    background: rgba(74, 222, 128, 0.14);
    color: var(--color-success);
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.ds-badge-pending,
.ds-badge-warning {
    background: rgba(251, 191, 36, 0.14);
    color: var(--color-warning);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.ds-badge-danger {
    background: rgba(248, 113, 113, 0.14);
    color: var(--color-danger);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.ds-badge-info {
    background: rgba(96, 165, 250, 0.14);
    color: var(--color-info);
    border: 1px solid rgba(96, 165, 250, 0.35);
}

/* User Profile Nav Item */
.ds-nav-user {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 6px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(184, 58, 8, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-nav-user:hover {
    background: rgba(255, 255, 255, 0.92);
    border-color: #ffffff;
    box-shadow: 0 6px 18px rgba(184, 58, 8, 0.14);
}

.ds-nav-user .ds-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #ff8c00;
    background: #ffffff;
    padding: 1.5px;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.35);
    flex-shrink: 0;
}

.ds-nav-user-info {
    display: flex;
    align-items: center;
    text-align: left;
    line-height: 1.2;
}

.ds-nav-user-name {
    font-weight: 800;
    font-size: 14.5px;
    color: #1a1625;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ds-nav-user-name .ds-badge-admin {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff !important;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    line-height: 1;
}

.ds-nav-user-coin {
    font-size: 11px;
    color: var(--color-primary);
    font-weight: 700;
}

.ds-nav-icon-btn {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px rgba(184, 58, 8, 0.08);
}

.ds-btn-logout {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(238, 82, 83, 0.35) !important;
    transition: all 0.2s ease;
}

.ds-btn-logout:hover {
    background: linear-gradient(135deg, #ff5252 0%, #d63031 100%) !important;
    box-shadow: 0 6px 16px rgba(238, 82, 83, 0.5) !important;
    transform: translateY(-1px);
}

/* Forum Topics */
.ds-topic-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.ds-topic-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.18s ease;
}

.ds-topic-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
    background: var(--color-surface-2);
}

.ds-topic-pin {
    background: linear-gradient(90deg, rgba(255, 175, 77, 0.10) 0%, var(--color-surface) 60%);
    border-left: 4px solid var(--color-primary);
}

.ds-topic-body {
    flex: 1;
    min-width: 0;
}

.ds-topic-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-topic-meta {
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ds-comment-count {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--color-bg-tertiary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Post Detail View */
.ds-post-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-5);
}

.ds-post-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 var(--space-2) 0;
    color: var(--color-text-primary);
}

.ds-post-content {
    font-size: 15px;
    line-height: 1.75;
    color: var(--color-text);
    word-break: break-word;
}

.ds-comment-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px dashed var(--color-border);
}

.ds-comment-item:last-child {
    border-bottom: none;
}

/* Tables */
.ds-table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.ds-table th {
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.ds-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 14px;
    color: var(--color-text);
    vertical-align: middle;
}

.ds-table tbody tr:hover td {
    background: rgba(255, 175, 77, 0.07);
}

.ds-rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 13px;
}

.ds-rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #5a3c00;
    box-shadow: 0 2px 10px rgba(255, 170, 0, 0.45);
}

.ds-rank-2 {
    background: linear-gradient(135deg, #e0e0e0 0%, #a8adb8 100%);
    color: #2a2e39;
    box-shadow: 0 2px 8px rgba(176, 176, 176, 0.3);
}

.ds-rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #a05a2c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.35);
}

/* Authentication Box */
.ds-auth-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
}

.ds-auth-card {
    max-width: 440px;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-6);
    box-shadow: var(--shadow-lg);
}

.ds-auth-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.ds-auth-header img {
    height: 64px;
    margin-bottom: var(--space-3);
    filter: drop-shadow(0 4px 14px var(--color-primary-glow));
}

.ds-auth-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 var(--space-1) 0;
    color: var(--color-text-primary);
}

/* Forms */
.ds-form-group {
    margin-bottom: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    text-align: left;
}

.ds-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.ds-input,
.ds-textarea,
.ds-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ds-input::placeholder,
.ds-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.ds-input:focus,
.ds-textarea:focus,
.ds-select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-bg-secondary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* Select: mũi tên + option list dễ đọc trên nền tối */
.ds-select option {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.ds-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Alerts */
.ds-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ds-alert-success {
    background: rgba(74, 222, 128, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.ds-alert-error {
    background: rgba(248, 113, 113, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Pricing Cards */
.ds-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-5);
}

.ds-pricing-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ds-pricing-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.ds-pricing-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
}

.ds-pricing-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: var(--space-3) 0 var(--space-4) 0;
}

.ds-qr-box {
    background: #fff;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    display: inline-block;
    max-width: 320px;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.ds-qr-box img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* ============ Home Page (single-screen) ============ */
body.page-home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8db91;
    background-image: url('/images/hero_bg_goku.png');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    color: #2d273f;
    position: relative;
    overflow-x: hidden;
}

@media (min-width: 992px) and (min-height: 650px) {
    body.page-home {
        height: 100vh;
        overflow: hidden;
    }
}

/* ============ Floating Glass Navbar on Home Page ============ */
body.page-home .ds-nav {
    position: sticky;
    top: 16px;
    z-index: 100;
    max-width: 1140px;
    width: calc(100% - 32px);
    margin: 16px auto 0;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: saturate(180%) blur(26px);
    -webkit-backdrop-filter: saturate(180%) blur(26px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(80, 20, 120, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

body.page-home .ds-nav-inner {
    height: 72px;
    padding: 0 32px;
}

body.page-home .ds-nav-brand {
    color: #ff8a1e;
    font-size: 22px;
    font-weight: 900;
    gap: 14px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

body.page-home .ds-nav-brand img {
    height: 52px;
    width: 52px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 95%;
    border: 3px solid #ff8c00;
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.65);
}

body.page-home .ds-nav-links a {
    color: #ffe0b0;
    font-weight: 700;
    font-size: 16px;
    padding: 10px 22px;
    border-radius: 999px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

body.page-home .ds-nav-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

body.page-home .ds-nav-links a.is-active {
    background: linear-gradient(135deg, #ffc266 0%, #ff8a1e 55%, #ef5a0c 100%);
    color: #2a1a06;
    font-weight: 800;
    text-shadow: none;
    box-shadow: 0 3px 12px rgba(239, 90, 12, 0.4);
}

body.page-home .ds-nav-cta .ds-btn-ghost {
    color: #ffe0b0;
    font-weight: 700;
    border-color: rgba(255, 224, 176, 0.6);
}

body.page-home .ds-nav-cta .ds-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Pill dark button for header & general use */
.ds-btn-pill-dark {
    background: #181622;
    color: #ffffff !important;
    border: none;
    border-radius: 999px;
    padding: 8px 22px;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 4px 14px rgba(24, 22, 34, 0.3);
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.ds-btn-pill-dark:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* ============ Visually Hidden Utility ============ */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============ Home Hero Content ============ */
body.page-home .ds-home-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-4) 48px var(--space-5);
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
}

body.page-home .ds-home-content {
    max-width: 630px;
    text-align: left;
    z-index: 10;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: dsHeroFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dsHeroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dragon Ball Icon + Eyebrow */
body.page-home .ds-home-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 8px;
    position: relative;
}

body.page-home .ds-dragonball-img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 4px 18px rgba(255, 140, 0, 0.75));
    animation: dsBallPulse 3s infinite alternate ease-in-out;
}

body.page-home .ds-dragonball-right {
    animation-delay: 1.5s;
    transform: rotate(12deg);
}

@keyframes dsBallPulse {
    0% { transform: scale(1); filter: drop-shadow(0 4px 16px rgba(255, 120, 0, 0.6)); }
    100% { transform: scale(1.08); filter: drop-shadow(0 6px 26px rgba(255, 160, 0, 0.95)); }
}

body.page-home .ds-eyebrow-text {
    position: relative;
    font-size: 28px;
    font-weight: 900;
    font-style: italic;
    color: #ff4800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(255, 120, 0, 0.35);
    padding: 0 4px 6px;
    display: inline-block;
}

body.page-home .ds-eyebrow-text::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 4px;
    height: 2.5px;
    background: linear-gradient(90deg, #ff4800 0%, #ffa500 100%);
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(255, 120, 0, 0.4);
}

/* Main Logo Wrap: NRO ZERO */
body.page-home .ds-home-logo-wrap {
    margin: 6px 0 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

body.page-home .ds-home-logo {
    width: 100%;
    max-width: 580px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(255, 70, 0, 0.28)) drop-shadow(0 4px 18px rgba(120, 40, 220, 0.32));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

body.page-home .ds-home-logo:hover {
    transform: scale(1.025);
    filter: drop-shadow(0 10px 30px rgba(255, 70, 0, 0.38)) drop-shadow(0 6px 24px rgba(138, 43, 226, 0.42));
}

body.page-home .ds-home-title {
    display: none;
}

/* Description paragraph */
body.page-home .ds-home-desc {
    font-size: 17.5px;
    color: #ffe0b0;
    max-width: 590px;
    margin: 0 0 26px 0;
    line-height: 1.6;
    font-weight: 700;
    text-align: left;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
}

body.page-home .ds-desc-dash {
    color: #272133;
    font-weight: 800;
    margin-right: 4px;
}

/* CTA Download Buttons Side-by-Side */
body.page-home .ds-home-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    width: 100%;
}

body.page-home .ds-btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 13px 22px;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    min-width: 165px;
}

body.page-home .ds-btn-hero-web {
    background: linear-gradient(135deg, #6c3bfe 0%, #531df4 100%);
    box-shadow: 0 10px 26px -4px rgba(99, 47, 245, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

body.page-home .ds-btn-hero-win {
    background: linear-gradient(135deg, #ff6c26 0%, #ff5214 100%);
    box-shadow: 0 10px 26px -4px rgba(255, 85, 20, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

body.page-home .ds-btn-hero-android {
    background: linear-gradient(135deg, #2b2e34 0%, #1e2025 100%);
    box-shadow: 0 10px 26px -4px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.page-home .ds-btn-hero:hover {
    transform: translateY(-4px) scale(1.03);
}

body.page-home .ds-btn-hero-web:hover {
    box-shadow: 0 16px 36px -4px rgba(99, 47, 245, 0.65);
}

body.page-home .ds-btn-hero-win:hover {
    box-shadow: 0 16px 36px -4px rgba(255, 90, 20, 0.6);
}

body.page-home .ds-btn-hero-android:hover {
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65);
}

body.page-home .ds-btn-hero-icon {
    font-size: 27px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

body.page-home .ds-btn-hero-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

body.page-home .ds-btn-hero-text .label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.1;
    letter-spacing: 0.01em;
}

body.page-home .ds-btn-hero-text .platform {
    font-size: 17.5px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Version text */
body.page-home .ds-home-version {
    font-size: 14px;
    color: #3d354d;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
}

body.page-home .ds-home-version span {
    font-weight: 800;
    color: #1a1625;
}

/* Footer override on home page */
body.page-home .ds-footer {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: none;
    padding: 10px 24px 18px;
    color: #4a4359;
}

body.page-home .ds-footer-meta {
    text-align: center;
    font-size: 11px;
    color: #5c546d;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

@media (max-width: 991.98px) {
    body.page-home {
        background-position: 68% center;
        height: auto !important;
        overflow-y: auto !important;
    }
    body.page-home .ds-home-hero {
        padding: 36px 20px 320px;
        justify-content: center;
    }
    body.page-home .ds-home-content {
        max-width: 100%;
        text-align: center;
        align-items: center;
        margin: 0 auto;
    }
    body.page-home .ds-home-eyebrow,
    body.page-home .ds-home-logo-wrap,
    body.page-home .ds-home-buttons,
    body.page-home .ds-home-version {
        justify-content: center;
    }
    body.page-home .ds-home-desc {
        text-align: center;
        margin: 0 auto 20px;
    }
}

/* ============ Apple-Style Glassmorphism Leaderboard Table ============ */
.ds-apple-card {
    max-width: 920px;
    width: calc(100% - 32px);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 24px;
    padding: 22px 24px;
    box-shadow: 0 20px 50px rgba(255, 140, 0, 0.15);
    overflow: hidden;
}

.ds-apple-card .ds-btn-ghost,
.ds-apple-tab {
    color: #4b5563 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

.ds-apple-card .ds-btn-ghost:hover,
.ds-apple-tab:hover {
    color: #1a1625 !important;
    background: #ffffff !important;
    border-color: #ffaa00 !important;
    box-shadow: 0 4px 12px rgba(255, 170, 0, 0.2) !important;
}

.ds-apple-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ds-apple-table-wrap::-webkit-scrollbar {
    display: none;
}

.ds-apple-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 7px;
    min-width: 600px;
}

.ds-apple-table th {
    font-size: 12px;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 16px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}

.ds-apple-table th.th-center {
    text-align: center;
}

.ds-apple-table th.th-right {
    text-align: right;
}

.ds-apple-row {
    background: rgba(255, 255, 255, 0.48);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-apple-row td {
    padding: 9px 16px;
    vertical-align: middle;
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Thu gọn: avatar + huy hiệu hạng + tên nhỏ lại cho bảng gọn hơn */
.ds-apple-row td img {
    width: 34px !important;
    height: 34px !important;
}

.ds-apple-row td:first-child > div {
    width: 30px !important;
    height: 30px !important;
    font-size: 12.5px !important;
}

.ds-apple-row td div[style*="font-weight: 800"][style*="16px"] {
    font-size: 14.5px !important;
}

.ds-apple-row td.td-center {
    text-align: center;
}

.ds-apple-row td.td-right {
    text-align: right;
}

.ds-apple-row td:first-child {
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.8);
}

.ds-apple-row td:last-child {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.8);
}

.ds-apple-row:hover {
    background: rgba(255, 255, 255, 0.88);
    transform: scale(1.006);
    box-shadow: 0 10px 28px rgba(255, 140, 0, 0.18);
}

/* Apple Pill Badges for exact column alignment */
.ds-apple-pill {
    display: inline-block;
    min-width: 96px;
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    color: #1e293b;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 3px 8px;
}

.ds-boss-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(249, 115, 22, 0.12) 100%);
    color: #dc2626;
    font-weight: 800;
    font-size: 13.5px;
    padding: 4px 14px;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, 0.28);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
    letter-spacing: -0.01em;
}

.ds-boss-pill i {
    font-size: 14px;
    color: #ef4444;
}

/* Card Header & Tabs container inside Apple Card */
.ds-apple-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Reusable Rank Medals */
.ds-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 900;
    flex-shrink: 0;
}
.ds-rank-1 {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #ffd700 0%, #ff9900 100%);
    color: #1a1625;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(255, 170, 0, 0.5);
    border: 2px solid #fff9e6;
}
.ds-rank-2 {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    color: #1e293b;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
    border: 2px solid #ffffff;
}
.ds-rank-3 {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #fba94c 0%, #d97706 100%);
    color: #ffffff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    border: 2px solid #fffbeb;
}
.ds-rank-other {
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.06);
    color: #4b5563;
    font-weight: 800;
    font-size: 15px;
}

/* ============ Mobile Responsive Optimizations (@media max-width: 768px) ============ */
@media (max-width: 768px) {
    /* Safe padding at document bottom to prevent dock overlap */
    body {
        padding-bottom: max(76px, calc(66px + env(safe-area-inset-bottom))) !important;
    }
    body.page-home {
        padding-bottom: max(76px, calc(66px + env(safe-area-inset-bottom))) !important;
    }

    /* Navbar optimization */
    .ds-nav {
        top: 8px;
        width: calc(100% - 16px);
        margin: 8px auto 0;
        border-radius: 20px;
    }
    .ds-nav-inner {
        height: 56px;
        padding: 0 12px;
    }
    .ds-nav-brand {
        font-size: 16px;
        gap: 8px;
    }
    .ds-nav-brand img {
        height: 34px;
        width: 34px;
        border-width: 2px;
    }
    .ds-nav-links {
        display: none !important;
    }
    .ds-nav-cta {
        gap: 6px;
    }
    .ds-nav-cta .ds-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 34px;
    }
    .ds-nav-user {
        padding: 2px 8px 2px 3px;
        gap: 6px;
        max-width: 135px;
    }
    .ds-nav-user .ds-avatar {
        width: 28px;
        height: 28px;
    }
    .ds-nav-user-name {
        font-size: 12.5px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ds-nav-icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 14px !important;
        padding: 0 !important;
    }

    /* Floating Glass Bottom Navigation Dock */
    .ds-mobile-dock {
        display: flex !important;
        position: fixed !important;
        bottom: max(10px, env(safe-area-inset-bottom)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 20px) !important;
        max-width: 440px !important;
        background: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border: 1px solid rgba(255, 255, 255, 0.95) !important;
        border-radius: 999px !important;
        padding: 6px 8px !important;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(255, 140, 0, 0.18) !important;
        z-index: 1050 !important;
        justify-content: space-around !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
    }
    .ds-mobile-pill {
        flex: 1;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 4px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        color: #4b5563;
        background: transparent;
        border: none;
        text-decoration: none;
        white-space: nowrap;
        box-shadow: none;
        transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
        min-height: 44px;
    }
    .ds-mobile-pill i {
        font-size: 17px;
        line-height: 1;
    }
    .ds-mobile-pill span {
        font-size: 10.5px;
        line-height: 1;
    }
    .ds-mobile-pill.is-active,
    .ds-mobile-pill:active {
        background: linear-gradient(135deg, #ffc266 0%, var(--color-primary) 100%);
        color: #2a1a06 !important;
        border-color: transparent;
        box-shadow: 0 4px 14px rgba(255, 140, 0, 0.32);
    }
    .ds-mobile-pill-admin {
        color: #d97706;
    }

    /* Homepage Hero optimization */
    body.page-home .ds-home-hero {
        padding: 24px 16px 40px;
        min-height: calc(100vh - 160px);
    }
    body.page-home .ds-home-logo {
        max-width: 94%;
    }
    body.page-home .ds-eyebrow-text {
        font-size: 20px;
    }
    body.page-home .ds-dragonball-img {
        width: 44px;
        height: 44px;
    }
    body.page-home .ds-home-desc {
        font-size: 14.5px;
        line-height: 1.6;
        margin-bottom: 22px;
        padding: 0 4px;
    }
    body.page-home .ds-desc-br {
        display: none;
    }
    body.page-home .ds-home-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto 20px;
        gap: 12px;
    }
    body.page-home .ds-btn-hero {
        width: 100%;
        min-height: 52px;
        padding: 12px 20px;
        justify-content: center;
        border-radius: 14px;
    }

    /* Apple table refinement */
    .ds-apple-card {
        padding: 14px 12px;
        border-radius: 20px;
        width: calc(100% - 16px);
        max-width: 100%;
        overflow: hidden;
    }
    .ds-apple-table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-sm);
        position: relative;
    }
    .ds-apple-table {
        min-width: 480px;
    }
    .ds-apple-table th,
    .ds-apple-row td {
        padding: 9px 10px;
        font-size: 12.5px;
    }
    .ds-apple-pill {
        min-width: 80px;
        font-size: 12px;
        padding: 4px 6px;
    }
    .ds-apple-card-header {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        margin-bottom: 14px;
        padding-bottom: 10px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ds-apple-card-header::-webkit-scrollbar {
        display: none;
    }
    .ds-forum-tabs {
        width: 100%;
        display: inline-flex;
        justify-content: flex-start;
        padding: 4px;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ds-forum-tabs::-webkit-scrollbar {
        display: none;
    }
    .ds-forum-tab {
        padding: 6px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }
    .ds-rank-1, .ds-rank-2, .ds-rank-3 {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .ds-rank-other {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
}

/* ==========================================
   FORUM — light-gold surface component layer
   Nền site đã là kem/vàng sáng; các token chữ gốc (--color-text-*)
   là của theme tối nên mờ trên card sáng. Bộ token mực tối + component
   .ds-forum-* dưới đây bám công thức tương phản của .ds-apple-* (chữ tối
   trên kính sáng) để mọi nội dung diễn đàn đọc rõ, đạt WCAG AA.
   ========================================== */
:root {
    --ink-strong: #1a1625;
    --ink: #3b354d;
    --ink-soft: #5d566d;
    --ink-faint: #8a8397;
    --forum-line: rgba(26, 22, 37, 0.10);
    --forum-line-soft: rgba(26, 22, 37, 0.06);
    --forum-gold: #e8880c;
    --forum-gold-tint: rgba(255, 170, 40, 0.14);
}

/* ---- Toolbar: tabs + nút tạo chủ đề ---- */
.ds-forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.ds-forum-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(255, 140, 0, 0.1);
}

.ds-forum-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-soft);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-forum-tab:hover {
    color: var(--ink-strong);
    background: rgba(255, 255, 255, 0.75);
}

.ds-forum-tab.is-active {
    color: #2a1a06;
    background: linear-gradient(135deg, #ffc266 0%, var(--color-primary) 55%, var(--color-orange-mid) 100%);
    box-shadow: 0 4px 14px var(--color-primary-glow);
}

/* ---- Section heads ---- */
.ds-forum-section-head {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ink-strong);
    margin: 0 0 16px;
}

.ds-forum-section-head--pin {
    color: var(--forum-gold);
}

.ds-forum-section-head .ds-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-faint);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--forum-line);
    padding: 2px 10px;
    border-radius: 999px;
}

/* ---- Topic list & cards ---- */
.ds-forum-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ds-forum-topic {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ds-forum-topic:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(255, 140, 0, 0.22);
    border-color: #ffb454;
}

.ds-forum-topic--pin {
    border-left: 4px solid var(--forum-gold);
    background:
        linear-gradient(90deg, var(--forum-gold-tint) 0%, rgba(255, 255, 255, 0.62) 42%);
}

.ds-forum-topic__body {
    flex: 1;
    min-width: 0;
}

.ds-forum-topic__head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-forum-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink-strong);
    text-decoration: none;
    word-break: break-word;
    transition: color 0.15s ease;
}

.ds-forum-title:hover {
    color: var(--color-primary-hover);
}

.ds-forum-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-faint);
    margin-top: 6px;
}

.ds-forum-meta strong {
    color: var(--ink);
    font-weight: 700;
}

.ds-forum-meta .dot {
    color: var(--ink-faint);
    opacity: 0.6;
}

.ds-forum-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--forum-line);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
    flex-shrink: 0;
}

.ds-forum-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--forum-line);
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.16s ease;
}

.ds-forum-topic:hover .ds-forum-go {
    color: #2a1a06;
    background: linear-gradient(135deg, #ffc266 0%, var(--color-primary) 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.ds-forum-pin-badge {
    background: linear-gradient(135deg, #ffd873 0%, var(--forum-gold) 100%);
    color: #4a2c00;
    box-shadow: 0 2px 8px rgba(232, 136, 12, 0.35);
}

/* ---- Empty state ---- */
.ds-forum-empty {
    text-align: center;
    padding: 48px 24px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--forum-line);
    border-radius: var(--radius-lg);
}

.ds-forum-empty__icon {
    font-size: 42px;
    color: var(--color-primary);
    opacity: 0.85;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px var(--color-primary-glow));
}

.ds-forum-empty p {
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 18px;
}

/* ---- Pagination ---- */
.ds-forum-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.ds-forum-pager a {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--forum-line);
    transition: all 0.15s ease;
}

.ds-forum-pager a:hover {
    color: var(--ink-strong);
    border-color: #ffb454;
}

.ds-forum-pager a.is-active {
    color: #2a1a06;
    background: linear-gradient(135deg, #ffc266 0%, var(--color-primary) 100%);
    border-color: transparent;
    box-shadow: 0 4px 14px var(--color-primary-glow);
}

/* ==========================================
   THREAD / POST DETAIL — light surface
   ========================================== */
.ds-thread-back {
    margin-bottom: 20px;
}

/* Nút quay lại tông sáng (dùng trên nền kem/card sáng) */
.ds-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--forum-line);
    text-decoration: none;
    transition: all 0.16s ease;
}

.ds-back-btn:hover {
    color: var(--ink-strong);
    background: rgba(255, 255, 255, 0.9);
    border-color: #ffb454;
}

/* Biến thể chỉ-icon, hình tròn */
.ds-back-btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 16px;
    flex-shrink: 0;
}

.ds-thread-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-top: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 12px 36px rgba(255, 140, 0, 0.14);
}

.ds-thread-author {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--forum-line);
}

.ds-thread-author__name {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink-strong);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-thread-author__time {
    font-size: 13px;
    color: var(--ink-faint);
    margin-top: 4px;
}

.ds-thread-title {
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--ink-strong);
    margin: 0 0 16px;
}

.ds-thread-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--ink);
    word-break: break-word;
}

.ds-thread-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    margin-top: 20px;
}

.ds-thread-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--forum-line);
    font-size: 13px;
    color: var(--ink-faint);
}

.ds-thread-foot .like {
    color: #e0554f;
    font-weight: 700;
}

/* ---- Comment composer + list ---- */
.ds-comment-box {
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.1);
}

.ds-comment-box__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink-strong);
    margin: 0 0 16px;
}

.ds-comment-login {
    text-align: center;
    padding: 22px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--forum-line);
    border-radius: var(--radius-md);
}

.ds-comment-login p {
    color: var(--ink-soft);
    margin: 0 0 12px;
}

.ds-comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ds-comment {
    display: flex;
    gap: 16px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 18px rgba(255, 140, 0, 0.08);
}

.ds-comment__body {
    flex: 1;
    min-width: 0;
}

.ds-comment__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ds-comment__author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-comment__name {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink-strong);
}

.ds-comment__time {
    color: var(--ink-faint);
    font-size: 12px;
}

.ds-comment__text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink);
    word-break: break-word;
}

.ds-btn-del {
    color: #e0554f;
    border-color: rgba(224, 85, 79, 0.3);
    background: rgba(224, 85, 79, 0.06);
    padding: 3px 10px;
    font-size: 12px;
}

.ds-btn-del:hover {
    background: rgba(224, 85, 79, 0.14);
    border-color: #e0554f;
}

/* ---- Compose / create post form on light surface ---- */
.ds-forum-form-card {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-top: 4px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 12px 36px rgba(255, 140, 0, 0.14);
}

.ds-forum-form-card h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink-strong);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.ds-forum-form-card .hint {
    font-size: 14px;
    color: var(--ink-faint);
    margin: 6px 0 0;
}

/* Forms on light surface: input nền trắng, chữ tối */
.ds-input--light,
.ds-textarea--light {
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--forum-line);
    color: var(--ink-strong);
}

.ds-input--light::placeholder,
.ds-textarea--light::placeholder {
    color: var(--ink-faint);
}

.ds-input--light:focus,
.ds-textarea--light:focus {
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.ds-label--light {
    color: var(--ink-strong);
    font-weight: 700;
    font-size: 14px;
}

.ds-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--forum-line);
}

@media (max-width: 560px) {
    .ds-grid, .ds-grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .ds-card {
        padding: 18px 16px;
    }
    .ds-forum-topic {
        padding: 14px 16px;
        gap: 12px;
    }
    .ds-forum-toolbar {
        gap: 12px;
    }
    .ds-forum-tabs {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ds-forum-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* Small phone specific refinements under 480px */
@media (max-width: 480px) {
    .ds-nav-brand span {
        font-size: 15px;
    }
    .ds-nav-brand img {
        width: 30px;
        height: 30px;
    }
    .ds-nav-cta .ds-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    .ds-apple-table {
        min-width: 440px;
    }
    .ds-apple-table th,
    .ds-apple-row td {
        padding: 8px 8px;
        font-size: 12px;
    }
    .ds-apple-pill {
        min-width: 72px;
        font-size: 11.5px;
        padding: 3px 6px;
    }
    .ds-hero {
        padding: 24px 12px !important;
    }
    .ds-hero h1 {
        font-size: 22px !important;
    }
    .ds-section {
        padding: 16px 8px;
    }
    .ds-input, .ds-input--light {
        font-size: 16px !important; /* Prevents auto zoom on iOS Safari */
    }
}

/* Extra small devices (iPhone SE, Galaxy Fold cover screen) under 380px */
@media (max-width: 380px) {
    .ds-nav-brand span {
        display: none;
    }
    .ds-nav-user-name {
        max-width: 60px;
    }
    .ds-mobile-pill span {
        font-size: 9.5px;
    }
    .ds-mobile-pill i {
        font-size: 15px;
    }
}
