/* ==========================================
   FERNANDES Fan Tribute - Founding Members Hall
   永遠の殿堂 - 創設メンバー専用スタイル
   ========================================== */

:root {
    --fm-color-gold: #d4af37;
    --fm-color-gold-light: #f0d77f;
    --fm-color-gold-dark: #b8960c;
    --fm-color-primary: #c41e3a;
    --fm-color-bg: #050508;
    --fm-color-bg-alt: #0a0a14;
    --fm-font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --fm-font-display: 'Oswald', sans-serif;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--fm-font-main);
    background: var(--fm-color-bg);
    color: #fff;
}

/* Stars Background */
.fm-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.fm-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: fm-twinkle 3s infinite ease-in-out;
}

@keyframes fm-twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

/* Gradient overlay */
.fm-gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at center top, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at center bottom, rgba(196, 30, 58, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Main Container */
.fm-container {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* Content Area */
.fm-content-area {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
    height: calc(100vh - 200px);
}

/* Grid mode needs scrollable content area */
.fm-content-area.grid-mode {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header */
.fm-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(180deg, var(--fm-color-bg) 0%, transparent 100%);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fm-logo {
    display: flex;
    flex-direction: column;
}

.fm-logo-text {
    font-family: var(--fm-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #fff;
}

.fm-logo-sub {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--fm-color-gold);
    text-transform: uppercase;
}

.fm-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.fm-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fm-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fm-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--fm-color-gold);
    color: var(--fm-color-gold);
}

.fm-home-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.fm-home-link:hover {
    color: var(--fm-color-gold);
}

/* Title Section */
.fm-title-section {
    padding-top: 80px;
    text-align: center;
    padding-bottom: 2rem;
}

.fm-title {
    font-family: var(--fm-font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: 8px;
    background: linear-gradient(135deg, var(--fm-color-gold-light) 0%, var(--fm-color-gold) 50%, var(--fm-color-gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.fm-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 4px;
}

.fm-counter {
    margin-top: 1rem;
    font-family: var(--fm-font-display);
}

.fm-counter-current {
    font-size: 2rem;
    color: var(--fm-color-gold);
}

.fm-counter-limit {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===================
   SCROLL MODE
   =================== */
.fm-scroll-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.fm-scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    padding-top: 50vh;
    padding-bottom: 50vh;
    animation: fm-credits-scroll linear infinite;
    animation-play-state: running;
}

.fm-scroll-container:hover .fm-scroll-content {
    animation-play-state: paused;
}

@keyframes fm-credits-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.fm-member-scroll {
    padding: 1rem 0;
}

.fm-member-number {
    font-family: var(--fm-font-display);
    font-size: 0.7rem;
    color: rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 0.25rem;
}

.fm-member-name {
    font-size: 1.3rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.fm-member-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    font-size: 0.6rem;
    letter-spacing: 1px;
    border-radius: 10px;
    text-transform: uppercase;
}

.fm-badge-founder {
    background: linear-gradient(135deg, var(--fm-color-gold), var(--fm-color-gold-dark));
    color: #000;
}

.fm-badge-early {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fm-badge-supporter {
    background: rgba(196, 30, 58, 0.3);
    color: #fff;
}

/* ===================
   GRID MODE
   =================== */
.fm-grid-container {
    padding: 0 2rem 2rem;
    padding-bottom: 100px;
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.fm-member-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.fm-member-card:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.fm-card-number {
    font-family: var(--fm-font-display);
    font-size: 0.65rem;
    color: var(--fm-color-gold);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.fm-card-name {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

/* ===================
   HIGHLIGHT (Your Entry)
   =================== */
.fm-member-highlight {
    position: relative;
    animation: fm-highlight-pulse 2s ease-in-out infinite;
}

.fm-member-highlight.fm-member-card {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--fm-color-gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.fm-member-highlight.fm-member-scroll {
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1) 20%, rgba(212, 175, 55, 0.1) 80%, transparent);
    padding: 1.5rem 2rem;
    border-radius: 8px;
}

.fm-member-highlight .fm-member-name,
.fm-member-highlight .fm-card-name {
    color: var(--fm-color-gold-light);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.fm-member-highlight .fm-member-number,
.fm-member-highlight .fm-card-number {
    color: var(--fm-color-gold);
}

.fm-member-highlight::before {
    content: 'YOU';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--fm-color-gold);
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 1px;
}

.fm-member-highlight.fm-member-scroll::before {
    top: 50%;
    right: 20%;
    transform: translateY(-50%);
}

@keyframes fm-highlight-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ===================
   CONSTELLATION MODE
   =================== */
.fm-constellation-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.fm-constellation-member {
    position: absolute;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fm-constellation-member:hover {
    transform: scale(1.1);
    z-index: 10;
}

.fm-constellation-dot {
    width: 8px;
    height: 8px;
    background: var(--fm-color-gold);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    box-shadow: 0 0 10px var(--fm-color-gold);
    animation: fm-pulse 2s ease-in-out infinite;
}

@keyframes fm-pulse {
    0%, 100% { box-shadow: 0 0 10px var(--fm-color-gold); }
    50% { box-shadow: 0 0 20px var(--fm-color-gold), 0 0 30px var(--fm-color-gold); }
}

.fm-constellation-name {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.fm-constellation-member:hover .fm-constellation-name {
    opacity: 1;
}

/* Footer gradient */
.fm-footer-gradient {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(0deg, var(--fm-color-bg) 0%, transparent 100%);
    pointer-events: none;
    z-index: 50;
}

/* Loading */
.fm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
}

.fm-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--fm-color-gold);
    border-radius: 50%;
    animation: fm-spin 1s linear infinite;
}

@keyframes fm-spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.fm-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.fm-empty-title {
    font-family: var(--fm-font-display);
    font-size: 1.5rem;
    color: var(--fm-color-gold);
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    html, body {
        overflow: visible;
        overflow-x: hidden;
    }

    .fm-container {
        height: auto;
        min-height: 100vh;
    }

    .fm-header {
        padding: 0.75rem 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
        align-items: center;
        background: var(--fm-color-bg);
    }

    .fm-logo-text {
        font-size: 1rem;
    }

    .fm-logo-sub {
        font-size: 0.55rem;
    }

    .fm-home-link {
        font-size: 0.7rem;
    }

    .fm-controls {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .fm-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
    }

    .fm-title-section {
        padding-top: 120px;
        padding-bottom: 1.5rem;
    }

    .fm-title {
        font-size: clamp(1.2rem, 6vw, 1.8rem);
        letter-spacing: 4px;
        margin-bottom: 0.3rem;
    }

    .fm-subtitle {
        font-size: 0.8rem;
        letter-spacing: 3px;
    }

    .fm-counter {
        margin-top: 0.75rem;
    }

    .fm-counter-current {
        font-size: 1.6rem;
    }

    .fm-counter-limit {
        font-size: 0.85rem;
    }

    .fm-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .fm-member-card {
        padding: 1rem;
    }

    .fm-member-name {
        font-size: 1rem;
    }

    .fm-content-area {
        height: auto;
        flex: 1;
        min-height: 0;
    }
}

/* Scrollbar styling */
.fm-content-area.grid-mode::-webkit-scrollbar {
    width: 6px;
}

.fm-content-area.grid-mode::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.fm-content-area.grid-mode::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.fm-content-area.grid-mode::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
