/* ============================================================================
 * css/game.css — Định dạng giao diện chung Web Game Thủy Hử 9v9
 * ============================================================================ */
@import "thuy_hu_icon_actions.css";

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================================================
 * QUY TẮC THIẾT KẾ PHẲNG ĐÔNG PHƯƠNG — TRIỆT TIÊU TOÀN BỘ VIỀN MẶC ĐỊNH
 * Xóa viền của các button, của các icon đi, chỉ hover hoặc chọn mới highlight
 * ============================================================================ */

/* 1. Mọi Button & Nút Thao Tác: Triệt tiêu hoàn toàn viền cả ở trạng thái nghỉ lẫn hover / highlight */
button,
.btn,
.icon-action-btn,
a.btn,
a[role="button"],
[role="button"],
.home-stage-card-wrap,
.campaign-journey-node {
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.22s ease,
                color 0.2s ease,
                text-shadow 0.2s ease,
                background-color 0.2s ease !important;
}

/* 2. Tuyệt đối KHÔNG sinh viền khi Hover, Highlight, Selected hoặc Active */
button:hover,
.btn:hover,
.icon-action-btn:hover,
a.btn:hover,
a[role="button"]:hover,
[role="button"]:hover,
.home-stage-card-wrap:hover,
.campaign-journey-node:hover,
button:focus-visible,
.btn:focus-visible,
button.active,
button.is-active,
button.selected,
button.is-selected,
button[aria-selected="true"],
.btn.active,
.btn.selected,
button:active {
    border: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 3. CHỈ SÁNG ICON VÀ TEXT LÊN THÔI KHI HOVER / HIGHLIGHT / SELECTED */
button:hover img,
.btn:hover img,
a:hover img,
[role="button"]:hover img,
.group:hover img,
button:hover svg,
.btn:hover svg,
a:hover svg,
button:hover i,
.btn:hover i,
a:hover i,
button.active img,
button.selected img,
.btn.active img,
.btn.selected img {
    filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.95)) brightness(1.2) !important;
    transition: filter 0.22s ease, transform 0.22s ease;
}

button:hover span,
button:hover p,
button:hover h1,
button:hover h2,
button:hover h3,
.btn:hover span,
a:hover span,
.group:hover span,
button:hover,
button.active span,
button.selected span,
.btn.active span,
.btn.selected span {
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.85) !important;
    color: #fef08a !important;
    transition: text-shadow 0.22s ease, color 0.2s ease;
}

/* Biến thể phát sáng theo màu của Icon & Text */
button[class*="emerald"]:hover img,
button[class*="emerald"]:hover i {
    filter: drop-shadow(0 0 14px rgba(52, 211, 153, 0.95)) brightness(1.2) !important;
}
button[class*="emerald"]:hover span,
button[class*="emerald"]:hover {
    text-shadow: 0 0 12px rgba(52, 211, 153, 0.85) !important;
    color: #a7f3d0 !important;
}

button[class*="rose"]:hover img,
button[class*="rose"]:hover i {
    filter: drop-shadow(0 0 14px rgba(244, 63, 94, 0.95)) brightness(1.2) !important;
}
button[class*="rose"]:hover span,
button[class*="rose"]:hover {
    text-shadow: 0 0 12px rgba(244, 63, 94, 0.85) !important;
    color: #fecdd3 !important;
}

button[class*="cyan"]:hover img,
button[class*="cyan"]:hover i {
    filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.95)) brightness(1.2) !important;
}
button[class*="cyan"]:hover span,
button[class*="cyan"]:hover {
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.85) !important;
    color: #a5f3fc !important;
}

/* 4. Nút biểu tượng thuần túy: Triệt tiêu hoàn toàn viền và nền cả ở trạng thái nghỉ lẫn hover/active */
.btn-pure-icon,
button.btn-pure-icon,
a.btn-pure-icon,
.btn-pure-icon:hover,
button.btn-pure-icon:hover,
a.btn-pure-icon:hover,
.btn-pure-icon:active,
button.btn-pure-icon:active,
a.btn-pure-icon:active {
    border: none !important;
    border-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 4. Mọi Icon & Badge: Triệt tiêu hoàn toàn viền thô bao quanh */
.thuyhu-icon,
img.thuyhu-icon,
.icon-class-badge,
.icon-terrain-badge,
.icon-status-badge,
.icon-status-cc,
.icon-status-dot {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 5. Highlight Icon khi Hover hoặc khi Được Chọn */
.thuyhu-icon:hover,
.icon-class-badge:hover,
button:hover .thuyhu-icon,
.group:hover .thuyhu-icon,
[role="button"]:hover .thuyhu-icon {
    filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.85)) brightness(1.18) !important;
}

