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

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #636363;
    background: #fff;
    line-height: 1.6;
    font-weight: 300;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

/* === Header / Banner === */
#header {
    background: linear-gradient(135deg, #a163a2 0%, #667eea 50%, #56ab6f 100%);
    padding: 4rem 2rem 3rem;
    text-align: center;
    color: #fff;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo-icon {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.logo-icon svg {
    width: 64px;
    height: 64px;
    animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.site-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.site-desc {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.8;
}

/* === Navigation === */
#nav {
    background: linear-gradient(135deg, #a163a2 0%, #667eea 50%, #56ab6f 100%);
    padding: 0 2rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

#nav ul {
    list-style: none;
    display: inline-flex;
    gap: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}

#nav ul li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s, color 0.2s;
}

#nav ul li:last-child a {
    border-right: none;
}

#nav ul li a:hover,
#nav ul li a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* === Main Section === */
#main-section {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.main-content {
    text-align: center;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 300;
    color: #636363;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, #efa8b0, #a89cc8, #8cc9f0);
}

.section-header p {
    color: #999;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* === Form === */
.input-group {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

#username-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 300;
    color: #636363;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#username-input:focus {
    border-color: #a89cc8;
    box-shadow: 0 0 0 3px rgba(168, 156, 200, 0.15);
}

#username-input::placeholder {
    color: rgba(99, 99, 99, 0.55);
}

/* Turnstile */
#turnstile-container {
    display: none;
    justify-content: center;
    margin: 1rem auto;
}

.submit-group {
    margin-top: 1.5rem;
}

/* === Buttons === */
.btn-primary {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: #4acfc9;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #3bbfb9;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.btn-outline {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: transparent;
    color: #636363;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
}

.btn-outline:hover {
    background: rgba(0,0,0,0.02);
    border-color: #bbb;
}

#download-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: #4acfc9;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#download-btn:hover {
    background: #3bbfb9;
    transform: translateY(-1px);
}

#download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === Action Buttons (footer of main section) === */
.action-buttons {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Results === */
#results {
    margin: 3rem auto 0;
    max-width: 920px;
    padding: 0 0 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 2.5rem 1rem 2rem;
    margin-bottom: 2.25rem;
    text-align: center;
}

.user-avatar-ring {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 18px 40px rgba(220, 39, 67, 0.14);
}

.user-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #fff;
}

.user-avatar-ring.placeholder {
    color: #8d97a8;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #bc1888);
}

.user-avatar-ring.placeholder span {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    font-size: 3rem;
    font-weight: 700;
}

.user-summary strong {
    display: block;
    font-size: 2.1rem;
    line-height: 1.1;
    font-weight: 300;
    letter-spacing: 0;
    color: #4f5665;
}

.story-count-line {
    margin-top: 0.6rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2f3441;
}

.story-last-line {
    margin-top: 0.35rem;
    font-size: 0.98rem;
    color: #8a93a3;
}

.media-grid-title {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.4rem;
}

.media-grid-title h3 {
    font-size: 2.65rem;
    font-weight: 300;
    line-height: 1.1;
    color: #5b6270;
}

.media-grid-title p {
    margin-top: 0.5rem;
    font-size: 0.98rem;
    color: #8a93a3;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
    justify-content: center;
    gap: 2rem 2.25rem;
}

.media-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #edf0f5;
    padding: 1.35rem 1.35rem 1.1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 18px 36px rgba(28, 37, 60, 0.08);
}

.media-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 156, 200, 0.35);
    box-shadow: 0 24px 48px rgba(28, 37, 60, 0.12);
}

.media-frame {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(248,249,252,0.96), rgba(238,241,247,0.96));
}

.media-card img,
.media-card video {
    width: 100%;
    max-width: 236px;
    max-height: 420px;
    margin: 0 auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    background: #0d0f14;
}

.media-meta {
    margin-top: 1rem;
}

.media-type-line {
    font-size: 0.92rem;
    font-weight: 700;
    color: #424a58;
}

.media-time-line {
    margin-top: 0.25rem;
    font-size: 0.92rem;
    color: #8a93a3;
}

.media-card .download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    padding: 0.95rem 1.25rem;
    background: linear-gradient(135deg, #4acfc9, #45a7f8);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.96rem;
    letter-spacing: 0;
    box-shadow: 0 14px 24px rgba(69, 167, 248, 0.18);
}

.media-card .download-link:hover {
    background: linear-gradient(135deg, #40c3bd, #3f9bf0);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.4rem 1.5rem;
    border: 1px dashed #d6dce6;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafbfd, #f3f6fb);
    color: #8892a3;
    font-weight: 600;
}

/* === How To Section === */
#howto {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid #eee;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.step-item {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.6;
}

.start-btn-wrap {
    margin-top: 2rem;
}

/* === FAQ Section === */
#faq {
    padding: 4rem 2rem;
    background: #f7f7f7;
    border-top: 1px solid #eee;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-title {
    text-align: center;
    font-size: 1rem;
    color: #999;
    margin-bottom: 2.5rem;
    letter-spacing: 1px;
}

.faq-item {
    margin-bottom: 2.5rem;
}

.faq-item h3 {
    font-size: 1.4rem;
    font-weight: 300;
    color: #636363;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    position: relative;
    text-align: center;
}

.faq-item h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, #efa8b0, #a89cc8, #8cc9f0);
}

.faq-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: justify;
}

/* === Footer === */
#footer {
    background: linear-gradient(135deg, #a163a2 0%, #667eea 50%, #56ab6f 100%);
    padding: 3rem 2rem;
    color: rgba(255,255,255,0.85);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-about h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.8;
    opacity: 0.85;
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* === Loading === */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #4acfc9;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* === Error / Info Messages === */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    font-weight: 600;
}

.info-message {
    text-align: center;
    padding: 2rem;
    color: #636363;
    font-weight: 400;
}

/* === Responsive === */
@media (max-width: 736px) {
    .site-title { font-size: 2.2rem; }
    #header { padding: 3rem 1.5rem 2rem; }
    
    #nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    #nav ul li a {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 0.6rem 1rem;
    }
    
    #main-section { padding: 2.5rem 1.5rem; }
    
    .section-header h2 { font-size: 1.4rem; }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .steps-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .faq-item h3 { font-size: 1.2rem; }
    .user-avatar-ring {
        width: 112px;
        height: 112px;
    }
    .user-summary strong {
        font-size: 1.7rem;
    }
    .story-count-line {
        font-size: 1.1rem;
    }
    .media-grid-title h3 {
        font-size: 2rem;
    }
    .media-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .media-frame {
        min-height: 0;
    }
    .media-card img,
    .media-card video {
        max-width: 100%;
        max-height: none;
    }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.8rem; }
    #main-section { padding: 2rem 1rem; }
    #download-btn { padding: 0.85rem 2rem; font-size: 1rem; }
}
