/* Profile Tab Styles */
.profile-section {
    padding: 10px 15px;
    text-align: left;
}

.profile-section label {
    display: block;
    font-family: Bubblegum Sans, cursive;
    font-size: 1rem;
    color: var(--storybook-brown-deep);
    margin-bottom: 5px;
}

.profile-section h3 {
    font-family: Bubblegum Sans, cursive;
    font-size: 1.1rem;
    color: var(--storybook-brown-deep);
    margin: 0 0 10px 0;
    text-align: center;
}

.profile-name-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.profile-name-row input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    font-family: Bubblegum Sans, cursive;
    font-size: 1rem;
    color: var(--storybook-brown);
    background: #fff;
}

.profile-name-row input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.profile-btn {
    padding: 8px 16px;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    background: linear-gradient(to bottom, #fffae6, #f5e6c8);
    font-family: Bubblegum Sans, cursive;
    font-size: 0.95rem;
    color: var(--storybook-brown);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-btn:hover {
    background: var(--gold-accent);
    border-color: var(--bonus-bg);
}

.profile-scores {
    background: #fffae6;
    border: 2px solid var(--card-border);
    border-radius: 10px;
    padding: 10px;
}

.profile-scores-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-score-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.profile-diff {
    font-family: Bubblegum Sans, cursive;
    font-size: 0.95rem;
    color: var(--storybook-brown);
}

.profile-score-val {
    font-family: Bubblegum Sans, cursive;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--storybook-brown-deep);
}

.profile-loading,
.profile-empty {
    text-align: center;
    padding: 15px;
    font-family: Bubblegum Sans, cursive;
    color: var(--storybook-brown);
    font-style: italic;
}

.profile-auth {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

.logout-btn {
    background: linear-gradient(to bottom, #ffb3b3, #ff8080);
    border-color: #cc6666;
    color: #8b0000;
}

.logout-btn:hover {
    background: linear-gradient(to bottom, #ff9999, #ff6666);
}

.login-btn {
    background: linear-gradient(to bottom, #b3d9ff, #80c0ff);
    border-color: #6699cc;
    color: #003366;
}

.login-btn:hover {
    background: linear-gradient(to bottom, #99ccff, #66b3ff);
}

/* Profile header row - name + save + auth */
.profile-header-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 15px;
}

.profile-header-row input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    font-family: Bubblegum Sans, cursive;
    font-size: 1rem;
    color: var(--storybook-brown);
    background: #fff;
    min-width: 0;
}

.profile-header-row input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

/* Inline achievements in profile */
.profile-achievements {
    background: #fffae6;
    border: 2px solid var(--card-border);
    border-radius: 10px;
    padding: 10px;
}

.achievements-progress-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.achievements-grid-inline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md, 12px);
}

.achievement-mini {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg, #fffae6);
    border: 3px solid var(--card-border, #d2c5a0);
    border-radius: var(--radius-xl, 12px);
    cursor: default;
    transition:
        transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    box-shadow:
        inset 0 0 2px rgba(0, 0, 0, 0.1),
        0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.achievement-mini.unlocked {
    border-color: var(--gold-accent, #FFD966);
    box-shadow:
        inset 0 0 2px rgba(0, 0, 0, 0.05),
        0 3px 8px rgba(255, 217, 102, 0.4);
}

.achievement-mini.unlocked:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        inset 0 0 1px rgba(0, 0, 0, 0.05),
        0 6px 16px rgba(255, 217, 102, 0.5);
    border-color: var(--gold-accent, #FFD966);
    z-index: 10;
}

.achievement-mini.locked {
    opacity: 0.5;
    filter: grayscale(1);
    background-color: #f5f0e0;
}

.achievement-mini.locked:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

.achievement-icon-mini {
    width: 80%;
    height: 80%;
    object-fit: contain;
    pointer-events: none;
}

/* Achievement hover popup */
.achievement-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #fffae6 0%, #fff9e6 100%);
    border: 2px solid var(--gold-accent);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 140px;
    max-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.achievement-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--gold-accent);
}

.achievement-mini:hover .achievement-popup {
    opacity: 1;
    visibility: visible;
}

.achievement-popup-name {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 0.95rem;
    color: var(--storybook-brown-deep, #5C2E00);
    text-align: center;
    margin-bottom: 4px;
}

.achievement-popup-desc {
    font-size: 0.75rem;
    color: var(--storybook-brown, #663300);
    text-align: center;
    line-height: 1.3;
}