.thuyhu-icon.is-selected,
.thuyhu-icon.selected,
.thuyhu-icon.active,
button.active .thuyhu-icon,
button.selected .thuyhu-icon,
button.is-active .thuyhu-icon,
button[aria-selected="true"] .thuyhu-icon {
    filter: drop-shadow(0 0 18px rgba(250, 204, 21, 1)) brightness(1.28) !important;
}

/* Custom Sleek Dark Oriental Scrollbar - Triệt tiêu hoàn toàn thanh cuộn trắng thô mặc định */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(6, 9, 17, 0.7);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb {
    background: rgba(217, 119, 6, 0.35);
    border-radius: 9999px;
    border: 1px solid rgba(245, 158, 11, 0.15);
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.75);
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(217, 119, 6, 0.35) rgba(6, 9, 17, 0.7);
}

/* Ẩn hoàn toàn thanh cuộn cho các container dùng class .no-scrollbar */
.no-scrollbar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.no-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

body {
    background-color: #060911;
    color: #f8fafc;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Thẻ phong cách Đông Phương Cổ Phong */
.oriental-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(6, 9, 17, 0.98));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.oriental-card-gold {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(12, 19, 34, 0.98));
    border: 1.5px solid rgba(250, 204, 21, 0.45);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6), 0 0 14px rgba(234, 179, 8, 0.15);
}

/* Hiệu ứng trạng thái quân cờ trên sa bàn đấu trận */
.active-turn-unit {
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.95)) drop-shadow(0 0 20px rgba(245, 158, 11, 0.6));
    z-index: 50 !important;
}

.swap-selected-unit {
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.95));
    outline: 2px dashed #38bdf8;
    outline-offset: 2px;
}

.target-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    pointer-events: none;
    animation: spinReticle 3s linear infinite;
}

/* Chữ bay số sát thương (Floating Combat Text) */
.floating-combat-text {
    position: absolute;
    pointer-events: none;
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95), 0 0 10px rgba(0,0,0,0.85);
    white-space: nowrap;
    z-index: 95;
    animation: floatUpFade 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: 'Cinzel', serif;
}

/* Vệt chém VFX */
.slash-vfx {
    position: absolute;
    width: 90px;
    height: 90px;
    pointer-events: none;
    z-index: 89;
    animation: slashPop 0.45s ease-out forwards;
}

/* Cột sét giật sấm sét VFX */
.thunder-pillar-vfx {
    position: absolute;
    width: 80px;
    height: 240px;
    pointer-events: none;
    z-index: 92;
    animation: thunderStrike 0.65s ease-out forwards;
}

/* Banner Cut-in Tuyệt Kỹ Nộ */
.ult-cutin-banner {
    position: absolute;
    top: 15%;
    left: 50%;
    z-index: 98;
    pointer-events: none;
    animation: cutInSlide 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Vùng highlight ô di chuyển và mục tiêu đánh */
.move-highlight {
    animation: pulseMove 1.4s infinite;
    cursor: pointer;
}

.attack-highlight {
    animation: attackHighlightPulse 1.2s infinite;
    cursor: crosshair;
}

/* Rung màn hình khi trúng trảm nặng - Đã vô hiệu hóa để giữ màn hình cố định */
.shake-screen {
    animation: none !important;
    transform: none !important;
}

/* Nút Sa Bàn Lộ Trình Giang Hồ */
.wuxia-journey-node {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wuxia-journey-node:hover {
    transform: translateY(-4px) scale(1.05);
    z-index: 30;
}
.wuxia-journey-active {
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.7), 0 0 45px rgba(245, 158, 11, 0.4);
    animation: goldGlowPulse 2s infinite ease-in-out;
}

/* ============================================================================
 * HỆ THỐNG COMPONENT CHIẾN THUẬT SA BÀN (Wuxia Tactical Components)
 * ============================================================================ */

/* Khung ngắm di chuột thời gian thực (Tactical Reticle) */
.tactical-reticle-hover {
    pointer-events: none;
    animation: reticlePulse 1.6s ease-in-out infinite alternate;
}

@keyframes reticlePulse {
    0% {
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.4), inset 0 0 8px rgba(250, 204, 21, 0.2);
    }
    100% {
        box-shadow: 0 0 22px rgba(250, 204, 21, 0.8), inset 0 0 15px rgba(250, 204, 21, 0.35);
    }
}

