/* === BASE RESET & BODY === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: linear-gradient(160deg, #4a0000 0%, #2d0000 50%, #1a0000 100%);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    color: #fef2f2;
    position: relative;
}

/* === CHINESE LATTICE BACKGROUND === */
/* Two overlapping repeating-linear-gradient grids create the lattice pattern */
.lattice-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 38px,
            rgba(155, 28, 28, 0.18) 38px,
            rgba(155, 28, 28, 0.18) 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 38px,
            rgba(155, 28, 28, 0.18) 38px,
            rgba(155, 28, 28, 0.18) 40px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 18px,
            rgba(251, 191, 36, 0.04) 18px,
            rgba(251, 191, 36, 0.04) 19px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 18px,
            rgba(251, 191, 36, 0.04) 18px,
            rgba(251, 191, 36, 0.04) 19px
        );
    pointer-events: none;
}

/* === DRAGON WATERMARK (opacity: 0.05) === */
/* CSS-only dragon silhouette via radial gradients centered on page */
.dragon-watermark {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    z-index: 0;
    opacity: 0.05;
    background: radial-gradient(ellipse 60% 30% at 50% 40%, #fbbf24 0%, transparent 70%),
                radial-gradient(ellipse 30% 60% at 30% 60%, #fbbf24 0%, transparent 70%),
                radial-gradient(ellipse 30% 60% at 70% 60%, #fbbf24 0%, transparent 70%),
                radial-gradient(circle 80px at 50% 15%, #dc2626 0%, transparent 100%);
    pointer-events: none;
}

/* === LANTERN DECORATIONS (CSS-only) === */
/* Lantern shape: tall oval body (border-radius: 50% 50% 45% 45%) with gradient */
.lantern {
    position: fixed;
    top: 60px;
    width: 55px;
    height: 80px;
    border-radius: 50% 50% 45% 45%;
    background: radial-gradient(ellipse at 35% 35%, #ff6b6b, #cc0000 60%, #7a0000);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.7), 0 0 50px rgba(220, 38, 38, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* Lantern tassel via ::after pseudo-element */
.lantern::before {
    content: '';
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 14px;
    background: #fbbf24;
    border-radius: 2px;
}

.lantern::after {
    content: '';
    position: absolute;
    bottom: -18px; left: 50%;
    transform: translateX(-50%);
    width: 2px; height: 20px;
    background: linear-gradient(to bottom, #fbbf24, transparent);
    border-radius: 1px;
}

/* Horizontal gold band across lantern middle */
.lantern-left::before,
.lantern-right::before {
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.8);
}

.lantern-left  { left: 20px; animation: lanternSway 4s ease-in-out infinite; }
.lantern-right { right: 20px; animation: lanternSway 4s ease-in-out infinite reverse; }

@keyframes lanternSway {
    0%, 100% { transform: rotate(-6deg); }
    50%       { transform: rotate(6deg); }
}

/* === MAIN CONTENT WRAPPER === */
.content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px 0;
}

/* === LOGO === */
.logo-container {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

.logo {
    width: 450px;
    max-width: 95%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 22px rgba(251, 191, 36, 0.6));
}

/* === MARQUEE TEXT === */
.marquee-text {
    width: 100%;
    background: rgba(80, 10, 10, 0.9);
    padding: 14px 0;
    border-top: 2px solid #fbbf24;
    border-bottom: 2px solid #fbbf24;
    margin-bottom: 30px;
    overflow: hidden;
    white-space: nowrap;
    color: #fbbf24;
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(14px, 4vw, 20px);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.marquee-inner {
    display: inline-block;
    animation: scrollText 22s linear infinite;
    padding-left: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .marquee-inner { animation: none; padding-left: 20px; white-space: normal; }
}

@keyframes scrollText {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* === CTA BUTTON === */
.btn-wrapper {
    margin-bottom: 50px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Red-gold gradient CTA with Chinese lattice border-image effect */
.ref-btn {
    display: inline-block;
    background: linear-gradient(145deg, #dc2626, #9b1c1c 40%, #7f1d1d 70%, #fbbf24 100%);
    color: #fef2f2;
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: clamp(20px, 6vw, 30px);
    padding: clamp(14px, 3vw, 20px) clamp(30px, 8vw, 60px);
    border-radius: 80px;
    text-decoration: none;
    border: 4px solid #fbbf24;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.6), 0 0 60px rgba(251, 191, 36, 0.2), inset 0 2px 5px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
}

.ref-btn:hover {
    background: linear-gradient(145deg, #fbbf24, #f59e0b 40%, #dc2626 100%);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(220, 38, 38, 0.8), 0 0 80px rgba(251, 191, 36, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    color: #1a0000;
    text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
    .ref-btn:hover { transform: none; }
}

/* === FLAG SECTION === */
.flag-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.flag-row {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.flag-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
    margin-bottom: 15px;
    cursor: pointer;
}

.flag {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fbbf24;
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.5), 0 0 10px rgba(251, 191, 36, 0.4);
    animation: spinLeft 10s linear infinite;
    pointer-events: none;
}

.flag-item:active { opacity: 0.8; }

@keyframes spinLeft {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .flag { animation: none; }
}

.country-name {
    margin-top: 10px;
    font-size: clamp(16px, 5vw, 22px);
    font-weight: 700;
    color: #fef2f2;
    font-family: 'Noto Serif SC', serif;
    text-shadow: 2px 2px 4px #000;
    text-align: center;
    pointer-events: none;
}

.greeting {
    font-size: clamp(14px, 4.5vw, 18px);
    font-weight: 600;
    color: #fbbf24;
    text-shadow: 1px 1px 2px #000;
    margin-bottom: 2px;
    pointer-events: none;
}

/* === SEO CONTENT === */
.seo-content {
    width: 100%;
    max-width: 1200px;
    background: rgba(80, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    /* Chinese lattice border via border-image repeating gradient */
    border: 3px solid transparent;
    border-image:
        repeating-linear-gradient(
            90deg,
            #fbbf24 0px, #fbbf24 8px,
            #9b1c1c 8px, #9b1c1c 16px
        ) 3;
    padding: 40px 30px;
    border-radius: 0;
    text-align: left;
    margin-top: 50px;
    color: #fef2f2;
    box-shadow: 0 0 40px rgba(155, 28, 28, 0.4), inset 0 0 30px rgba(0, 0, 0, 0.3);
    /* Fallback rounded corners for browsers that don't support border-image + border-radius */
    outline: 2px solid rgba(251, 191, 36, 0.3);
    outline-offset: 6px;
}

.seo-content h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    color: #fbbf24;
    margin-bottom: 20px;
    border-left: 6px solid #dc2626;
    padding-left: 18px;
}

.seo-content p {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 18px;
    color: #fde8e8;
}

.seo-content b {
    color: #fbbf24;
    font-weight: 700;
}

.security-badge {
    background: rgba(155, 28, 28, 0.5);
    border: 1px solid #fbbf24;
    padding: 15px;
    font-size: 14px;
    color: #fef2f2;
    font-weight: 600;
    text-align: center;
    margin-top: 20px;
    backdrop-filter: blur(5px);
    letter-spacing: 1px;
}

/* === JACKPOT TICKER === */
.jackpot-section {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px 20px;
    background: rgba(80, 10, 10, 0.9);
    border: 1px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.1), inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.jackpot-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ticker-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(251, 191, 36, 0.25);
    font-size: 14px;
    color: #fde8e8;
}

.ticker-item:last-child { border-bottom: none; }
.ticker-time   { color: #f9a8a8; min-width: 45px; font-size: 13px; }
.ticker-game   { color: #fef2f2; min-width: 100px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; }
.ticker-user   { color: #fca5a5; flex: 1; font-family: monospace; font-size: 13px; }
.ticker-amount { color: #fbbf24; font-weight: 700; font-size: 14px; }

/* === REVIEW SECTION === */
.review-section {
    width: 100%;
    max-width: 1200px;
    margin: 60px auto 40px;
    padding: 40px 30px;
    background: rgba(80, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 30px rgba(155, 28, 28, 0.4);
}

.review-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 28px;
    font-weight: 700;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.review-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}

.rating-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stars {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
}

.stars input { display: none; }

.stars label {
    font-size: 35px;
    color: #444;
    cursor: pointer;
    transition: color 0.1s;
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
    color: #fbbf24;
    text-shadow: 0 0 20px #fbbf24;
}

.review-input {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.review-input textarea {
    flex: 1;
    min-width: 250px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(251, 191, 36, 0.5);
    color: #fef2f2;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    resize: none;
    height: 60px;
    transition: border-color 0.3s, background 0.3s;
}

.review-input textarea:focus {
    outline: none;
    border-color: #fbbf24;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.review-input textarea::placeholder {
    color: rgba(254, 242, 242, 0.5);
}

.submit-btn {
    padding: 0 30px;
    background: linear-gradient(145deg, #dc2626, #9b1c1c);
    border: 2px solid #fbbf24;
    color: #fbbf24;
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 60px;
    min-width: 120px;
    letter-spacing: 1px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.5);
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #1a0000;
}

@media (prefers-reduced-motion: reduce) {
    .submit-btn:hover { transform: none; }
}

.reviews-header {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 20px;
    text-align: center;
    font-family: 'Noto Serif SC', serif;
}

.reviews-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 280px;
}

.review-card {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    background: rgba(60, 5, 5, 0.7);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 25px 20px;
    backdrop-filter: blur(5px);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .review-card { animation: none; }
}

.review-card:hover {
    background: rgba(100, 10, 10, 0.85);
    border-color: #fbbf24;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.15);
}

.reviewer {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fbbf24, #dc2626);
    border: 2px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fef2f2;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
}

.reviewer-name {
    font-weight: 700;
    color: #fbbf24;
    font-size: 16px;
}

.review-date {
    font-size: 12px;
    color: rgba(254, 242, 242, 0.55);
    font-family: monospace;
}

.review-stars {
    color: #fbbf24;
    margin-bottom: 15px;
    font-size: 16px;
}

.review-stars i { margin-right: 3px; }

.review-text {
    color: #fde8e8;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

/* === MODAL STYLES === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(160deg, #3b0000, #1a0000 60%, #2d0000);
    border: 3px solid #fbbf24;
    padding: 40px 35px;
    width: 92%;
    max-width: 520px;
    text-align: center;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.4), 0 0 30px rgba(251, 191, 36, 0.2);
    animation: modalPop 0.3s ease-out;
    position: relative;
}

/* Decorative lattice corners on modal */
.modal-content::before,
.modal-content::after {
    content: '';
    position: absolute;
    width: 30px; height: 30px;
    border-color: #fbbf24;
    border-style: solid;
}

.modal-content::before {
    top: 8px; left: 8px;
    border-width: 3px 0 0 3px;
}

.modal-content::after {
    bottom: 8px; right: 8px;
    border-width: 0 3px 3px 0;
}

@keyframes modalPop {
    0%   { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .modal-content { animation: none; }
}

.modal-title {
    font-family: 'Noto Serif SC', serif;
    color: #fbbf24;
    font-size: 28px;
    margin-bottom: 24px;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
    letter-spacing: 2px;
}

/* === BẦU CUA PICKER GRID (3×2) === */
.baucua-picker {
    margin-bottom: 20px;
}

.picker-label {
    color: #fde8e8;
    font-size: 15px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
}

.baucua-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.baucua-symbol {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(80, 10, 10, 0.9);
    border: 2px solid rgba(251, 191, 36, 0.5);
    color: #fef2f2;
    font-size: 38px;
    padding: 14px 8px 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.baucua-symbol span {
    font-size: 13px;
    font-family: 'Noto Serif SC', serif;
    color: #fbbf24;
    font-weight: 700;
    letter-spacing: 1px;
}

.baucua-symbol:hover {
    background: rgba(155, 28, 28, 0.9);
    border-color: #fbbf24;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
}

.baucua-symbol:active {
    transform: scale(0.95);
}

.baucua-symbol.selected {
    background: linear-gradient(145deg, #9b1c1c, #dc2626);
    border-color: #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .baucua-symbol:hover  { transform: none; }
    .baucua-symbol:active { transform: none; }
}

/* === DICE TRAY === */
.minigame-container {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(251, 191, 36, 0.4);
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.dice-tray {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.dice-face {
    width: 75px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(145deg, #fde8e8, #fff);
    border: 2px solid #fbbf24;
    font-size: 42px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

/* Dice shake animation triggered via JS class */
.dice-face.shaking {
    animation: diceShake 0.12s ease-in-out infinite;
}

@keyframes diceShake {
    0%   { transform: rotate(-10deg) scale(1.05); }
    25%  { transform: rotate(10deg)  scale(0.95); }
    50%  { transform: rotate(-8deg)  scale(1.05); }
    75%  { transform: rotate(8deg)   scale(0.95); }
    100% { transform: rotate(0deg)   scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .dice-face.shaking { animation: none; }
}

.modal-message {
    font-size: 18px;
    color: #fde8e8;
    margin-bottom: 22px;
    min-height: 24px;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

.success-text {
    color: #fbbf24;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.hidden {
    display: none !important;
}

.modal-cta-btn {
    background: linear-gradient(145deg, #dc2626, #9b1c1c 50%, #fbbf24);
    color: #fef2f2;
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 700;
    padding: 15px 30px;
    border: 3px solid #fbbf24;
    cursor: pointer;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.5), inset 0 0 10px rgba(251, 191, 36, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.modal-cta-btn:hover {
    transform: scale(1.04);
    background: linear-gradient(145deg, #fbbf24, #f59e0b 50%, #dc2626);
    color: #1a0000;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.6);
}

@media (prefers-reduced-motion: reduce) {
    .modal-cta-btn:hover { transform: none; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .logo { width: 350px; }
    .flag { width: 85px; height: 85px; }
    .flag-item { min-width: 110px; }
    .lantern { display: none; }
    .baucua-grid { gap: 8px; }
    .baucua-symbol { font-size: 32px; padding: 12px 6px 8px; }
    .modal-content { padding: 30px 20px; }
    .modal-title { font-size: 22px; }
}

@media (max-width: 480px) {
    .logo { width: 280px; }
    .flag { width: 75px; height: 75px; }
    .flag-item { min-width: 100px; }
    .marquee-text { font-size: 13px; padding: 10px 0; }
    .ref-btn { white-space: normal; font-size: 22px; padding: 16px 30px; line-height: 1.3; word-break: keep-all; }
    .ticker-item { font-size: 12px; gap: 6px; }
    .ticker-time { min-width: 35px; }
    .ticker-game { min-width: 80px; }
    .baucua-symbol { font-size: 28px; }
    .dice-face { width: 60px; height: 60px; font-size: 34px; }
}
