/* =======================================
   ホーム画面
======================================= */

/* フレンドボタン */
.forest-friend-button {
    position: absolute;
    top: 70px;
    right: 16px;
    z-index: 20;

    width: 46px;
    height: 46px;

    padding: 0;
    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.9);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.forest-friend-button img {
    width: 42px;
    height: 42px;

    object-fit: contain;
    display: block;
}


/* =======================================
   フレンド画面
======================================= */

.profile-screen {
    box-sizing: border-box;

    width: 100%;

    padding:
        12px
        14px
        120px;
}


/* =======================================
   フレンド画面 ヘッダー
======================================= */

.profile-header {
    margin-bottom: 8px;
}

.profile-header h2 {
    margin:
        8px
        0
        12px;

    font-size: 28px;
}

.profile-back-button {
    border: none;
    border-radius: 18px;

    padding:
        5px
        10px;

    font-size: 15px;

    cursor: pointer;
}


/* =======================================
   上段
   左：スピリア
   右：プロフィール
======================================= */

.profile-top {
    display: grid;

    grid-template-columns:
        44% 56%;

    align-items: center;

    width: 100%;
}


/* =======================================
   現在のスピリア
======================================= */

.profile-spiria {
    box-sizing: border-box;

    width: 100%;

    padding:
        4px
        6px;

    text-align: center;
}

.profile-spiria-title {
    margin:
        0
        0
        6px;

    font-size: 15px;

    white-space: nowrap;
}

.profile-screen .profile-spiria-image {
    width: 145px !important;
    height: 145px !important;

    max-width: 100% !important;
    max-height: 145px !important;

    object-fit: contain !important;

    display: block;

    margin:
        0
        auto;
}

.profile-spiria-name {
    display: block;

    margin-top: 4px;

    text-align: center;

    font-size: 15px;
    font-weight: 700;
}


/* =======================================
   自分のプロフィール
======================================= */

.profile-content {
    box-sizing: border-box;

    width: 100%;

    padding:
        14px
        12px;

    background:
        rgba(
            255,
            248,
            225,
            0.94
        );

    border:
        2px
        solid
        #d5b36a;

    border-radius: 20px;
}

.profile-content h3 {
    margin:
        0
        0
        12px;

    font-size: 18px;

    white-space: nowrap;
}

.profile-name {
    margin-bottom: 12px;
}

.profile-name span {
    display: block;

    font-size: 12px;
}

.profile-name strong {
    display: block;

    margin-top: 2px;

    font-size: 17px;

    overflow-wrap: anywhere;
}

.profile-stats {
    border-top:
        1px
        dashed
        rgba(130, 100, 40, 0.4);

    padding-top: 9px;
}

.profile-stats > div {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 6px;

    margin:
        6px
        0;

    font-size: 13px;
}

.profile-stats strong {
    font-size: 18px;
}


/* 名前編集 */

.profile-edit-button {
    width: 100%;

    margin-top: 10px;

    padding:
        7px
        6px;

    border:
        1px
        solid
        #31964a;

    border-radius: 18px;

    background: white;

    font-size: 13px;

    cursor: pointer;
}


/* =======================================
   お気に入りカード
======================================= */

.profile-favorites {
    clear: both;

    margin-top: 18px;

    padding:
        14px
        12px;

    background:
        rgba(
            255,
            248,
            225,
            0.82
        );

    border:
        1px
        solid
        rgba(
            213,
            179,
            106,
            0.65
        );

    border-radius: 18px;
}

.profile-favorites h3 {
    margin:
        0
        0
        12px;

    font-size: 18px;
}

.profile-favorites-empty {
    min-height: 90px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        2px
        dashed
        rgba(
            160,
            145,
            110,
            0.35
        );

    border-radius: 14px;

    font-size: 13px;

    opacity: 0.65;
}


/* =======================================
   フレンド
======================================= */

.profile-friends {
    margin-top: 14px;

    padding:
        14px
        12px;

    background:
        rgba(
            255,
            248,
            225,
            0.82
        );

    border:
        1px
        solid
        rgba(
            213,
            179,
            106,
            0.65
        );

    border-radius: 18px;
}

.profile-friends-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 10px;
}

.profile-friends-header h3 {
    margin: 0;

    font-size: 18px;
}

