/* ==========================================================================
   CARDMASTER ARENA — CINEMATIC GAME HOMEPAGE
   ========================================================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #d4a853;
    --gold-light: #f0d78c;
    --dark: #0a0a0f;
    --dark-card: #111118;
    --dark-surface: #16161f;
    --text: #e8e6e3;
    --text-muted: #8a8a99;
    --accent: #38bdf8;
    --red: #ef4444;
    --green: #10b981;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
.title-gold {
    color: var(--gold);
    text-shadow: 0 0 40px rgba(212,168,83,0.3);
}

.section-label {
    font-size: 0.75rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.section-heading {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 3.5rem;
    line-height: 1.2;
}

/* ================================================================
   HERO — FULL VIEWPORT CINEMATIC
   ================================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.35) saturate(0.8);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10,10,15,0.4) 0%,
        rgba(10,10,15,0.1) 40%,
        rgba(10,10,15,0.7) 80%,
        rgba(10,10,15,1) 100%
    );
}

/* Floating suit particles */
.particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.06;
    color: var(--gold);
    animation: particleFloat 25s infinite linear;
}
.p1 { left: 10%; animation-delay: 0s; font-size: 2rem; }
.p2 { left: 25%; animation-delay: -4s; font-size: 1.2rem; color: var(--red); }
.p3 { left: 45%; animation-delay: -8s; font-size: 1.8rem; }
.p4 { left: 65%; animation-delay: -12s; font-size: 1rem; }
.p5 { left: 80%; animation-delay: -16s; font-size: 2.5rem; }
.p6 { left: 92%; animation-delay: -20s; font-size: 1.4rem; color: var(--red); }

@keyframes particleFloat {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.06; }
    90%  { opacity: 0.06; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ---- Navbar ---- */
.navbar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.nav-card-icon {
    width: 32px;
    filter: drop-shadow(0 0 6px rgba(212,168,83,0.5));
}
.brand-text {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}
.brand-accent {
    color: var(--gold);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.5px;
}
.nav-link:hover { color: var(--gold); }

.nav-cta {
    background: transparent;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 0.55rem 1.3rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-cta:hover {
    background: var(--gold);
    color: var(--dark);
    box-shadow: 0 0 25px rgba(212,168,83,0.4);
}

/* ---- Hero Center Content ---- */
.hero-center {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 5%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--green);
    margin-bottom: 2rem;
    text-transform: uppercase;
}
.badge-dot {
    width: 8px; height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: dotPulse 2s infinite;
    display: inline-block;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 550px;
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ---- Primary CTA Button ---- */
.btn-play {
    position: relative;
    background: linear-gradient(135deg, var(--gold), #b8860b);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 25px rgba(212,168,83,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-play:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 40px rgba(212,168,83,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-play:active { transform: scale(0.98); }

.btn-play-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--dark);
    text-transform: uppercase;
}

.btn-play::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: sweepShine 4s infinite;
}
@keyframes sweepShine {
    0%   { left: -100%; }
    25%  { left: 150%; }
    100% { left: 150%; }
}

.btn-play-lg .btn-play-inner {
    padding: 1.2rem 3.5rem;
    font-size: 1.1rem;
}
.btn-full { width: 100%; }
.btn-full .btn-play-inner { width: 100%; }

.btn-explore {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}
.btn-explore:hover { color: var(--gold); }
.btn-explore i { animation: bounceDown 2s infinite; }
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ---- Hero Fanned Cards ---- */
.hero-cards {
    position: relative;
    width: 350px;
    height: 160px;
    margin-top: 3rem;
}
.hc {
    position: absolute;
    width: 100px;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    left: 50%;
    bottom: 0;
    transform-origin: bottom center;
}
.hc1 { transform: translateX(-50%) rotate(-24deg) translateY(-5px); z-index: 1; }
.hc2 { transform: translateX(-50%) rotate(-12deg) translateY(-3px); z-index: 2; }
.hc3 { transform: translateX(-50%) rotate(0deg); z-index: 3; }
.hc4 { transform: translateX(-50%) rotate(12deg) translateY(-3px); z-index: 4; }
.hc5 { transform: translateX(-50%) rotate(24deg) translateY(-5px); z-index: 5; }

.hc:hover {
    transform: translateX(-50%) rotate(0deg) translateY(-35px) scale(1.15);
    z-index: 10;
    box-shadow: 0 20px 50px rgba(212,168,83,0.4);
}

/* ---- Scroll Hint ---- */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.scroll-hint span {
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    opacity: 0.5;
}
.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--gold), transparent);
    animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 40px; }
    50% { opacity: 1; height: 55px; }
}

