/*
 * public/assets/css/app.css — Base mobile-first cho mặt công khai (task 23.2).
 *
 * Quy ước:
 *   - Viết base cho MOBILE trước (1 cột, bottom-nav cố định đáy).
 *   - Desktop nâng cấp trong khối @media (min-width: 769px): lưới nhiều cột,
 *     hiện top nav, ẩn bottom-nav (Req 12.1).
 *   - Không dùng framework; chỉ vài biến CSS + class theo tên các view đang dùng
 *     (home-*, auth-*, game-detail*, trade-*, coupon-*, wallet-*, ranking-*,
 *     catalog-*, app-download-*, .btn, .alert, .form-field, .bottom-nav).
 */

:root {
    --c-bg: #f8fafc;
    --c-surface: #ffffff;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e2e8f0;
    --c-primary: #2563eb;
    --c-primary-text: #ffffff;
    --c-secondary: #e2e8f0;
    --c-secondary-text: #1e293b;
    --c-success-bg: #dcfce7;
    --c-success-text: #166534;
    --c-error-bg: #fee2e2;
    --c-error-text: #991b1b;
    --c-warning-bg: #fef3c7;
    --c-warning-text: #92400e;
    --c-info-bg: #dbeafe;
    --c-info-text: #1e40af;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --gap: 1rem;
    --gap-sm: .5rem;
    --header-h: 56px;
    --bottomnav-h: 60px;
    --maxw: 1100px;
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .18);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .28);
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-bg);
    /* Chừa chỗ cho bottom-nav cố định trên mobile. */
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
}

/* ── Ảnh nền động (random wallpaper API) ────────────────────────────── */
.app-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('https://www.98qy.com/sjbz/api.php');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.app-bg__overlay {
    position: absolute;
    inset: 0;
    /* Lớp phủ sáng giúp nội dung dễ đọc ở light mode. */
    background: rgba(255, 255, 255, .72);
}
[data-theme="dark"] .app-bg__overlay {
    background: rgba(15, 17, 26, .78);
}
/* Nền body trong suốt để thấy ảnh nền phía sau. */
body.app-body { background: transparent; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ── Header sticky ──────────────────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}
.app-header__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    min-height: var(--header-h);
    padding: 0 var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
}
.app-header__brand {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--c-text);
}
.app-header__brand:hover { text-decoration: none; }
.app-header__nav { display: none; gap: .25rem; flex-wrap: wrap; }
.app-header__link {
    padding: .4rem .65rem;
    border-radius: 8px;
    color: var(--c-secondary-text);
    font-weight: 600;
    font-size: .95rem;
}
.app-header__link:hover { background: var(--c-secondary); text-decoration: none; }
.app-header__link.is-active { background: var(--c-primary); color: var(--c-primary-text); }

/* ── Main ───────────────────────────────────────────────────────────── */
.app-main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: var(--gap);
}
.app-main > main { padding: 0; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--c-primary); color: var(--c-primary-text); }
.btn-secondary { background: var(--c-secondary); color: var(--c-secondary-text); }
.btn-disabled, .btn:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: 10px;
    margin: 0 0 1rem;
    font-size: .95rem;
}
.alert-success { background: var(--c-success-bg); color: var(--c-success-text); }
.alert-error { background: var(--c-error-bg); color: var(--c-error-text); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning-text); }
.alert-info { background: var(--c-info-bg); color: var(--c-info-text); }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-field { display: block; margin: 0 0 1rem; }
.form-label { display: block; margin: 0 0 .35rem; font-weight: 600; font-size: .95rem; }
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--c-surface);
    color: var(--c-text);
}
.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid var(--c-primary);
    outline-offset: 1px;
    border-color: var(--c-primary);
}
.captcha-widget { margin: 0 0 1rem; }

/* Card chung dùng lại cho nhiều block. */
.auth-card,
.coupon-card,
.trade-card,
.trade-create-card,
.promo-card,
.wallet-balance-card,
.wallet-history,
.app-download-card,
.game-card,
.ranking-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

/* ── Home ───────────────────────────────────────────────────────────── */
/* Tab danh mục đầu trang: Trang chủ / Mới / Sắp tới / Phổ biến (cuộn ngang
   trên mobile, dùng chung cho trang chủ và trang danh mục). */
.home-tabs {
    margin: 0 0 var(--gap);
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.home-tabs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: .35rem;
    white-space: nowrap;
}
.home-tabs__item { flex: 0 0 auto; }
.home-tabs__link {
    display: inline-block;
    padding: .65rem .9rem;
    color: var(--c-muted);
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 3px solid transparent;
}
.home-tabs__link:hover { text-decoration: none; color: var(--c-text); }
.home-tabs__link.is-active {
    color: var(--c-text);
    border-bottom-color: var(--c-primary);
}

/* Nhóm game trên trang chủ (Mới / Sắp tới / Phổ biến) khi cuộn xuống. */
.home-group { margin: var(--gap) 0; }
.home-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .6rem;
}
.home-group__title { margin: 0; font-size: 1.25rem; display: flex; align-items: center; gap: .45rem; }
.home-group__more {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--c-primary);
    font-size: .95rem;
}