.profile-friends-header button {
    border: none;

    border-radius: 18px;

    padding:
        6px
        12px;

    background: #31964a;
    color: white;

    font-weight: 700;

    cursor: pointer;
}


/* フレンド追加 */

.profile-friend-buttons {
    margin-top: 12px;
}

.profile-friend-buttons button {
    width: 100%;

    min-height: 60px;

    border:
        2px
        dashed
        rgba(
            120,
            110,
            90,
            0.35
        );

    border-radius: 14px;

    background:
        rgba(
            255,
            255,
            255,
            0.55
        );

    font-size: 15px;

    cursor: pointer;
}


/* =======================================
   小さいiPhone向け微調整
======================================= */

@media (max-width: 380px) {

    .profile-screen {
        padding-left: 10px;
        padding-right: 10px;
    }

    .profile-top {
        grid-template-columns:
            43% 57%;
    }

    .profile-screen .profile-spiria-image {
        width: 130px !important;
        height: 130px !important;
    }

    .profile-spiria-title {
        font-size: 13px;
    }

    .profile-content {
        padding:
            12px
            9px;
    }

    .profile-content h3 {
        font-size: 16px;
    }
}
/* =======================================
   フレンド画面 下段レイアウト修正
======================================= */

/* お気に入りカード・フレンドを
   画面いっぱいの1列にする */
.profile-screen > .profile-favorites,
.profile-screen > .profile-friends {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* お気に入りカード */
.profile-screen > .profile-favorites {
    margin-top: 18px !important;
}

/* フレンド */
.profile-screen > .profile-friends {
    margin-top: 14px !important;
}

/* 名前編集ボタンは表示しない */
.profile-edit-button {
    display: none !important;
}

/* ホーム上部の4つのアイコン */
.forest-garden-home .forest-friend-button,
.forest-garden-home .forest-quest-button,
.forest-garden-home .forest-treasure-button,
.forest-garden-home .forest-settings-button {
    position: absolute !important;
    top: 16px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 30;

    width: 70px;
    height: 70px;
    padding: 0;

    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);

    display: flex;
    align-items: center;
    justify-content: center;
}

/* 左から、なかま・クエスト・宝箱・設定 */
.forest-garden-home .forest-friend-button {
    left: calc(50% - 112px) !important;
}

.forest-garden-home .forest-quest-button {
    left: calc(50% - 52px) !important;
    font-size: 32px;
}

.forest-garden-home .forest-treasure-button {
    left: calc(50% + 8px) !important;
}

.forest-garden-home .forest-settings-button {
    left: calc(50% + 68px) !important;
}

.forest-garden-home .forest-friend-button img,
.forest-garden-home .forest-treasure-button img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.forest-garden-home .forest-settings-button span {
    font-size: 27px;
}

/* 上のアイコンを下メニューみたいに大きくする */
.forest-garden-home .forest-friend-button,
.forest-garden-home .forest-quest-button,
.forest-garden-home .forest-treasure-button,
.forest-garden-home .forest-settings-button {
    width: 76px !important;
    height: 76px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* フレンド・宝箱の絵を大きく */
.forest-garden-home .forest-friend-button img,
.forest-garden-home .forest-treasure-button img {
    width: 72px !important;
    height: 72px !important;
}

/* クエストの巻物 */
.forest-garden-home .forest-quest-button {
    font-size: 58px !important;
}

/* 4つを横並びにする */
.forest-garden-home .forest-friend-button {
    left: calc(50% - 152px) !important;
}
.forest-garden-home .forest-quest-button {
    left: calc(50% - 76px) !important;
}
.forest-garden-home .forest-treasure-button {
    left: 50% !important;
}
.forest-garden-home .forest-settings-button {
    left: calc(50% + 76px) !important;
}

.forest-garden-home .forest-quest-button img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain !important;
    display: block;
}

/* 上の4つのアイコンの大きさと間隔を調整 */
.forest-garden-home .forest-friend-button,
.forest-garden-home .forest-quest-button,
.forest-garden-home .forest-treasure-button,
.forest-garden-home .forest-settings-button {
    width: 92px !important;
    height: 92px !important;
}

.forest-garden-home .forest-friend-button img,
.forest-garden-home .forest-quest-button img,
.forest-garden-home .forest-treasure-button img {
    width: 90px !important;
    height: 90px !important;
    object-fit: contain !important;
}