/* Quân cờ Danh Tướng Tác Chiến (Tactical Hero Token) */
.tactical-hero-token {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
    will-change: transform;
}

.tactical-hero-token:hover {
    transform: translateY(-2px) scale(1.08);
    filter: drop-shadow(0 6px 12px rgba(234, 179, 8, 0.6));
    z-index: 40 !important;
}

/* Quân cờ Boss & Địch (Tactical Boss Token) */
.tactical-boss-token {
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.7));
}

.tactical-boss-token:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 0 18px rgba(244, 63, 94, 0.95));
    z-index: 40 !important;
}

/* Ô cờ sa bàn ghép đối tượng (Composite Cell) - Liền mạch, KHÔNG viền ô vuông */
.composite-cell {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.composite-cell:hover {
    z-index: 25;
}

/* Ấn triện cao độ & che chắn */
.tactical-seal-elevation {
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease;
}

.tactical-seal-cover {
    backdrop-filter: blur(4px);
    transition: transform 0.15s ease;
}

/* Icon Sơn Trại góc trái trang chủ — Bề thế, sang trọng */
#home-leader-icon {
    width: 56px !important;
    height: 56px !important;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.9));
}

@media (min-width: 640px) {
    #home-leader-icon {
        width: 68px !important;
        height: 68px !important;
    }
}

@media (min-width: 1024px) {
    #home-leader-icon {
        width: 76px !important;
        height: 76px !important;
    }
}

/* Layout ổn định cho nút Chiến Ải sảnh chính (Chống FOUC / giật layout khi F5) */
#home-ui-right {
    align-self: flex-end;
}

@media (max-width: 639px) {
    #home-ui-right {
        width: auto;
    }
}

/* Nút Chiến Ải sảnh chính — Hoàng Kim Thao Lược (Đầy đủ viền, nền & ánh hào quang) */
#btn-home-campaign-entry {
    padding: 5px 16px !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 35%, #fbbf24 65%, #d97706 100%) !important;
    border: 2px solid #fef08a !important;
    border-color: #fef08a !important;
    box-shadow: 0 0 28px rgba(251, 191, 36, 0.75), 0 4px 16px rgba(0, 0, 0, 0.5) !important;
    color: #1c1917 !important;
}

#btn-home-campaign-entry:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fef08a 100%) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.95), 0 6px 20px rgba(0, 0, 0, 0.6) !important;
}

#btn-home-campaign-entry img {
    width: 48px !important;
    height: 48px !important;
}

#btn-home-campaign-entry span {
    font-size: 22px !important;
    line-height: 1 !important;
    color: #1c1917 !important;
    text-shadow: 0 1px 1px rgba(254, 243, 199, 0.8) !important;
}

@media (min-width: 640px) {
    #btn-home-campaign-entry {
        padding: 6px 18px !important;
        gap: 10px !important;
    }
    #btn-home-campaign-entry img {
        width: 56px !important;
        height: 56px !important;
    }
    #btn-home-campaign-entry span {
        font-size: 27px !important;
    }
}

/* ============================================================================
 * Khung Viền Mỹ Thuật WebP Lương Sơn Bạc (UIFrames System)
 * ============================================================================ */
.ui-frame-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ui-frame-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: fill;
    z-index: 10;
    opacity: 0.2;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.ui-frame-container:hover .ui-frame-border,
.ui-frame-container.selected .ui-frame-border,
.ui-frame-container.active .ui-frame-border,
.selected .ui-frame-border,
.active .ui-frame-border {
    opacity: 1 !important;
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.85)) !important;
}

.ui-frame-content {
    position: relative;
    z-index: 1;
}

.ui-frame-selected {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    animation: framePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes framePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.75;
        transform: scale(1.02);
    }
}