/* GM Tool section — khu riêng, nổi bật hơn các nhóm thường. */
.home-group--gm-tool {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: 16px;
    padding: 1rem 1.1rem 1.25rem;
    margin-left: calc(-1 * var(--gap, 1rem));
    margin-right: calc(-1 * var(--gap, 1rem));
}
.home-group--gm-tool .home-group__title { color: #e2e8f0; }
.home-group--gm-tool .home-group__more  { color: #7dd3fc; }
.home-group--gm-tool .game-card__name   { color: #e2e8f0; }
.home-group--gm-tool .game-card__link:hover .game-card__name { color: #7dd3fc; }

/* Badge "GM" — pill vàng nhỏ bên cạnh tiêu đề */
.home-group__badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .15rem .45rem;
    border-radius: 6px;
    font-size: .68rem; font-weight: 800; letter-spacing: .04em;
    line-height: 1.2;
}
.home-group__badge--gm {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.home-banners__list,
.home-shortcuts__list,
.home-promotions__list,
.coupon-list,
.trade-list,
.game-grid,
.game-detail__tags,
.game-detail__gallery,
.game-card__tags,
.wallet-txn-list,
.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.home-banner {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--gap);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
}
.home-banner--default {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    text-align: center;
    padding: 1.5rem;
}
.home-banner__caption { display: block; padding: .6rem .8rem; font-weight: 600; }
.home-shortcuts__list { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; margin: var(--gap) 0; }
.home-shortcut__link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 64px;
    padding: .6rem;
    border-radius: var(--radius);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    font-weight: 700;
}
.home-promotions__list { display: grid; gap: .6rem; }
.promo-card { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.promo-card__title { font-weight: 700; }
.promo-card__reward { color: var(--c-primary); font-weight: 700; }
.promo-card__btn { margin-top: .5rem; }
.promo-card__form { margin-top: .5rem; }
.promo-card__time { color: var(--c-muted); font-size: .8rem; margin-top: .25rem; }
.promo-card--claimed { opacity: .85; }
.promo-card--not_yet { opacity: .9; }
.home-promotions__empty,
.coupon-empty,
.trade-empty,
.catalog-empty,
.ranking-empty,
.wallet-empty {
    color: var(--c-muted);
    padding: 1rem;
    text-align: center;
}

/* ── Catalog / game grid ────────────────────────────────────────────── */
.catalog-search { display: flex; gap: .5rem; margin: 0 0 var(--gap); }
.catalog-search input { flex: 1; padding: .6rem .75rem; border: 1px solid var(--c-border); border-radius: 10px; }
.catalog-search button { white-space: nowrap; padding: .6rem 1rem; border: 0; border-radius: 10px; background: var(--c-primary); color: #fff; font-weight: 700; }
.catalog-group { margin: 0 0 1.5rem; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.game-card { padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.game-card__link { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--c-text); }
.game-card__icon { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.game-card__icon--placeholder { background: var(--c-secondary); display: block; }
.game-card__name { font-weight: 600; text-align: center; font-size: .95rem; }
.game-card__tags { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; }
.game-card__tag,
.game-detail__tag {
    font-size: .72rem;
    background: var(--c-secondary);
    color: var(--c-secondary-text);
    padding: .12rem .45rem;
    border-radius: 999px;
}
.catalog-pagination,
.trade-pagination,
.wallet-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* ── Game Detail — redesigned (gd-*) ────────────────────────────────── */

/* Break out of app-main padding so hero is edge-to-edge */
.gd {
    margin: calc(-1 * var(--gap));
}

/* Hero */
.gd-hero {
    position: relative;
    min-height: 300px;
    display: flex; align-items: flex-end;
    overflow: hidden;
    background: #0f172a;
}
.gd-hero__bg { position: absolute; inset: 0; }
.gd-hero__banner {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(.5) saturate(1.1);
}
.gd-hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,.95) 0%, rgba(15,23,42,.55) 55%, rgba(15,23,42,.15) 100%);
}
.gd-hero__inner {
    position: relative; z-index: 1;
    display: flex; align-items: flex-end; gap: 1rem;
    width: 100%; padding: 2rem 1rem 1.5rem;
}
.gd-hero__icon {
    flex-shrink: 0; width: 72px; height: 72px;
    border-radius: 14px; object-fit: cover;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    border: 2px solid rgba(255,255,255,.18);
}
.gd-hero__content { flex: 1; min-width: 0; }
.gd-hero__meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.gd-hero__title {
    font-size: 1.5rem; font-weight: 800; color: #fff; margin: 0 0 .15rem;
    line-height: 1.2; text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.gd-hero__dev { color: rgba(255,255,255,.65); font-size: .85rem; margin: 0 0 .35rem; }
.gd-hero__desc {
    color: rgba(255,255,255,.82); font-size: .88rem;
    line-height: 1.55; margin: .5rem 0 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gd-hero__rating { display: flex; align-items: center; gap: .4rem; margin: .45rem 0 0; }
.gd-hero__rating-val { color: #fff; font-weight: 700; font-size: .88rem; }
.gd-hero__rating-count { color: rgba(255,255,255,.55); font-size: .8rem; }
.gd-hero__cta { margin-top: .9rem; }
.gd-cta-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .75rem 1.6rem; border-radius: 12px;
    font: inherit; font-size: .95rem; font-weight: 700;
    cursor: pointer; border: none; text-decoration: none;
    box-shadow: 0 4px 18px rgba(0,0,0,.4);
    transition: filter .15s, transform .1s;
}
.gd-cta-btn:active { transform: scale(.97); }

/* Stars */
.gd-stars { display: inline-flex; gap: 1px; line-height: 1; }
.gd-stars__star { font-size: 1rem; color: rgba(255,255,255,.28); }
.gd-stars__star--on { color: #fbbf24; }
.gd-stars--sm .gd-stars__star { font-size: .82rem; color: #d1d5db; }
.gd-stars--sm .gd-stars__star--on { color: #f59e0b; }

/* Hero badges */
.gd-badge {
    display: inline-flex; align-items: center;
    padding: .18rem .58rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .025em;
}
.gd-badge--upcoming { background: rgba(251,191,36,.28); color: #fef3c7; border: 1px solid rgba(251,191,36,.45); }
.gd-badge--new      { background: rgba(34,197,94,.28);  color: #dcfce7; border: 1px solid rgba(34,197,94,.45); }
.gd-badge--popular  { background: rgba(139,92,246,.3);  color: #ede9fe; border: 1px solid rgba(139,92,246,.45); }
.gd-badge--published{ background: rgba(255,255,255,.14);color: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.22); }
.gd-badge--cat      { background: rgba(255,255,255,.1); color: rgba(255,255,255,.76); border: 1px solid rgba(255,255,255,.16); }

/* Status badge in sidebar (light mode) */
.gd-status-badge { display: inline-flex; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.gd-status-badge--upcoming { background: #fef3c7; color: #b45309; }
.gd-status-badge--new      { background: #dcfce7; color: #15803d; }
.gd-status-badge--popular  { background: #ede9fe; color: #7c3aed; }
.gd-status-badge--published{ background: #f1f5f9; color: #475569; }
[data-theme="dark"] .gd-status-badge--upcoming { background: #451a03; color: #fde68a; }
[data-theme="dark"] .gd-status-badge--new      { background: #14532d; color: #86efac; }
[data-theme="dark"] .gd-status-badge--popular  { background: #2e1065; color: #c4b5fd; }
[data-theme="dark"] .gd-status-badge--published{ background: #1e293b; color: #94a3b8; }

/* Body layout */
.gd-body {
    display: grid; grid-template-columns: 1fr; gap: 1rem;
    padding: var(--gap);   /* restores the margin we cancelled on .gd */
    /* Extra bottom padding on mobile so sticky bar doesn't cover content */
    padding-bottom: calc(var(--gap) + 70px + var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
}
.gd-main { display: flex; flex-direction: column; gap: 1rem; order: 2; }
.gd-side { display: flex; flex-direction: column; gap: 1rem; order: 1; }

/* Cards */
.gd-card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 14px; overflow: hidden;
}
.gd-card__title {
    display: flex; align-items: center; gap: .5rem;
    font-size: .95rem; font-weight: 700; margin: 0;
    padding: .8rem 1.1rem .65rem;
    border-bottom: 1px solid var(--c-border);
}
.gd-card__body { padding: 1rem 1.1rem; }
.gd-card--warn { border-color: #fde68a; }
.gd-card--warn .gd-card__title { background: #fffbeb; border-bottom-color: #fde68a; }
.gd-card__title--warn { color: #92400e; }
[data-theme="dark"] .gd-card--warn { background: #1c1a0e; border-color: #854d0e; }
[data-theme="dark"] .gd-card--warn .gd-card__title { background: rgba(133,77,14,.2); border-bottom-color: #854d0e; }
[data-theme="dark"] .gd-card__title--warn { color: #fde68a; }

/* Description */
.gd-desc { font-size: .95rem; line-height: 1.8; color: var(--c-text); }

/* Gallery */
.gd-gallery {
    display: flex; gap: .65rem;
    overflow-x: auto; padding: .9rem 1.1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.gd-gallery::-webkit-scrollbar { height: 4px; }
.gd-gallery::-webkit-scrollbar-track { background: var(--c-border); border-radius: 2px; }
.gd-gallery::-webkit-scrollbar-thumb { background: var(--c-muted); border-radius: 2px; }
.gd-gallery__item {
    flex-shrink: 0; scroll-snap-align: start;
    border-radius: 10px; overflow: hidden;
    border: 1px solid var(--c-border);
}
.gd-gallery__item img { height: 190px; width: auto; display: block; }

/* Info list */
.gd-info { list-style: none; margin: 0; padding: 0; }
.gd-info__row {
    display: flex; justify-content: space-between; align-items: center; gap: .75rem;
    padding: .6rem 1.1rem; border-bottom: 1px solid var(--c-border); font-size: .87rem;
}
.gd-info__row:last-child { border-bottom: none; }
.gd-info__key { color: var(--c-muted); flex-shrink: 0; }
.gd-info__val { font-weight: 600; text-align: right; }
.gd-info__val--stars { display: flex; align-items: center; gap: .3rem; }

/* Download buttons in sidebar */
.gd-dl { display: flex; flex-direction: column; gap: .5rem; padding: .9rem 1.1rem; }

/* Tags */
.gd-tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: .9rem 1.1rem; }
.gd-tag {
    display: inline-flex; padding: .3rem .8rem;
    background: var(--c-bg); border: 1px solid var(--c-border);
    border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--c-muted);
    transition: background .12s;
}
.gd-tag:hover { background: var(--c-secondary); }

/* Preserved classes (iOS note blocks) */
.game-detail__download-form { display: contents; }
.game-detail__note-block { margin-bottom: .75rem; }
.game-detail__note-block:last-child { margin-bottom: 0; }
.game-detail__note-block p { margin: .35rem 0 0; font-size: .9rem; line-height: 1.6; }
.game-detail__note-badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.game-detail__note-badge--tf { background: #dbeafe; color: #1d4ed8; }
.game-detail__note-badge--sl { background: #fce7f3; color: #be185d; }

/* Download buttons */
.btn-download {
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    width: 100%; padding: .82rem 1.25rem;
    border: none; border-radius: 12px;
    font: inherit; font-size: .95rem; font-weight: 700;
    cursor: pointer; text-decoration: none;
    transition: filter .15s, transform .1s;
}
.btn-download:active { transform: scale(.98); }
.btn-download--android { background: #34a853; color: #fff; }
.btn-download--android:hover { filter: brightness(1.08); }
.btn-download--ios     { background: #1c1c1e; color: #fff; }
.btn-download--ios:hover { filter: brightness(1.15); }
.btn-download--h5      { background: var(--c-primary); color: #fff; }
.btn-download--h5:hover { filter: brightness(1.08); }
.btn-download--special { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; }
.btn-download--special:hover { filter: brightness(1.08); }

/* Admin-only card */
.gd-card--admin { border-color: #818cf8; background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(139,92,246,.04)); }
.gd-card--admin .gd-card__title { background: rgba(99,102,241,.08); border-bottom-color: #a5b4fc; color: #4338ca; }
[data-theme="dark"] .gd-card--admin { background: rgba(99,102,241,.08); border-color: #6366f1; }
[data-theme="dark"] .gd-card--admin .gd-card__title { background: rgba(99,102,241,.15); border-bottom-color: #6366f1; color: #a5b4fc; }
.gd-admin-urls { display: flex; flex-direction: column; gap: .5rem; padding: .9rem 1.1rem; }
.btn-download--admin {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; padding: .7rem 1rem;
    border: 1.5px solid #6366f1; border-radius: 10px;
    font: inherit; font-size: .9rem; font-weight: 600;
    color: #4f46e5; background: rgba(99,102,241,.06);
    cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn-download--admin:hover { background: rgba(99,102,241,.14); border-color: #4f46e5; }
[data-theme="dark"] .btn-download--admin { color: #a5b4fc; border-color: #6366f1; background: rgba(99,102,241,.1); }
[data-theme="dark"] .btn-download--admin:hover { background: rgba(99,102,241,.2); }
.gd-admin-notes { padding: .9rem 1.1rem; font-size: .9rem; line-height: 1.7; color: var(--c-text); }
.gd-admin-notes img { max-width: 100%; border-radius: 8px; }

/* ── Admin Iframe Panel ────────────────────────────────────────────── */
.gd-iframe-panel {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: stretch; justify-content: flex-end;
}
.gd-iframe-panel[hidden] { display: none; }
.gd-iframe-panel__overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
    cursor: pointer;
}
.gd-iframe-panel__container {
    position: relative; display: flex; flex-direction: column;
    width: 100%; max-width: 900px;
    background: var(--c-card-bg, #fff);
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    border-radius: 16px 0 0 16px;
    overflow: hidden;
    animation: gd-iframe-slide .25s ease-out;
}
@keyframes gd-iframe-slide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.gd-iframe-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.06));
    border-bottom: 1px solid rgba(99,102,241,.2);
    flex-shrink: 0;
}
.gd-iframe-panel__info { flex: 1; min-width: 0; }
.gd-iframe-panel__title {
    margin: 0; font-size: 1rem; font-weight: 700; color: #4338ca;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gd-iframe-panel__url {
    display: block; font-size: .75rem; color: var(--c-muted, #6b7280);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.gd-iframe-panel__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.gd-iframe-panel__newtab {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    color: #6366f1; background: rgba(99,102,241,.08);
    text-decoration: none; transition: background .15s;
}
.gd-iframe-panel__newtab:hover { background: rgba(99,102,241,.18); }
.gd-iframe-panel__close {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; border: none;
    color: #6b7280; background: rgba(0,0,0,.05);
    cursor: pointer; transition: background .15s, color .15s;
}
.gd-iframe-panel__close:hover { background: rgba(239,68,68,.1); color: #ef4444; }
.gd-iframe-panel__body { flex: 1; position: relative; overflow: hidden; }
.gd-iframe-panel__loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem; color: var(--c-muted, #6b7280); font-size: .85rem;
    background: var(--c-card-bg, #fff);
    z-index: 2; transition: opacity .3s;
}
.gd-iframe-panel__loading svg { animation: gd-spin 1s linear infinite; }
@keyframes gd-spin { to { transform: rotate(360deg); } }
.gd-iframe-panel__loading.is-hidden { opacity: 0; pointer-events: none; }
.gd-iframe-panel__iframe {
    width: 100%; height: 100%; border: none; display: block;
}

/* Dark mode */
[data-theme="dark"] .gd-iframe-panel__container { background: var(--c-card-bg, #1e1e2e); }
[data-theme="dark"] .gd-iframe-panel__header { background: rgba(99,102,241,.12); border-bottom-color: #6366f1; }
[data-theme="dark"] .gd-iframe-panel__title { color: #a5b4fc; }
[data-theme="dark"] .gd-iframe-panel__close { background: rgba(255,255,255,.06); color: #9ca3af; }
[data-theme="dark"] .gd-iframe-panel__close:hover { background: rgba(239,68,68,.15); color: #f87171; }

/* Mobile: full-width panel */
@media (max-width: 768px) {
    .gd-iframe-panel__container { max-width: 100%; border-radius: 0; }
}

/* Sidebar download card — hidden on mobile (bottom-sheet is the CTA) */
.gd-side__dl-desktop { display: none; }

/* ── Sticky download bar (mobile) ──────────────────────────────────── */
.gd-dlbar {
    position: fixed;
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0;
    z-index: 40;
    padding: .6rem .9rem;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    box-shadow: 0 -2px 16px rgba(0,0,0,.08);
    display: flex;
    gap: .6rem;
}
.gd-dlbar__btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .82rem 1.25rem; border: none; border-radius: 12px;
    font: inherit; font-size: .97rem; font-weight: 700; cursor: pointer;
    background: var(--c-primary); color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    transition: filter .15s, transform .1s;
}
.gd-dlbar__btn:active { transform: scale(.98); filter: brightness(.93); }

/* ── Bottom sheet ───────────────────────────────────────────────────── */
.gd-sheet {
    position: fixed; inset: 0; z-index: 200;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.gd-sheet[hidden] { display: none; }
.gd-sheet__overlay {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.gd-sheet__body {
    position: relative; z-index: 1;
    background: var(--c-surface);
    border-radius: 20px 20px 0 0;
    padding: .75rem 1.25rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    max-height: 88vh;
    overflow-y: auto;
}
.gd-sheet__handle {
    width: 40px; height: 4px;
    background: var(--c-border); border-radius: 2px;
    margin: 0 auto .9rem;
}
.gd-sheet__title {
    font-size: 1.05rem; font-weight: 700;
    margin: 0 0 1rem; color: var(--c-text);
}
.gd-sheet__links { display: flex; flex-direction: column; gap: .55rem; }
/* Channel hint next to button label */
.gd-sheet__channel-hint {
    font-size: .78rem; font-weight: 400;
    opacity: .75; margin-left: auto;
}
/* Larger sheet download buttons */
.gd-sheet__links .btn-download {
    padding: 1rem 1.25rem; font-size: 1rem;
}
.gd-sheet__guide {
    margin-top: 1.25rem;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
}
.gd-sheet__guide-title {
    display: flex; align-items: center; gap: .4rem;
    font-size: .9rem; font-weight: 700; margin: 0 0 .75rem;
    color: var(--c-text);
}
.gd-sheet__guide-block { margin-top: .75rem; }
.gd-sheet__guide-block p {
    margin: .35rem 0 0; font-size: .88rem; line-height: 1.65;
    color: var(--c-muted);
}
.gd-sheet__close {
    display: block; width: 100%; margin-top: 1.25rem;
    padding: .8rem; border: 1px solid var(--c-border); border-radius: 12px;
    font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--c-muted);
    transition: background .12s;
}
.gd-sheet__close:hover { background: var(--c-secondary); }
body.has-sheet { overflow: hidden; }

/* ── User Web Modals (uw-modal) — admin-form style ─────────────────── */
.uw-modal {
    position: fixed; inset: 0; z-index: 150;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.uw-modal[hidden] { display: none; }
.uw-modal__overlay {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.52);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.uw-modal__panel {
    position: relative; z-index: 1;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 18px; width: 100%; max-width: 460px;
    max-height: calc(100dvh - 2rem); overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.uw-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem .875rem; border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; background: var(--c-surface); z-index: 1;
}
.uw-modal__title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--c-text); }
.uw-modal__close {
    width: 30px; height: 30px; flex-shrink: 0;
    border: none; background: var(--c-secondary); border-radius: 50%;
    font-size: 1.1rem; cursor: pointer; color: var(--c-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.uw-modal__close:hover { background: var(--c-border); color: var(--c-text); }
.uw-modal__body { padding: 1.1rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.uw-modal__desc { font-size: .88rem; color: var(--c-muted); margin: 0; line-height: 1.5; }
/* Balance strip inside modal */
.uw-balance {
    display: flex; align-items: baseline; gap: .3rem; justify-content: center;
    padding: .6rem 1rem; background: var(--c-bg); border-radius: 12px;
    border: 1px solid var(--c-border);
}
.uw-balance__amount { font-size: 1.75rem; font-weight: 800; color: var(--c-primary); }
.uw-balance__unit { font-size: .88rem; color: var(--c-muted); }
/* Field */
.uw-field { display: flex; flex-direction: column; gap: .28rem; }
.uw-label { font-size: .85rem; font-weight: 600; color: var(--c-text); }
.uw-label__hint { font-weight: 400; color: var(--c-muted); font-size: .8rem; margin-left: .3rem; }
.uw-input {
    display: block; width: 100%; padding: .65rem .9rem; box-sizing: border-box;
    border: 1.5px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: .95rem; color: var(--c-text); background: var(--c-bg);
    transition: border-color .15s;
}
.uw-input:focus { border-color: var(--c-primary); outline: none; }
.uw-input[readonly] { background: var(--c-secondary); color: var(--c-muted); cursor: default; }
/* Preset grid */
.uw-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.uw-preset {
    padding: .55rem .35rem; border: 1.5px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: .82rem; font-weight: 700; color: var(--c-text);
    background: var(--c-surface); cursor: pointer; text-align: center;
    transition: border-color .12s, color .12s, background .12s;
}
.uw-preset:hover, .uw-preset.is-active { border-color: var(--c-primary); color: var(--c-primary); background: rgba(var(--c-primary-rgb, 99,102,241),.06); }
/* Copy row */
.uw-copy-row { display: flex; gap: .45rem; }
.uw-copy-row .uw-input { flex: 1; min-width: 0; }
.uw-copy-btn {
    flex-shrink: 0; padding: .65rem .9rem;
    border: 1.5px solid var(--c-border); border-radius: 10px;
    font: inherit; font-size: .85rem; font-weight: 600;
    background: var(--c-secondary); color: var(--c-text);
    cursor: pointer; white-space: nowrap; transition: background .12s;
}
.uw-copy-btn:hover { background: var(--c-border); }
.uw-copy-btn.is-copied { border-color: #34d399; color: #15803d; background: #dcfce7; }
/* Section divider label */
.uw-section { font-size: .78rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
/* Buttons */
.uw-btn {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    width: 100%; padding: .82rem 1rem; border: none; border-radius: 12px;
    font: inherit; font-size: .97rem; font-weight: 700; cursor: pointer;
    transition: filter .15s, transform .1s;
}
.uw-btn:active { transform: scale(.98); }
.uw-btn--primary { background: var(--c-primary); color: #fff; }
.uw-btn--primary:hover { filter: brightness(1.07); }
.uw-btn--secondary { background: var(--c-secondary); color: var(--c-text); border: 1px solid var(--c-border); }
.uw-btn--secondary:hover { background: var(--c-border); }
/* Flash inside modal */
.uw-flash { padding: .65rem .9rem; border-radius: 10px; font-size: .88rem; }
.uw-flash--ok  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.uw-flash--err { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
/* Dark mode */
[data-theme="dark"] .uw-modal__panel { background: var(--c-surface); }
[data-theme="dark"] .uw-input { background: var(--c-bg); }
[data-theme="dark"] .uw-copy-btn.is-copied { background: #14532d; border-color: #16a34a; color: #86efac; }
[data-theme="dark"] .uw-balance { background: var(--c-bg); }

/* ── Game Reviews ───────────────────────────────────────────────────── */
.game-reviews {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 14px; overflow: hidden;
}
.game-reviews__title {
    font-size: .95rem; font-weight: 700;
    padding: .8rem 1.1rem .65rem;
    border-bottom: 1px solid var(--c-border);
    margin: 0;
}
/* Average rating summary row */
.game-reviews__avg {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: .6rem 1.25rem; padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--c-border);
}
.game-reviews__avg-label { font-size: .85rem; color: var(--c-muted); }
.game-reviews__avg-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--c-text); }
.game-reviews__avg-stars { display: inline-flex; gap: 2px; font-size: 1.15rem; }
.game-reviews__count { font-size: .82rem; color: var(--c-muted); }

/* Review form */
.game-reviews__form {
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--c-border);
    display: flex; flex-direction: column; gap: .7rem;
}
.game-reviews__field { display: flex; flex-direction: column; gap: .35rem; }
.game-reviews__field-label { font-size: .85rem; font-weight: 600; color: var(--c-text); }
.game-reviews__select,
.game-reviews__textarea {
    display: block; width: 100%; padding: .6rem .85rem;
    border: 1px solid var(--c-border); border-radius: 8px;
    font: inherit; font-size: .9rem; background: var(--c-bg); color: var(--c-text);
    transition: border-color .15s;
    box-sizing: border-box;
}
.game-reviews__select:focus,
.game-reviews__textarea:focus { border-color: var(--c-primary); outline: none; }
.game-reviews__textarea { min-height: 90px; resize: vertical; }
.game-reviews__form .btn { align-self: flex-start; padding: .6rem 1.4rem; }

/* Empty state */
.game-reviews__empty {
    padding: 2rem 1.1rem; text-align: center;
    color: var(--c-muted); font-size: .9rem;
}

/* List */
.game-reviews__list {
    list-style: none; margin: 0; padding: 0;
}
.game-reviews__item {
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--c-border);
}
.game-reviews__item:last-child { border-bottom: none; }
.game-reviews__item-head {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: .4rem .75rem;
    margin-bottom: .45rem;
}
.game-reviews__author {
    font-weight: 700; font-size: .92rem; color: var(--c-text);
}
.game-reviews__item-stars {
    display: inline-flex; gap: 1px; font-size: .85rem;
}
.game-reviews__date {
    font-size: .78rem; color: var(--c-muted); margin-left: auto;
}
.game-reviews__body {
    font-size: .9rem; line-height: 1.65; color: var(--c-text);
    margin: 0; word-break: break-word;
}

/* Dark mode game-reviews */
[data-theme="dark"] .game-reviews { border-color: var(--c-border); }
[data-theme="dark"] .game-reviews__select,
[data-theme="dark"] .game-reviews__textarea {
    background: var(--c-surface); color: var(--c-text);
}

/* ── Auth ───────────────────────────────────────────────────────────── */
.auth-page { max-width: 480px; margin: 0 auto; }
.coupon-page, .trade-page, .wallet-page, .app-download-page { margin: 0 auto; }
.auth-card, .trade-create-card { padding: 1.25rem; }
.auth-title, .trade-create-title { text-align: center; }
.auth-alt, .trade-alt { text-align: center; color: var(--c-muted); margin-top: 1rem; }

/* ── Coupon ─────────────────────────────────────────────────────────── */
.coupon-list { display: grid; gap: .75rem; }
.coupon-card { padding: 1rem; }
.coupon-card-reward-value { color: var(--c-primary); font-weight: 700; }
.coupon-giftcode { margin-top: 1.5rem; }

/* ── Trade ──────────────────────────────────────────────────────────── */
.trade-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: var(--gap); }
.trade-list { display: grid; gap: .75rem; }
.trade-card { padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.trade-card-price-value { font-weight: 700; color: var(--c-primary); }

/* ── Wallet ─────────────────────────────────────────────────────────── */
.wallet-balance-card { padding: 1.25rem; text-align: center; margin-bottom: var(--gap); }
.wallet-balance-amount { font-size: 1.8rem; font-weight: 800; margin: 0; }
.wallet-balance-unit { font-size: 1rem; color: var(--c-muted); }
.wallet-history { padding: 1rem; }
.wallet-txn-list { display: grid; gap: .5rem; }
.wallet-txn-item { padding: .6rem 0; border-bottom: 1px solid var(--c-border); }
.wallet-txn-main { display: flex; justify-content: space-between; gap: .5rem; }
.wallet-txn-credit { color: var(--c-success-text); font-weight: 700; }
.wallet-txn-debit { color: var(--c-error-text); font-weight: 700; }
.wallet-txn-meta { display: flex; justify-content: space-between; gap: .5rem; color: var(--c-muted); font-size: .82rem; }

/* ── Ranking ────────────────────────────────────────────────────────── */
.ranking-list { display: grid; gap: .5rem; counter-reset: rank; }
.ranking-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; }
.ranking-item__rank { font-weight: 800; min-width: 2ch; text-align: center; color: var(--c-primary); }
.ranking-item__game { display: flex; align-items: center; gap: .6rem; flex: 1; color: var(--c-text); }
.ranking-item__icon { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.ranking-item__icon--placeholder { background: var(--c-secondary); display: block; }
.ranking-item__players { text-align: right; font-size: .82rem; color: var(--c-muted); display: flex; flex-direction: column; }
.ranking-item__players-value { font-weight: 700; color: var(--c-text); }

/* ── App download ───────────────────────────────────────────────────── */
.app-download-card { padding: 1.25rem; }
.app-download-actions { display: grid; gap: 1rem; margin-top: 1rem; }
.app-download-meta { color: var(--c-muted); font-size: .9rem; }

/* ── Bottom nav (mobile) ────────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 30;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
}
.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--c-muted);
    font-size: .7rem;
    font-weight: 600;
    text-decoration: none;
}
.bottom-nav__item:hover { text-decoration: none; }
.bottom-nav__item.is-active { color: var(--c-primary); }
.bottom-nav .nav-icon { width: 22px; height: 22px; }
.bottom-nav__label { line-height: 1; }

/* ════════════════════════════════════════════════════════════════════
 * Desktop (Req 12.1): hiện top nav, ẩn bottom-nav, lưới nhiều cột.
 * ════════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    body.app-body { padding-bottom: 0; }

    .app-header__nav { display: flex; }

    .bottom-nav { display: none; }

    h1 { font-size: 1.8rem; }

    .home-shortcuts__list { grid-template-columns: repeat(3, 1fr); }
    .home-promotions__list { grid-template-columns: repeat(3, 1fr); }

    .game-grid { grid-template-columns: repeat(5, 1fr); }
    .coupon-list { grid-template-columns: repeat(3, 1fr); }
    .trade-list { grid-template-columns: repeat(3, 1fr); }
    /* Account shortcuts — more columns on wide screens */
    .account-shortcuts__list { grid-template-columns: repeat(6, 1fr) !important; }

    /* Auth forms stay narrow; content pages expand to app max-width */
    .auth-page { max-width: 500px; }
    .wallet-page { max-width: 640px; }
    .coupon-page, .trade-page { max-width: var(--maxw); }
    .app-download-page { max-width: 760px; }
    /* Account hub also expands on desktop */
    .account-page, .account-menu-page, .svip-page { max-width: var(--maxw); }

    .app-download-actions { grid-template-columns: 1fr 1fr; }

    /* Game detail — desktop */
    .gd-hero { min-height: 420px; }
    .gd-hero__inner { padding: 3rem 2rem 2.5rem; gap: 1.5rem; }
    .gd-hero__icon { width: 110px; height: 110px; border-radius: 20px; }
    .gd-hero__title { font-size: 2rem; }
    .gd-hero__desc { -webkit-line-clamp: 4; max-width: 580px; }
    .gd-body { grid-template-columns: 1fr 300px; gap: 1.5rem; padding: var(--gap) 0; padding-bottom: var(--gap); }
    .gd-main { order: 1; }
    .gd-side { order: 2; }
    .gd-gallery__item img { height: 230px; }
    /* On desktop: show sidebar download card, hide sticky bar */
    .gd-side__dl-desktop { display: block; }
    .gd-dlbar { display: none; }
}


/* ── Auth modal (hộp thoại đăng nhập / đăng ký) ─────────────────────── */
.app-header__logout { margin: 0; display: inline; }
.app-header__link--button {
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

body.has-modal { overflow: hidden; }

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.auth-modal[hidden] { display: none; }
.auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}
.auth-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--c-surface);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem 1.25rem;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
}
.auth-modal__close {
    position: absolute;
    top: .5rem;
    right: .65rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--c-muted);
    cursor: pointer;
}
.auth-modal__close:hover { color: var(--c-text); }
.auth-modal__tabs {
    display: flex;
    gap: .25rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid var(--c-border);
}
.auth-modal__tab {
    flex: 1;
    padding: .65rem .5rem;
    border: 0;
    background: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--c-muted);
    border-bottom: 3px solid transparent;
}
.auth-modal__tab.is-active {
    color: var(--c-text);
    border-bottom-color: var(--c-primary);
}
.auth-modal__intro { color: var(--c-muted); margin: 0 0 1rem; font-size: .92rem; }
.auth-modal__alert { margin: 0 0 1rem; }
.auth-modal__alert[hidden] { display: none; }


/* ── Account hub (Req 13) ───────────────────────────────────────────── */
.account-page, .account-menu-page, .svip-page { margin: 0 auto; }

.account-profile { padding: .5rem 0 1rem; }
.account-profile__top { display: flex; align-items: flex-start; gap: .85rem; border-radius: 14px; padding: .2rem; }
.account-profile__top[style] { padding: 1rem; color: #fff; }
.account-profile__top[style] .account-profile__name,
.account-profile__top[style] .account-profile__code { color: #fff; }
.account-avatar {
    flex: 0 0 auto;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.6rem;
    overflow: hidden;
}
.account-avatar__letter { text-transform: uppercase; }
.account-avatar__img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.account-avatar--framed { border: 4px solid #f59e0b; box-sizing: border-box; }
.account-profile__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.account-profile__name-row { display: flex; align-items: center; gap: .5rem; }
.account-profile__name { font-size: 1.25rem; font-weight: 800; }
.account-svip-badge {
    font-size: .7rem; font-weight: 700;
    padding: .1rem .45rem; border-radius: 6px;
    background: #e2e8f0; color: #64748b;
}
.account-svip-badge.is-unlocked { background: linear-gradient(135deg,#fde68a,#f59e0b); color: #7c2d12; }
.account-profile__wallet { display: flex; align-items: baseline; gap: .4rem; color: var(--c-text); }
.account-profile__balance { font-weight: 700; }
.account-profile__balance-sub { color: var(--c-muted); font-size: .85rem; }
.account-profile__wallet-link { color: var(--c-primary); font-size: .85rem; font-weight: 600; }
.account-profile__code { color: var(--c-muted); font-size: .82rem; }
.account-profile__menu-btn { flex: 0 0 auto; font-size: 1.4rem; color: var(--c-muted); padding: .25rem .4rem; }

.account-pass {
    display: flex; align-items: center; gap: .5rem;
    padding: .85rem 1rem; margin: .25rem 0 1rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}
.account-pass__title { font-weight: 800; }
.account-pass__subtitle { color: #b45309; font-size: .9rem; }
.account-pass__arrow { margin-left: auto; font-size: 1.2rem; }

.account-shortcuts__list {
    list-style: none; margin: 0 0 1rem; padding: 1rem 0;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
    border-bottom: 1px solid var(--c-border);
}
.account-shortcut__link {
    display: flex; flex-direction: column; align-items: center; gap: .4rem;
    color: var(--c-text); text-align: center;
    /* Support both <a> and <button> */
    background: none; border: none; cursor: pointer; font: inherit; padding: 0;
    text-decoration: none; width: 100%;
}
.account-shortcut__icon { color: var(--c-text); }
.account-shortcut__label { font-size: .85rem; }

.account-played__title { font-size: 1.15rem; font-weight: 800; margin-bottom: .75rem; }
.account-played__list { margin-top: .5rem; }
.account-empty {
    display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: 2.5rem 1rem; text-align: center;
}
.account-empty__text { color: var(--c-muted); margin: 0; }
.account-empty__cta { color: var(--c-primary); font-weight: 700; }

/* ── Account menu (Req 13.6) ────────────────────────────────────────── */
.account-menu-header { display: flex; align-items: center; gap: .85rem; padding: .5rem 0 1.25rem; }
.account-menu-header__info { display: flex; flex-direction: column; gap: .2rem; }
.account-menu-header__name { font-size: 1.2rem; font-weight: 800; }
.account-menu-header__code { color: var(--c-muted); font-size: .82rem; }
.account-menu-list {
    list-style: none; margin: 0 0 1rem; padding: 0;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    overflow: hidden;
}
.account-menu-item + .account-menu-item { border-top: 1px solid var(--c-border); }
.account-menu-link {
    display: flex; align-items: center; gap: .75rem;
    width: 100%; padding: .9rem 1rem;
    color: var(--c-text); background: none; border: 0; cursor: pointer;
    font-size: 1rem; text-align: left;
}
.account-menu-link:hover { text-decoration: none; background: #f8fafc; }
.account-menu-link__icon { color: var(--c-muted); display: inline-flex; }
.account-menu-link__label { flex: 1; }
.account-menu-link__value { color: var(--c-muted); font-size: .85rem; }
.account-menu-link__arrow { color: var(--c-muted); font-size: 1.1rem; }
.account-logout {
    margin: 0; background: var(--c-surface);
    border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden;
}
.account-menu-link--logout { color: var(--c-error-text); }

/* ── SVIP (Req 14) ──────────────────────────────────────────────────── */
.svip-hero {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.5rem 1.25rem; border-radius: var(--radius);
    background: linear-gradient(135deg, #e5e7eb, #cbd5e1);
    color: #334155; margin-bottom: 1.25rem;
}
.svip-hero.is-unlocked { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #7c2d12; }
.svip-hero__body { flex: 1; min-width: 0; }
.svip-hero__status { font-size: .8rem; font-weight: 700; opacity: .85; }
.svip-hero__name { font-size: 2rem; font-weight: 900; letter-spacing: 1px; margin: .1rem 0 .4rem; }
.svip-hero__hint { font-size: .9rem; margin: 0 0 .6rem; }
.svip-progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.55); overflow: hidden; }
.svip-progress__bar { display: block; height: 100%; background: #475569; }
.svip-hero.is-unlocked .svip-progress__bar { background: #7c2d12; }
.svip-progress__label { display: block; margin-top: .35rem; font-size: .82rem; font-weight: 600; }
.svip-hero__crown { flex: 0 0 auto; opacity: .8; }

.svip-benefits__title { font-size: 1.15rem; font-weight: 800; margin-bottom: .75rem; }
.svip-benefits__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.svip-benefit {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: .9rem; display: flex; flex-direction: column; gap: .3rem;
}
.svip-benefit__title { font-weight: 700; }
.svip-benefit__desc { color: var(--c-muted); font-size: .82rem; }

@media (min-width: 769px) {
    .account-shortcuts__list { grid-template-columns: repeat(4, 1fr); }
}


/* ── Account drawer (menu trượt) ────────────────────────────────────── */
.account-avatar--sm { width: 48px; height: 48px; font-size: 1.2rem; }
.account-drawer { position: fixed; inset: 0; z-index: 110; }
.account-drawer[hidden] { display: none; }
.account-drawer__overlay {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .5);
    opacity: 0; transition: opacity .2s ease;
}
.account-drawer.is-open .account-drawer__overlay { opacity: 1; }
.account-drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(86%, 360px);
    background: #f1f5f9;
    padding: 1rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .22s ease;
    box-shadow: -8px 0 30px rgba(15, 23, 42, .22);
}
.account-drawer.is-open .account-drawer__panel { transform: translateX(0); }
.account-drawer__header { display: flex; align-items: center; gap: .75rem; padding: .5rem .25rem 1rem; }
.account-drawer__info { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.account-drawer__name { font-weight: 800; font-size: 1.1rem; }
.account-drawer__code { color: var(--c-muted); font-size: .8rem; }
.account-drawer__close { border: 0; background: none; font-size: 1.6rem; color: var(--c-muted); cursor: pointer; line-height: 1; }
.account-drawer .account-menu-list { margin-bottom: .85rem; }

/* ── Account sub-pages (profile / security / settings / support) ────── */
.account-subpage { max-width: 640px; margin: 0 auto; }
.account-subpage__header { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.account-subpage__back { font-size: 1.6rem; line-height: 1; color: var(--c-text); padding: 0 .35rem; }
.account-subpage__title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.account-card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.account-card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: .85rem; }
.account-form .form-field input[disabled] { background: #f1f5f9; color: var(--c-muted); }
.form-error { display: block; margin-top: .3rem; color: var(--c-error-text); font-size: .85rem; }
.account-note { color: var(--c-muted); text-align: center; padding: 1rem; }

.support-guess__title { font-size: 1.05rem; font-weight: 800; margin-bottom: .75rem; }
.support-faq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.support-faq-item {
    display: flex; align-items: center; gap: .5rem;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: .9rem 1rem;
}
.support-faq-item__q { flex: 1; }
.support-faq-item__arrow { color: var(--c-muted); font-size: 1.1rem; }


/* ── Chat (Req 18) ──────────────────────────────────────────────────── */
.chat-page { display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.chat-page__header { display: flex; align-items: center; gap: .5rem; padding: .75rem 0; }
.chat-page__back { font-size: 1.6rem; line-height: 1; color: var(--c-text); padding: 0 .35rem; }
.chat-page__title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.chat { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.chat__more { align-self: center; margin: .25rem 0; padding: .35rem .75rem; background: transparent; border: 1px solid var(--c-border); border-radius: 999px; font-size: .85rem; cursor: pointer; }
.chat__list { list-style: none; margin: 0; padding: .25rem; height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); }
.chat__item { max-width: 80%; align-self: flex-start; background: #f1f5f9; border-radius: 12px; padding: .4rem .6rem; }
.chat__item.is-mine { align-self: flex-end; background: #dbeafe; }
.chat__sender { display: block; font-size: .72rem; font-weight: 600; opacity: .7; }
.chat__body { display: block; font-size: .95rem; word-break: break-word; white-space: pre-wrap; }
.chat__time { display: block; font-size: .65rem; opacity: .55; margin-top: .15rem; }
.chat__empty { text-align: center; opacity: .6; padding: 1.5rem 1rem; }
.chat__form { display: flex; gap: .5rem; padding: .5rem 0; }
.chat__input { flex: 1 1 auto; padding: .55rem .75rem; border: 1px solid var(--c-border); border-radius: 999px; font-size: .95rem; }
.chat__send { flex: 0 0 auto; }
.chat__error { color: var(--c-error-text); font-size: .85rem; text-align: center; padding: .35rem; }

/* ── Tu Tiên (Req 19) ───────────────────────────────────────────────── */
.cultivation-page { padding: 0; max-width: 480px; margin: 0 auto; }
.cultivation__header { display: flex; align-items: center; gap: .5rem; margin: .75rem 0 1rem; }
.cultivation__back { font-size: 1.6rem; line-height: 1; color: var(--c-text); padding: 0 .35rem; }
.cultivation__title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.cultivation__card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.25rem; }
.cultivation__realm-row, .cultivation__points-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .85rem; }
.cultivation__label { color: var(--c-muted); font-size: .85rem; }
.cultivation__realm { font-size: 1.4rem; font-weight: 800; color: var(--c-primary); }
.cultivation__points { font-variant-numeric: tabular-nums; font-weight: 700; }
.cultivation__sep { margin: 0 .25rem; color: var(--c-muted); }
.cultivation__progress { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: .5rem 0 .25rem; }
.cultivation__bar { height: 100%; background: linear-gradient(90deg, #8b6ef0, #6b4ee6); width: 0; transition: width .4s ease; }
.cultivation__percent { text-align: right; font-size: .75rem; color: var(--c-muted); margin: 0 0 .85rem; }
.cultivation__next, .cultivation__max { font-size: .85rem; color: var(--c-muted); margin: .25rem 0 .85rem; }
.cultivation__msg { min-height: 1.1rem; font-size: .85rem; color: var(--c-primary); margin: .25rem 0; }
.cultivation__breakthrough { width: 100%; }
.cultivation__breakthrough:disabled { opacity: .5; cursor: not-allowed; }
.cultivation__hint { font-size: .78rem; color: var(--c-muted); text-align: center; margin-top: .75rem; }

/* ── Nông Trại (Req 20) ─────────────────────────────────────────────── */
.farm-page { max-width: 640px; margin: 0 auto; }
.farm-intro { color: var(--c-muted); margin: 0 0 .75rem; font-size: .9rem; }
.farm-alert { margin-bottom: .75rem; }
.farm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.farm-plot { border: 1px solid var(--c-border); border-radius: var(--radius); padding: .85rem; background: var(--c-surface); display: flex; flex-direction: column; gap: .5rem; min-height: 150px; }
.farm-plot.is-empty   { background: #f8fafc; border-style: dashed; }
.farm-plot.is-growing { background: #fffaf0; }
.farm-plot.is-ready   { background: #f0fdf4; border-color: #58b368; }
.farm-plot__slot { font-size: .72rem; color: var(--c-muted); font-weight: 700; }
.farm-plot__body { display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.farm-plot__crop-name { font-weight: 700; }
.farm-plot__status { font-size: .82rem; color: var(--c-muted); }
.farm-plot__status--ready { color: #2f8f43; font-weight: 700; }
.farm-plot__countdown { font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 800; }
.farm-crop-select { width: 100%; padding: .5rem; border-radius: 8px; border: 1px solid var(--c-border); }
@media (min-width: 769px) {
    .farm-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ════════════════════════════════════════════════════════════════════
 * Hệ thống nhất quán: trạng thái rỗng / đang tải / toast (Req 22.1, 22.3).
 * Các tiện ích dùng chung, mobile-first. Nhiều view đã có class riêng
 * (.account-empty, .coupon-empty, .chat__empty, ...) — các tiện ích ở đây
 * chuẩn hóa và bổ sung, không thay thế.
 * ════════════════════════════════════════════════════════════════════ */

/* ── Empty state (trạng thái rỗng) ──────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--c-muted);
}
.empty-state__icon { font-size: 2.4rem; line-height: 1; opacity: .55; }
.empty-state__title { font-weight: 700; color: var(--c-text); margin: 0; }
.empty-state__text { color: var(--c-muted); margin: 0; font-size: .92rem; }
.empty-state__cta { color: var(--c-primary); font-weight: 700; margin-top: .35rem; }

/* Chuẩn hóa các trạng thái rỗng đã có cho đồng nhất khoảng cách/màu. */
.home-promotions__empty,
.coupon-empty,
.trade-empty,
.catalog-empty,
.ranking-empty,
.wallet-empty,
.account-note {
    color: var(--c-muted);
    padding: 1rem;
    text-align: center;
}

/* ── Loading (đang tải) ─────────────────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1.5rem 1rem;
    color: var(--c-muted);
    font-size: .92rem;
    text-align: center;
}
.loading__spinner,
.spinner {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: var(--radius-pill);
    animation: spin .7s linear infinite;
    flex: 0 0 auto;
}
.loading--block { flex-direction: column; padding: 2.5rem 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .loading__spinner, .spinner { animation-duration: 2s; }
}

/* ── Toast / thông báo nổi ──────────────────────────────────────────── */
.toast-container {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(92%, 420px);
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    padding: .7rem 1rem;
    border-radius: var(--radius);
    background: var(--c-text);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: .5rem;
    animation: toast-in .2s ease;
}
.toast[hidden] { display: none; }
.toast--success { background: var(--c-success-bg); color: var(--c-success-text); }
.toast--error { background: var(--c-error-bg); color: var(--c-error-text); }
.toast--warning { background: var(--c-warning-bg); color: var(--c-warning-text); }
.toast--info { background: var(--c-info-bg); color: var(--c-info-text); }
.toast__close {
    margin-left: auto;
    border: 0;
    background: none;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
}
.toast__close:hover { opacity: 1; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

/* ── Badge thông báo trên bottom-nav (Req 22) ───────────────────────── */
/* Mục account của bottom-nav cần là điểm neo cho badge đếm tuyệt đối. */
.bottom-nav__item { position: relative; }
.bottom-nav__badge {
    position: absolute;
    top: 6px;
    left: 50%;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--c-error-text);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--c-surface);
}
.bottom-nav__badge[hidden] { display: none; }

@media (min-width: 769px) {
    /* Toast neo theo góc khi bottom-nav ẩn trên desktop. */
    .toast-container {
        left: auto;
        right: 1rem;
        bottom: 1rem;
        transform: none;
    }
}

/* ── Cửa hàng trang trí hồ sơ (Req 23) ──────────────────────────────── */
.shop-page { padding: .5rem 0 2rem; }
.shop-head__title { font-size: 1.4rem; font-weight: 800; margin: .25rem 0; }
.shop-head__sub { color: #64748b; font-size: .9rem; margin: 0 0 1rem; }
.shop-alert { padding: .6rem .85rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.shop-alert--ok { background: #dcfce7; color: #166534; }
.shop-alert--err { background: #fee2e2; color: #b91c1c; }

.shop-preview { margin-bottom: 1.5rem; }
.shop-preview__banner {
    position: relative; height: 140px; border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    background-size: cover; background-position: center;
    display: flex; align-items: flex-end; padding: 12px;
}
.shop-preview__avatar-wrap { }
.shop-preview__frame {
    display: inline-flex; align-items: center; justify-content: center;
    width: 76px; height: 76px; border-radius: 50%;
    background: #fff; border: 4px solid #fff; box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.shop-preview__frame.has-frame { border-width: 5px; border-color: #f59e0b; }
.shop-preview__avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.shop-preview__avatar--empty { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.shop-preview__hint { font-size: .8rem; color: #64748b; margin: .5rem 0 0; }

.shop-section { margin-bottom: 1.5rem; }
.shop-section__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .65rem; }
.shop-empty { color: #94a3b8; font-size: .88rem; }
.shop-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: .75rem;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .shop-grid { grid-template-columns: repeat(4, 1fr); } }
.shop-item {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column;
}
.shop-item__media { aspect-ratio: 16 / 10; background: #f1f5f9; overflow: hidden; }
.shop-item--avatar .shop-item__media, .shop-item--frame .shop-item__media { aspect-ratio: 1 / 1; }
.shop-item__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-item__body { padding: .55rem .65rem .25rem; display: flex; flex-direction: column; gap: .15rem; }
.shop-item__name { font-weight: 600; font-size: .9rem; }
.shop-item__price { color: #ef4444; font-weight: 700; font-size: .85rem; }
.shop-item__type { color: #94a3b8; font-size: .75rem; }
.shop-item__actions { padding: .5rem .65rem .65rem; margin-top: auto; }
.shop-item__actions form { margin: 0; }
.shop-btn {
    width: 100%; padding: .45rem; border-radius: 8px; border: 0;
    font-weight: 700; font-size: .85rem; cursor: pointer;
}
.shop-btn--buy { background: #2563eb; color: #fff; }
.shop-btn--equip { background: #10b981; color: #fff; }
.shop-badge {
    display: block; text-align: center; padding: .45rem;
    border-radius: 8px; font-size: .8rem; font-weight: 700;
}
.shop-badge--equipped { background: #e0e7ff; color: #3730a3; }

/* ── Gia Tộc + Đại Chiến Gia Tộc (Req 24) ───────────────────────────── */
.clan-page { padding: .5rem 0 2rem; }
.clan-head__title { font-size: 1.4rem; font-weight: 800; margin: .25rem 0; }
.clan-head__sub { color: #64748b; font-size: .9rem; margin: 0 0 1rem; }
.clan-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 1rem; margin-bottom: 1.25rem; }
.clan-card__head { display: flex; align-items: center; gap: .6rem; }
.clan-card__name { font-size: 1.2rem; font-weight: 800; margin: 0; }
.clan-card__desc { color: #475569; font-size: .9rem; margin: .4rem 0 0; }
.clan-card__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: .85rem 0; }
.clan-card__actions form { margin: 0; }
.clan-sub { font-size: 1.02rem; font-weight: 700; margin: 1rem 0 .55rem; }
.clan-badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 700; }
.clan-badge--leader { background: #fef3c7; color: #92400e; }
.clan-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.clan-member { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; background: #f8fafc; border-radius: 8px; }
.clan-member__name { font-weight: 600; font-size: .9rem; }
.clan-form { display: flex; flex-direction: column; gap: .65rem; }
.clan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.clan-list__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem .7rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: .6rem .7rem; }
.clan-list__rank { font-weight: 800; color: #f59e0b; }
.clan-list__name { font-weight: 700; font-size: .92rem; }
.clan-list__meta { grid-column: 2 / 3; color: #64748b; font-size: .78rem; }
.clan-list__item form { margin: 0; grid-row: 1 / 3; grid-column: 3; }

.shop-btn--danger { background: #ef4444; color: #fff; }
.shop-btn[disabled] { opacity: .5; cursor: not-allowed; }

.war-live, .war-pending, .war-challenge { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 1rem; margin-bottom: 1.25rem; }
.war-scoreboard { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.war-side { flex: 1; text-align: center; display: flex; flex-direction: column; gap: .25rem; }
.war-side__name { font-weight: 700; font-size: .9rem; }
.war-side__score { font-weight: 800; font-size: 1.15rem; }
.war-side--ch .war-side__score { color: #2563eb; }
.war-side--de .war-side__score { color: #ef4444; }
.war-vs { font-weight: 800; color: #94a3b8; }
.war-bar { height: 12px; border-radius: 999px; background: #ef4444; overflow: hidden; margin: .75rem 0 .5rem; }
.war-bar__fill { display: block; height: 100%; background: #2563eb; transition: width .4s ease; }
.war-ends, .war-note { font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.war-note { color: #b45309; }


/* ════════════════════════════════════════════════════════════════════════
 * MERGED MODULE STYLESHEETS (Task 3.1)
 *
 * Gộp chat.css, cultivation.css, farm.css vào hệ thống dùng chung. app.css đã
 * được nạp toàn cục ở layouts/web.php (sau tokens.css), nên các module dưới đây
 * có mặt trên mọi trang mà không cần <link> rời. Class giữ nguyên tên để tương
 * thích ngược (không đổi tên hàng loạt, không vỡ view).
 *
 * Quy ước refactor:
 *   - Dùng semantic token (--c-*, --radius*, --space-*, --shadow-*, --header-h,
 *     --bottomnav-h, --maxw) thay cho literal lặp; bỏ fallback literal vì
 *     tokens.css luôn nạp trước.
 *   - Màu mang "chủ đề" (tu tiên tím-vàng, nông trại xanh-nâu) gom vào biến
 *     module-scoped (--cult-*, --farm-*) để loại bỏ giá trị lặp, dễ chỉnh.
 * ════════════════════════════════════════════════════════════════════════ */

/* ─── Module: Chat (chung + DM) ──────────────────────────────────────────
 * Nguồn cũ: chat.css. Dùng token trực tiếp (đã bỏ literal fallback). */
.chat-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.chat-page__header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    position: sticky;
    top: var(--header-h);
    background: var(--c-bg);
    z-index: 1;
}

.chat-page__back {
    font-size: 1.6rem;
    line-height: 1;
    color: var(--c-text);
    text-decoration: none;
    padding: var(--space-1) var(--space-2);
}

.chat-page__title {
    font-size: var(--fs-lg);
    margin: 0;
    color: var(--c-text);
}

.chat {
    display: flex;
    flex-direction: column;
    /* Chiều cao khả dụng: trừ header trên + bottom-nav dưới. */
    height: calc(100vh - var(--header-h) - var(--bottomnav-h) - 3rem);
    min-height: 320px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.chat__more {
    flex: 0 0 auto;
    align-self: center;
    margin: var(--space-2);
    padding: 0.35rem 0.9rem;
    font-size: var(--fs-sm);
    color: var(--c-primary);
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
}

.chat__list {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: var(--space-3);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    -webkit-overflow-scrolling: touch;
}

.chat__item {
    display: flex;
    flex-direction: column;
    max-width: 78%;
    align-self: flex-start;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius);
    border-bottom-left-radius: 4px;
    background: var(--c-secondary);
    color: var(--c-secondary-text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.chat__item.is-mine {
    align-self: flex-end;
    background: var(--c-primary);
    color: var(--c-primary-text);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: 4px;
}

.chat__sender {
    font-size: 0.72rem;
    font-weight: var(--fw-medium);
    opacity: 0.85;
    margin-bottom: 0.1rem;
}

.chat__item.is-mine .chat__sender {
    display: none;
}

.chat__body {
    font-size: 0.95rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.chat__time {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-top: 0.15rem;
    align-self: flex-end;
}

.chat__empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--space-4);
    color: var(--c-muted);
    font-size: 0.9rem;
    text-align: center;
}

.chat__form {
    flex: 0 0 auto;
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}

.chat__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    color: var(--c-text);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-pill);
}

.chat__input:focus {
    outline: none;
    border-color: var(--c-primary);
}

.chat__send {
    flex: 0 0 auto;
    white-space: nowrap;
}

.chat__error {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.4rem var(--space-3);
    font-size: 0.82rem;
    color: var(--c-error-text);
    background: var(--c-error-bg);
    text-align: center;
}

@media (min-width: 768px) {
    .chat {
        height: calc(100vh - var(--header-h) - 4rem);
    }

    .chat__item {
        max-width: 60%;
    }
}

/* ─── Module: Cultivation (Tu Tiên) ──────────────────────────────────────
 * Nguồn cũ: cultivation.css. Màu chủ đề gom vào biến --cult-* để bỏ lặp. */
.cultivation-page {
    --cult-gold: #ffd76e;
    --cult-purple: #7c5cff;
    --cult-text: #f4f2ff;
    --cult-text-soft: rgba(244, 242, 255, 0.9);
    --cult-text-mute: rgba(232, 228, 255, 0.7);

    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-6);
    box-sizing: border-box;
}

.cultivation__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.cultivation__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #e9e6ff;
    background: rgba(124, 92, 255, 0.18);
    text-decoration: none;
    flex: 0 0 auto;
}

.cultivation__back:active {
    background: rgba(124, 92, 255, 0.32);
}

.cultivation__title {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: #2a2150;
}

.cultivation__card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 22px 18px;
    color: var(--cult-text);
    background: linear-gradient(155deg, #4b2a8a 0%, #2d2363 55%, #1b1942 100%);
    box-shadow: 0 14px 34px rgba(43, 28, 96, 0.35);
}

.cultivation__card::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -30%;
    width: 70%;
    height: 140%;
    background: radial-gradient(circle, rgba(255, 214, 110, 0.22), transparent 70%);
    pointer-events: none;
}

.cultivation__realm-row,
.cultivation__points-row {
    position: relative;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 14px;
}

.cultivation__label {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cult-text-mute);
}

.cultivation__realm {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    color: var(--cult-gold);
    text-shadow: 0 0 16px rgba(255, 215, 110, 0.45);
}

.cultivation__points {
    font-size: 1.05rem;
    font-weight: var(--fw-medium);
    font-variant-numeric: tabular-nums;
}

.cultivation__sep {
    opacity: 0.55;
    margin: 0 2px;
}

.cultivation__progress {
    position: relative;
    height: 14px;
    border-radius: var(--radius-pill);
    background: rgba(13, 11, 38, 0.55);
    overflow: hidden;
    margin-top: 6px;
}

.cultivation__bar {
    height: 100%;
    width: 0;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--cult-purple) 0%, #b08bff 55%, var(--cult-gold) 100%);
    transition: width 0.6s ease;
}

.cultivation__percent {
    margin-top: var(--space-2);
    text-align: right;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: rgba(244, 242, 255, 0.85);
}

.cultivation__next,
.cultivation__max {
    margin: var(--space-4) 0 0;
    font-size: 0.95rem;
    color: var(--cult-text-soft);
}

.cultivation__next strong {
    color: var(--cult-gold);
}

.cultivation__max {
    font-weight: var(--fw-medium);
    color: var(--cult-gold);
    text-align: center;
}

.cultivation__msg {
    min-height: 1.2em;
    margin: 14px 0 0;
    font-size: 0.9rem;
    text-align: center;
}

.cultivation__msg.is-error {
    color: #ff9d9d;
}

.cultivation__msg.is-success {
    color: #9dffc4;
}

.cultivation__breakthrough {
    display: block;
    width: 100%;
    margin-top: var(--space-4);
    padding: 14px 16px;
    border: 0;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: var(--fw-bold);
    letter-spacing: 0.03em;
    color: #3a2400;
    background: linear-gradient(135deg, #ffe7a3 0%, var(--cult-gold) 45%, #f5b942 100%);
    box-shadow: 0 8px 20px rgba(245, 185, 66, 0.4);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}

.cultivation__breakthrough:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 4px 12px rgba(245, 185, 66, 0.35);
}

.cultivation__breakthrough:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.cultivation__hint {
    margin: 18px 4px 0;
    font-size: 0.82rem;
    line-height: var(--lh-base);
    color: #6b6690;
    text-align: center;
}

@media (min-width: 600px) {
    .cultivation__card {
        padding: 28px 26px;
    }
    .cultivation__realm {
        font-size: 1.75rem;
    }
}

/* ─── Module: Farm (Nông Trại) ───────────────────────────────────────────
 * Nguồn cũ: farm.css. Màu chủ đề gom vào biến --farm-* để bỏ lặp. */
.farm-page {
    --farm-green: #4caf50;
    --farm-green-dark: #1b5e20;
    --farm-green-press: #43a047;
    --farm-amber: #f9a825;
    --farm-amber-press: #f57f17;
    --farm-border: #d7e6d2;
    --farm-text: #2e3d33;

    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-6);
    box-sizing: border-box;
}

.farm__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.farm__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: var(--farm-green-dark);
    background: rgba(76, 175, 80, 0.16);
    text-decoration: none;
    flex: 0 0 auto;
}

.farm__back:active {
    background: rgba(76, 175, 80, 0.32);
}

.farm__title {
    font-size: 20px;
    font-weight: var(--fw-medium);
    margin: 0;
    color: var(--farm-green-dark);
}

.farm__intro {
    margin: 0 0 var(--space-3);
    color: #4e5d52;
    font-size: 14px;
}

.farm__msg {
    min-height: 20px;
    margin: 0 0 var(--space-3);
    font-size: 14px;
    font-weight: var(--fw-medium);
    text-align: center;
    transition: color 0.2s ease;
}

.farm__msg.is-success {
    color: #2e7d32;
}

.farm__msg.is-error {
    color: #c62828;
}

.farm__seedbar {
    margin-bottom: 18px;
}

.farm__seedbar-label {
    display: block;
    font-size: 13px;
    font-weight: var(--fw-medium);
    color: #4e5d52;
    margin-bottom: var(--space-2);
}

.farm__seeds {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.farm-seed {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 104px;
    padding: 10px 12px;
    border: 2px solid var(--farm-border);
    border-radius: 14px;
    background: var(--c-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.farm-seed:active {
    transform: scale(0.97);
}

.farm-seed.is-selected {
    border-color: var(--farm-green);
    box-shadow: 0 4px 14px rgba(76, 175, 80, 0.28);
}

.farm-seed__name {
    font-size: 15px;
    font-weight: var(--fw-medium);
    color: var(--farm-text);
}

.farm-seed__meta {
    font-size: 12px;
    color: #7a8a7e;
}

.farm__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (min-width: 520px) {
    .farm__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.farm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f4fbef 0%, #e7f3df 100%);
    border: 2px solid var(--farm-border);
    box-sizing: border-box;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.farm-tile__plot {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 40%, #c7a17a 0%, #a87b53 100%);
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.18);
}

.farm-tile__icon {
    font-size: 34px;
    line-height: 1;
}

.farm-tile__icon::before {
    content: '\1F311'; /* 🌑 đất trống mặc định */
}

/* Trạng thái: empty / growing / ready */
.farm-tile--empty .farm-tile__icon::before {
    content: '\1F33E'; /* 🌾 (đất sẵn sàng gieo) */
    opacity: 0.4;
}

.farm-tile--growing {
    border-color: #aed581;
}

.farm-tile--growing .farm-tile__icon::before {
    content: '\1F331'; /* 🌱 mầm */
}

.farm-tile--ready {
    border-color: #ffca28;
    box-shadow: 0 6px 18px rgba(255, 202, 40, 0.35);
    animation: farm-ready-pulse 1.6s ease-in-out infinite;
}

.farm-tile--ready .farm-tile__plot {
    background: radial-gradient(circle at 50% 40%, #ffe082 0%, #ffb300 100%);
}

.farm-tile--ready .farm-tile__icon::before {
    content: '\1F33B'; /* 🌻 chín */
}

@keyframes farm-ready-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.farm-tile__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.farm-tile__crop {
    font-size: 15px;
    font-weight: var(--fw-medium);
    color: var(--farm-text);
}

.farm-tile__state {
    font-size: 13px;
    color: #6b7a6f;
    min-height: 18px;
}

.farm-tile__countdown {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-medium);
    color: #558b2f;
}

.farm-tile__actions {
    width: 100%;
    margin-top: 2px;
}

.farm-tile .btn {
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: var(--fw-medium);
    cursor: pointer;
    color: #fff;
}

.farm-tile .btn--primary {
    background: var(--farm-green);
}

.farm-tile .btn--primary:active {
    background: var(--farm-green-press);
}

.farm-tile .btn--success {
    background: var(--farm-amber);
}

.farm-tile .btn--success:active {
    background: var(--farm-amber-press);
}

.farm-tile .btn[disabled] {
    opacity: 0.6;
    cursor: default;
}

.farm-tile .btn[hidden] {
    display: none;
}

/* ── Tabs component (.tabs) — Task 2.1, Req 1.3 ─────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--c-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs__item {
    display: inline-block;
    padding: .55rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--c-muted);
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.tabs__item:hover { color: var(--c-primary); }
.tabs__item.is-active,
.tabs__item[aria-selected="true"] {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}
.tabs__item:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: -2px;
    border-radius: 4px 4px 0 0;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Breadcrumb component (.crumbs) — Task 2.1, Req 1.3 ─────────────────── */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: .83rem;
    color: var(--c-muted);
}
.crumbs__item { display: flex; align-items: center; gap: .25rem; }
.crumbs__item + .crumbs__item::before {
    content: '/';
    color: var(--c-border);
    flex-shrink: 0;
}
.crumbs__link {
    color: var(--c-muted);
    text-decoration: none;
    transition: color .15s;
}
.crumbs__link:hover { color: var(--c-primary); text-decoration: underline; }
.crumbs__item[aria-current="page"] .crumbs__link,
.crumbs__item[aria-current="page"] { color: var(--c-text); font-weight: 500; }



/* ── Floating social links (widget cố định trái/phải) ─────────────────── */
.social-fab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.social-fab--right { right: 14px; }
.social-fab--left  { left: 14px; }

.social-fab__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    color: #4b5563;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
    transition: transform .15s, box-shadow .15s, color .15s, background .15s;
    text-decoration: none;
}
.social-fab__item:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
    text-decoration: none;
}
.social-fab__item svg { width: 24px; height: 24px; }
.social-fab__img {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
}

/* Màu thương hiệu khi hover */
.social-fab__item--facebook:hover  { background: #1877f2; color: #fff; }
.social-fab__item--messenger:hover { background: #0084ff; color: #fff; }
.social-fab__item--zalo:hover      { background: #0068ff; color: #fff; }
.social-fab__item--telegram:hover  { background: #229ed9; color: #fff; }
.social-fab__item--discord:hover   { background: #5865f2; color: #fff; }
.social-fab__item--youtube:hover   { background: #ff0000; color: #fff; }
.social-fab__item--tiktok:hover    { background: #000;    color: #fff; }
.social-fab__item--phone:hover     { background: #16a34a; color: #fff; }
.social-fab__item--email:hover     { background: #ea4335; color: #fff; }
.social-fab__item--custom:hover    { background: var(--c-primary, #6366f1); color: #fff; }

/* Tooltip nhãn */
.social-fab__tip {
    position: absolute;
    white-space: nowrap;
    background: rgba(17, 24, 39, .92);
    color: #fff;
    font-size: .78rem;
    padding: .3rem .6rem;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.social-fab--right .social-fab__tip { right: calc(100% + 10px); }
.social-fab--left  .social-fab__tip { left:  calc(100% + 10px); }
.social-fab__item:hover .social-fab__tip { opacity: 1; }

[data-theme="dark"] .social-fab__item { background: #1e2130; color: #cbd5e1; }

/* Mobile: thu nhỏ và nhích lên trên bottom-nav */
@media (max-width: 768px) {
    .social-fab { top: auto; bottom: calc(var(--bottomnav-h) + 16px); transform: none; gap: .5rem; }
    .social-fab__item { width: 40px; height: 40px; }
    .social-fab__item svg { width: 20px; height: 20px; }
    /* Ẩn tooltip trên mobile (không có hover) */
    .social-fab__tip { display: none; }
}


/* ── Donate section (trang chi tiết game) ─────────────────────────────── */
.gd-cta-btn--donate {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.2rem; border-radius: 12px;
    font-weight: 700; text-decoration: none;
    color: #fff; background: linear-gradient(135deg, #f43f5e, #ec4899);
    box-shadow: 0 4px 14px rgba(244, 63, 94, .3);
    transition: transform .15s, box-shadow .15s;
}
.gd-cta-btn--donate:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(244, 63, 94, .4); text-decoration: none; }

/* Donate card v2 — redesigned */
.gd-donate2 {
    border-radius: 18px;
    overflow: hidden;
    background: var(--c-surface, #fff);
    border: 1px solid rgba(244, 63, 94, .18);
    box-shadow: 0 10px 30px -12px rgba(244, 63, 94, .25);
}
[data-theme="dark"] .gd-donate2 { border-color: rgba(244, 63, 94, .3); }

.gd-donate2__head {
    display: flex; align-items: center; gap: .85rem;
    padding: 1.1rem 1.2rem;
    background: linear-gradient(120deg, #f43f5e 0%, #ec4899 55%, #d946ef 100%);
    color: #fff;
    position: relative;
}
.gd-donate2__head-icon {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 14px;
    background: rgba(255, 255, 255, .2);
    backdrop-filter: blur(4px);
    animation: gd-donate-pulse 2.2s ease-in-out infinite;
}
@keyframes gd-donate-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
.gd-donate2__title { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.gd-donate2__subtitle { margin: .15rem 0 0; font-size: .82rem; opacity: .92; }

.gd-donate2__body {
    display: flex; flex-wrap: wrap; gap: 1.4rem;
    padding: 1.3rem 1.2rem;
    align-items: flex-start;
}

/* QR */
.gd-donate2__qr {
    display: flex; flex-direction: column; align-items: center; gap: .55rem;
    flex-shrink: 0; margin: 0 auto;
}
.gd-donate2__qr-frame {
    position: relative;
    width: 208px; height: 208px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.gd-donate2__qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gd-donate2__corner {
    position: absolute; width: 22px; height: 22px;
    border: 3px solid #f43f5e; z-index: 2;
}
.gd-donate2__corner--tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.gd-donate2__corner--tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.gd-donate2__corner--bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.gd-donate2__corner--br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.gd-donate2__scanline {
    position: absolute; left: 12px; right: 12px; top: 12px; height: 3px;
    background: linear-gradient(90deg, transparent, #f43f5e, transparent);
    border-radius: 3px; z-index: 3;
    animation: gd-donate-scan 2.6s ease-in-out infinite;
}
@keyframes gd-donate-scan {
    0%, 100% { transform: translateY(0); opacity: .2; }
    50%      { transform: translateY(180px); opacity: 1; }
}
.gd-donate2__scan {
    display: inline-flex; align-items: center; gap: .35rem;
    margin: 0; font-size: .82rem; font-weight: 600; color: var(--c-muted, #6b7280);
}
.gd-donate2__qr-bank {
    font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: #f43f5e; background: rgba(244, 63, 94, .1);
    padding: .2rem .6rem; border-radius: 999px;
}

/* Info */
.gd-donate2__info { flex: 1; min-width: 230px; display: flex; flex-direction: column; gap: .8rem; }
.gd-donate2__field { display: flex; flex-direction: column; gap: .25rem; }
.gd-donate2__label {
    font-size: .72rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
    color: var(--c-muted, #9ca3af);
}
.gd-donate2__value {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .6rem .75rem;
    background: var(--c-surface-2, #f6f7fb);
    border: 1px solid var(--c-border, #eceef3);
    border-radius: 10px;
    font-size: 1rem; font-weight: 600; color: var(--c-text);
}
.gd-donate2__value--mono span { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .5px; }
.gd-donate2__copy {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    border: none; border-radius: 8px; cursor: pointer;
    color: #f43f5e; background: rgba(244, 63, 94, .1);
    transition: background .15s, color .15s, transform .1s;
}
.gd-donate2__copy:hover { background: #f43f5e; color: #fff; }
.gd-donate2__copy:active { transform: scale(.9); }
.gd-donate2__check-ico { display: none; }
.gd-donate2__copy.is-copied { background: #16a34a; color: #fff; }
.gd-donate2__copy.is-copied .gd-donate2__copy-ico { display: none; }
.gd-donate2__copy.is-copied .gd-donate2__check-ico { display: block; }

.gd-donate2__content {
    margin-top: .3rem; font-size: .9rem; line-height: 1.7; color: var(--c-text);
    padding-top: .8rem; border-top: 1px dashed var(--c-border, #e5e7eb);
}
.gd-donate2__content img { max-width: 100%; border-radius: 8px; }

.gd-donate2__foot {
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .7rem 1rem;
    font-size: .82rem; font-weight: 600; color: #f43f5e;
    background: rgba(244, 63, 94, .06);
    border-top: 1px solid rgba(244, 63, 94, .12);
}

@media (max-width: 560px) {
    .gd-donate2__body { gap: 1rem; }
    .gd-donate2__qr-frame { width: 180px; height: 180px; }
    @keyframes gd-donate-scan { 0%,100%{transform:translateY(0);opacity:.2} 50%{transform:translateY(152px);opacity:1} }
}
@media (prefers-reduced-motion: reduce) {
    .gd-donate2__head-icon, .gd-donate2__scanline { animation: none; }
}
