﻿@charset "UTF-8";
/* ======================================================
   DESIGN SYSTEM: AETHERPUNK / DARK FANTASY RPG
====================================================== */
@import url('https://fonts.googleapis.com/css2?family=Handjet:wght,ELSH@100..900,2&family=Spectral+SC:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Grenze:ital,wght@0,100..900;1,100..900&family=VT323&display=swap');
@font-face {
  font-family: "F08";
  src: url("/assets/FVF Fernando 08.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Retro2k";
  src: url("/assets/SVN-Retron 2000.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TwistyPixel";
  src: url("/assets/TwistyPixel.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
    --bg-dark: #03030a;
    --surface-glass: rgba(12, 10, 32, 0.94);
    --border-magic: rgba(165, 140, 255, 0.28);
    --border-gold: #d4c084;
    --gold-glow: rgba(212, 192, 132, 0.4);
    --purple-light: #c77dff;
    --cyan-crystal: #4cc9f0;
    --gold-cp: #ffd166;
    /* Glow xanh dùng chung cho class .glow-green (đổi 1 chỗ là đổi toàn bộ) */
    --glow-green-rgb: 0, 255, 73;
    --glow-green-speed: 2.8s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f1f1ff;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* KHUNG CẢNH BACKGROUND HUYỀN B?? (T�?I 40%) */
#bg-scene-backdrop {
    position: absolute;
    inset: 0;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/f_webp/q_auto:best/main-bg_ycus2c.png) center 65% / cover no-repeat;
    z-index: 0;
}
#bg-scene-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(3, 3, 10, 0.4); /* �?ộ tối 40% chuẩn x?�c */
}

#app-3d {
    position: absolute;
    inset: -15px;
    z-index: 1;
	background: 
        linear-gradient(rgb(30 105 127 / 54%), rgb(19 19 61 / 59%)), url(https://res.cloudinary.com/aurorawoods/image/upload/f_webp/q_auto:best/main-bg_ycus2c.png) center / cover no-repeat;
    transition: opacity 7s ease-in-out; /* Fade in trong 4s */
	pointer-events: auto;
}
#app-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    mix-blend-mode: screen; /* Khử n�?n đen, vi?�n đ?� & hạt s?�ng rực tr?�n n�?n rừng */
}

/* ======================================================
   HỆ TH�?NG ICON CSS ::before & SVG DATA URI
====================================================== */
.rpg-ico {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.2em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Data URI SVG cho Tinh Quang (T?�m) */
.ico-tq {
    background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707295/qbv57fqvnwagy38mclbo.png);
}

/* Data URI SVG cho Tinh Thạch (Lam Ng�?c) */
.ico-tt {
    background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707322/lbp5ildgxk0ioq0jhgfl.png);
}

/* Data URI SVG cho Cống Hiến (Khi?�n V?�ng) */
.ico-ch {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707502/heeqfj2kb5gau7fdna1q.png");
}

/* Data image ico cho Sản Phẩm G?�i T?�n Thủ */
.ico-pkg1 { box-shadow: #00ff7396 1px 1px 20px 8px;
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706996/yrkpmpqng4i7oeuys77t.png");
}
.ico-pkg2 { box-shadow: #00bbff96 1px 1px 20px 8px;
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1791549415/lur2d7ajwhtoav20ynxt.png");
}
.ico-pkg3 { box-shadow: #d997ffbb 1px 1px 20px 8px;
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1791549416/zvcyud7jyv8azyp6ukjw.png");
}
.ico-pkg4 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1791549417/qud4kywpnzdbt2nleisc.png");
}

/* Data URI SVG cho Quest D?� Ngoại */
.ico-quest1 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706994/mocfpzclhuzw7puss7do.png");
}
.ico-quest2 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706993/uavlbezrjfvhxmozkczr.png");
}
.ico-quest3 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706993/rl2eys9ygbj6kcqrycys.png");
}
.ico-pkg5 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712825/u1fyks0jzb0lihkx3dry.png");
}
.ico-pkg6 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712830/dr4chkdpimg9aabcwume.png");
}
/* Data URI SVG cho Ẩm Thực Rừng */
.ico-food1 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706990/rb5vpiynhpmttfiwty9u.png");
}
.ico-food2 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706989/yovhx8uaj7a4phlwqzrr.png");
}
.ico-food3 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706989/djaolq823s2b5qjtm6kb.png");
}
.ico-food4 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1793018044/brabec8a4qxmqfgbdr5u.png");
}
.ico-ticket1 { box-shadow: #fdfa21ec 1px 1px 20px 8px;
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1793018040/uhcylnd29aobhollllzw.png");
}
.ico-ticket2 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1793018041/yyympbxlmwx3t1a2dsmd.png");
}
.ico-ticket3 {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706989/djaolq823s2b5qjtm6kb.png");
}
/* ======================================================
   HỆ TH�?NG ICON 30 VẬT PHẨM CH??C PH??C (DATA URI BASE64)
   Chuẩn h?�a class để Admin Bot Telegram c?� thể quản l?�/thay thế
====================================================== */
.item-ico {
    display: inline-block;
    width: 60px;
    height: 60px;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
    background-position: center;
    background-size: 100%;
    background-repeat: no-repeat;
}

.item-ico::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
/*CHÚC PHÚC TINH LINH */
.ico-item-thach::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790714369/dkyhu3pibaseml8vsk8e.png); }
.ico-item-mam::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790714369/imilruxrileu2sedzxp5.png); }
.ico-item-suong::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790714371/qjey1gcct3jeeke6mzmh.png); }
.ico-item-than::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790714370/yvclja38qmy2izmg1c5w.png); }
/* ?��� COMMON ITEMS (01 -> 12) */
/* 01: �?ng tre */
.ico-item-01::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712844/lubwzzcxw3qdcamfvlpz.png); }
/* 02: Nhựa th?�ng */
.ico-item-02::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712835/sit9rdwgvkodukwlkdq9.png); }
/* 03: +1 Tinh Quang */
.ico-item-03::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707295/qbv57fqvnwagy38mclbo.png); }
/* 04: Mảnh vải */
.ico-item-04::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712836/plsxmfamh2ybgvxui83g.png); }
/* 05: Gậy gỗ */
.ico-item-05::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712837/mmgzlrnuomsrlhv2sqyd.png); }
/* 06: Trứng g?� */
.ico-item-06::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712820/utxagtnwh0sgyirig4od.png); }
/* 07: Bắp ng?� */
.ico-item-07::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712838/wftedxcuwbucsomlzkec.png); }
/* 08 & 09: Cống Hiến */
.ico-item-08::before, .ico-item-09::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712839/hsk9oneukj6ujhcmbb2t.png); }
/* 10: Tr?� thảo mộc */
.ico-item-10::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712840/tmav6gseff7qzbmcwu57.png); }
/* 11: Khoai lang */
.ico-item-11::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790713098/vvlnpq37q5kjyeforvgs.png); }
/* 12: Thịt nướng */
.ico-item-12::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712842/t9czeflzsah9egyeslwj.png); }

/* ?��� UNCOMMON ITEMS (13 -> 21) */
/* 13: B?�nh Potion */
.ico-item-13::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712842/n214rt2ehphk477pgffc.png); }
/* 14: Cocktail */
.ico-item-14::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712841/ggpyqaybn8zsd1in64aa.png); }
/* 15: Thẻ X2 Main Quest */
.ico-item-15::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790713403/oeuv0q4sdlpr4uvkoyht.png); }
/* 16: ??o cho?�ng */
.ico-item-16::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712833/lvbesmhtrwibpxhjgp0f.png); }
/* 17: Trợ thủ NPC */
.ico-item-17::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707002/odnavswopuf4dlb9zigw.png); }
/* 18 & 19: Tinh Thạch */
.ico-item-18::before, .ico-item-19::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712834/ir1pnfd0yxu4uwctarmw.png); }
/* 20: �?ạo cụ Quest */
.ico-item-20::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712827/zrlkgvumbl28va1vjxm6.png); }
/* 21: �??�n b?�o đ?�m */
.ico-item-21::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712831/ev492osssq0da3lfrzh5.png); }

/* ?��� RARE ITEMS (22 -> 27) */
/* 22: Huy hiệu xanh */
.ico-item-22::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712829/ziuuewqch5jhoqmwjseu.png); }
/* 23: Dịch chuyển */
.ico-item-23::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712830/dr4chkdpimg9aabcwume.png); }
/* 24: V?� Gacha Chợ */
.ico-item-24::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712826/czqlilui4jysg2risvol.png); }
/* 25: D?�y chuy�?n */
.ico-item-25::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712826/hoex2tioiz0mzgbwvf4s.png); }
/* 26: Qu?� b?� mật */
.ico-item-26::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712825/u1fyks0jzb0lihkx3dry.png); }
/* 27: Thẻ b?�i ma thuật */
.ico-item-27::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712824/vlk9i9gjopaqda11zcxe.png); }

/* ?��� LEGENDARY ITEMS (28 -> 30) */
/* 28: N?�ng cấp ph?�ng */
.ico-item-28::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712822/xcabrziwe997mspnjpn3.png); }
/* 29: Thẻ lưu tr?� free */
.ico-item-29::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712822/befhycpzipswry7pn1ye.png); }
/* 30: Trang bị Ranger */
.ico-item-30::before { background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790712821/npgt9wjtbu7lwcjpgsxl.png); }

/* ======================================================
   ICON MENU DOCK NAVIGATION & N??T TR�? VỀ (DATA URI BASE64)
====================================================== */
.dock-ico {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-ico .rpg-ico {
    width: 80px;
    height: 80px;
}

/* ?��� Menu Nhiệm Vụ */
.ico-menu-quest {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707003/jgxj2hybjk7xno6br3ni.png");
}

/* ?�?� Menu T?�i �?ồ */
.ico-menu-bag {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707004/zupuy5jto9bgunlst549.png");
}

/* ?��� Menu Shop */
.ico-menu-shop {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707001/ixghtkbyfyvf52j5dmzj.png");
}

/* ?����? Menu Căn Cước */
.ico-menu-profile {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707002/odnavswopuf4dlb9zigw.png");
}

/* ?�?? N?�t Trở V�? */
.ico-back-wind {
    background-image: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707000/nprugmyrif3iizreygzc.png);
}

/* ======================================================
   ICON 6 HỆ NGUY??N T�? TINH QUANG THẠCH (DATA URI BASE64)
====================================================== */
/* ?��� Hệ 1: H�?a Diệm */
.ico-elem-fire {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710612/mtcdbh8hwnu0whiuovxc.png");
}

/* ☀�? Hệ 2: Th?�i Dương */
.ico-elem-sun {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710610/ledj9cvqrpcy36crume7.png");
}

/* ?��� Hệ 3: Thảo Mộc */
.ico-elem-wood {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710609/thj0edarshr2mppyoikk.png");
}

/* �?��? Hệ 4: Băng Tinh */
.ico-elem-ice {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710608/rcmixancbozqnrzlmhdo.png");
}

/* �?� Hệ 5: Thi?�n H?� */
.ico-elem-lightning {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710611/c3lnbjckyallkxnklwgo.png");
}

/* ?��� Hệ 6: Ma Ph?�p */
.ico-elem-magic {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710605/vvxmztdo70rkp7wjbya6.png");
}

/* �?� �??� chưa mở kh?�a (Silhouette Silhouette) */
.ico-elem-unknown {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710606/e9grohts7ztnjwmkvt4l.png");
}

/* ======================================================
   TOP STATUS BAR
====================================================== */
.rpg-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(5,5,18,0.95) 0%, rgba(5,5,18,0.5) 80%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    z-index: 10;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo {
    position: relative;
    width: 15%;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--border-gold);
    text-shadow: 0 0 10px var(--gold-glow);
    cursor: pointer;
    touch-action: manipulation;
}
.brand-logo img {height: 10vh; position: fixed; top: 0; left:5px;}

/* ======================================================
   LOGO TOOLTIP (bên cạnh .brand-logo, hiện khi click logo)
   ====================================================== */
.logo-tooltip {
    position: absolute;
    left: calc(50% + 1px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px) scale(0.95);
    white-space: nowrap;
    background: linear-gradient(135deg, #2a1a0a 0%, #1a0f05 100%);
    border: 1.5px solid #ffd166;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: "Handjet", sans-serif;
    font-size: small;
    font-weight: 700;
    color: #ffe66d;
    text-shadow: 0 0 8px rgba(255, 230, 109, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 60;
}

.logo-tooltip::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #ffd166;
}

.logo-tooltip.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}

.logo-tooltip.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .logo-tooltip {
        font-size: 11px;
        padding: 5px 10px;
        left: calc(100% + 8px);
    }
}

.currency-group { display: flex; gap: 6px; }

.currency-pill {
    background: transparent;
    border: 1px solid var(--border-magic);
    border-radius: 10px;
    padding: 3px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
    backdrop-filter: blur(8px);
}

.curr-label { font-size: 8px; text-transform: uppercase; color: #a58cff; }
.curr-val { font-size: 11px; font-weight: bold; color: #fff; display: flex; align-items: center; gap: 3px; }

.user-avatar-frame { position: relative; cursor: pointer; }
.avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1.5px solid var(--border-gold);
    display: block;
}
.level-badge {
    position: absolute;
    bottom: -3px;
    right: -4px;
    background: #000;
    color: var(--gold-cp);
    font-size: 8px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 4px;
    border: 1px solid var(--border-gold);
}

.tab-indicator {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    font-size: x-small;
    letter-spacing: 2px;
    color: rgb(247 230 89 / 59%);
    text-transform: uppercase;
    z-index: 10;
    font-family: 'Spectral SC';
    white-space: pre-line;
    text-align: center;
}

/* ======================================================
   VIEWPORT GACHA (BỆ �??? & TH?�NG B??O)
====================================================== */
.crystal-title-box {
    position: absolute;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 17, 50, 0.65);
    border: 1px solid var(--border-magic);
    padding: 6px 16px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    z-index: 10;
}
.crystal-name { font-size: 12px; font-weight: bold; color: #ffe66d; }

.loot-card {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgb(10 8 25 / 45%);
    border: 2px solid #84d4cd9c;
    box-shadow: 0 0 25px var(--gold-glow);
    padding: 14px 20px;
    border-radius: 12px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.17, 0.67, 0.2, 1.2);
    z-index: 20;
    min-width: 270px;
}
.loot-card.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

#claimContainer {
    position: absolute;
    bottom: 33vh; /* �?ặt chuẩn x?�c 30% từ bottom l?�n */
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

/* Ẩn dứt điểm khi chưa mở được đ?� */
#claimContainer.hidden,
#claimContainer[style*="display: none"] {
    display: none !important;
    pointer-events: none !important;
}

/* N?�t Thu Thập với hiệu ứng Scale to ra + H?�o quang bập b?�ng */
#claimContainer:not(.hidden) .btn-claim {
    font-family: "Handjet", sans-serif;
    background: #f0f8ff00;
    border: transparent;
    color: #ffffff;
    border-radius: 35px;
    font-size: medium;
    font-weight: 800;
    letter-spacing: 1.5px;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgb(79 113 207 / 85%);
    
    /* Kết hợp 2 hiệu ứng: Ph?�ng to l?�c xuất hiện (0.4s) + Bập b?�ng lặp v?� tận */
    animation: 
        claimPopIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        claimGlowPulse 2s infinite ease-in-out 0.45s;
}

/* 1. Hiệu ứng ph?�ng to nở ra từ t?�m */
@keyframes claimPopIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 2. Hiệu ứng nhịp thở bập b?�ng (Scale nhẹ + H?�o quang v?�ng rực) */
@keyframes claimGlowPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(207, 244, 255, 0.749), 0 0 30px rgba(0, 212, 159, 0.4);
    }
    50% {
        transform: scale(1.07);
        box-shadow: 0 0 35px rgba(255, 241, 186, 0.949), 0 0 60px rgba(255, 170, 0, 0.8);
    }
}

