/* --- 1. FONTS & RESET --- */
@font-face { font-family: 'Haas-Bold'; src: url('font-bold.otf'); }
@font-face { font-family: 'Haas-Light'; src: url('font-light.otf'); }

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gbs-color: #ff3b30;
    --char-color: #d4d400;
    --item-color: #00a82d;
    --skill-color: #2b60de;
    --accent-color: var(--gbs-color); /* Default */
}

body {
    background-color: #000;
    background-image: url('how-to-play-bg.png');
    background-repeat: no-repeat;
    background-position: 20% calc(0% - 250px);
    background-size: 130% auto; 
    min-height: 100vh;
    font-family: 'Haas-Light', sans-serif;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.5;
    position: relative; 
}

/* --- BACKGROUND GLOW EFFECT --- */
body::before {
    content: '';
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 75% 50%, rgba(0, 200, 255, 0.1) 0%, transparent 60%);
    z-index: -1;
    animation: glowPulse 4s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes glowPulse {
    from { opacity: 0.4; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.1); }
}

/* --- 2. NAVIGATION --- */
.navbar {
    display: flex;
    align-items: center;
    padding: 40px 150px 20px 150px; 
    height: 120px;
    position: relative;
    z-index: 100;
}

.logo img { height: 75px; width: auto; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* The List Item is the ONLY thing that creates the underline now */
.nav-links li {
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    position: relative; 
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

/* The Link inside the List Item */
.nav-links li a, 
.nav-links li a:visited {
    color: inherit; /* Takes color from the LI */
    text-decoration: none;
    display: inline-block;
}

/* SLIDING UNDERLINE EFFECT (Only on LI to avoid doubling) */
.nav-links li::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f8ff5c;
    box-shadow: 0 0 10px #f8ff5c;
    transition: width 0.3s ease;
}

.nav-links li:hover::after {
    width: 100%;
}

.nav-links li:hover {
    color: #f8ff5c;
    text-shadow: 0 0 15px rgba(248, 255, 92, 0.8);
}

/* --- 3. HERO CONTENT --- */
.how-to-play-hero {
    padding-top: 15vh; 
    padding-left: 150px;
    padding-right: 150px;
    padding-bottom: 150px;
    display: flex;
    flex-direction: column;
}

.how-to-play-content {
    max-width: 2400px;
}

.page-title {
    font-family: 'Haas-Bold', sans-serif;
    font-size: clamp(60px, 10vw, 110px); 
    line-height: 0.9;
    letter-spacing: -4px;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.horizontal-line {
    width: 100%;
    max-width: 800px; 
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    margin-bottom: 60px;
}

/* --- 4. ACCORDION & CARD GALLERY --- */
.accordion {
    max-width: 2400px;
}

.accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    color: white;
    font-family: 'Haas-Bold', sans-serif;
    font-size: 22px;
    text-align: left;
    padding: 40px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.accordion-header:hover { color: rgba(255,255,255,0.7); }

.arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.accordion-item.active .arrow { transform: rotate(-135deg); }

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
    max-height: 3000px; 
    overflow: visible !important;
}

.inner-text {
    padding-bottom: 40px;
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.6);
}

/* --- TRUE CENTER BREAKOUT FIX --- */
.card-gallery-wrapper {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    padding: 100px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.card-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    justify-content: center;
    z-index: 10;
}

.card-btn {
    padding: 12px 28px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    font-family: 'Haas-Bold', sans-serif;
    color: white;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.3;
    background: rgba(255,255,255,0.05);
    text-transform: uppercase;
}

.card-btn:hover { opacity: 0.6; transform: translateY(-2px); }
.card-btn.active { opacity: 1; transform: translateY(-4px); border-color: rgba(255,255,255,0.4); }

.card-btn.gbs.active { background-color: var(--gbs-color); box-shadow: 0 10px 20px rgba(255,59,48,0.3); }
.card-btn.char.active { background-color: var(--char-color); box-shadow: 0 10px 20px rgba(212,212,0,0.3); }
.card-btn.item.active { background-color: var(--item-color); box-shadow: 0 10px 20px rgba(0,168,45,0.3); }
.card-btn.skill.active { background-color: var(--skill-color); box-shadow: 0 10px 20px rgba(43,96,222,0.3); }

.card-display-container {
    width: 90%;
    max-width: 700px; 
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 80px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 800px;
}

.card-view { 
    display: none; 
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.card-view.active { 
    display: flex; 
    animation: cardFadeIn 0.6s ease forwards;
}

/* --- ANNOTATION SYSTEM --- */
.annotated-card {
    position: relative;
    width: 320px;
    height: 460px;
    margin-bottom: 60px;
}

.annotated-card img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9);
}

.card-desc {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.annotation {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.annotation-line {
    position: absolute;
    height: 1.5px;
    background: var(--accent-color); 
    transform-origin: left center;
    box-shadow: 0 0 8px var(--accent-color);
}

.annotation-label {
    position: absolute;
    background: var(--accent-color);
    color: #000; 
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Haas-Bold', sans-serif;
    white-space: nowrap;
    top: -12px;
    left: 100%;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Set dynamic colors based on the active card type */
#gbs-display { --accent-color: var(--gbs-color); }
#char-display { --accent-color: var(--char-color); }
#item-display { --accent-color: var(--item-color); }
#skill-display { --accent-color: var(--skill-color); }

.annotation-label.right {
    left: auto;
    right: 100%;
    margin-right: 10px;
}

/* --- MODE TOGGLE BUTTONS --- */
.mode-nav {
    display: flex;
    gap: 20px;
    margin-bottom: 35px;
}

.mode-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 40px;
    border-radius: 50px;
    font-family: 'Haas-Bold', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: #f8ff5c;
    color: black;
    border-color: #f8ff5c;
    box-shadow: 0 0 20px rgba(248, 255, 92, 0.4);
}

/* --- CONTENT VISIBILITY --- */
.mode-content {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.mode-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- VIDEO STYLES --- */
.video-container {
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
    background: #000;
}

.video-container iframe {
    width: 100%;
    height: 100%;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .navbar, .how-to-play-hero { padding-left: 50px; padding-right: 50px; }
    .page-title { font-size: 80px; }
}

@media (max-width: 768px) {
    .navbar { padding: 20px; height: auto; flex-direction: column; gap: 20px; }
    .nav-links { position: static; transform: none; gap: 20px; }
    .how-to-play-hero { padding-top: 50px; padding-left: 20px; padding-right: 20px; }
    .page-title { font-size: 50px; }
    .card-display-container { padding: 40px 20px; }
}