.profile-container {
    margin: 1.5rem auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    overflow: hidden;
}
.profile-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 2rem;
    text-align: center;
    color: #fff;
    position: relative;
}
.avatar-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
.avatar-big {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    background: #e94560;
    color: #fff;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.3);
    transition: border-color 0.2s;
}
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap:hover .avatar-big { border-color: #ffd700; }
.avatar-edit-hint {
    position: absolute;
    bottom: -2px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}
.avatar-wrap:hover .avatar-edit-hint { opacity: 1; }
#avatarInput { display: none; }

.nickname-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    cursor: pointer;
}
.nickname-text { font-size: 1.3rem; font-weight: bold; }
.nickname-edit-icon { font-size: 0.8rem; opacity: 0.6; }
.nickname-wrap:hover .nickname-edit-icon { opacity: 1; }

.nickname-input-wrap {
    display: none;
    margin-top: 0.6rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.nickname-input-wrap.show { display: inline-flex; }
.nickname-input-wrap input {
    font-size: 1.1rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    width: 140px;
    text-align: center;
}
.nickname-input-wrap input:focus { outline: none; border-color: #ffd700; }
.nickname-input-wrap button {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.btn-save { background: #4caf50; color: #fff; }
.btn-cancel { background: rgba(255,255,255,0.2); color: #fff; }

.email-tag { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-top: 0.3rem; }
.uuid-tag { font-size: 0.7rem; color: rgba(255,255,255,0.35); margin-top: 0.2rem; word-break: break-all; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    padding: 1.5rem;
}
.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}
.stat-card .num { font-size: 1.3rem; font-weight: bold; color: #e94560; }
.stat-card .label { font-size: 0.75rem; color: #888; margin-top: 0.2rem; }

.action-section {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.action-btn-full {
    display: block;
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: #e94560; color: #fff; }
.btn-primary:hover { background: #d73750; }
.btn-secondary { background: #1a1a2e; color: #fff; }
.btn-secondary:hover { background: #2a2a4e; }
.btn-outline { background: #fff; color: #e94560; border: 2px solid #e94560; }
.btn-outline:hover { background: #fff5f7; }

.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.auth-modal.show { display: flex; }
.auth-box {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
}
.auth-tabs { display: flex; margin-bottom: 1.2rem; border-bottom: 2px solid #eee; }
.auth-tab {
    flex: 1; padding: 0.6rem; text-align: center;
    cursor: pointer; color: #888; border-bottom: 2px solid transparent;
    margin-bottom: -2px; background: none; border-top: none; border-left: none; border-right: none;
    font-size: 0.95rem;
}
.auth-tab.active { color: #e94560; border-bottom-color: #e94560; font-weight: bold; }
.form-group { margin-bottom: 0.8rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; color: #666; }
.form-group input {
    width: 100%; padding: 0.7rem; border: 1px solid #ddd;
    border-radius: 6px; font-size: 0.95rem;
}
.form-group input:focus { outline: none; border-color: #e94560; }
.code-row { display: flex; gap: 0.5rem; }
.code-row input { flex: 1; }
.code-btn {
    padding: 0 1rem; border: none; background: #e94560;
    color: #fff; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.code-btn:disabled { background: #ccc; }
.submit-btn-full {
    width: 100%; padding: 0.8rem; border: none;
    background: #e94560; color: #fff; font-size: 1rem;
    font-weight: bold; border-radius: 6px; cursor: pointer; margin-top: 0.5rem;
}
.submit-btn-full:hover { background: #d73750; }
.msg { text-align: center; margin-top: 0.8rem; font-size: 0.85rem; }
.msg.success { color: #4caf50; }
.msg.error { color: #f44336; }
.close-btn {
    display: block; margin: 1rem auto 0; background: none;
    border: none; color: #888; cursor: pointer; font-size: 0.9rem;
}
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #333; color: #fff; padding: 0.6rem 1.2rem;
    border-radius: 8px; font-size: 0.9rem; z-index: 200;
    opacity: 0; transition: opacity 0.3s;
}
.toast.show { opacity: 1; }