/* BANNER THU THẬP TH?�NH C?�NG 3S */
.collect-banner {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: transparent;
    border-radius: 12px;
    padding: 16px 32px;
     /* Exit transition chỉ tr?�n container */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Inner element chạy float animation */
.collect-banner-float {
    animation: bannerFloatAndGlow 3s ease-in-out infinite alternate;
    background: #00000069;
    border-radius: 20px;
    border-style: inset;
}

/* Ẩn banner khi c?� class hidden */
.collect-banner.hidden {
    display: none!important;
}

/* Slide-down exit animation - tr?�n container */
.collect-banner.slide-down-exit {
    transform: translateX(-50%) translateY(180%) scale(0.7);
    opacity: 0;
    pointer-events: none;
}

/* --- 2. �?ịnh dạng phần nội dung chữ v?� ng?�i sao --- */
.collect-banner-content {
    display: grid;
    align-items: center;
    gap: 15px;
    color: #fff3cd; /* M?�u v?�ng kem ho?�ng gia */
    font-family: "Handjet", sans-serif;
    font-size: x-large; /* Chữ to bản */
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    
    /* Hiệu ứng ph?�t s?�ng chữ chuyển động */
    text-shadow: 
        0 0 5px #ffae00,
        0 0 10px #ffae00,
        0 0 20px #ff7700,
        0 0 40px #ff3300;
    animation: textGlowPulse 2s ease-in-out infinite alternate;
}

/* --- 3. Hiệu ứng cho c?�c ng?�i sao (✦) --- */
.banner-star {
    color: #ffcc00;
    font-size: 30px;
    display: inline-block;
    text-shadow: 0 0 10px #ffea00, 0 0 20px #ff9900;
    animation: starRotateAndShine 2s linear infinite;
}

/* --- 4. C?�c Keyframes tạo chuyển động ?�nh s?�ng --- */

/* Hiệu ứng nổi bồng b�?nh v?� đổi độ s?�ng vi�?n banner */
@keyframes bannerFloatAndGlow {
    0% {
        transform: translateY(0);
        box-shadow: 
            0 0 15px rgba(0, 255, 213, 0.4),
            0 0 30px rgba(9, 255, 0, 0.2),
            inset 0 0 15px rgba(0, 195, 255, 0.2);
        border-color: #00ffaa98;
    }
    100% {
        transform: translateY(-8px); /* Nổi l?�n xuống nhẹ */
        box-shadow: 
            0 0 25px rgba(255, 215, 0, 0.8),
            0 0 50px rgba(255, 140, 0, 0.6),
            inset 0 0 25px rgba(255, 215, 0, 0.4);
        border-color: #fff6a1;
    }
}

/* Hiệu ứng nhấp nh?�y ?�nh s?�ng chữ (Glowing Pulse) */
@keyframes textGlowPulse {
    0% {
        text-shadow: 
            0 0 4px #ffae00,
            0 0 10px #ffae00,
            0 0 18px #ff7700;
        filter: brightness(0.9);
    }
    100% {
        text-shadow: 
            0 0 8px #fff,
            0 0 16px #ffae00,
            0 0 30px #ff5500,
            0 0 50px #ff2200;
        filter: brightness(1.2);
    }
}

/* Hiệu ứng ng?�i sao lấp l?�nh / xoay nhẹ */
@keyframes starRotateAndShine {
    0% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 2px #fff);
    }
    50% {
        transform: scale(1.2) rotate(15deg);
        filter: drop-shadow(0 0 10px #ffcc00);
    }
    100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 2px #fff);
    }
}
@keyframes bannerPop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ======================================================
   BOTTOM ARC WHEEL DOCK - BỆ �??? MA PH??P CHUẨN MOCKUP
====================================================== */
.rpg-dock {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px; /* Khống chế b�? rộng tối đa, kh?�ng để tr?�n m?�n h?�nh tr?�n PC */
    height: 180px;
    z-index: 30;
    pointer-events: none;
}

/* Bệ đ?� chạm khắc cổ k?�nh dưới đ?�y dock */
.dock-stone-pedestal {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    height: 130px;
    border-radius: 50% 50% 20px 20px;
    background: radial-gradient(ellipse at 50% 30%, #352654 0%, #171126 70%, #090611 100%);
    border: 3px solid #5d4880;
    box-shadow: 
        0 -6px 25px rgba(124, 77, 255, 0.4),
        inset 0 4px 15px rgba(199, 125, 255, 0.3),
        inset 0 -10px 20px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    display:none;
}

.rpg-dock::before {
    display: none; /* B�? vi�?n mảnh cũ */
}

/* �?ịnh dạng c?�c n?�t hu?�n chương tr?�n vi�?n v?�ng */
.dock-btn {
    pointer-events: auto;
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.dock-btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.3);
}

.dock-btn:active {
    transform: translateY(-2px) scale(0.96);
    filter: brightness(1.1);
}

.medallion-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #bfa15f;
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.8),
        0 0 12px rgba(212, 192, 132, 0.35),
        inset 0 0 8px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.dock-btn:hover .medallion-btn {
    border-color: #ffd166;
    box-shadow: 
        0 6px 15px rgba(0,0,0,0.9),
        0 0 20px rgba(255, 209, 102, 0.6),
        inset 0 0 12px rgba(255, 209, 102, 0.2);
    transform: scale(1.08);
}

.dock-btn:active .medallion-btn {
    transform: scale(0.95);
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.8),
        0 0 15px rgba(255, 209, 102, 0.4),
        inset 0 0 10px rgba(0,0,0,0.9);
}

.dock-btn.active .medallion-btn {
    border-color: #ffe66d;
    box-shadow: 0 0 18px rgba(255, 230, 109, 0.7);
}

.medallion-btn .rpg-ico {
    width: 28px;
    height: 28px;
}

/* Badge dấu cộng xanh s?�ng như trong ảnh */
.badge-plus {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #00f5d4;
    color: #061e23;
    font-size: 11px;
    font-weight: 900;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px #00f5d4;
    border: 1px solid #fff;
}
.badge-mark {
    position: absolute;
    top: -2px;
    left: -2px;
    background: #c95a5a;
    color: #061e23;
    font-size: 11px;
    font-weight: 900;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px #ff7f44;
    border: 1px solid #fff;
}

/* ICON BUTTON MENU */
/*ICON QUEST*/
.dock-btn.sub-left { bottom: 18px; left: 14%; transform: translateX(-50%);
background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707003/jgxj2hybjk7xno6br3ni.png) no-repeat center / contain fixed; }
/*ICON T??I*/
.dock-btn.mid-left { bottom: 58px; left: 24%; transform: translateX(-50%);
background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707004/zupuy5jto9bgunlst549.png) no-repeat center / cover fixed;}
.dock-btn.center-core { bottom: 52px; left: 50%; transform: translateX(-50%); z-index: 10; }
/*ICON SHOP*/
.dock-btn.mid-right { bottom: 58px; right: 24%; transform: translateX(50%);
background:url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707001/ixghtkbyfyvf52j5dmzj.png) no-repeat center / cover fixed; }
/*ICON PROFILE*/
.dock-btn.sub-right { bottom: 18px; right: 14%; transform: translateX(50%);
background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707002/odnavswopuf4dlb9zigw.png) no-repeat center / cover fixed; }

/* ======================================================
   MAGIC ORB BUTTON - GACHA CORE (THIẾT KẾ M�?I)
====================================================== */

.magic-orb-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: 50%;
    padding: 8px;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790708681/pdz3gzkko93bxbskwnpy.png) center / 100% 100%;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-orb-wrapper:hover {
    transform: scale(1.08);
}

.magic-orb-wrapper:active {
    transform: scale(0.95);
}

/* Outer Golden Metallic Ring Frame */
.gold-ring {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe885 0%, #d4a237 35%, #8a5d10 65%, #ffd700 100%);
    padding: 8px;
    box-shadow: 
        0 0 30px rgba(212, 162, 55, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.7),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
    transition: box-shadow 0.4s ease;
}

.magic-orb-wrapper:hover .gold-ring {
    box-shadow: 
        0 0 50px rgba(255, 215, 0, 0.85),
        0 0 80px rgba(168, 85, 247, 0.6),
        inset 0 0 25px rgba(255, 255, 255, 0.95);
}

/* Gold Star/Diamond Spikes on Rim (8 spikes) */
.magic-orb-wrapper:hover .spike {
    filter: drop-shadow(0 0 8px #ffffff) brightness(1.3);
    transform: scale(1.2) rotate(45deg);
}

/* Inner Celestial Chamber */
.orb-chamber {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 30%, #1c153b 0%, #0c0824 60%, #03010b 100%);
    overflow: hidden;
    border: 2.5px solid rgba(212, 162, 55, 0.5);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.95);
}

/* Nebula Swirl inside Orb */
.orb-nebula {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.35) 0%, transparent 60%),
                radial-gradient(circle at 30% 20%, rgba(168, 85, 247, 0.35) 0%, transparent 50%);
    filter: blur(6px);
    animation: nebulaSpin 12s linear infinite;
}

@keyframes nebulaSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Central Glowing Crystal Orb Base */
.crystal-ball {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, 
        #ffffff 0%, 
        #f0abfc 20%, 
        #c084fc 45%, 
        #6b21a8 75%, 
        #3b0764 100%);
    box-shadow: 
        0 0 25px rgba(192, 132, 252, 0.7),
        0 0 50px rgba(168, 85, 247, 0.5),
        inset -8px -8px 18px rgba(24, 9, 46, 0.85);
    transition: all 0.4s ease;
    animation: orbPulse 3s ease-in-out infinite alternate;
}

@keyframes orbPulse {
    0% {
        box-shadow: 0 0 20px rgba(192, 132, 252, 0.7), 0 0 40px rgba(168, 85, 247, 0.4);
        transform: translate(-50%, -55%) scale(1);
    }
    100% {
        box-shadow: 0 0 35px rgba(232, 121, 249, 0.9), 0 0 65px rgba(168, 85, 247, 0.7);
        transform: translate(-50%, -55%) scale(1.05);
    }
}

.magic-orb-wrapper:hover .crystal-ball {
    background: radial-gradient(circle at 35% 30%, 
        #ffffff 0%, 
        #f5d0fe 25%, 
        #e879f9 50%, 
        #a855f7 75%, 
        #581c87 100%);
    transform: translate(-50%, -55%) scale(1.1);
    filter: brightness(1.25);
}

/* Highlights & Sparkles on Orb */
.crystal-shine {
    position: absolute;
    top: 12%;
    left: 18%;
    width: 28px;
    height: 18px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transform: rotate(-35deg);
    filter: blur(1px);
}

.crystal-sparkle {
    position: absolute;
    color: #ffffff;
    font-size: 14px;
    text-shadow: 0 0 6px #fff, 0 0 12px #e879f9;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* Cost badge inside orb */
.core-cost-badge-orb {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: #4cc9f0;
    font-size: 9px;
    font-weight: 900;
    font-family: "Handjet", sans-serif;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid var(--cyan-crystal);
    box-shadow: 0 0 8px rgba(76, 201, 240, 0.5), 0 0 15px rgba(76, 201, 240, 0.2);
    z-index: 10;
    pointer-events: none;
}

/* Canvas overlay for magic wisps & particles */
#gachaOrbCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    pointer-events: none;
    z-index: 30;
    mix-blend-mode: screen;
    border-radius: 50%;
}

/* Shockwave Expansion Ring */
.shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 3px solid #f5d0fe;
    box-shadow: 0 0 20px #e879f9, inset 0 0 15px #3b82f6;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
}

.shockwave.active {
    animation: shockwaveExpand 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shockwaveExpand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
        border-width: 4px;
    }
    100% {
        width: 450px;
        height: 450px;
        opacity: 0;
        border-width: 1px;
    }
}

/* ======================================================
   BỘ RESPONSIVE TO?�N DIỆN CHO DOCK (MAGIC ORB BUTTON)
====================================================== */

/* 1. M?�n h?�nh điện thoại si?�u nh�? (< 360px: iPhone SE1, Fold gập hẹp) */
@media (max-width: 359px) {
    .rpg-dock {
        height: 160px;
        transform: translateX(-50%) scale(0.8);
        transform-origin: bottom center;
    }
    .gold-ring {
        width: 180px;
        height: 180px;
    }
    #gachaOrbCanvas {
        width: 180px;
        height: 180px;
    }
    .crystal-ball {
        width: 78px;
        height: 78px;
    }
    .spike {
        width: 15px;
        height: 15px;
    }
}

/* 2. M?�n h?�nh điện thoại ti?�u chuẩn (360px -> 480px: �?a số smartphone) */
@media (min-width: 360px) and (max-width: 480px) {
    .rpg-dock {
        height: 175px;
        bottom: 0;
    }
    .gold-ring {
        width: 140px;
        height: 140px;
    }
    #gachaOrbCanvas {
        width: 200px;
        height: 200px;
    }
    .crystal-ball {
        width: 88px;
        height: 88px;
    }
}

/* 3. M?�n h?�nh trung b?�nh / Xoay ngang (481px -> 768px: Tablet d�?c / Mobile Landscape) */
@media (min-width: 481px) and (max-width: 768px) {
    .rpg-dock {
        height: 185px;
        max-width: 460px;
        bottom: 5px;
    }
    .gold-ring {
        width: 180px;
        height: 180px;
    }
    #gachaOrbCanvas {
        width: 200px;
        height: 200px;
    }
    .crystal-ball {
        width: 92px;
        height: 92px;
    }
}

/* 4. M?�n h?�nh m?�y t?�nh & Tablet ngang (>= 769px: Chuẩn to nhất) */
@media (min-width: 769px) {
    .rpg-dock {
        height: 200px;
        max-width: 520px;
        bottom: 12px;
    }
    .dock-stone-pedestal {
        width: 400px;
        height: 155px;
    }
    .medallion-btn {
        width: 58px;
        height: 58px;
    }
    .medallion-btn .rpg-ico {
        width: 32px;
        height: 32px;
    }
    .gold-ring {
        width: 220px;
        height: 220px;
        padding: 10px;
    }
    #gachaOrbCanvas {
        width: 240px;
        height: 240px;
    }
    .crystal-ball {
        width: 105px;
        height: 105px;
    }
    .spike {
        width: 22px;
        height: 22px;
    }
    .dock-btn.sub-left { bottom: 20px; left: 12%; }
    .dock-btn.mid-left { bottom: 70px; left: 22%; }
    .dock-btn.center-core { bottom: 40px; }
    .dock-btn.mid-right { bottom: 70px; right: 22%; }
    .dock-btn.sub-right { bottom: 20px; right: 12%; }
}

/* Guest mode - n?�t Gacha ở giữa m?�n h?�nh */
body.guest-mode .dock-btn.center-core {
    pointer-events: auto;
    bottom: 45vh !important;
    left: 50% !important;
    transform: translate(-50%, 50%) !important;
    transition: all 0.7s cubic-bezier(0.2, 0.8, 0.2, 1.2);
    z-index: 32;
}
body.guest-mode .dock-btn.center-core.moved {
    bottom: 45% !important;
}
body.guest-mode .gold-ring {
    width: 220px;
    height: 220px;
}
body.guest-mode #gachaOrbCanvas {
    width: 220px;
    height: 220px;
}

/* ======================================================
   OVERLAY PANELS & N??T TR�? VỀ ?�??
====================================================== */
.overlay-panel {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(14px);
    z-index: 40;
    overflow-y: auto;
    padding: 70px 14px 100px;
    display: block;
}
.overlay-panel.hidden { display: none !important; }

