/* ====================================
   紅龍撲克共用樣式表
   用於所有頁面的共用 CSS
   ==================================== */

html {
    overflow-y: scroll;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #0f0f0f;
    color: #F5F5F5;
    scroll-behavior: smooth;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============ 防止語言切換閃爍 ============ */
[data-i18n]:not(.i18n-ready),
[data-i18n-btn]:not(.i18n-ready) {
    opacity: 0;
}

[data-i18n].i18n-ready,
[data-i18n-btn].i18n-ready {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

/* ============ 導航列 ============ */
#header-placeholder {
    height: 104px;
    /* 64px nav + 40px ticker (approximate) */
    width: 100%;
}

nav.nav-sticky,
.nav-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999 !important;
    background-color: rgba(15, 15, 15, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    transition: box-shadow 0.3s ease;
}

/* Add shadow when scrolled */
nav.nav-sticky.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ============ Announcement Ticker ============ */
#announcement-ticker {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100%;
    z-index: 9998 !important;
    background-color: rgba(15, 15, 15, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============ 龍鱗特效按鈕 ============ */
.btn-dragon {
    background: linear-gradient(135deg, #D90429 0%, #8D021F 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(217, 4, 41, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-dragon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-dragon:hover::after {
    left: 100%;
}

.btn-dragon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 4, 41, 0.5);
}

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

/* ============ 卡片懸浮效果 ============ */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(217, 4, 41, 0.2);
    border-color: #D90429;
}

/* ============ 模態框 ============ */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #333;
    box-shadow: 0 10px 60px rgba(217, 4, 41, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #D90429;
}

.modal-content p {
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 16px;
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
    margin: 16px 0;
}

.modal-content ul li {
    color: #ccc;
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.modal-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #D90429;
    font-weight: bold;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #999;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #D90429;
}

/* ============ 語言選擇器 ============ */
.lang-selector,
.language-selector {
    position: relative;
}

/* ============ 導航鏈接樣式 ============ */
.nav-link {
    position: relative;
    color: white;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #FFD700;
}

.nav-link.active {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

mask-composite: exclude;
opacity: 0.6;
animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* ============ 語言選擇器 ============ */

.lang-current {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
    min-width: 120px;
}

.lang-current:hover {
    background: #2a2a2a;
    border-color: #D90429;
}

.lang-current .flag {
    font-size: 20px;
}

.lang-current .arrow {
    margin-left: auto;
    transition: transform 0.3s;
    color: #999;
}

.lang-current.active .arrow {
    transform: rotate(180deg);
}

.lang-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lang-toggle:hover {
    border-color: #D90429;
    transform: scale(1.1);
}

.lang-toggle i {
    font-size: 20px;
    color: #fff;
}

.lang-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    z-index: 1000;
}

.lang-options.show {
    display: flex;
}

.lang-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    white-space: nowrap;
    width: 100%;
    text-align: left;
}

.lang-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

