body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    color: #ffffff;
    background-color: #000;
    /* 実績画面と同じ背景画像を使用 */
    background-image: url('../img/Achievementsimage.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;
}

.settings-container {
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4); /* 背景を少し暗くして文字を読みやすく（少し濃くしました） */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    box-sizing: border-box;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.back-button {
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background-color 0.2s;
    align-self: flex-start; /* 左上に配置 */
    display: inline-block;
    border: none;
    cursor: pointer;
    margin-bottom: 20px; /* コンテンツとの間隔 */
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.language-switch {
    min-width: 48px;
    box-sizing: border-box;
    margin-bottom: 20px;
    padding: 8px 12px;
    color: #f0edff;
    background: rgba(13, 17, 23, 0.66);
    border: 1px solid rgba(178, 171, 216, 0.62);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.language-switch:hover,
.language-switch:focus-visible {
    color: #ffffff;
    background: rgba(86, 81, 127, 0.82);
    border-color: #b2abd8;
    outline: none;
}

/* メインコンテンツを中央寄せにするラッパー */
.settings-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* ★変更: 480px(小)と600px(大)の間くらいに設定 */
    max-width: 540px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease;
    /* ★追加: 下に余白を入れて全体を少し上に配置 */
    padding-bottom: 10vh;
}

.settings-content h1 {
    /* ★変更: 2.5rem(小)と3.5rem(大)の間くらい */
    font-size: 3rem;
    margin: 0 0 25px 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    letter-spacing: 4px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

/* フォーム部分のコンテナ */
.title-editor {
    width: 100%;
    background: rgba(22, 27, 34, 0.7);
    /* ★変更: 1.5rem(小)と2rem(大)の間くらい */
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.title-editor h2 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: #fff;
}

.title-editor p {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 1.4rem;
}

/* プレビュー表示 */
.preview-box {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid #b2abd8;
    border-radius: 8px;
    /* ★変更: 1rem(小)と1.5rem(大)の間くらい */
    padding: 1.25rem;
    /* ★変更: 1.2rem(小)と1.5rem(大)の間くらい */
    font-size: 1.35rem;
    /* ★変更: 1.5rem(小)と2rem(大)の間くらい */
    margin-bottom: 1.75rem;
    color: #e1dcff;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(86, 81, 127, 0.58);
    text-shadow: 0 0 8px rgba(178, 171, 216, 0.45);
}

.selectors {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    margin-bottom: 1.75rem;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(33, 38, 45, 0.9);
    border: 1px solid #30363d;
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;
}

select:hover {
    border-color: #8b949e;
}

select:focus {
    outline: none;
    border-color: #b2abd8;
    box-shadow: 0 0 0 3px rgba(86, 81, 127, 0.5);
}

/* 保存ボタン */
.save-btn {
    /* ★変更: 宇宙背景になじむ紫のアクセント */
    background: #56517f;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.9rem 2.5rem; /* サイズ調整 */
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    /* ★変更: 影の色も紫系に変更 */
    box-shadow: 0 4px 15px rgba(23, 6, 51, 0.6);
    width: 100%;
}

.save-btn:hover {
    /* transformを削除して固定 */
    /* ★変更: ホバー時の影の色も紫系に変更 */
    background: #696391;
    box-shadow: 0 6px 20px rgba(23, 6, 51, 0.75);
}

.save-btn:active {
    /* transformを削除して固定 */
}

/* ★追加: 連打対策（無効化時）のスタイル */
.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
    box-shadow: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* スマホ対応 */
@media screen and (max-width: 768px) {
    .settings-container {
        padding: 20px;
    }

    .language-switch {
        min-width: 44px;
        padding: 7px 10px;
    }
    
    .settings-content h1 {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    .title-editor {
        padding: 1.4rem;
    }

    .selectors {
        flex-direction: column;
        gap: 0.8rem;
    }

    .preview-box {
        font-size: 1.15rem;
        padding: 0.9rem;
    }
}