.panel-container { max-width: 600px; margin: 0 auto; position: relative; }
.panel-header { display: flex; justify-content: space-between; align-items: center; padding:0 10px; margin-bottom: 12px;background: url(https://iili.io/n7lLwwg.png) no-repeat left / 90% 100%; }
.section-title { font-size: 14px; font-weight: bold; color: var(--border-gold); font-family: F08;    padding: 5px 10px; }
.close-panel-btn { 
    font-size: 24px; 
    color: #a8a4c2; 
    cursor: pointer; 
    transition: all 0.2s ease;
    width: 35px;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706998/njf74rvra03mjeikam8j.png) no-repeat center / 100% 100%;
}

.close-panel-btn:hover {
    color: #fff;
    transform: scale(1.2) rotate(90deg);
}

.close-panel-btn:active {
    transform: scale(1.1) rotate(90deg);
}

/* N??T TR�? VỀ �???Y ?�?? */
.panel-bottom-dock {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    padding-bottom: 10px;
}
.btn-back-dock {
    background: transparent;
    border: transparent;
    border-radius: 80px;
    padding: 0px 20px 0px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    will-change: transform;
    touch-action: none;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.btn-back-dock:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.5);
    border-color: rgb(148 129 215 / 50%);
}

.btn-back-dock:active {
    transform: translateY(-1px) scale(1.0);
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.3);
}
.back-ico { font-size: 40px; line-height: 1; }
i.ico-back-wind {width: 64px; height: 64px;}
/* Tabs */
.inv-tabs {     display: flex;    gap: 8px;    margin-bottom: 12px;   flex-wrap: nowrap;    justify-content: center;    align-items: center;}
.inv-tab-btn:not(.btn-celtic) {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-magic);
    color: #a8a4c2;
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    padding: 2%;
    width: 100%;
    margin: 0 auto;
    font-size: medium;
    transition: all 0.2s ease;
}

.inv-tab-btn:not(.btn-celtic):hover {
    background: rgba(157, 78, 221, 0.2);
    border-color: var(--purple-light);
    transform: scale(1.03);
}

.inv-tab-btn:not(.btn-celtic):active {
    transform: scale(0.98);
}

.inv-tab-btn:not(.btn-celtic).active {
    background: rgba(157, 78, 221, 0.3);
    border-color: var(--purple-light);
    color: #fff;
}
.inv-tab-btn{width: 100%;    margin: 0 auto;    padding: 1%;}
.inv-content.hidden { display: none; }

/* Lưới 5x5 */
.grid-5x5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.item-slot {
    aspect-ratio: 1;
    background: rgba(20, 16, 45, 0.65);
    border: 1px solid var(--border-magic);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-slot:hover {
    background: rgba(30, 26, 60, 0.85);
    border-color: var(--purple-light);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(124, 108, 255, 0.4);
}

.item-slot:active {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(124, 108, 255, 0.3);
}
.item-slot.empty { opacity: 0.25; border-style: dashed; }
.item-slot-icon { font-size: 20px; }
.item-slot-qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 9px;
    font-weight: bold;
    color: #ffe66d;
    background: rgba(0,0,0,0.7);
    padding: 0 3px;
    border-radius: 4px;
}

/* Tủ 990 �??� */
.progress-box { margin-bottom: 12px; }
.progress-label { font-size: 10px; color: #c9c3ff; margin-bottom: 4px; }
.progress-bar-container {
    width: 100%;
    height: 7px;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.progress-fill { height: 100%; background: linear-gradient(90deg, #7c6cff, #ffd166); transition: width 0.3s; }

/* Nhắc mốc thưởng 33 biến thể trong tab Quang Thạch */
.progress-milestone-hint {
    margin-top: 6px;
    font-size: 9.5px;
    letter-spacing: 0.4px;
    color: #7ee8fa;
    text-align: center;
    text-shadow: 0 0 8px rgba(126, 232, 250, 0.5);
}
.filter-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: #c9c3ff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Spectral SC';
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(124, 108, 255, 0.2);
    border-color: var(--purple-light);
    transform: scale(1.05);
}

.filter-btn:active {
    transform: scale(0.98);
}

.filter-btn.active { 
    background: #c77dff4a; 
    color: #ffffff; 
    font-weight: bold; 
}
.gem-grid-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 52vh;
    overflow-y: auto;
}
.gem-slot {
    background: rgba(20, 16, 45, 0.6);
    border: 1px solid var(--border-magic);
    border-radius: 6px;
    padding: 6px 2px;
    text-align: center;
    font-size: 9px;
}
.gem-slot.unlocked {
    border-color: #335378;
    background: rgba(22, 21, 26, 0.767);
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.25);
}
.gem-slot.locked { opacity: 0.35; border-style: dashed; }
.gem-slot-icon { font-size: 18px; }
.gem-slot-code { font-weight: bold; color: #ffe66d; }
.gem-slot-name { font-size: 8px; color: #a8a4c2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ======================================================
   PANEL HƯ�?NG DẪN NHIỆM VỤ
====================================================== */
.quest-guide-panel {
    background: linear-gradient(135deg, rgba(25, 18, 40, 0.85) 0%, rgba(15, 10, 30, 0.95) 100%);
    border: 1px solid rgba(212, 192, 132, 0.35);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 229, 153, 0.1);
    animation: guidePanelSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes guidePanelSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-15px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 192, 132, 0.2);
}

.ico-guide {
    background-image: url("https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790707003/jgxj2hybjk7xno6br3ni.png");
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.8));
}

.guide-title {
    font-family: 'Spectral SC', serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffe66d;
    text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
    letter-spacing: 0.5px;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-text {
    font-size: small;
    color: #d4c084;
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(10, 8, 20, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(165, 140, 255, 0.15);
    transition: all 0.2s ease;
}

.guide-step:hover {
    border-color: rgba(212, 192, 132, 0.4);
    background: rgba(15, 12, 30, 0.8);
    transform: translateX(4px);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #d4a237 0%, #ffd166 100%);
    color: #1a0f00;
    border-radius: 50%;
    font-size: small;
    font-weight: 900;
    font-family: 'Handjet', sans-serif;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(212, 162, 55, 0.4);
}

.step-text {
    font-size: small;
    color: #e8e0c8;
    line-height: 1.4;
    font-family: 'Handjet', sans-serif;
    flex: 1;
}

/* ======================================================
   BẢNG NHIỆM VỤ DẠNG PIN-BOARD
====================================================== */
.pin-board-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(25, 18, 40, 0.6);
    padding: 12px;
    border-radius: 12px;
    font-family: 'Handjet';
}
.pin-card {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790708870/kmljyhgxr5rerv0g52sc.png) no-repeat top / 100% 100%;
    color: #2b1f0c;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}
.pin-tack {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790708907/dzukhqrkmb8lmugjhfez.png) no-repeat center / 100%;
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: xx-large;
}
.pin-title { font-size: medium; font-weight: bold; color: #3a3126; margin-top: 4px;}
.pin-desc { font-size: medium; color: #211a12; margin: 4px 0; line-height: 1.25; white-space: pre-line; }
.pin-badge { font-size: smaller; font-weight: bold; color: #1d394d; margin-bottom: 4px; }
/* pin-btn legacy style (only when not using btn-medieval) */
.pin-btn:not(.btn-medieval) {
    background: transparent;
    color: #fff;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pin-btn:not(.btn-medieval):hover {
    background: #a65d00;
    transform: scale(1.05);
}
.pin-btn:not(.btn-medieval):active {
    transform: scale(0.98);
}
.pin-input {
    width: 100%;
    padding: 4px;
    font-size: 8px;
    background: #fff;
    border: 1px solid #c9b084;
    color: #000;
    border-radius: 3px;
    margin-bottom: 4px;
    font-family: inherit;
}
.pin-input:focus {
    outline: none;
    border-color: #8a4b00;
    box-shadow: 0 0 5px rgba(138, 75, 0, 0.3);
}

/* INPUT TỔNG QU??T */
.rpg-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    background: rgba(20, 16, 45, 0.7);
    border: 1px solid var(--border-magic);
    color: #fff;
    border-radius: 8px;
    font-family: inherit;
}
.rpg-input:focus {
    outline: none;
    border-color: var(--purple-light);
    box-shadow: 0 0 10px rgba(124, 108, 255, 0.4);
}
.rpg-input::placeholder {
    color: #a8a4c2;
}

/* ======================================================
   SHOP 2 CỘT GỌN G?�NG
====================================================== */
.shop-subtitle {    text-align: center; font-family: 'Handjet';padding: 1%; font-size: larger; color: beige;white-space: pre-line; }
.shop-2col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: url(https://iili.io/n7MkgIf.png) no-repeat center / 100% 100%;
}
.shop-2col-card {
    background: rgba(25, 20, 50, 0.7);
    border: 1px solid var(--border-magic);
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.shop-2col-card:hover {
    background: rgba(35, 30, 70, 0.85);
    border-color: #ffd166;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 5px 20px rgba(255, 209, 102, 0.3);
}

.shop-2col-card:active {
    transform: translateY(-1px) scale(1.0);
}
.shop-2col-card.selected {
    border-color: #ffd166;
    background: rgba(212, 192, 132, 0.15);
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.3);
}
.shop-2col-icon { font-size: 24px; margin-bottom: 3px; }
.shop-2col-title { font-size: 10px; font-weight: bold; color: #fff; }
.shop-2col-tag { font-size: 8px; color: #4cc9f0; margin-top: 1px; }

/* State rỗng/lỗi của lưới shop — KHÔNG còn fallback data.js:
   lỗi mạng thì hiện card này + nút Thử lại, checkout bị khoá. */
.shop-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 12px;
    text-align: center;
}
.shop-state-ico { width: 40px; height: 40px; opacity: 0.9; }
.shop-state-title {
    margin: 0;
    font-family: "Handjet", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #ffe66d;
}
.shop-state-desc {
    margin: 0;
    max-width: 280px;
    font-size: 11px;
    line-height: 1.45;
    color: #c9c3ff;
}
.shop-state-retry { margin-top: 6px; padding: 8px 18px; font-size: 12px; }
.shop-state.is-error .shop-state-title { color: #ff8fa3; }
.shop-state.is-error .shop-state-ico { filter: drop-shadow(0 0 8px rgba(255, 51, 85, 0.55)); }
#btnCheckoutShop:disabled,
#btnCheckoutShop:disabled:hover {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.5);
    box-shadow: none;
    transform: none;
    text-shadow: none;
}

.shop-checkout-bar {
    position: sticky;
    bottom: -80px;
    background: url(https://iili.io/n7MkgIf.png) center;
    border-top: 1px solid var(--border-gold);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    margin-top: 10px;
}
.checkout-summary { font-size: 11px; font-family: F08;}
/* btn-buy legacy style (only when not using btn-magical) */
.btn-buy:not(.btn-magical) { 
    font-family: "Handjet", sans-serif;
    padding: 8px 16px; 
    font-size: 11px;
    background: linear-gradient(135deg, #7c6cff, #4a34b8);
    border: 1px solid var(--border-magic);
    color: #fff;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(124, 108, 255, 0.4);
    transition: all 0.3s ease;
}
.btn-buy:not(.btn-magical):hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(124, 108, 255, 0.6);
}
.btn-buy:not(.btn-magical):active {
    transform: translateY(0);
}

/* ======================================================
   CĂN CƯ�?C: AVATAR VU?�NG L�?N TRUNG T?�M
====================================================== */
.passport-card-centered {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790708981/wm5xvgzw1gvqtxf5bwcm.png) center / 100% 100%;
    border: 1.5px solid var(--border-gold);
    border-radius: 12px;
    padding: 18px 14px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
}
.avatar-square-frame {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 10px 20px;
    border: 2px solid var(--border-gold);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 15px var(--gold-glow);
    float: left;
}
.avatar-large-square { width: 100%; height: 100%; object-fit: cover; }
.passport-badge-floating {
       position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #4cc9f0;
    font-size: 19px;
    font-weight: bold;
    padding: 2px 0;
    border-top: 1px solid var(--border-gold);
    text-align: center;
}
.passport-name-main { font-size: 15px; color: #ffe66d; font-family: 'Cinzel';}
.passport-role-tag { font-size: 10px; color: #a8a4c2; margin-bottom: 12px; }

/* Chỉ báo "đang chờ Hội trưởng duyệt" đổi tên */
.pending-name-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #ffe66d;
    background: rgba(124, 108, 255, 0.18);
    border: 1px solid rgba(255, 230, 109, 0.45);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
    animation: pendingNamePulse 2s ease-in-out infinite;
}
.pending-name-badge.hidden { display: none; }
@keyframes pendingNamePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
    .pending-name-badge { animation: none; }
}

.passport-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}
.rank-label {font-family:'Handjet'; padding: 0 10px;}
.stat-pill { background: rgba(0,0,0,0.5); padding: 6px 2px; border-radius: 6px; }
.stat-lbl { font-size: 8px; color: #a8a4c2; text-transform: uppercase; }
.stat-pill b { display: block; font-size: 10px; margin-top: 2px; color: #fff; }

/* ======================================================
   MODAL RPG GLASS & TINH LINH BAN CH??C PH??C
====================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(8px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: url(https://iili.io/n70P1ql.png) center / 100%;
    border: 1.5px solid var(--border-gold);
    border-radius: 12px;
    padding: 30px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    position: relative;
    font-family: Retro2k;
}
.close-modal { position: absolute; top: 8px; right: 12px; font-size: 22px; cursor: pointer; color: #a8a4c2; 
background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706999/esy0uorbvuidvrvpvu9l.png) no-repeat center / 100% 100%;width: 35px;}

/* Card Ch?�c Ph?�c H?�o Quang */
.rpg-blessing-box {
    border: 2px solid #ffd166;
    box-shadow: 0 0 30px rgba(255, 209, 102, 0.6);
}
.blessing-tier-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #000;
    color: #ffd166;
    border: 1px solid #ffd166;
    margin-bottom: 8px;
}
.blessing-icon-large { font-size: 42px; margin: 6px 0; }
.blessing-title { font-size: 14px; color: #ffe66d; }
.blessing-desc { font-size: 11px; color: #e2dcff; margin-top: 4px; line-height: 1.35; }

/* Button X?�c Nhận Thu V?�o T?�i trong Modal Ch?�c Ph?�c */
#btnCloseBlessingModal {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.8px;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 0 20px rgba(76, 201, 240, 0.5),
        0 0 40px rgba(255, 209, 102, 0.3),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: blessingButtonGlow 2s infinite ease-in-out;
}

#btnCloseBlessingModal:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.8),
        0 0 60px rgba(255, 209, 102, 0.6);
}

#btnCloseBlessingModal:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 15px rgba(76, 201, 240, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

@keyframes blessingButtonGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(76, 201, 240, 0.5),
            0 0 40px rgba(255, 209, 102, 0.3),
            inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(76, 201, 240, 0.8),
            0 0 60px rgba(255, 209, 102, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
}

/* ======================================================
   MODAL MỐC SƯU TẦM QUANG THẠCH (MỖI 33 BIẾN THỂ)
====================================================== */
.rpg-milestone-box {
    border: 2px solid #7ee8fa;
    box-shadow: 0 0 30px rgba(126, 232, 250, 0.6), 0 0 70px rgba(124, 108, 255, 0.35);
    animation: milestoneBoxPulse 2.4s infinite ease-in-out;
    overflow: hidden;
}

/* Vòng hào quang xoay quanh icon Tinh Thạch */
.milestone-halo {
    position: absolute;
    top: 46px;
    left: 50%;
    width: 150px;
    height: 150px;
    margin-left: -75px;
    border-radius: 50%;
    border: 2px dashed rgba(126, 232, 250, 0.55);
    pointer-events: none;
    animation: milestoneHaloSpin 9s linear infinite;
}

.milestone-icon-large {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 10px 0 4px;
    filter: drop-shadow(0 0 14px rgba(126, 232, 250, 0.9));
}

.milestone-tier-tag {
    position: relative;
    display: inline-block;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #000;
    color: #7ee8fa;
    border: 1px solid #7ee8fa;
    margin-bottom: 8px;
}

.milestone-title {
    position: relative;
    font-size: 15px;
    color: #7ee8fa;
    text-shadow: 0 0 12px rgba(126, 232, 250, 0.8);
    animation: milestoneTitleGlow 1.8s infinite ease-in-out;
}

.milestone-desc {
    position: relative;
    font-size: 11px;
    color: #e2dcff;
    margin-top: 6px;
    line-height: 1.4;
    white-space: pre-line;
}

.milestone-note {
    font-size: 10px;
    color: #ffd166;
    margin-bottom: 8px;
    font-style: italic;
    white-space: pre-line;
}

#btnCloseGemMilestoneModal {
    padding: 13px 20px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.5px;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow:
        0 0 20px rgba(126, 232, 250, 0.5),
        0 0 40px rgba(124, 108, 255, 0.3),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    animation: milestoneButtonGlow 2s infinite ease-in-out;
}

#btnCloseGemMilestoneModal:hover { transform: scale(1.05); }
#btnCloseGemMilestoneModal:active { transform: scale(0.98); }

@keyframes milestoneHaloSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes milestoneBoxPulse {
    0%, 100% { box-shadow: 0 0 26px rgba(126, 232, 250, 0.5), 0 0 60px rgba(124, 108, 255, 0.3); }
    50%      { box-shadow: 0 0 40px rgba(126, 232, 250, 0.85), 0 0 95px rgba(124, 108, 255, 0.55); }
}

@keyframes milestoneTitleGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(126, 232, 250, 0.7); }
    50%      { text-shadow: 0 0 20px rgba(126, 232, 250, 1), 0 0 36px rgba(124, 108, 255, 0.7); }
}

