/* ==============================
   エリア・ルーム管理
============================== */

.area-manage-page {
    max-width: 1100px;
    margin: 0 auto;
}

.area-manage-header-card,
.area-manage-card {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #999;
    border-radius: 6px;
    background: #fff;
}

.area-manage-header-card__title,
.area-manage-card__title {
    margin: 0;
    padding: 0;
    border-bottom: none;
    line-height: 1.4;
}

.area-manage-header-card__current {
    margin-top: 8px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.5;
}

.area-manage-card__header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #bbb;
}

.area-map {
    position: relative;
    width: 100%;
    max-width: 980px;
    aspect-ratio: 4 / 3;
    margin: 0 auto 14px;
    border: 2px solid #111;
    border-radius: 8px;
    background: #111;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.area-map__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.area-map__points {
    position: absolute;
    inset: 0;
}

.area-map__button {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 84px;
    min-height: 34px;
    padding: 6px 12px;
    border: 2px solid rgba(20, 20, 20, 0.75);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #111;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    font-weight: bold;
    line-height: 1.2;
    transform: translate(-50%, -50%);
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.area-map__button:hover {
    background: rgba(255, 255, 255, 0.98);
    transform: translate(-50%, -50%) scale(1.04);
}

.area-map__button.is-current {
    border-color: #111;
    background: rgba(35, 35, 35, 0.92);
    color: #fff;
}

.area-map__button.is-selected {
    outline: 3px solid #2f6fd6;
    outline-offset: 2px;
}

.area-map__button.is-private {
    border-style: dashed;
}

.area-map__empty {
    position: absolute;
    left: 50%;
    top: 50%;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #555;
    font-weight: bold;
    transform: translate(-50%, -50%);
}

.area-map__badge,
.room-row__badge {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #2f6fd6;
    border-radius: 999px;
    color: #2f6fd6;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.area-map__empty,
.area-manage-empty {
    color: #666;
    line-height: 1.7;
}

.area-move-form__select-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.area-move-form__select-row label {
    font-weight: bold;
}

.area-move-form__select-row select {
    min-width: 220px;
    max-width: 100%;
    padding: 4px 6px;
}

.area-move-form__submit-row {
    display: flex;
    justify-content: center;
}

.area-manage-button {
    display: inline-block;
    box-sizing: border-box;
    min-height: 28px;
    padding: 3px 9px;
    border: 1px solid #777;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.area-manage-button:hover {
    background: #eee;
    text-decoration: none;
}

.area-manage-button--primary {
    border-color: #333;
    background: #333;
    color: #fff;
}

.area-manage-button--primary:hover {
    background: #555;
}


/* ==============================
   エリア選択プレビュー
============================== */

.area-preview-panel {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 220px;
    margin: 12px 0;
    border: 2px solid #111;
    border-radius: 6px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.area-preview-panel__overlay {
    position: relative;
    box-sizing: border-box;
    min-height: 220px;
    padding: 12px;
}

.area-preview-panel__title {
    margin: 0;
    padding: 0;
    border-bottom: none;
    color: #fff;
    font-family:
        "Yu Mincho",
        "Hiragino Mincho ProN",
        "Times New Roman",
        serif;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.2;
    text-shadow:
        2px 2px 0 #000,
        -2px 2px 0 #000,
        2px -2px 0 #000,
        -2px -2px 0 #000,
        0 2px 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        -2px 0 0 #000;
}

.area-preview-panel__description {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 14px;
    color: #fff;
    font-family:
        "Yu Mincho",
        "Hiragino Mincho ProN",
        "Times New Roman",
        serif;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.3;
    white-space: pre-wrap;
    text-shadow:
        2px 2px 0 #000,
        -2px 2px 0 #000,
        2px -2px 0 #000,
        -2px -2px 0 #000,
        0 2px 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        -2px 0 0 #000;
}


/* ==============================
   ルーム一覧：横一列カード
============================== */

.room-list-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) 80px minmax(180px, 2fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fafafa;
}

.room-row.is-official {
    border-color: #8aaee8;
    background: #f7fbff;
}

.room-row__favorite form,
.room-row__actions form {
    margin: 0;
}

.room-row__icon-button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    line-height: 1;
}

.room-row__icon-button.is-favorite {
    font-weight: bold;
}

.room-row__name {
    overflow: hidden;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-row__meta {
    overflow: hidden;
    white-space: nowrap;
}

.room-row__creator {
    color: #444;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

.room-row__description {
    overflow: hidden;
    color: #444;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-row__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.room-row__area {
    color: #666;
    font-size: 12px;
}

.room-row__gear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    color: #222;
    text-decoration: none;
}

.room-row__gear:hover {
    background: #eee;
    text-decoration: none;
}


/* ==============================
   ルーム作成フォーム
============================== */

.room-create-compact-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.room-create-compact-form__fields {
    flex: 1 1 500px;
}

.room-create-compact-form__fields p {
    margin: 0 0 8px;
}

.room-create-compact-form__fields input,
.room-create-compact-form__fields textarea {
    box-sizing: border-box;
    max-width: 100%;
}

.room-row.is-private {
    border-color: #aaa;
    background: #f1f1f1;
    opacity: 0.9;
}

.room-row__badge--private {
    border-color: #777;
    color: #555;
}

.room-row__name--disabled {
    color: #555;
    cursor: default;
}

.room-row__icon-button--disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: default;
}

/* ==============================
   エリア・ルーム管理 スマホ暫定
============================== */

@media (max-width: 800px) {
    .area-preview-panel {
        min-height: 160px;
    }

    .area-preview-panel__overlay {
        min-height: 160px;
    }

    .area-preview-panel__title {
        font-size: 22px;
    }

    .area-preview-panel__description {
        bottom: 12px;
        font-size: 15px;
    }

    .room-row {
        grid-template-columns: minmax(120px, 1fr) auto;
        grid-template-areas:
            "name actions"
            "meta actions"
            "description description";
        align-items: center;
    }

    .room-row__name {
        grid-area: name;
    }

    .room-row__meta {
        grid-area: meta;
    }

    .room-row__description {
        grid-area: description;
    }

    .room-row__actions {
        grid-area: actions;
    }
}



@media (max-width: 800px) {
    .area-map {
        max-width: 100%;
    }

    .area-map__button {
        min-width: 68px;
        min-height: 30px;
        padding: 5px 9px;
        font-size: 13px;
    }
}

/* ==============================
   ルーム設定画面
============================== */

.room-edit-page {
    max-width: 1100px;
    margin: 0 auto;
}

.room-edit-preview-card {
    margin-bottom: 16px;
}

.room-edit-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.room-edit-status-item {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.room-edit-status-item__label {
    color: #666;
    font-size: 13px;
}

.room-edit-status-item__value {
    display: block;
    margin-top: 3px;
    font-size: 16px;
}

.room-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.room-edit-form__field label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.room-edit-form__field input,
.room-edit-form__field textarea {
    max-width: 100%;
}

.room-edit-form__checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.room-edit-form__check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    cursor: pointer;
}

.room-edit-form__check-row input {
    width: auto;
}

.room-edit-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

@media (max-width: 800px) {
    .room-edit-status-grid {
        grid-template-columns: 1fr;
    }

    .room-edit-form__actions {
        justify-content: flex-start;
    }
}

/* ==============================
   エリアプレビュー：説明文を下端基準で表示
============================== */

.area-preview-panel {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 9 / 2;
    min-height: 0;
    overflow: hidden;

    background-size: 100% auto;
    background-position: center center;
    background-repeat: no-repeat;

    /*
       中の文字は個別にabsolute配置するため、
       flex指定が残っていても無効化する。
    */
    display: block;
    padding: 0;
}

/* タイトルは左上固定 */
.area-preview-panel h2,
.area-preview-panel h3,
.area-preview-panel__title {
    position: absolute;
    top: 18px;
    left: 28px;
    right: 28px;

    margin: 0;
    line-height: 1.25;
}

/* 説明文は左下固定。行が増えたら上に伸びる */
.area-preview-panel p,
.area-preview-panel__description {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;

    margin: 0;
    line-height: 1.45;

    overflow: hidden;
}