.lang-btn.active {
    background: linear-gradient(135deg, #D90429 0%, #8D021F 100%);
    color: #fff;
    font-weight: bold;
}

.lang-btn .flag {
    font-size: 20px;
}

/* ============ LINE 圖標按鈕 ============ */
.line-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.line-icon-btn:hover {
    transform: scale(1.1);
    border-color: #D90429;
}

.line-icon-btn i {
    font-size: 20px;
    color: #fff;
}

/* ============ 漢堡菜單按鈕 ============ */
.hamburger-menu {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #333;
    /* display: flex; 移除此行，讓 Tailwind 的 lg:hidden 能正常工作 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.hamburger-menu:hover {
    border-color: #D90429;
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
}

.hamburger-menu.active {
    border-color: #D90429;
    background: linear-gradient(135deg, #D90429 0%, #8D021F 100%);
}

.hamburger-menu i {
    font-size: 18px;
    color: #fff;
    transition: transform 0.3s;
}

.hamburger-menu.active i {
    transform: rotate(90deg);
}

/* ============ 移動版菜單 ============ */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
    display: none;
    flex-direction: column;
    padding: 16px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 40;
}

.mobile-menu.show {
    display: flex;
}

.mobile-menu-item {
    color: #fff;
    text-decoration: none;
    padding: 16px 24px;
    transition: all 0.3s;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background: rgba(217, 4, 41, 0.1);
    border-left-color: #D90429;
    color: #FFD700;
}

/* ============ 背景圖片輪播（Hero） ============ */
.hero-bg-slider {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: heroSlide 15s infinite;
}

.hero-bg-slide:nth-child(1) {
    animation-delay: 0s;
}

.hero-bg-slide:nth-child(2) {
    animation-delay: 5s;
}

.hero-bg-slide:nth-child(3) {
    animation-delay: 10s;
}

@keyframes heroSlide {
    0% {
        opacity: 0;
    }

    6.67% {
        opacity: 0.3;
    }

    33.33% {
        opacity: 0.3;
    }

    40% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* ============ 響應式設計 ============ */
@media (max-width: 640px) {
    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .lang-current {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ============ 滾動條樣式 ============ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D90429;
}

/* ============ 金色邊框按鈕 ============ */
.btn-gold-outline {
    border: 2px solid #FFD700;
    color: #FFD700;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-gold-outline:hover {
    background: #FFD700;
    color: #0f0f0f;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* ============ 卡片懸浮特效 ============ */
.feature-card {
    background-color: #1a1a1a;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: #D90429;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(217, 4, 41, 0.15);
}

/* ============ 邀請碼區塊 ============ */
.invite-box {
    background: rgba(255, 215, 0, 0.05);
    border: 1px dashed #FFD700;
    color: #FFD700;
    cursor: pointer;
    transition: all 0.2s;
}

.invite-box:hover {
    background: rgba(255, 215, 0, 0.15);
}

/* ============ QR Code 掃描框動畫 ============ */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #D90429;
    box-shadow: 0 0 4px #D90429;
    top: 0;
    left: 0;
    animation: scan 2.5s infinite linear;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ============ 回到頂部按鈕 ============ */
.back-to-top-btn {
    position: fixed;
    right: 20px;
    bottom: 270px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 998;
}

.back-to-top-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #5a5a5a 0%, #3a3a3a 100%);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

.back-to-top-btn:active {
    transform: translateY(-3px) scale(1.05);
}

/* ============ 浮動按鈕菜單 ============ */
.floating-menu {
    position: fixed;
    right: 20px;
    bottom: 30px;
    z-index: 999;
}

.floating-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E90FF 0%, #1565C0 100%);
    box-shadow: 0 4px 20px rgba(30, 144, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: floatingPulseBlue 2s infinite;
}

@keyframes floatingPulseBlue {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(30, 144, 255, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(30, 144, 255, 0.8), 0 0 0 10px rgba(30, 144, 255, 0.1);
    }
}

.floating-btn:hover {
    transform: scale(1.1);
}

.floating-btn.active {
    transform: rotate(45deg);
    animation: none;
}

.floating-options {
    position: absolute;
    bottom: 75px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.floating-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-option {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px solid #1E90FF;
    padding: 14px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    min-width: 160px;
}

.floating-option:hover {
    background: linear-gradient(135deg, #1E90FF 0%, #1565C0 100%);
    border-color: #FFD700;
    transform: translateX(-8px) scale(1.05);
    box-shadow: 0 6px 25px rgba(30, 144, 255, 0.6);
}

.floating-option i {
    font-size: 24px;
}

/* ====================================
   獨立禮物浮動按鈕
   ==================================== */
.floating-download-btn {
    position: fixed;
    right: 20px;
    bottom: 190px;
    z-index: 999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8C00 0%, #FF6B00 100%);
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: floatingPulseOrange 2s infinite;
}

@keyframes floatingPulseOrange {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 140, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 140, 0, 0.8), 0 0 0 10px rgba(255, 140, 0, 0.1);
    }
}

.floating-download-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #E67E00 0%, #E65C00 100%);
}

.floating-gift-btn {
    position: fixed;
    right: 20px;
    bottom: 110px;
    z-index: 999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D90429 0%, #8D021F 100%);
    box-shadow: 0 4px 20px rgba(217, 4, 41, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: floatingPulseRed 2s infinite;
}

@keyframes floatingPulseRed {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(217, 4, 41, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(217, 4, 41, 0.8), 0 0 0 10px rgba(217, 4, 41, 0.1);
    }
}

.floating-gift-btn:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #C00327 0%, #7D011A 100%);
}

/* ====================================
   撲克牌飄落動畫
   ==================================== */

/* Poker card falling animation */
@keyframes float-down {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ============ Ticker 跑馬燈動畫 ============ */
@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-content {
    animation: ticker-scroll 30s linear infinite;
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    margin-right: 2rem;
}

.poker-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.poker-card {
    position: absolute;
    width: 50px;
    height: 70px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 4px;
    opacity: 0;
    animation: float-down linear infinite;
}

.card-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.card-rank {
    font-size: 0.75rem;
    font-weight: bold;
}

.card-suit {
    font-size: 0.65rem;
    margin-top: -2px;
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
}

.poker-card.red {
    color: #dc2626;
}

.poker-card.black {
    color: #1f2937;
}

/* Responsive sizing for poker cards */
@media (min-width: 640px) {
    .poker-card {
        width: 60px;
        height: 84px;
        padding: 5px;
    }

    .card-rank {
        font-size: 0.9rem;
    }

    .card-suit {
        font-size: 0.8rem;
    }

    .card-center {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .poker-card {
        width: 70px;
        height: 98px;
        padding: 6px;
    }

    .card-rank {
        font-size: 1.1rem;
    }

    .card-suit {
        font-size: 0.95rem;
    }

    .card-center {
        font-size: 1.8rem;
    }
}