@keyframes milestoneButtonGlow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(126, 232, 250, 0.5),
            0 0 40px rgba(124, 108, 255, 0.3),
            inset 0 0 15px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 32px rgba(126, 232, 250, 0.9),
            0 0 66px rgba(124, 108, 255, 0.6),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
}

/* Modal Shop Chi Tiết */
.shop-modal-ico-box { font-size: 40px; margin-bottom: 4px; }
p.shop-modal-desc {
    font-size: 12px;
    color: #fcffc2;
    text-align: center;
    line-height: 1.4;
    /* pre-line: giữ \n thành xuống dòng, vẫn collapse khoảng trắng thừa
       (ổn định hơn pre-wrap vì không lệch chữ khi text-align:center) */
    white-space: pre-line;
    /* Chống tràn ngang khi gặp chuỗi dài không có khoảng trắng */
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    padding: 5px;
    border-radius: 10px;
    background: #213147e3;
}

/* Quiz Answers */
.quiz-answers-box { display: flex; flex-direction: column; gap: 6px; }
.btn-quiz-ans {
    font-family: "Handjet", sans-serif;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-magic);
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    font-size: large;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}
.btn-quiz-ans:hover {
    background: rgba(124, 108, 255, 0.3);
    border-color: var(--purple-light);
}
.btn-quiz-ans:active { 
    background: #7c6cff;
    transform: scale(0.98);
}

/* ======================================================
   BUTTON ACTIONS TỔNG QU??T
====================================================== */
.btn-action {
    font-family: "Handjet", sans-serif;
    background: linear-gradient(135deg, #7c6cff, #4a34b8);
    border: 1px solid var(--border-magic);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(124, 108, 255, 0.4);
    transition: all 0.3s ease;
    white-space: nowrap;
}
.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(124, 108, 255, 0.6);
}
.btn-action:active {
    transform: translateY(0);
}
.btn-action.hidden {
    display: none !important;
}

/* N??T SUMMON / CLAIM */
.btn-summon {
    font-family: "Handjet", sans-serif;
    background: linear-gradient(135deg, #4cc9f0, #3a0ca3);
    border: 2px solid #ffd166;
    color: #fff;
    padding: 14px 30px;
    border-radius: 35px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1.8px;
    cursor: pointer;
    box-shadow: 
        0 0 20px rgba(76, 201, 240, 0.5),
        0 0 40px rgba(255, 209, 102, 0.3);
    transition: all 0.3s ease;
}
.btn-summon:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.8),
        0 0 60px rgba(255, 209, 102, 0.6);
}
.btn-summon:active {
    transform: scale(0.98);
}

/* ======================================================
   BUTTON STYLES 01-05 (TỪ RPG OPTION BUTTONS SHOWCASE)
====================================================== */

/* --- STYLE 01: CELTIC FANTASY (�?ăng k?�, �?ăng nhập, Tab Inventory) --- */
.btn-celtic {
    font-family: "Handjet", sans-serif;
    font-size: large;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_mediumWebP/v1792231312/gqw3idszze3yzfl6wsj9.png) center / 100% 100%;
    border: transparent;
    color: #b7e4c7;
    box-shadow: 0 0 15px rgba(46, 125, 50, 0.3), inset 0 0 10px rgba(74, 222, 128, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: preline;
}
.btn-celtic::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    pointer-events: none;
}
.btn-celtic:hover {
    color: #fef08a;
    border-color: #eab308;
    box-shadow: 0 0 25px rgba(234, 179, 8, 0.5), inset 0 0 15px rgba(34, 197, 94, 0.3);
    transform: translateY(-3px) scale(1.02);
}
.btn-celtic:active {
    transform: translateY(1px) scale(0.98);
}
.btn-celtic-wood {background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790709073/cnotk8phfz9csxr2fckf.png) center / 100% 100% ; padding: 20px 10px;}
/* --- STYLE 02: MEDIEVAL RPG (Quest Panel Buttons) --- */
.btn-medieval {
    font-family: "Handjet", sans-serif;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790709657/byvmeb13rapibxywapz4.png) center / 100% 100%;
    color: #443614;
    box-shadow: 1px 3px 2px 0px #12100e57, 0 10px 15px rgba(0, 0, 0, 0.7), inset 0 2px 3px rgba(255, 255, 255, 0.2);
    transition: all 0.15s ease;
    position: relative;
    padding: 1%;
    font-size: medium;
    border: transparent;
    border-style: inset;
    font-weight: 600;
}
.btn-medieval:hover {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790709658/hgqqcavl3dv1mnisp7ku.png) center / 100% 100%;
    color: #ffffff;
    box-shadow: 0 8px 0 #12100e, 0 0 20px rgba(245, 158, 11, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}
.btn-medieval:active {
    box-shadow: 0 2px 0 #12100e, 0 3px 5px rgba(0, 0, 0, 0.8), inset 0 2px 8px rgba(0, 0, 0, 0.6);
    transform: translateY(4px);
}

/* --- STYLE 03: DARK FANTASY (Reserved) --- */
.btn-dark {
    font-family: "Handjet", sans-serif;
    background: linear-gradient(135deg, #1a0505 0%, #080101 100%);
    border: 1px solid #7f1d1d;
    color: #f87171;
    box-shadow: 0 0 15px rgba(153, 27, 27, 0.4), inset 0 0 12px rgba(0, 0, 0, 0.9);
    transition: all 0.3s ease;
    letter-spacing: 2px;
    position: relative;
}
.btn-dark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.btn-dark:hover {
    color: #fca5a5;
    border-color: #dc2626;
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.7), inset 0 0 20px rgba(185, 28, 28, 0.5);
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
    transform: scale(1.03);
}
.btn-dark:hover::after {
    opacity: 1;
}

/* --- STYLE 04: FAIRY CORE (Reserved) --- */
.btn-fairy {
    font-family: "Handjet", sans-serif;
    background: linear-gradient(135deg, #fbcfe8 0%, #e9d5ff 50%, #c7d2fe 100%);
    border: 2px solid #ffffff;
    color: #701a75;
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-fairy:hover {
    transform: translateY(-4px) rotate(-1deg) scale(1.04);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6), inset 0 2px 6px rgba(255, 255, 255, 1);
    background: linear-gradient(135deg, #fce7f3 0%, #f3e8ff 50%, #e0e7ff 100%);
    color: #86198f;
}
.btn-fairy:active {
    transform: translateY(0) rotate(0deg) scale(0.97);
}

/* --- STYLE 05: MAGICAL RPG (Shop Checkout) --- */
.btn-magical {
    font-family: "Handjet", sans-serif;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790709919/judceu25u5s8vtipeglt.png) center / 100% 100%;
    border: transparent;
    color: #e9d5ff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4), inset 0 0 15px rgba(192, 132, 252, 0.2);
    transition: all 0.3s ease;
    position: relative;
    padding: 1% 2%;
    font-size: medium;
}
.btn-magical:hover {
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.6), 0 0 15px rgba(168, 85, 247, 0.8), inset 0 0 20px rgba(56, 189, 248, 0.4);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.9);
    transform: translateY(-2px);
}
.btn-magical:active {
    transform: translateY(0) scale(0.98);
}

/* QR Box */
.qr-box {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    width: 120px;
    height: 120px;
    margin: 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-box img { width: 100%; height: 100%; }
.qr-note { font-size: 9px; color: #a8a4c2; text-align: center; }

/* Admin Modal */
.admin-modal-box { border-color: #ff3366 !important; }
.admin-grid-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn-admin-act {
    font-family: "Handjet", sans-serif;
    background: rgba(40,15,45,0.85);
    border: 1px solid var(--border-magic);
    color: #fff;
    padding: 6px 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
}
.btn-admin-act.btn-reset { background: rgba(90,10,25,0.8); border-color: #ff3366; color: #ff99aa; }
/* ======================================================
   MODAL PREVIEW 3D TINH QUANG THẠCH
====================================================== */
.rpg-gem-preview-box {
    background: rgba(14, 10, 32, 0.96) !important;
    border: 1.5px solid var(--border-gold) !important;
    box-shadow: 0 0 35px var(--gold-glow) !important;
    max-width: 320px;
    padding: 16px 14px;
}

.gem-preview-3d-wrapper {
    width: 170px;
    height: 170px;
    margin: 4px auto 10px;
    position: relative;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(165, 140, 255, 0.2) 0%, transparent 72%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#gem3dPreviewContainer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    mix-blend-mode: screen;
}
#gem3dPreviewContainer canvas:active { cursor: grabbing; }

.preview-badge-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.preview-sys-tag {
    background: rgba(40, 25, 75, 0.7);
    border: 1px solid var(--border-magic);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preview-code-tag {
    background: #000;
    border: 1px solid var(--border-gold);
    color: var(--cyan-crystal);
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.preview-title {
    font-size: 15px;
    color: #ffe66d;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 230, 109, 0.4);
}

.preview-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.preview-stat-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
}

.p-stat-lbl {
    display: block;
    font-size: 8px;
    color: #a8a4c2;
    text-transform: uppercase;
}

.p-stat-val {
    display: block;
    font-size: 11px;
    color: #fff;
    margin-top: 2px;
}

.preview-desc {
    font-size: 10px;
    color: #c9c3ff;
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 6px;
}

/* ======================================================
   MODAL THÔNG TIN NHÀ PHIÊU LƯU (PLAYER INFO)
   ====================================================== */
.rpg-player-info-box {
    background: rgba(14, 10, 32, 0.96) !important;
    border: 1.5px solid var(--border-gold) !important;
    box-shadow: 0 0 35px var(--gold-glow) !important;
    max-width: 340px;
    padding: 18px 16px;
    text-align: center;
}

.player-info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.player-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--border-gold);
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 20px var(--gold-glow);
    position: relative;
}

.player-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-main-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    color: #ffe66d;
    text-shadow: 0 0 10px rgba(255, 230, 109, 0.5);
    margin: 0;
}

.player-code {
    font-size: 11px;
    color: #4cc9f0;
    letter-spacing: 1px;
    font-weight: 600;
    display: none;
}

.player-info-body {
    text-align: left;
}

.player-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.player-stat-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.player-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 230, 109, 0.4);
}

.player-stat-label {
    display: block;
    font-size: 8px;
    color: #a8a4c2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-stat-value {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.player-stat-value .rpg-ico {
    width: 16px;
    height: 16px;
}

.player-badge-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: rgba(255, 230, 109, 0.08);
    border: 1px solid rgba(255, 230, 109, 0.2);
    border-radius: 8px;
}

.player-badge-label {
    font-size: 8px;
    color: #a8a4c2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.player-badge-value {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffd166;
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
    min-height: 24px;
}

/* Hiệu ứng chạm v?�o ?� đ?� */
.gem-slot {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gem-slot:active {
    transform: scale(0.94);
}

/* ======================================================
   CHỨC NGHIỆP NHẬP VAI ONBOARDING
====================================================== */
.class-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.btn-class-opt {
    font-family: "Handjet", sans-serif;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-magic);
    color: #c9c3ff;
    padding: 7px 4px;
    border-radius: 6px;
    font-size: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.btn-class-opt.active {
    background: rgba(126, 103, 255, 0.25);
    border-color: #ffd166;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.3);
}

/* N?�t icon m?�y ảnh đổi avatar */
.avatar-upload-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgb(240 229 255 / 85%);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
    transition: transform 0.15s ease, background 0.15s ease;
}

.avatar-upload-badge:active {
    transform: scale(0.88);
    background: #7c6cff;
}
input.hidden {display: none;}

/* ======================================================
   N??T GOOGLE SIGN-IN CHUẨN GIAO DIỆN RPG
====================================================== */
.google-auth-wrapper {
    margin-bottom: 12px;
}

.btn-google-rpg {
    font-family: "Handjet", sans-serif;
    width: 100%;
    background: #ffffff;
    border: 1px solid #d4c084;
    border-radius: 25px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.google-icon {
    width: 18px;
    height: 18px;
}

#googleBtnText {
    color: #1f1f1f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ======================================================
   ONBOARDING FORM CHI TIẾT
====================================================== */
.onboard-form-group {
    margin-bottom: 8px;
}

.onboard-lbl {
    font-size: 10px;
    font-weight: bold;
    color: #ffe66d;
    display: block;
    margin-bottom: 3px;
    font-family: 'F08';
}

.gender-toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.btn-gender-opt {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-magic);
    color: #c9c3ff;
    padding: 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-gender-opt.active {
    background: rgba(255, 209, 102, 0.2);
    border-color: #ffd166;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.avatar-select-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.avatar-option-slot {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    transition: transform 0.15s, border-color 0.15s;
}

.avatar-option-slot img {
    width: 100%;
    height: 100%;
    display: block;
}

.avatar-option-slot.selected {
    border-color: #ffd166;
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.6);
    transform: scale(1.06);
}

/* --- BUOC 3: Modal xac nhan cuoi cung truoc khi dang ky --- */
.onboard-confirm-intro {
    font-size: 11px;
    color: #c9c3ff;
    line-height: 1.45;
    margin-bottom: 8px;
    font-family: Retro2k;
}

.onboard-confirm-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px;
}

.onboard-confirm-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
    font-family: Retro2k;
}

.onboard-confirm-key {
    flex: 0 0 82px;
    color: #8e8aab;
    font-size: 10px;
}

.onboard-confirm-val {
    flex: 1;
    min-width: 0;
    color: #fff;
    word-break: break-word;
}

.onboard-confirm-outro {
    font-size: 11px;
    color: #ffe66d;
    text-align: center;
    margin-top: 10px;
    font-family: Retro2k;
}

/* ======================================================
   �?�?NH DẠNG BẢNG TH?�NG TIN CHI TIẾT CĂN CƯ�?C (PROFILE)
====================================================== */
.passport-email-txt {
    font-size: 10px;
    color: #4cc9f0;
    margin-top: -2px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.passport-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
    text-align: left;
}

.info-cell {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(165, 140, 255, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
}

.info-k {
    font-size: 8px;
    color: #a8a4c2;
    text-transform: uppercase;
    display: block;
    letter-spacing: 0.5px;
}

.info-v {
    font-size: 11px;
    color: #ffe66d;
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

span#profRankNeed {
    position: absolute;
    right: 15px;}

    /* ======================================================
   PHASE 3: THẺ V?� & QR CODE OFFLINE THỰC �?�?A
====================================================== */
.qr-status-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-gold);
    color: var(--cyan-crystal);
    font-size: 8px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.qr-ticket-box {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(212, 192, 132, 0.35);
    border-radius: 10px;
    padding: 10px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.qr-token-txt {
    font-size: 9px;
    color: #ffd166;
    font-weight: bold;
    letter-spacing: 1px;
    margin-top: 4px;
}

.qr-live-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 9px;
    color: #4cc9f0;
    margin-top: 4px;
}

