/* -------------------------------------
   PROFILE EDIT PAGE STYLES
   ------------------------------------- */

#page-profile {
    background-color: #1a0f05 !important;
    color: #fdf5e6 !important;
    font-family: 'Noto Sans JP', sans-serif;
    height: 100%;
    width: 100% !important;
    box-sizing: border-box;
    padding: 20px 24px 24px 24px !important;
    display: none !important;
    overflow-y: auto;
}

#page-profile.active {
    display: flex !important;
    flex-direction: column;
}

.profile-container {
    width: 100%;
    max-width: 100%;
    flex: 1;
    background: #2a1a0a;
    border: 2px solid #8b4513;
    border-radius: 15px;
    padding: 20px 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.profile-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.profile-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139,69,19,0.3);
}

.profile-title {
    font-family: 'Cinzel', serif;
    color: #d2b48c;
    font-size: 1.5rem;
    margin-bottom: 4px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.profile-subtitle {
    color: #8b4513;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ユーザー選択（プロフィールの前処理） */
.profile-user-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

/* パスワード入力（絵文字） */
.emoji-auth-container {
    text-align: center;
    margin: 40px 0;
}

.emoji-display-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    min-height: 60px;
}

.emoji-slot {
    width: 60px;
    height: 60px;
    background: #000;
    border: 2px solid #8b4513;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.emoji-slot.empty {
    border-style: dashed;
    background: rgba(0,0,0,0.2);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #4a3a2a;
}

.emoji-btn {
    font-size: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    padding: 5px;
}

.emoji-btn:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px #ffd700);
}

/* プロフィール編集フォーム */
.profile-form-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 600px) {
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.profile-avatar-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #d4af37;
    background: #1a0f05;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owned-icons-lib {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid #4a3a2a;
    width: 100%;
}

.lib-icon-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #5d4a36;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}

.lib-icon-thumb.active {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255,215,0,0.4);
    transform: scale(1.1);
}

.lib-icon-thumb .btn-delete-icon {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lib-icon-thumb:hover .btn-delete-icon {
    display: flex;
}

/* 称号選択 */
.title-select-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.title-item {
    background: #3a2a1a;
    border: 2px solid #5d4a36;
    color: #d2b48c;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.title-item:hover {
    background: #4a3a2a;
}

.title-item.active {
    background: #8b4513;
    color: white;
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.profile-actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-rpg {
    font-family: 'Cinzel', serif;
    font-weight: 900;
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-rpg-primary {
    background: linear-gradient(180deg, #d4af37, #b8860b);
    color: #1a0f05;
    border: 2px solid #8b4513;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.btn-rpg-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    background: linear-gradient(180deg, #e5be48, #d4af37);
}

.btn-rpg-outline {
    background: transparent;
    border: 2px solid #8b4513;
    color: #d2b48c;
}

.btn-rpg-outline:hover {
    background: rgba(139, 69, 19, 0.2);
}

/* 全てクリアボタン */
.picker-clear-btn {
    background: #3a2a1a;
    border: 2px solid #d4af37;
    color: #d4af37;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.picker-clear-btn:hover {
    background: #d4af37;
    color: #1a0f05;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}