/* ================================================================
   GAME MODES SECTION
   ================================================================ */
.modes {
    background: var(--dark);
    padding: 7rem 0;
    position: relative;
}
.modes::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.2;
}

.modes-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
    text-align: center;
}

.modes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.mode-item {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
    text-align: left;
}
.mode-item:hover {
    transform: translateY(-8px);
    border-color: rgba(212,168,83,0.3);
}

.mode-visual {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, rgba(212,168,83,0.03), rgba(10,10,15,0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mode-card-stack {
    position: relative;
    width: 180px;
    height: 160px;
}
.mc {
    position: absolute;
    width: 100px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}
.mc1 { top: 0; left: 10px; transform: rotate(-8deg); z-index: 3; }
.mc2 { top: 5px; left: 40px; transform: rotate(0deg); z-index: 2; }
.mc3 { top: 10px; left: 70px; transform: rotate(8deg); z-index: 1; }

.mode-item:hover .mc1 { transform: rotate(-15deg) translateX(-10px); }
.mode-item:hover .mc2 { transform: rotate(0deg) translateY(-8px) scale(1.05); }
.mode-item:hover .mc3 { transform: rotate(15deg) translateX(10px); }

.mode-hot {
    position: absolute;
    top: 15px; right: 15px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 2px;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(239,68,68,0.4);
}

.mode-info {
    padding: 1.8rem;
}
.mode-tag {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.tag-fire { color: #f97316; }

.mode-name {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    text-align: left;
}
.mode-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}
.mode-stats {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.mode-stats li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.mode-stats i { color: var(--gold); font-size: 0.75rem; }

.mode-italic {
    border-color: rgba(239,68,68,0.15);
}
.mode-italic .mode-visual {
    background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(10,10,15,0.5));
}

/* ================================================================
   FEATURES SECTION
   ================================================================ */
.features {
    background: var(--dark-surface);
    padding: 7rem 0;
}

.features-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.feat-card {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: 0.3s;
}
.feat-card:hover {
    border-color: rgba(212,168,83,0.2);
    transform: translateY(-5px);
}

.feat-icon {
    width: 55px; height: 55px;
    margin: 0 auto 1.2rem;
    border-radius: 12px;
    background: rgba(212,168,83,0.08);
    border: 1px solid rgba(212,168,83,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--gold);
}

.feat-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}
.feat-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ================================================================
   FINAL CTA SECTION
   ================================================================ */
.cta-section {
    padding: 7rem 5%;
    text-align: center;
    position: relative;
    background: var(--dark);
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(212,168,83,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cta-inner {
    position: relative;
    z-index: 1;
}
.cta-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--gold);
}
.cta-text {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 2rem 5%;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-brand {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}
.footer-inner p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================================================
   LOGIN MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.modal-top {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-card-deco {
    position: relative;
    height: 60px;
    margin-bottom: 1.2rem;
}
.deco-card {
    width: 45px;
    position: absolute;
    top: 0;
    left: 50%;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
.dc1 { transform: translateX(-70%) rotate(-10deg); }
.dc2 { transform: translateX(-30%) rotate(10deg); }

.modal-heading {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.modal-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modal-form .field {
    margin-bottom: 1.5rem;
    text-align: left;
}
.modal-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
}
.modal-form input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: 0.2s;
}
.modal-form input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
}
.modal-form input::placeholder { color: #555; }

/* ================================================================
   ALERTS (reuse existing logic)
   ================================================================ */
.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-size: 0.85rem;
    text-align: center;
}
.alert.error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    display: block;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .nav-links .nav-link { display: none; }
    .modes-row { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr; }
    .hero-cards { width: 280px; }
    .hc { width: 80px; }
    .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 500px) {
    .features-grid { grid-template-columns: 1fr; }
    .hero-cards { width: 240px; }
    .hc { width: 65px; }
    .btn-play-inner { padding: 0.9rem 1.8rem; font-size: 0.9rem; }
    .mode-visual { height: 180px; }
    .modal-box { padding: 1.8rem; }
}

/* Login overlay compat — main.js expects these classes */
.login-overlay { 
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.login-overlay.active { display: flex; }

.login-modal {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

.close-modal {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-modal:hover { color: var(--text); background: rgba(255,255,255,0.05); }