/* Ẩn/hiện từng phần trong modal vật phẩm (Buff vs QR thực địa) */
#qrWrapperOffline.hidden,
#qrcodeContainer.hidden,
#modalQrTokenTxt.hidden,
#btnUseBuffItem.hidden {
    display: none !important;
}

/* Item Buff: dòng trạng thái đổi sang thông điệp dùng ngay */
.qr-ticket-box.is-buff {
    border-color: rgba(74, 222, 128, 0.55);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6), 0 0 14px rgba(74, 222, 128, 0.25);
}
.qr-ticket-box.is-buff .qr-live-status {
    color: #4ade80;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
}
.qr-ticket-box.is-buff .status-dot-pulse {
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
}

/* Nút dùng Buff: nổi bật, dễ bấm */
.btn-buff-use {
    width: 100%;
    margin-top: 10px;
    font-family: "Handjet", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #052e16;
    background: linear-gradient(180deg, #86efac 0%, #22c55e 55%, #15803d 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 10px;
    cursor: pointer;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.55), inset 0 0 10px rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-buff-use:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.75), inset 0 0 12px rgba(255, 255, 255, 0.35);
}
.btn-buff-use:active { transform: translateY(1px) scale(0.98); }
.btn-buff-use:disabled {
    filter: grayscale(0.5) brightness(0.8);
    cursor: not-allowed;
    box-shadow: none;
}

.status-dot-pulse {
    width: 6px;
    height: 6px;
    background: #00f5d4;
    border-radius: 50%;
    box-shadow: 0 0 8px #00f5d4;
    animation: statusBlink 1.5s infinite ease-in-out;
}

@keyframes statusBlink {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* N?�t �?ăng Nhập tr?�n Topbar */
.user-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* btn-top-login legacy style (only when not using btn-celtic) */
.btn-top-login:not(.btn-celtic) {
    background: linear-gradient(180deg, #7c6cff 0%, #433299 100%);
    border: 1px solid var(--border-gold);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 108, 255, 0.4);
    white-space: nowrap;
}

.btn-top-login.hidden {
    display: none !important;
}

/* ======================================================
   UX ONBOARDING D?�NH CHO USER M�?I (GUEST-MODE)
====================================================== */

/* 1. Ẩn Pill ti�?n tệ v?� Avatar tr?�n Topbar, chỉ giữ n?�t �?ăng Nhập */
body.guest-mode .currency-group,
body.guest-mode #btnProfileQuick {
    display: none !important;
}
body.guest-mode #btnTopLogin {
    display: block !important;
    width: 150px; padding: 5%; font-size: medium;}

/* 2. Ẩn 4 n?�t menu ở Dock đ?�y, tắt n�?n Dock để kh?�ng che m?�n h?�nh */
body.guest-mode .rpg-dock {
    background: transparent !important;
    pointer-events: none;
}
body.guest-mode .rpg-dock::before {
    display: none !important;
}
body.guest-mode .dock-btn:not(.center-core) {
    display: none !important;
}

/* 4. Banner Cuộn Giấy Cổ */
.welcome-scroll-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 10, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

/* Hiệu ứng trượt xuống dưới v?� biến mất khi click */
.welcome-scroll-overlay.slide-down-exit {
    transform: translateY(120vh);
    opacity: 0;
    pointer-events: none;
}

.scroll-card {
    position: relative;
    max-width: 500px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scrollFloat 3s ease-in-out infinite alternate;
}

.scroll-bg-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 25px rgba(255, 209, 102, 0.4));
}

.scroll-inner-content {
    position: absolute;
    inset: 15% 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #3d260f; /* M?�u mực cổ điển tr?�n n�?n giấy */
    font-family: "Handjet", sans-serif;
    pointer-events: none;
}

.scroll-title {
    font-size: 17px;
    font-weight: 800;
    color: #633303;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.scroll-text {
    font-size: medium;
    line-height: 1.3;
    color: #4a2d11;
    font-weight: 600;
    margin-bottom: 12px;
}

.scroll-tap-hint {
    font-size: 12px;
    font-weight: bold;
    color: #8f4f06;
    animation: textBlink 1.5s infinite;
}

@keyframes scrollFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

@keyframes textBlink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ======================================================
   GUEST HELPER FAIRY (Tinh Linh Hướng Dẫn)
   ====================================================== */
.guest-helper {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
}

/* Ẩn ho?�n to?�n khi kh?�ng hoạt động */
.guest-helper.hidden {
    display: none !important;
}

/* Trạng th?�i khởi tạo: ẩn ở top-right viewport */
.guest-helper.enter-from-top-right {
    top: 5vh;
    right: 5vw;
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
}

/* Trạng th?�i active: bay đến g?�c top-right của Gacha Orb */
.guest-helper.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    /* Vị tr?� được set bằng JS dựa tr?�n vị tr?� #dockGachaTrigger */
}

/* Trạng th?�i exit: bay sang phải ra kh�?i m?�n h?�nh */
.guest-helper.exit-to-right {
    opacity: 0;
    transform: translateX(120vw) scale(0.5) rotate(20deg);
    pointer-events: none;
}

/* Fairy image */
.helper-fairy-img {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 12px rgba(255, 209, 102, 0.8));
    animation: fairyFloat 2.5s ease-in-out infinite alternate;
}

/* Tooltip tr?�n đầu */
.helper-tooltip {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: linear-gradient(135deg, #2a1a0a 0%, #1a0f05 100%);
    border: 1.5px solid #ffd166;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: "Handjet", sans-serif;
    font-size: small;
    font-weight: 700;
    color: #ffe66d;
    text-shadow: 0 0 8px rgba(255, 230, 109, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    opacity: 0;
    animation: tooltipPopIn 0.4s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: none;
}

.helper-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #ffd166;
}

/* Animations */
@keyframes fairyFloat {
    0% { transform: translateY(0) rotate(-2deg); }
    100% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes tooltipPopIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.8); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Sparkle effect quanh fairy */
.guest-helper::before {
    content: '✦';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 14px;
    color: #ffd166;
    animation: sparkleSpin 2s linear infinite;
    opacity: 0.8;
    text-shadow: 0 0 8px #ffd166;
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg) scale(1); opacity: 0.5; }
    50% { transform: rotate(180deg) scale(1.3); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.5; }
}

/* ======================================================
   GACHA READY TOOLTIP (Hiện khi valTinhQuang > 0)
   ====================================================== */
.gacha-ready-tooltip {
    position: absolute;
    right: -150px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    white-space: nowrap;
    background: transparent;
    border: transparent;
    border-radius: 6px;
    padding: 4px 10px;
    font-family: "retro2k";
    font-size: small;
    font-weight: 700;
    color: #c9ffff;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
}

.gacha-ready-tooltip::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #4ac0de;
}

.gacha-ready-tooltip.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    right: -70px;
}

.gacha-ready-tooltip.hidden {
    display: none !important;
}

/* Pulse animation khi show */
@keyframes gachaTooltipPulse {
    0%, 100% {text-shadow: #cfb8ff 1px 1px 8px;}
    50% { text-shadow: #ffffff 1px 1px 15px;}
}

.gacha-ready-tooltip.show {
    animation: gachaTooltipPulse 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 480px) {
    .gacha-ready-tooltip {
        right: -80px;
        font-size: 10px;
        padding: 3px 8px;
    }
    .gacha-ready-tooltip.show {
        right: -70px;
    }
}

/* ======================================================
   AVATAR CHANGE TOOLTIP (nhắc đổi avatar +1 Tinh Quang)
   Gắn trên avatar topbar (.user-avatar-frame — position: relative, không overflow hidden)
   ====================================================== */
.avatar-change-tooltip {
    position: absolute;
    bottom: -34px;                 /* né .level-badge (bottom: -3px) */
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    white-space: nowrap;
    color: #ffffff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;          /* nhãn tĩnh — click xuyên qua vào avatar */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 60;
}
.avatar-change-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.avatar-change-tooltip.hidden {
    display: none !important;
}

/* Pulse glow nhẹ để thu hút ánh mắt */
@keyframes avatarTooltipPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
    50% { box-shadow: 0 2px 10px rgba(74,144,226,0.8); }
}
.avatar-change-tooltip.show {
    animation: avatarTooltipPulse 2s ease-in-out infinite;
}

/* Responsive màn nhỏ: neo sang phải, tránh tràn lề viewport */
@media (max-width: 480px) {
    .avatar-change-tooltip {
        left: auto;
        right: -4px;
        transform: translateX(0) scale(0.8);
        bottom: -30px;
        font-size: 9px;
        padding: 3px 8px;
    }
    .avatar-change-tooltip.show {
        transform: translateX(0) scale(1);
    }
    .avatar-change-tooltip::after {
        left: auto;
        right: 21px;
        transform: none;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .helper-fairy-img { width: 70px; height: 70px; }
    .helper-tooltip { font-size: 10px; padding: 5px 10px; top: -38px; }
}

/* ======================================================
   GUIDE HELPER FAIRY (Cho user đ?� login - non guest mode)
   ====================================================== */
.guide-helper {
    position: fixed;
    z-index: 20;
    pointer-events: auto; /* Clickable */
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
}

/* Ẩn ho?�n to?�n khi kh?�ng hoạt động */
.guide-helper.hidden {
    display: none !important;
}

/* Trạng th?�i khởi tạo: ẩn ở bottom-left viewport */
.guide-helper.enter-from-bottom-left {
    bottom: 5vh;
    left: 5vw;
    opacity: 0;
    transform: scale(0.5) rotate(15deg);
}

/* Trạng th?�i active: bay đến g?�c top-left của Gacha Orb */
.guide-helper.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    /* Vị tr?� được set bằng JS dựa tr?�n vị tr?� #dockGachaTrigger */
}

/* Trạng th?�i exit: bay sang phải ra kh�?i m?�n h?�nh */
.guide-helper.exit-to-right {
    opacity: 0;
    transform: translateX(120vw) scale(0.5) rotate(-20deg);
    pointer-events: none;
}

/* Trạng th?�i exit: bay sang tr?�i ra kh�?i m?�n h?�nh (khi Gacha triggered) */
.guide-helper.exit-to-left {
    opacity: 0;
    transform: translateX(-120vw) scale(0.5) rotate(20deg);
    pointer-events: none;
}

/* Fairy image - d?�ng chung class helper-fairy-img */
.guide-helper .helper-fairy-img {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 0 12px rgba(76, 201, 240, 0.8));
    animation: fairyFloat 2.5s ease-in-out infinite alternate;
}

/* Tooltip tr?�n đầu */
.guide-helper .helper-tooltip {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: linear-gradient(135deg, #0a1a2a 0%, #050f1a 100%);
    border: 1.5px solid #4cc9f0;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: "Handjet", sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #4cc9f0;
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    opacity: 0;
    animation: tooltipPopIn 0.4s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: none;
}

.guide-helper .helper-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #4cc9f0;
}

/* Sparkle effect quanh guide fairy (m?�u xanh cyan) */
.guide-helper::before {
    content: '✦';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 14px;
    color: #4cc9f0;
    animation: sparkleSpin 2s linear infinite;
    opacity: 0.8;
    text-shadow: 0 0 8px #4cc9f0;
}

/* ======================================================
   GUIDE HELPER IMAGE BANNER (Hiện khi click guideHelper)
   ====================================================== */
.guide-helper-banner {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.guide-helper-banner.show {
    opacity: 1;
    pointer-events: auto;
}

.guide-banner-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: bannerPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-banner-img {
    max-width: 100%;
    max-height: 90vh;
}

@keyframes bannerPopIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    .guide-helper .helper-fairy-img { width: 70px; height: 70px; }
    .guide-helper .helper-tooltip { font-size: 10px; padding: 5px 10px; top: -38px; }
}

/* ======================================================
   LORE HELPER FAIRY (Cổ thư - C?�ch top-right Gacha Orb 150px b?�n phải)
   ====================================================== */
.lore-helper {
    position: fixed;
    z-index: 40;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
}

.lore-helper.hidden {
    display: none !important;
}

/* Trạng th?�i khởi tạo: ẩn ở top-right viewport (xa hơn guide helper) */
.lore-helper.enter-from-top-right-far {
    top: 5vh;
    right: 5vw;
    opacity: 0;
    transform: scale(0.5) rotate(-15deg);
}

/* Trạng th?�i active: bay đến vị tr?� c?�ch top-right Gacha Orb 150px b?�n phải */
.lore-helper.active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Trạng th?�i exit */
.lore-helper.exit-to-right {
    opacity: 0;
    transform: translateX(120vw) scale(0.5) rotate(20deg);
    pointer-events: none;
}

.lore-helper .helper-fairy-img {
    width: 90px;
    height: 130px;
    filter: drop-shadow(0 0 22px rgb(255, 163, 57));
    animation: fairyFloat 2.5s ease-in-out infinite alternate;
}

.lore-helper .helper-tooltip {
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: linear-gradient(135deg, #2a1a0a 0%, #1a0f05 100%);
    border: 1.5px solid #d4af37;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: "Handjet", sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    opacity: 0;
    animation: tooltipPopIn 0.4s 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: none;
}

.lore-helper .helper-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #d4af37;
}

/* Sparkle effect v?�ng kim */
.lore-helper::before {
    content: '✦';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 14px;
    color: #d4af37;
    animation: sparkleSpin 2s linear infinite;
    opacity: 0.8;
    text-shadow: 0 0 8px #d4af37;
}

/* ======================================================
   CORNER 3D PORTAL - CỔNG MA THUẬT GÓC MÀN HÌNH
   (Cách cạnh phải 10px, cách top 10%)
   ====================================================== */
.corner-portal3d {
    position: fixed;
    top: 10%;
    right: 10px;
    width: 132px;
    height: 178px;
    z-index: 39;
    pointer-events: none;   /* Chỉ nhận chuột khi module bật .p3d-interactive */
    cursor: pointer;
    /* Cổng mờ dần từ phải vào giống lore helper */
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
    /* Không có bloom nên glow ngoài do CSS đảm nhiệm.
       2 lớp drop-shadow: lớp rộng cho hào quang, lớp hẹp cho viền sáng.
       Filter tuân theo alpha của canvas -> bo tròn theo hình cổng, không tạo khung vuông. */
    filter: drop-shadow(0 0 16px rgba(255, 0, 127, 0.55))
            drop-shadow(0 0 25px rgba(0, 240, 255, 0.28));
}

.corner-portal3d.hidden {
    display: none !important;
}

/* Trạng thái active: hiện ra tại góc phải */
.corner-portal3d.active {
    opacity: 1;
    transform: translateX(0);
}

/* Trạng thái thoát: bay tới và mất đi */
.corner-portal3d.exit-to-right {
    opacity: 0;
    transform: translateX(46px) scale(0.72);
    pointer-events: none;
}

/* Khung con do portal-3d.js tự tạo: bỏ viền, chỉ giữ nền trong suốt.
   overflow:hidden + bo tròn để mép vùng đệm của WebGL không lộ thành đường thẳng. */
.corner-portal3d > .p3d-root {
    border-radius: 14px;
    overflow: hidden;
}

/* Mobile: thu nhỏ lại để không đè lên topbar */
@media (max-width: 480px) {
    .corner-portal3d {
        width: 104px;
        height: 142px;
        top: 11%;
        right: 6px;
    }
}

/* ======================================================
   LORE READER MODAL (Cổ thư lật trang 3D)
   ====================================================== */