.forest-garden-home .forest-settings-button span {
    font-size: 42px !important;
}

.forest-garden-home .forest-friend-button {
    left: calc(50% - 176px) !important;
}

.forest-garden-home .forest-quest-button {
    left: calc(50% - 88px) !important;
}

.forest-garden-home .forest-treasure-button {
    left: 50% !important;
}

.forest-garden-home .forest-settings-button {
    left: calc(50% + 88px) !important;
}

/* 上の4アイコンをホーム画面の幅に合わせて均等配置 */
.forest-garden-home .forest-friend-button {
    left: 12.5% !important;
    transform: translateX(-50%);
}

.forest-garden-home .forest-quest-button {
    left: 37.5% !important;
    transform: translateX(-50%);
}

.forest-garden-home .forest-treasure-button {
    left: 62.5% !important;
    transform: translateX(-50%);
}

.forest-garden-home .forest-settings-button {
    left: 87.5% !important;
    transform: translateX(-50%);
}

.forest-garden-home .forest-treasure-button img {
    width: 104px !important;
    height: 104px !important;
}

.forest-garden-home .forest-settings-button span {
    font-size: 52px !important;
}

/* 庭に置いた宝箱と掲示物のサイズ調整 */
.forest-garden-home .forest-garden-world .garden-decoration {
    position: absolute !important;
    z-index: 5 !important;
    width: 76px !important;
    height: 76px !important;
    pointer-events: none;
}

.forest-garden-home .forest-garden-world .garden-decoration img {
    display: block !important;
    width: 76px !important;
    height: 76px !important;
    max-width: 76px !important;
    max-height: 76px !important;
    object-fit: contain !important;
}

.forest-garden-home .forest-garden-world .garden-chest-decoration {
    left: 3% !important;
    top: 57% !important;
}

.forest-garden-home .forest-garden-world .garden-board-decoration {
    left: 68% !important;
    top: 43% !important;
}

/* 庭の宝箱と掲示板 */
.forest-garden-home .forest-garden-world .garden-chest-decoration {
    left: 3% !important;
    top: 61% !important;
    width: 120px !important;
    height: 120px !important;
    z-index: 1 !important;
}

.forest-garden-home .forest-garden-world .garden-chest-decoration img {
    width: 120px !important;
    height: 120px !important;
}

.forest-garden-home .forest-garden-world .garden-board-decoration {
    left: 64% !important;
    top: 38% !important;
    width: 160px !important;
    height: 240px !important;
    z-index: 1 !important;
}

.forest-garden-home .forest-garden-world .garden-board-decoration img {
    width: 160px !important;
    height: 240px !important;
}

/* スピリアを飾りより手前に表示 */
.forest-garden-home .forest-garden-world .forest-spirit-zone {
    z-index: 2 !important;
}

#gardenChestDecoration {
    width: 140px !important;
    height: 140px !important;
    z-index: 1 !important;
}

#gardenChestDecoration img {
    width: 140px !important;
    height: 140px !important;
}

#gardenBoardDecoration {
    width: 150px !important;
    height: 225px !important;
    z-index: 1 !important;
}

#gardenBoardDecoration img {
    width: 150px !important;
    height: 225px !important;
}

#gardenChestDecoration {
    width: 180px !important;
    height: 180px !important;
    z-index: 1 !important;
}

#gardenChestDecoration img {
    width: 120% !important;
    height: 200% !important;
    object-fit: contain;
    max-width: none !important;
max-height: none !important;
}

#gardenBoardDecoration {
    width: 200px !important;
    height: 270px !important;
    z-index: 1 !important;
}

#gardenBoardDecoration img {
    width: 130% !important;
    height: 130% !important;
    object-fit: contain;
    max-width: none !important;
max-height: none !important;
}

#gardenChestDecoration,
#gardenBoardDecoration {
    pointer-events: auto !important;
    cursor: pointer;
}

/* ホーム画面のバランス調整 */
.forest-garden-home .forest-friend-button,
.forest-garden-home .forest-quest-button,
.forest-garden-home .forest-treasure-button,
.forest-garden-home .forest-settings-button {
    top: 48px !important;
}

#gardenChestDecoration,
#gardenChestDecoration img {
    width: 110px !important;
    height: 110px !important;
}

#gardenBoardDecoration,
#gardenBoardDecoration img {
    width: 130px !important;
    height: 190px !important;
}