/* Anime Wordle - Profile page styles
 * Loaded on profile.html. Uses CSS variables defined in shared/styles.css
 * (--bg-card, --bg-dropdown, --accent-sky, --accent-ocean, --color-correct,
 *  --color-close, --color-incorrect, --text-primary, --text-secondary).
 *
 * Visual language matches shared/streak.css, shared/leaderboard.css and
 * shared/auth.css — deep ocean panels, soft sky borders, rounded corners.
 */

.profile-page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 8px 0 40px;
    color: var(--text-primary, #F5F5F0);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ====================================================================
 * Page title
 * ================================================================= */

.profile-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 12px 4px 16px;
    letter-spacing: 0.01em;
    color: var(--text-primary, #F5F5F0);
}

/* ====================================================================
 * Summary section: signed-out card / handle row / streak card
 * ================================================================= */

.profile-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.profile-card {
    background: var(--bg-card, rgba(20, 60, 100, 0.92));
    border: 1px solid rgba(91, 164, 212, 0.3);
    border-radius: 12px;
    padding: 16px 18px;
}

.profile-handle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-handle-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(245, 245, 240, 0.55);
    margin-bottom: 4px;
}

.profile-handle-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #F5F5F0);
    word-break: break-all;
}

/* Sign-in callout (signed-out users) */

.profile-signin-card {
    text-align: center;
    padding: 22px 18px;
}

.profile-signin-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.profile-signin-body {
    font-size: 0.92rem;
    color: var(--text-secondary, rgba(245, 245, 240, 0.8));
    line-height: 1.45;
    margin-bottom: 16px;
}

.profile-signin-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 280px;
    margin: 0 auto;
}

/* Streak card */

.profile-streak-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-streak-flame {
    font-size: 1.8rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.55));
}

.profile-streak-info {
    flex: 1;
    min-width: 0;
}

.profile-streak-current {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}

.profile-streak-current-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(245, 245, 240, 0.55);
    margin-bottom: 2px;
}

.profile-streak-best {
    font-size: 0.85rem;
    color: var(--text-secondary, rgba(245, 245, 240, 0.8));
    margin-top: 4px;
}

/* ====================================================================
 * Tabs
 * ================================================================= */

.profile-tabs {
    background: var(--bg-card, rgba(20, 60, 100, 0.92));
    border: 1px solid rgba(91, 164, 212, 0.25);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.profile-tab-bar {
    display: flex;
    border-bottom: 1px solid rgba(91, 164, 212, 0.22);
    background: rgba(15, 45, 75, 0.55);
}

.profile-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary, rgba(245, 245, 240, 0.8));
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-tab:hover {
    color: var(--text-primary, #F5F5F0);
    background: rgba(91, 164, 212, 0.08);
}

.profile-tab.is-active {
    color: var(--text-primary, #F5F5F0);
    border-bottom-color: var(--accent-sky, #5BA4D4);
}

.profile-tab:focus-visible {
    outline: 2px solid var(--accent-sky, #5BA4D4);
    outline-offset: -2px;
}

.profile-tab-panel {
    padding: 16px 16px 18px;
}

.profile-tab-panel[hidden] { display: none; }

/* ====================================================================
 * Stat grid
 * ================================================================= */

.profile-page .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.profile-page .stat-grid-secondary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(91, 164, 212, 0.22);
}

.profile-page .stat-card {
    background: rgba(15, 45, 75, 0.55);
    border: 1px solid rgba(91, 164, 212, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-page .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, rgba(245, 245, 240, 0.8));
    line-height: 1.2;
}

.profile-page .stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary, #F5F5F0);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

/* Color hints on per-cell counts */
.profile-page .stat-card[data-tone="green"]  .stat-value { color: var(--color-correct, #4ADE80); }
.profile-page .stat-card[data-tone="yellow"] .stat-value { color: var(--color-close, #FBBF24); }
.profile-page .stat-card[data-tone="red"]    .stat-value { color: var(--color-incorrect, #F87171); }

/* Achievements list host (the actual scrolling list comes from achievements.css) */
.ach-list-host {
    width: 100%;
}

/* ====================================================================
 * Mobile
 * ================================================================= */

@media (max-width: 600px) {
    .profile-page {
        padding: 4px 0 32px;
    }

    .profile-page-title {
        font-size: 1.35rem;
        margin: 8px 4px 12px;
    }

    .profile-card { padding: 14px; }

    .profile-page .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .profile-page .stat-card { padding: 10px 12px; }

    .profile-page .stat-value { font-size: 1.2rem; }

    .profile-tab { padding: 11px 8px; font-size: 0.9rem; }

    .profile-tab-panel { padding: 14px 12px 16px; }

    .profile-streak-current { font-size: 1.25rem; }
    .profile-streak-flame { font-size: 1.5rem; }
}