.lore-reader-modal {
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lore-reader-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.lore-reader-container {
    width: 100%;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
    background: linear-gradient(180deg, #1e130c 0%, #0d0806 100%);
    border-radius: 16px;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.9),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: loreReaderPopIn 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes loreReaderPopIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.lore-reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(180deg, #2a1b12 0%, #150d08 100%);
    border-bottom: 2px solid #d4af37;
    position: relative;
}

.lore-reader-header::before { top: 6px; left: 6px; border-top: 2px solid; border-left: 2px solid; }
.lore-reader-header::after { top: 6px; right: 6px; border-top: 2px solid; border-right: 2px solid; }

.lore-reader-title {
    font-family: 'Cinzel';
    font-size: 18px;
    color: #f3e5ab;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    letter-spacing: 1px;
}

.lore-reader-page-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710027/kkhc8cgivejnhenmh76s.png) no-repeat center / 100% 100%;
    border-radius: 20px;
    padding: 6px 14px;
    font-family: "Cinzel", serif;
    font-size: 12px;
    color: #d4af37;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.lore-reader-page-indicator i {
    color: #d4af37;
    font-size: 14px;
}

.lore-reader-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, #3d2719 0%, #1c110a 100%);
    border: 2px solid #d4af37;
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.2);
}

.lore-reader-close:hover {
    border-color: #fff2a8;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5), inset 0 0 5px rgba(212, 175, 55, 0.3);
    transform: scale(1.1);
}

.lore-reader-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #0a0604;
    min-height: 0; /* Allow shrinking below 300px */
}

/* Swiper Flip Effect Styles for Lore Reader */
.lore-reader-viewport .swiper {
    width: 100%;
    height: 100%;
}

.lore-reader-viewport .swiper-wrapper {
    height: 100%;
}

.lore-reader-viewport .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1e130c;
    overflow: hidden;
    border-radius: 8px;
}

.lore-reader-viewport .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image without cropping */
    pointer-events: none; /* Prevent image drag conflicts on mobile */
}

/* Custom Swiper Navigation Buttons for Lore Reader */
.lore-reader-viewport .lore-swiper-btn {
    color: #d4af37 !important;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.8));
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #3d2719 0%, #1c110a 100%);
    border: 2px solid #d4af37;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.lore-reader-viewport .lore-swiper-btn:hover {
    border-color: #fff2a8;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5), inset 0 0 5px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.lore-reader-viewport .lore-swiper-btn::after {
    font-size: 20px !important;
    font-weight: 700;
}

