.account-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding: 3rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.account-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.account-avatar-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.account-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #1e40af;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: filter 0.2s;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.account-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 1.4rem;
}

.account-avatar-wrapper:hover .account-avatar-overlay {
    opacity: 1;
}

.account-avatar-wrapper.uploading .account-avatar-overlay {
    opacity: 1;
}

.account-avatar-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: avatar-spin 0.7s linear infinite;
    display: none;
}

.account-avatar-wrapper.uploading .account-avatar-spinner {
    display: block;
}

.account-avatar-wrapper.uploading .avatar-camera-icon {
    display: none;
}

.avatar-remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    border: 2px solid white;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    z-index: 2;
}

.account-avatar-wrapper:hover .avatar-remove-btn {
    opacity: 1;
}

.avatar-remove-btn:hover {
    background: #b91c1c;
    transform: scale(1.15);
}

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

.username-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-top h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.edit-name-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 0;
}

.edit-name-btn:hover {
    opacity: 1;
}

.username-edit-form {
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.username-edit-form input {
    padding: 0.4rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.username-edit-form input:focus {
    border-color: var(--accent-color);
}

.save-name-btn {
    padding: 0.4rem 0.9rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-name-btn {
    padding: 0.4rem 0.9rem;
    background: #e5e7eb;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.account-top p {
    color: #6b7280;
    font-size: 1rem;
}

.account-content {
    flex: 1;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ─── XP Section ─── */
.xp-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-radius: 14px;
    padding: 1.5rem;
    color: white;
}

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.xp-level-name {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.02em;
}

.xp-level-sub {
    display: block;
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 0.1rem;
}

.xp-streak-badge {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
}

.xp-bar-track {
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #a5f3fc);
    border-radius: 999px;
    transition: width 0.6s ease;
    min-width: 4px;
}

.xp-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.8;
}

.points-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
}

.points-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.points-total span:first-child {
    font-size: 4rem;
    font-weight: bold;
    color: #1e40af;
    line-height: 1;
}

.points-label {
    font-size: 1rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.points-breakdown {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-title {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: -0.25rem;
}

.points-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #374151;
}

.points-row span:last-child {
    font-weight: bold;
}

.no-points {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

/* ─── Dein Fortschritt ─── */
.fortschritt-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem 1.5rem 0.5rem;
}

.fortschritt-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.fw-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.fw-item:last-child {
    border-bottom: none;
}

.fw-item-icon {
    font-size: 1.25rem;
    width: 1.75rem;
    text-align: center;
    flex-shrink: 0;
}

.fw-item-body {
    flex: 1;
    min-width: 0;
}

.fw-item-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.fw-item-sub {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.1rem;
}

.fw-item-value {
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    text-align: right;
}

.account-bottom {
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.logout-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 0.7;
}

/* ─── Debug Panel ─── */
.debug-panel {
    margin-top: 2rem;
    padding: 1.25rem;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    background: #fffbeb;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.debug-title {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
}

.debug-row {
    display: flex;
    gap: 0.5rem;
}

.debug-input {
    flex: 1;
    padding: 0.4rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}

.debug-btn {
    padding: 0.4rem 0.9rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.debug-btn-danger {
    background: #dc2626;
    width: 100%;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] .account-top p { color: #9ca3af; }

[data-theme="dark"] .username-edit-form input {
    background: #111827; border-color: #3d4163; color: var(--text-color);
}
[data-theme="dark"] .cancel-name-btn { background: #2d3148; color: var(--text-color); }

[data-theme="dark"] .points-section,
[data-theme="dark"] .fortschritt-section {
    background: #1a1d2e; border-color: #2d3148;
}
[data-theme="dark"] .points-label { color: #9ca3af; }
[data-theme="dark"] .points-breakdown { border-top-color: #2d3148; }
[data-theme="dark"] .breakdown-title,
[data-theme="dark"] .fortschritt-title,
[data-theme="dark"] .fw-item-sub { color: #6b7280; }
[data-theme="dark"] .points-row { color: #d1d5db; }
[data-theme="dark"] .no-points { color: #9ca3af; }
[data-theme="dark"] .fw-item { border-bottom-color: #2d3148; }
[data-theme="dark"] .fw-item-label { color: var(--text-color); }
[data-theme="dark"] .account-bottom { border-top-color: #2d3148; }

[data-theme="dark"] .debug-panel { background: #1a1400; border-color: #f59e0b; }
[data-theme="dark"] .debug-input { background: #111827; border-color: #3d4163; color: var(--text-color); }

[data-theme="dark"] .fw-item-icon {
    filter: saturate(1.3) brightness(1.15);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .account-main {
        padding: 2rem 1rem;
    }

    .points-total span:first-child {
        font-size: 3rem;
    }
}