.lore-reader-viewport .lore-swiper-btn.swiper-button-disabled {
    opacity: 0.4;
    filter: grayscale(0.8);
    cursor: not-allowed;
    border-color: #554333;
    color: #554333 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .lore-helper .helper-fairy-img { width: 80px; height: 120px; }
    .lore-helper .helper-tooltip { font-size: 10px; padding: 5px 10px; top: -38px; }
    
    .lore-reader-container { max-width: 95vw; height: 85vh; max-height: 90vh;}
    .lore-reader-title { font-size: 15px; }
    .lore-reader-btn { padding: 8px 12px; font-size: small; }
    
    .lore-reader-viewport .lore-swiper-btn {
        width: 36px;
        height: 36px;
    }
    .lore-reader-viewport .lore-swiper-btn::after {
        font-size: 16px !important;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .lore-reader-viewport .swiper {
        perspective: 1200px;
    }
}
/* BANNER L�?CH PHI??U LƯU */
.adventure-schedule-banner {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790717299/z71hrbs6ej1ihgzfwy2w.png) top / 100%;
    border: 1.5px solid #4cc9f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.adventure-schedule-banner:active { transform: scale(0.98); }
.schedule-badge {
    background: #d5cca0;
    color: #03030a;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
}
.schedule-title , .brochure-title { font-family:'Handjet';font-size: medium; color: #ffe66d; margin: 6px 0 4px; }
.schedule-desc,.brochure-desc { font-size: 10px; color: #c9c3ff; line-height: 1.3; white-space: pre-line; }
.schedule-cta { font-size: 10px; font-weight: bold; color: #4cc9f0; display: inline-block; margin-top: 6px; }

/* WRAPPER 2 BANNER SONG SONG */
.shop-banner-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.shop-banner-row > .adventure-schedule-banner,
.shop-banner-row > .adventure-brochure-banner {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* BANNER BROCHURE CHƯƠNG TR?�NH */
.adventure-brochure-banner {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790717171/dqe6kafubkkl3jzah7k6.png) top / 100%;
    border: 1.5px solid #c77dff;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(199, 125, 255, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.adventure-brochure-banner:active { transform: scale(0.98); }
.brochure-badge {
    background: #ffd166;
    color: #03030a;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
}
.brochure-cta { font-size: 10px; font-weight: bold; color: #c77dff; display: inline-block; margin-top: 6px; }

/* Responsive: stack tr?�n mobile nh�? */
@media (max-width: 380px) {
    .shop-banner-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* DANH S??CH L�?CH TR?�NH */
.schedule-list-box { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.schedule-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(165, 140, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sch-date { font-size: 9px; font-weight: bold; color: #ffd166; max-width: 60px; line-height: 1.2; }
.sch-info { flex: 1; margin: 0 8px; text-align: left; }
.sch-info b { font-size: 11px; color: #fff; display: block; }
.sch-info span { font-size: 9px; color: #a8a4c2; display: block; }
.sch-slots { font-size: 9px; font-weight: bold; color: #00f5d4; background: rgba(0,0,0,0.5); padding: 4px 6px; border-radius: 6px; }

/* EVENT1/2/3: gợi ý có thể chạm để xem ảnh hành trình (mở chung eventReaderModal) */
/* Glow xanh KHÔNG còn hard-code theo event1 nữa: dùng class dùng chung .glow-green,
   bật/tắt theo data.js -> GLOW_GREEN_CONFIG (xem khối GLOW GREEN bên dưới). */
.schedule-item.event1, .schedule-item.event2, .schedule-item.event3 { cursor: pointer; border-color: rgba(255, 209, 102, 0.45); transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.schedule-item.event1:hover, .schedule-item.event2:hover, .schedule-item.event3:hover, .schedule-item.event1:focus-visible, .schedule-item.event2:focus-visible, .schedule-item.event3:focus-visible { border-color: #ffd166; background: rgba(255, 209, 102, 0.08); outline: none; }
.sch-view-hint { font-size: 8px; color: #ffd166; display: block; margin-top: 2px; }

/* ======================================================
   GLOW GREEN — quầng sáng xanh dùng chung
   Gắn được cho BẤT KỲ event/phần tử nào, không chỉ event1/2/3:
       <div class="schedule-item glow-green">
   Tuỳ biến tại chỗ (không cần sửa CSS):
       style="--glow-green-rgb: 76, 201, 240; --glow-green-speed: 2s"
   Bật/tắt theo dữ liệu: data.js -> GLOW_GREEN_CONFIG
   Kỹ thuật: quầng sáng nằm ở ::after và chỉ animate opacity
   (compositor-friendly) thay vì animate box-shadow mỗi frame.
====================================================== */
:where(.glow-green) { position: relative; }
.glow-green {
    box-shadow:
        0 0 0 1px rgba(var(--glow-green-rgb), 0.30),
        0 0 10px 1px rgba(var(--glow-green-rgb), 0.28);
    transition: box-shadow 0.2s ease;
}
.glow-green::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 16px 3px rgba(var(--glow-green-rgb), 0.55);
    opacity: 0.5;
    transition: opacity 0.2s ease;
    animation: glowGreenBreath var(--glow-green-speed) ease-in-out infinite;
    will-change: opacity;
}
.glow-green:hover,
.glow-green:focus-visible {
    box-shadow:
        0 0 0 1px rgba(var(--glow-green-rgb), 0.55),
        0 0 16px 3px rgba(var(--glow-green-rgb), 0.45);
}
@keyframes glowGreenBreath {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
    .glow-green::after { animation: none; opacity: 0.65; }
}

/* 2 BANNER PROFILE */
.guild-action-banners { display: flex; flex-direction: row;   justify-content: center; gap: 8px; margin-top: 14px; }
.guild-banner-card {
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_optimzeWebP/v1790670395/xem2tgj2qyznxwur5fks.png) center / 100% 100%;
    border: 1px solid rgba(212, 192, 132, 0.3);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.15s;
    text-align: left;
}
.guild-banner-card:active { transform: scale(0.97); }
.banner-ico-box { font-size: 26px; }
.banner-txt-box h4 { font-size: 11px; color: #1f393f; font-family: 'Spectral SC'; }
.banner-txt-box p { font-size: 9px; color: #4d231d; margin-top: 2px; }

/* ======================================================
   TOAST NOTIFICATION SYSTEM (THAY THẾ ALERT)
====================================================== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 340px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(18, 14, 40, 0.96);
    border: 1px solid var(--border-magic);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(12px);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top right;
    min-width: 260px;
    max-width: 340px;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(100%) scale(0.9); }
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-top: 2px;
    box-shadow: 0 0 12px currentColor;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: "Handjet", sans-serif;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.toast-message {
    font-size: 10px;
    color: #c9c3ff;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Retro2k';
}

.toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #a8a4c2;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    margin-top: 2px;
}

.toast-close:hover {
    background: rgba(255, 80, 80, 0.2);
    color: #ff5050;
    transform: scale(1.1);
}

/* Toast Variants */
.toast-success .toast-icon { background: linear-gradient(135deg, #00f5d4, #00b8a0); color: #03030a; }
.toast-success { border-color: #00f5d4; box-shadow: 0 8px 32px rgba(0, 245, 212, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }

.toast-error .toast-icon { background: linear-gradient(135deg, #ff4d6d, #c72c4f); color: #fff; }
.toast-error { border-color: #ff4d6d; box-shadow: 0 8px 32px rgba(255, 77, 109, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }

.toast-warning .toast-icon { background: linear-gradient(135deg, #ffd166, #e8b000); color: #03030a; }
.toast-warning { border-color: #ffd166; box-shadow: 0 8px 32px rgba(255, 209, 102, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }

.toast-info .toast-icon { background: linear-gradient(135deg, #4cc9f0, #3a8fd8); color: #fff; }
.toast-info { border-color: #4cc9f0; box-shadow: 0 8px 32px rgba(76, 201, 240, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }

.toast-magic .toast-icon { background: linear-gradient(135deg, #c77dff, #a855f7); color: #fff; }
.toast-magic { border-color: #c77dff; box-shadow: 0 8px 32px rgba(199, 125, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }

/* Progress bar for auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 10px 10px;
    opacity: 0.6;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress { background: #00f5d4; }
.toast-error .toast-progress { background: #ff4d6d; }
.toast-warning .toast-progress { background: #ffd166; }
.toast-info .toast-progress { background: #4cc9f0; }
.toast-magic .toast-progress { background: #c77dff; }

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 100px;
        left: 12px;
        right: 12px;
        max-width: none;
    }
    .toast {
        min-width: auto;
    }
}

/* ======================================================
   GUIDE READER MODAL (Hướng dẫn Tinh Thủ - 2 trang lật)
   ====================================================== */
.guide-reader-modal {
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(10px);
    z-index: 255;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.guide-reader-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.guide-reader-container {
    width: 100%;
    max-width: 500px;
    height: 95vh;
    max-height: 95vh;
    background: linear-gradient(180deg, #0c1a2e 0%, #060d16 100%);
    border-radius: 16px;
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.9),
        inset 0 0 20px rgba(76, 201, 240, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: guideReaderPopIn 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes guideReaderPopIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.guide-reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(180deg, #122035 0%, #08101a 100%);
    border-bottom: 2px solid #4cc9f0;
    position: relative;
}

.guide-reader-header::before { 
    content: '';
    position: absolute;
    top: 6px; left: 6px; 
    width: 20px; height: 20px;
    border-top: 2px solid #4cc9f0; 
    border-left: 2px solid #4cc9f0; 
}
.guide-reader-header::after { 
    content: '';
    position: absolute;
    top: 6px; right: 6px; 
    width: 20px; height: 20px;
    border-top: 2px solid #4cc9f0; 
    border-right: 2px solid #4cc9f0; 
}

.guide-reader-title {
    font-family: 'Cinzel';
    font-size: 18px;
    color: #a8e6ff;
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.5);
    letter-spacing: 1px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-reader-page-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790710027/kkhc8cgivejnhenmh76s.png) no-repeat center / 100% 100%;
    border-radius: 20px;
    padding: 6px 14px;
    font-family: "Cinzel", serif;
    font-size: 12px;
    color: #4cc9f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.guide-reader-page-indicator i {
    color: #4cc9f0;
    font-size: 14px;
}

.guide-reader-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(180deg, #192e3f 0%, #0a151e 100%);
    border: 2px solid #4cc9f0;
    color: #4cc9f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.2);
}

.guide-reader-close:hover {
    border-color: #a8e6ff;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.5), inset 0 0 5px rgba(76, 201, 240, 0.3);
    transform: scale(1.1);
}

.guide-reader-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #050c14;
    min-height: 0; /* Allow shrinking below 300px */
}

/* Swiper Flip Effect Styles for Guide Reader */
.guide-reader-viewport .swiper {
    width: 100%;
    height: 100%;
}

.guide-reader-viewport .swiper-wrapper {
    height: 100%;
}

.guide-reader-viewport .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0a1522;
    overflow: hidden;
    border-radius: 8px;
}

.guide-reader-viewport .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image without cropping */
    pointer-events: none; /* Prevent image drag conflicts on mobile */
}

/* Custom Swiper Navigation Buttons for Guide Reader */
.guide-reader-viewport .guide-swiper-btn {
    color: #4cc9f0 !important;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.8));
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #192e3f 0%, #0a151e 100%);
    border: 2px solid #4cc9f0;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.guide-reader-viewport .guide-swiper-btn:hover {
    border-color: #a8e6ff;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.5), inset 0 0 5px rgba(76, 201, 240, 0.3);
    transform: translateY(-2px);
}

.guide-reader-viewport .guide-swiper-btn::after {
    font-size: 20px !important;
    font-weight: 700;
}

.guide-reader-viewport .guide-swiper-btn.swiper-button-disabled {
    opacity: 0.4;
    filter: grayscale(0.8);
    cursor: not-allowed;
    border-color: #335566;
    color: #335566 !important;
}

/* Responsive */
@media (max-width: 480px) {
    .guide-reader-container { max-width: 95vw; height: 85vh; max-height: 90vh; }
    .guide-reader-title { font-size: 15px; }
    .guide-reader-btn { padding: 8px 12px; font-size: 14px; }
    
    .guide-reader-viewport .guide-swiper-btn {
        width: 36px;
        height: 36px;
    }
    .guide-reader-viewport .guide-swiper-btn::after {
        font-size: 16px !important;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .guide-reader-viewport .swiper {
        perspective: 1200px;
    }
}

.guide-reader-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #0a1522;
    border: 2px solid #4cc9f0;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(76,201,240,0.1);
}

.guide-reader-emblem .rune-text {
    font-family: 'Cinzel', cursive;
    font-size: 20px;
    color: #4cc9f0;
    animation: runeGlow 3s infinite ease-in-out;
}

/* Responsive */
@media (max-width: 480px) {
    .guide-reader-container { max-width: 95vw; height: 85vh; max-height: 90vh; }
    .guide-reader-title { font-size: 15px; }
    .guide-reader-btn { padding: 8px 12px; font-size: 14px; }
    
    /* GIẢM 3D COMPLEXITY CHO MOBILE: Chỉ bật preserve-3d cho trang đang animation */
    .guide-book-stage { perspective: 1000px; }
    .guide-reader-viewport .lore-comic-page { transform-style: flat; }
    .guide-reader-viewport .lore-comic-page.animating { transform-style: preserve-3d; }
    .guide-reader-viewport .lore-page-face { backface-visibility: hidden; }
}

/* Tablet cũng giảm perspective */
@media (min-width: 481px) and (max-width: 1024px) {
    .guide-book-stage { perspective: 1200px; }
}

#guildModal h3, #rangerModal h3 {
    font-family: 'Spectral SC';
    font-weight: 600;
}
#googleBtnContainer span {font-family: 'F08'!important;}

.guide-reader-footer, .lore-reader-footer {display: grid; grid-template-columns: 1fr 1fr; justify-items: center;}
.guide-reader-btn,.lore-reader-btn  {padding: 5px 20px;}
/* ======================================================
   QUEST "NHẬP VAI VUI VẺ" - MODULE RPG ROLL D20
   (Port từ rpg-quest.html, tiền tố rq- để không xung đột CSS site)
   ====================================================== */
.rq-overlay {
    --rq-font-pixel: 'Retro2k';
    --rq-font-display: 'Jersey 25', monospace;
    --rq-bg-deep: #120d1c;
    --rq-panel-bg: #241a33;
    --rq-gold: #e8a33d;
    --rq-gold-lite: #ffd98a;
    --rq-gold-dark: #6b3d0d;
    --rq-parchment: #f6e7c1;
    --rq-ink: #000000;
    --rq-success: #6ede8a;
    --rq-fail: #e04a4a;

    position: fixed;
    inset: 0;
    z-index: 120;
    overflow: hidden;
    background-color: var(--rq-bg-deep);
    font-family: var(--rq-font-pixel);
    color: var(--rq-parchment);
    user-select: none;
    -webkit-user-select: none;
}
.rq-overlay.hidden { display: none; }

/* CANVAS 3D */
.rq-overlay #rqCanvasContainer { position: absolute; inset: 0; cursor: pointer; z-index: 0; }
.rq-overlay #rqCanvasContainer canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

/* LƯỚI CRT HOÀI CỔ */
.rq-crt-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 2px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0) 4px);
}

/* NÚT THOÁT */
.rq-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    width: 36px;
    height: 36px;
    font-family: var(--rq-font-pixel);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: var(--rq-gold-lite);
    background: rgba(18, 13, 28, 0.85);
    border: 3px solid var(--rq-gold-dark);
    cursor: pointer;
}
.rq-close-btn:hover { color: #fff; border-color: var(--rq-gold); }

/* NÚT BẤM PIXEL */
.rq-btn-pixel {
    padding: 12px 24px;
    font-family: var(--rq-font-pixel);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    color: #241404;
    background-color: var(--rq-gold);
    border: 3px solid #ffe4a8;
    box-shadow: 0 5px 0 var(--rq-gold-dark), 5px 5px 0 rgba(0, 0, 0, 0.5);
    cursor: pointer;
}
.rq-btn-pixel:hover { background-color: var(--rq-gold-lite); }
.rq-btn-pixel:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--rq-gold-dark), 2px 2px 0 rgba(0, 0, 0, 0.5); }
.rq-btn-pixel:disabled { opacity: .55; cursor: not-allowed; }

/* HÀNG NÚT HÀNH ĐỘNG TRONG POPUP (nút chính + nút THOÁT) */
.rq-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}
.rq-modal-actions .rq-btn-pixel {
    flex: 1 1 150px;
    max-width: 200px;
}

/* BIẾN THỂ NÚT PHỤ: viền mảnh, nền tối (dùng cho nút THOÁT) */
.rq-btn-alt {
    color: var(--rq-gold-lite);
    background-color: rgba(18, 13, 28, 0.85);
    border-color: var(--rq-gold-dark);
    box-shadow: 0 5px 0 var(--rq-ink), 5px 5px 0 rgba(0, 0, 0, 0.5);
}
.rq-btn-alt:hover {
    color: #fff;
    background-color: rgba(58, 42, 78, 0.9);
    border-color: var(--rq-gold);
}
.rq-btn-alt:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 var(--rq-ink), 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* MODAL BACKDROP */
.rq-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 5, 14, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.rq-modal-box {
    background-color: var(--rq-panel-bg);
    border: 4px solid var(--rq-gold);
    padding: 30px 24px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 8px 8px 0 var(--rq-ink);
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.rq-modal-title {
    font-size: 26px;
    color: var(--rq-gold-lite);
    margin: 0 0 12px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--rq-ink);
}
.rq-modal-desc { font-size: 15px; line-height: 1.5; color: var(--rq-parchment); margin-bottom: 24px; }
.rq-modal-dialogue {
    font-size: 14px;
    line-height: 1.5;
    font-style: italic;
    color: #ffe4a0;
    background: #150f22;
    border: 2px dashed var(--rq-gold-dark);
    padding: 10px 12px;
    margin: -8px 0 22px;
}

/* KHUNG QUEST */
.rq-quest-card {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 480px;
    background: rgba(36, 26, 51, 0.95);
    border: 3px solid var(--rq-gold);
    padding: 12px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.rq-quest-image { width: 100%; height:30vh; object-fit: cover; border: 2px solid var(--rq-gold-dark); image-rendering: pixelated; }
.rq-quest-header-row { display: flex; justify-content: space-between; align-items: baseline; }
.rq-quest-name { font-size: 18px; font-weight: 700; color: var(--rq-gold-lite); margin: 0; text-shadow: 1px 1px 0 var(--rq-ink); }
.rq-quest-condition { font-size: 13px; color: #ffe4a0; background: #110b1a; border: 1px solid var(--rq-gold-dark); padding: 3px 6px; white-space: nowrap; }
.rq-quest-desc { margin: 0; font-size: 15px; line-height: 1.4; color: #e6daf5; }
.rq-quest-tracker { display: flex; align-items: center; justify-content: space-between; background: #150f22; padding: 6px 10px; border: 1px dashed var(--rq-gold-dark); }
.rq-tracker-label { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.rq-tracker-pips { display: flex; gap: 6px; }
.rq-pip {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px;
    background: #332449; border: 2px solid #583c7d; color: #7d5aa8;
}
.rq-pip.active { background: var(--rq-success); border-color: #fff; color: #0d3819; font-weight: bold; box-shadow: 0 0 8px rgba(110, 222, 138, 0.8); }
.rq-pip.failed { background: var(--rq-fail); border-color: #fff; color: #fff; font-weight: bold; box-shadow: 0 0 8px rgba(224, 74, 74, 0.8); }

/* NÚT TUNG DƯỚI CHÂN */
.rq-ui-footer { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; z-index: 10; }

/* BẢNG KẾT QUẢ */
.rq-overlay #rqResultOverlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; opacity: 0; transform: scale(0.6); z-index: 20;
}
.rq-result-panel {
    background: var(--rq-panel-bg);
    border: 4px solid var(--rq-gold);
    padding: 20px 24px;
    text-align: center;
    box-shadow: 6px 6px 0 var(--rq-ink);
    width: 380px; max-width: calc(100vw - 32px);
}
.rq-result-panel.v-success { border-color: var(--rq-success); }
.rq-result-panel.v-fail { border-color: var(--rq-fail); }
.rq-result-title { font-size: 20px; font-weight: 700; margin: 0; text-transform: uppercase; }
.rq-result-title.v-success { color: var(--rq-success); }
.rq-result-title.v-fail { color: var(--rq-fail); }
.rq-result-number { font-family: var(--rq-font-display); font-size: 76px; line-height: 1; margin: 8px 0; color: #fff; text-shadow: 3px 3px 0 var(--rq-ink); }
.rq-result-badge { display: inline-block; padding: 5px 12px; font-size: 13px; font-weight: bold; color: #1a1206; background: var(--rq-gold); }
.rq-result-badge.v-success { background: var(--rq-success); color: #072e12; }
.rq-result-badge.v-fail { background: var(--rq-fail); color: #fff; }
.rq-result-dialogue { margin-top: 14px; background: #150f22; border: 2px solid #583c7d; padding: 8px 10px; text-align: left; }
.rq-result-speaker { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--rq-gold-lite); margin-bottom: 5px; }
.rq-result-speaker::before { content: '\00AB  '; color: var(--rq-gold); }
.rq-result-line { margin: 0; font-size: 14px; line-height: 1.45; color: #efe6ff; min-height: 38px; }
.rq-result-line::after { content: '_'; color: var(--rq-gold); }

/* MÀN HÌNH NHỎ: thu nhỏ khung quest cho vừa màn hình */
@media (max-width: 480px) {
    .rq-quest-card { padding: 9px; gap: 7px; }
    .rq-quest-image { height: 30vh; }
    .rq-quest-name { font-size: 15px; }
    .rq-quest-desc { font-size: 13px; }
    .rq-modal-box { padding: 22px 16px; }
    .rq-modal-actions { flex-direction: column; gap: 10px; }
    .rq-modal-actions .rq-btn-pixel { max-width: none; }
    .rq-modal-title { font-size: 21px; }
    .rq-result-number { font-size: 60px; }
    .rq-ui-footer { bottom: 16px; }
}

/* ======================================================
   NÚT BẬT/TẮT NHẠC NỀN (BGM) - SÁT CẠNH TRÁI, TOP 10%
   ====================================================== */
.bgm-toggle {
    position: fixed;
    left: 0;
    top: 10%;
    transform: translateY(-50%);
    z-index: 9990;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: transparent;
    border-left: none;
    border-radius: 0 19px 19px 0;   /* bo tròn cạnh phải, vuông sát mép trái */
    color: #b7e4c7;
    box-shadow: 0 0 12px rgba(46, 125, 50, 0.35), inset 0 0 8px rgba(74, 222, 128, 0.12);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.bgm-toggle:hover {
    color: #fef08a;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.55), inset 0 0 12px rgba(34, 197, 94, 0.28);
    padding-left: 4px;
}

.bgm-toggle:active {
    transform: translateY(-50%) scale(0.94);
}

.bgm-toggle:focus-visible {
    outline: 2px solid #ffd166;
    outline-offset: 2px;
}

/* Trạng thái tắt: xám + icon tắt tiếng */
.bgm-toggle.is-off {
    background: linear-gradient(160deg, #2b2b33 0%, #131318 100%);
    color: #8e8a9c;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    border-color: #4a4a55;
}

.bgm-toggle-ico {
    font-size: 19px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 0 4px rgba(255, 230, 150, 0.35));
}

.bgm-toggle.is-off .bgm-toggle-ico {
    filter: none;
    opacity: 0.65;
}

/* Nhịp sáng nhẹ khi đang phát */
.bgm-toggle:not(.is-off) .bgm-toggle-ico {
    animation: bgmPulse 2.4s ease-in-out infinite;
}

@keyframes bgmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.14); }
}

/* Màn hình nhỏ: thu gọn cho vừa */
@media (max-width: 480px) {
    .bgm-toggle { width: 32px; height: 32px; }
    .bgm-toggle-ico { font-size: 14px; }
    .bgm-toggle { border-radius: 0 16px 16px 0; }
}

.btn-admin-act.hidden {display: none;}

/* ======================================================
   NÚT "?" GÓC DƯỚI BÊN PHẢI + MODAL "CHỜ MỞ KHOÁ"
   Nội dung danh sách render từ texts.js (TEXTS.upcomingFeatures)
   ====================================================== */
.upcoming-fab {
    position: fixed;
    left: 10px;
    bottom: 14px;
    /* Cao hơn panel (40) + dock (30) nhưng thấp hơn modal (50) để không nổi lên trên popup */
    z-index: 45;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    background: linear-gradient(160deg, #2a2140 0%, #120d20 100%);
    border: 1px solid rgba(212, 192, 132, 0.55);
    border-radius: 50%;
    color: var(--gold-cp);
    box-shadow: 0 0 12px rgba(212, 192, 132, 0.35), inset 0 0 8px rgba(255, 209, 102, 0.12);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.upcoming-fab:hover {
    color: #fff7d6;
    border-color: var(--gold-cp);
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.6), inset 0 0 12px rgba(255, 209, 102, 0.25);
    transform: scale(1.08);
}

.upcoming-fab:active {
    transform: scale(0.94);
}

.upcoming-fab:focus-visible {
    outline: 2px solid var(--gold-cp);
    outline-offset: 2px;
}

.upcoming-fab-ico {
    font-family: 'Cinzel', 'Handjet', sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    display: block;
    transform: translateY(-1px);
    filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.5));
}

/* Nhịp sáng nhẹ nhắc user rằng có nội dung mới đang chờ */
.upcoming-fab-ico {
    animation: upcomingFabPulse 2.6s ease-in-out infinite;
}

@keyframes upcomingFabPulse {
    0%, 100% { opacity: 1; transform: translateY(-1px) scale(1); }
    50%      { opacity: 0.72; transform: translateY(-1px) scale(0.9); }
}

/* ======================================================
   NÚT "❔" GÓC DƯỚI BÊN PHẢI + LIGHTBOX TOÀN MÀN HÌNH
   ====================================================== */
.help-fab {
    position: fixed;
    right: 14px;
    bottom: 14px;
    /* Cao hơn panel (40) + dock (30) nhưng thấp hơn modal (50) để không nổi lên trên popup */
    z-index: 45;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;

    background: linear-gradient(160deg, #2a2140 0%, #120d20 100%);
    border: 1px solid rgba(212, 192, 132, 0.55);
    border-radius: 50%;
    color: var(--gold-cp);
    box-shadow: 0 0 12px rgba(212, 192, 132, 0.35), inset 0 0 8px rgba(255, 209, 102, 0.12);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.help-fab:hover {
    color: #fff7d6;
    border-color: var(--gold-cp);
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.6), inset 0 0 12px rgba(255, 209, 102, 0.25);
    transform: scale(1.08);
}

.help-fab:active { transform: scale(0.94); }

.help-fab:focus-visible {
    outline: 2px solid var(--gold-cp);
    outline-offset: 2px;
}

.help-fab-ico {
    font-family: 'Cinzel', 'Handjet', sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    display: block;
    transform: translateY(-1px);
    filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.5));
}
@media (max-width: 768px) {
    .help-fab {
        right: 8px;
        bottom: 104px;
    }
}

/* Lightbox toàn màn hình */
.help-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.help-lightbox.hidden { display: none; }

.help-lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.help-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.help-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 610;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}
.help-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--gold-cp);
    color: var(--gold-cp);
    transform: scale(1.1);
}

/* --- Modal CHỜ MỞ KHOÁ --- */
.upcoming-modal-box {
    max-width: 340px;
    max-height: 86vh;
    overflow-y: auto;
    text-align: left;
}

.upcoming-modal-title {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--gold-cp);
    text-align: center;
    text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
    padding-right: 26px;
}

.upcoming-modal-sub {
    font-family: Retro2k, sans-serif;
    font-size: 9.5px;
    line-height: 1.45;
    color: #a8a4c2;
    text-align: center;
    margin: 6px 0 10px;
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.upcoming-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 9px;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(212, 192, 132, 0.22);
    border-left: 2px solid rgba(212, 192, 132, 0.55);
    border-radius: 7px;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.upcoming-item:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 209, 102, 0.5);
}

.upcoming-item-idx {
    flex: 0 0 auto;
    font-family: 'Handjet', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--gold-cp);
    line-height: 1.5;
    min-width: 13px;
}

.upcoming-item-ico {
    flex: 0 0 auto;
    font-size: 15px;
    line-height: 1.3;
    filter: drop-shadow(0 0 5px rgba(255, 209, 102, 0.3));
}

.upcoming-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.upcoming-item-name {
    display: block;
    font-family: 'Handjet', sans-serif;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: #ffe66d;
}

.upcoming-item-desc {
    display: block;
    font-size: 9.5px;
    line-height: 1.45;
    color: #ddd8f5;
    margin-top: 2px;
}

.upcoming-item-lock {
    flex: 0 0 auto;
    font-size: 10px;
    opacity: 0.55;
    line-height: 1.6;
}

.upcoming-modal-note {
    font-size: 8.5px;
    color: #8e8aab;
    text-align: center;
    font-style: italic;
    margin-top: 10px;
}

/* Màn hình nhỏ / tablet: dock chiếm gần hết chiều ngang nên đẩy nút "?" lên cao hơn */
@media (max-width: 768px) {
    .upcoming-fab { width: 26px; height: 26px; right: 8px; bottom: 104px; }
    .upcoming-fab-ico { font-size: 13px; }
}

@media (max-width: 480px) {
    .upcoming-modal-box { max-width: 92vw; }
}

/* ======================================================
   BẢNG QUEST TẠI HỘI NGỌC LỤC  (#guildQuestModal)
   Mở bằng cách click #loreHelper. Ảnh nạp từ data.js -> GUILD_QUEST_DATA.
   - Lưới 2 cột rời rạc, mỗi tờ nghiêng ngẫu nhiên (biến --gq-tilt từ JS)
   - Khung 80vw x 70vh, luôn nằm giữa màn hình
   - Nội dung dài hơn khung -> cuộn dọc trong .guild-quest-body
   ====================================================== */
.guild-quest-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.guild-quest-modal.hidden { display: none; }
.guild-quest-modal.show { opacity: 1; pointer-events: auto; }

/* Khung bảng: nền lấy từ GUILD_QUEST_META.background (gán inline bởi app.js) */
.guild-quest-box {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 80vw;
    height: 70vh;
    max-width: 1280px;
    border-radius: 14px;
    border: 2px solid rgba(212, 175, 55, 0.55);
    box-shadow:
        0 0 45px rgba(212, 175, 55, 0.32),
        0 26px 70px rgba(0, 0, 0, 0.85),
        inset 0 0 26px rgba(0, 0, 0, 0.45);
    background-color: #1a1208;
    background-repeat: no-repeat;
    background-position: center;
    /* Ảnh nền gốc là DỌC (500x574) còn khung modal là NGANG (80vw x 70vh).
       Không dùng cover vì sẽ cắt mất khung viền trang trí của tấm bảng.
       Giãn vừa khung, đồng bộ với .modal-box của hệ thống. */
    background-size: 100% 100%;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.93) translateY(18px);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
}

.guild-quest-modal.show .guild-quest-box {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* --- Header --- */
.guild-quest-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    background: linear-gradient(180deg, rgba(28, 18, 9, 0.95) 0%, rgba(12, 8, 5, 0.95) 100%);
    border-bottom: 2px solid rgba(212, 175, 55, 0.6);
}

.guild-quest-title {
    margin: 0;
    font-family: 'Cinzel', 'Spectral SC', serif;
    font-size: clamp(13px, 1.5vw, 20px);
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #f3e5ab;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
}

.guild-quest-close {
    flex: 0 0 auto;
    position: static;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706999/esy0uorbvuidvrvpvu9l.png) no-repeat center / 100% 100%;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.guild-quest-close:hover { transform: scale(1.12) rotate(8deg); filter: brightness(1.2); }
.guild-quest-close:active { transform: scale(0.94); }

/* --- Vùng cuộn --- */
.guild-quest-body {
    flex: 1 1 auto;
    min-height: 0;               /* bắt buộc để con được phép co lại trong flex column */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.55) rgba(0, 0, 0, 0.4);
    overscroll-behavior: contain;
}

.guild-quest-body::-webkit-scrollbar { width: 8px; }
.guild-quest-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.4); border-radius: 4px; }
.guild-quest-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4af37, #8a6d1f);
    border-radius: 4px;
}

.guild-quest-hint {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 12px 10px;
    font-family: Retro2k, sans-serif;
    font-size: 9px;
    letter-spacing: 0.5px;
    text-align: center;
    color: rgba(243, 229, 171, 0.72);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    background: linear-gradient(180deg, rgba(12, 8, 5, 0) 0%, rgba(12, 8, 5, 0.85) 100%);
}

/* --- Lưới mobile 2 cột / desktop 3 cột --- */
.guild-quest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: start;
    padding-bottom: 8px;
}

@media (min-width: 769px) {
    .guild-quest-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.guild-quest-empty {
    grid-column: 1 / -1;
}

/* ======================================================
   MODAL XÁC NHẬN GACHA CHO GUEST
   ====================================================== */
#guestGachaConfirmModal .modal-box {
    animation: modalBoxPulse 2s ease-in-out infinite;
}

#guestGachaConfirmModal .btn-magical {
    font-family: Retro2k, sans-serif;
    letter-spacing: 1px;
}

#guestGachaConfirmModal .btn-celtic {
    font-family: Retro2k, sans-serif;
    letter-spacing: 0.5px;
}

@keyframes guestGachaIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

#guestGachaConfirmModal .modal-box > div:first-child {
    animation: guestGachaIconFloat 2s ease-in-out infinite;
}

/* ======================================================
   MODAL ĐĂNG NHẬP CHO USER ĐÃ ĐĂNG KÝ
   ====================================================== */
#returningUserLoginModal .modal-box {
    animation: modalBoxPulse 2s ease-in-out infinite;
}

#returningUserLoginModal .btn-celtic {
    font-family: Retro2k, sans-serif;
    letter-spacing: 0.5px;
}

@keyframes returningUserIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

#returningUserLoginModal .modal-box > div:first-child {
    animation: returningUserIconFloat 2s ease-in-out infinite;
}

/* Một tờ ảnh ghim trên bảng. --gq-dx/--gq-dy = lệch vị trí, --gq-tilt = độ nghiêng */
.gq-card {
    position: relative;
    display: block;
    width: 60%;
    margin: 0 auto;
    padding: 8px 8px 24px;
    border: 1px solid rgba(120, 90, 40, 0.6);
    border-radius: 3px;
    background: linear-gradient(180deg, #f7eed6 0%, #ddcda4 100%);
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.55);
    cursor: zoom-in;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    color: inherit;
    text-align: center;
    transform: translate(var(--gq-dx, 0px), var(--gq-dy, 0px)) rotate(var(--gq-tilt, 0deg));
    transform-origin: 50% 22%;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                filter 0.3s ease;
    will-change: transform;
}

/* Đinh ghim ở đầu tờ */
.gq-card::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 15px;
    height: 15px;
    margin-left: -7.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff6cd 0%, #d4af37 55%, #7a5c14 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.65);
    z-index: 2;
}

.gq-card:hover,
.gq-card:focus-visible {
    transform: translate(var(--gq-dx, 0px), calc(var(--gq-dy, 0px) - 8px)) rotate(var(--gq-tilt, 0deg)) scale(1.05);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.7);
    filter: brightness(1.06);
    z-index: 30;
    outline: none;
}

.gq-card-img {
    display: block;
    width: 100%;
    /* KHÔNG đặt aspect-ratio / object-fit: các tờ quest cổ gốc dọc
       (tỉ lệ 0.67 - 1.0), đặt khung + cover sẽ cắt mất nội dung.
       Để mỗi ảnh giữ nguyên tỉ lệ thật (đổi với tờ ảnh cổ dọc hay ngang
       đều không bao giờ bị cắt). */
    height: auto;
    border-radius: 2px;
    pointer-events: none;       /* click xuyên thẳng lên .gq-card */
}

.gq-card-caption {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 5px;
    font-family: Retro2k, sans-serif;
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0.4px;
    color: #4a3a1c;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ======================================================
   LIGHTBOX ẢNH QUEST  (#guildQuestLightbox)
   ====================================================== */
.guild-quest-lightbox {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px 16px;
    background: rgb(3 2 8 / 52%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guild-quest-lightbox.hidden { display: none; }
.guild-quest-lightbox.show { opacity: 1; }

/* Khung chứa ảnh + nút đăng ký, xếp dọc -> nút nằm ngay dưới ảnh */
.gql-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    max-height: 100%;
}

.gql-img {
    max-width: 100%;
    /* Cao tối đa 70vh để còn chỗ cho nút đăng ký + caption + bộ đếm bên dưới */
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 45px rgba(0, 0, 0, 0.9);
    transform: scale(0.96);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.guild-quest-lightbox.show .gql-img { transform: scale(1); }

.gql-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #f3e5ab;
    background: rgba(20, 13, 6, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gql-prev { left: 10px; }
.gql-next { right: 10px; }
.gql-nav:hover { background: rgba(212, 175, 55, 0.28); }
.gql-prev:hover { transform: translateY(-50%) scale(1.06); }
.gql-next:hover { transform: translateY(-50%) scale(1.06); }

/* Ảnh chỉ có 1 tờ -> ẩn nút chuyển ảnh */
.gql-nav.is-off { display: none; }

.gql-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 36px;
    padding: 0;
    border: 0;
    background: url(https://res.cloudinary.com/aurorawoods/image/upload/t_iconWebP/v1790706999/esy0uorbvuidvrvpvu9l.png) no-repeat center / 100% 100%;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.gql-close:hover { transform: scale(1.14) rotate(8deg); filter: brightness(1.2); }

.gql-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    padding: 0 70px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
    color: #f3e5ab;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

.gql-counter {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    font-family: Retro2k, sans-serif;
    font-size: 9px;
    text-align: center;
    color: rgba(243, 229, 171, 0.65);
}

/* --- Nút "Gửi Thông tin đăng ký Quest" (ngay dưới ảnh) --- */
.gql-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 11px 22px;
    border: 1px solid rgba(212, 175, 55, 0.75);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-family: Retro2k, sans-serif;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: #f7fbff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.gql-register i {
    font-size: 14px;
    color: #d9f0ff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

.gql-register-text {
    line-height: 1.3;
    text-align: center;
}

.gql-register:hover:not(:disabled),
.gql-register:focus-visible:not(:disabled) {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.7), 0 0 18px rgba(10, 123, 216, 0.6);
    filter: brightness(1.12);
    outline: none;
}

.gql-register:active:not(:disabled) {
    transform: translateY(1px) scale(0.99);
}

/* Đang gửi: xoay icon + mờ nút */
.gql-register.is-sending i { animation: gql-send-spin 0.9s linear infinite; }
.gql-register.is-sending { opacity: 0.8; cursor: progress; }

/* Đã gửi xong: chuyển sang xanh lá để người chơi biết đã thành công */
.gql-register.is-done {
    background: linear-gradient(180deg, #1e9e5a 0%, #146c3d 55%, #0d4a29 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(30, 158, 90, 0.45);
}

.gql-register:disabled { cursor: default; }

@keyframes gql-send-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Dòng giải thích nhỏ dưới nút */
.gql-register-note {
    margin: 0;
    max-width: 420px;
    font-family: Retro2k, sans-serif;
    font-size: 8px;
    line-height: 1.5;
    letter-spacing: 0.4px;
    text-align: center;
    color: rgba(243, 229, 171, 0.68);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* Màn hình nhỏ: thu padding, giữ lưới 2 cột cho mobile + khung 80vw x 70vh */
@media (max-width: 768px) {
    .guild-quest-modal { padding: 10px; }
    .guild-quest-header { padding: 10px 12px; }
    .guild-quest-body { padding: 12px 10px 6px; }
    .guild-quest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
    .gq-card { padding: 6px 6px 20px; }
    .gq-card-caption { font-size: 8px; }
    .gql-nav { width: 36px; height: 50px; font-size: 16px; }
    .gql-prev { left: 4px; }
    .gql-next { right: 4px; }
    .gql-caption { font-size: 11px; padding: 0 46px; }
    /* Màn nhỏ: thu ảnh + nút cho vừa màn hình */
    .gql-stage { gap: 9px; }
    .gql-img { max-height: 58vh; }
    .gql-register { padding: 9px 15px; font-size: 9px; gap: 7px; }
    .gql-register i { font-size: 12px; }
    .gql-register-note { font-size: 7px; max-width: 300px; }
}

/* ================= GEM LEADERBOARD HELPER (LEFT CORNER) ================= */
.gem-lb-helper {
    position: fixed;
    top: 10vh;
    left: 20px;               /* Sử dụng left thay vì right */
    z-index: 90;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
    opacity: 0;
    transform: translateX(-120%) scale(0.9);
    filter: drop-shadow(0 6px 18px rgba(124, 108, 255, 0.45));
    will-change: transform, opacity;
}

.gem-lb-helper.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.gem-lb-helper.hidden {
    display: none !important;
}

.gem-lb-helper.enter-from-top-left-far {
    transform: translateX(-160%) translateY(-40%) scale(0.85) rotate(-6deg);
    opacity: 0;
}

.gem-lb-helper.exit-to-left {
    transform: translateX(-140%) scale(0.92);
    opacity: 0;
    pointer-events: none;
}

.gem-lb-img {
    width: clamp(72px, 8vw, 92px);
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 10px 40px rgba(255, 230, 109, 0.25));
    transition: transform 280ms ease, filter 280ms ease;
}

.gem-lb-helper.active .gem-lb-img {
    animation: gemLbFloat 3.2s ease-in-out infinite alternate;
}

.gem-lb-helper:hover .gem-lb-img {
    transform: scale(1.08);
    filter: drop-shadow(0 12px 48px rgba(124, 108, 255, 0.45));
}

.gem-lb-tooltip {
    white-space: nowrap;
    max-width: min(70vw, 240px);
    text-align: center;
    padding: 6px 8px;
    line-height: 1.25;
    display: none;
}

@keyframes gemLbFloat {
    0% {
        transform: translateY(-4px) rotate(-1deg);
    }
    100% {
        transform: translateY(4px) rotate(1deg);
    }
}

/* ================= GEM LEADERBOARD LIST ================= */
.lb-list {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vw, 8px);
    margin-top: clamp(8px, 2vw, 10px);
    max-height: min(68vh, 520px);
    overflow: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    font-family: 'Handjet';
}

.lb-list::-webkit-scrollbar {
    width: 4px;
}

.lb-list::-webkit-scrollbar-thumb {
    background: rgba(255, 230, 109, 0.35);
    border-radius: 4px;
}

.lb-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 10px);
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 10px);
    border-radius: clamp(8px, 2vw, 10px);
    background: linear-gradient(180deg, rgba(124, 108, 255, 0.18), rgba(74, 52, 184, 0.12));
    border: 1px solid rgba(255, 230, 109, 0.25);
    box-shadow: 0 6px 18px -10px rgba(124, 108, 255, 0.45) inset;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    justify-content: center;
}

.lb-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 230, 109, 0.45);
    box-shadow: 0 10px 28px -14px rgba(124, 108, 255, 0.6);
}

.lb-me {
    box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.6) inset, 0 0 0 2px rgba(0, 245, 212, 0.25) inset;
    background: linear-gradient(180deg, rgba(0, 245, 212, 0.22), rgba(74, 52, 184, 0.14));
}

.lb-rank {
    min-width: clamp(30px, 6vw, 34px);
    text-align: center;
    font-weight: 700;
    color: #ffe66d;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(255, 230, 109, 0.45);
}

.lb-avatar {
    width: clamp(34px, 7vw, 50px);
    height: clamp(34px, 7vw, 50x);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    object-fit: cover;
    box-shadow: 0 6px 18px -10px rgba(124, 108, 255, 0.8);
}

.lb-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff9da;
}

.lb-code {
    font-size: clamp(9px, 2vw, 10px);
    opacity: 0.8;
    letter-spacing: 1px;
    color: #c9c3ff;
    display: none;
}

.lb-gem-count {
    font-weight: 700;
    color: #7c6cff;
    text-shadow: 0 2px 8px rgba(124, 108, 255, 0.35);
    white-space: nowrap;
}

.lb-gem-total {
    opacity: 0.6;
    margin-left: 2px;
    color: #c9c3ff;
}

.lb-sub,
.lb-note {
    font-size: clamp(10px, 2vw, 11px);
    opacity: 0.9;
    text-align: center;
    color: #fff9da;
    line-height: 1.5;
}

.lb-note {
    margin-top: clamp(8px, 2vw, 10px);
    opacity: 0.8;
}

.lb-avatar img {width: 100%;     border-radius: 50%;}
.lb-rank-1,.lb-rank-2,.lb-rank-3 {border-style: dashed;}
 .lb-rank-1 {background-color: #ffbe002b;box-shadow: yellow 2px 2px 2px;}
.lb-rank-2 {box-shadow: #00abffa6 2px 2px 2px; background: #00ceff2b;}
.lb-rank-3 {box-shadow: #00ff68a6 2px 2px 2px;    background: #00ff392b;}
#myRefCodeDisplay {font-family: 'Cinzel';}