@charset "UTF-8";

/* =========================================
   1. グローバル変数定義（CSS Variables）
   ========================================= */
:root {
    /* --- カラーパレット（デフォルト：ライトモード） --- */
    --accent-color: #00b4d8;
    --accent-hover: #00b4d890;
    --text-main: #000000;
    --text-muted: #888888;
    --bg-base: #ffffff;
    --bg-overlay: rgb(255 255 255 / 60%);
    --theme-hover-bg: #66c1d3;
    
    /* --- グラスモーフィズム（液状化）共通設定 --- */
    --glass-radius: 40px;
    --glass-blur: blur(60px) saturate(250%) contrast(110%) brightness(102%);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.2);
    --glass-border-top: 1.5px solid rgba(255, 255, 255, 0.8);

    /* 【強めのエフェクト】 (input, button, theme-item 等用) */
    --glass-bg-strong: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.1) 100%), radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    --glass-shadow-strong: 0 30px 60px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 0 25px rgba(255, 255, 255, 0.3), inset -10px -15px 40px rgba(255, 255, 255, 0.1), inset 2px 2px 4px rgba(255, 255, 255, 0.7);

    /* 【弱めのエフェクト】 (sidebar 用) */
    --glass-bg-light: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.05) 100%), radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    --glass-shadow-light: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.15), inset 2px 2px 4px rgba(255, 255, 255, 0.4);
}

/* =========================================
   2. ダークモード時の変数上書き
   ========================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --text-main: #ffffff;
        --bg-base: #111111;
        --bg-overlay: rgb(0 0 0 / 60%);
        --theme-hover-bg: #016d83;
    }
}

/* =========================================
   3. ベーススタイル・フォント・リセット
   ========================================= */
@media print {
    body { display: none !important; }
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    display: none;
}

@font-face {
    font-family: 'siteFont';
    src: url('https://prosub.cloudfree.jp/font/logotypejp_mp_m_1.1.woff') format('woff');
}

@font-face {
    font-family: 'corporatev3';
    src: url('https://prosub.cloudfree.jp/font/Corporate-Mincho-ver3.woff2') format('woff2');
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* 変数を使って背景と色を適用 */
    background: linear-gradient(var(--bg-overlay), var(--bg-overlay)), var(--bg-base);
    color: var(--text-main);
}

img {
    touch-action: none;
    pointer-events: auto;
    user-drag: none;
    -webkit-user-drag: none;
}

[contenteditable] { user-select: auto !important; }
hr { margin: 50px 0; }

input,
textarea,
button,
a {
  cursor: pointer;
}

/* =========================================
   4. 液状化エフェクトの共通クラス・要素まとめ
   ========================================= */
/* 何度も登場する「強力なブラー＋シャドウ」をここで一括適用 */
input[type="text"], input[type="email"], input[type="password"], input[name="code"],
select, input[type="datetime-local"], input[type="date"], textarea[name="bio"],
input[type="submit"], input[type="button"], button,
.theme-item, .message, .tab-item {
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    background: var(--glass-bg-strong) !important;
    box-shadow: var(--glass-shadow-strong) !important;
    border: var(--glass-border) !important;
    border-top: var(--glass-border-top) !important;
    border-radius: var(--glass-radius);
    color: var(--text-main) !important; /* テキスト色もここで一括対応 */
}

/* =========================================
   5. レイアウト・コンポーネントごとの詳細
   ========================================= */

/* --- サイドバー --- */
.sidebar {
    width: 80px;
    padding: 30px 0;
    margin: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    z-index: 100;
    
    /* 弱めのグラスエフェクト適用 */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: var(--glass-bg-light);
    box-shadow: var(--glass-shadow-light);
    border: var(--glass-border);
    border-top: var(--glass-border-top);
    border-radius: var(--glass-radius);
}

.sidebar a {
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    font-size: 24px;
    margin: 20px 0;
    padding: 5px;
    border-radius: 18px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    text-decoration: none;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px) scale(1.05);
    text-shadow: 0 0 15px rgba(255,255,255,0.6);
}

/* --- アカウント・ドロップダウン周り --- */
.account-container { position: relative; display: inline-block; padding: 10px; cursor: pointer; user-select: none; }
.sidebar-icon-wrapper { position: relative; display: inline-block; }
.sidebar-icon-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.switch-badge {
    position: absolute; bottom: -2px; right: -2px; background-color: #ffffff; color: var(--accent-color);
    border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.account-dropdown-menu {
    position: fixed; 
    background-color: rgba(255, 255, 255, 0.8); 
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    display: flex; flex-direction: column; padding: 0; 
    z-index: 2147483647; min-width: 200px; white-space: nowrap; overflow: hidden;
    opacity: 0; visibility: hidden; transform: scale(0.8); transform-origin: top left;
    transition: opacity 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.2s; 
}

.account-dropdown-menu.show { opacity: 1; visibility: visible; transform: scale(1); }
.account-dropdown-menu a { display: flex; align-items: center; text-decoration: none; color: #1c1c1e; padding: 12px 16px; transition: background-color 0.1s; }
.account-dropdown-menu a:hover { background-color: rgba(0, 0, 0, 0.08); }
.menu-divider { height: 0.5px; background-color: rgba(0,0,0,0.15); margin: 0 16px; }
.menu-header-text { font-size: 0.75em; color: var(--text-muted); margin: 8px 16px 4px 16px; }
.dropdown-icon-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; margin-right: 12px; }
.menu-text { font-size: 15px; font-weight: 500; flex-grow: 1; }

/* --- メインコンテナ --- */
.container {
    padding: 30px; overflow-y: auto; width: 100%; height: 100vh;
    display: flex; flex-direction: column; opacity: 0; transition: opacity 0.5s ease-in-out;
}
.container.loaded { opacity: 1; }
.container.fading { opacity: 0; }

@supports (-webkit-touch-callout: none) {
    .sidebar { height: calc(-webkit-fill-available - 40px); }
    .container { height: -webkit-fill-available; }
}

h1 { margin: 0 auto; text-align: center; width: 150px; font-size: 42px; border-radius: 10px; }
p { margin-bottom: 15px; font-size: 16px; }

/* --- フォーム部品の個別調整 --- */
input[type="text"], input[type="email"], input[type="password"], input[name="code"], 
select, input[type="datetime-local"], input[type="date"], textarea[name="bio"] {
    width: 100%; padding: 12px; margin-top: 5px; outline: none; font-size: 14px;
    transition: all 0.3s ease-in-out;
    box-sizing: border-box; /* paddingで枠がはみ出ないように追加 */
}

textarea[name="bio"] { border-radius: 10px; height: 50px; }

input:focus, select:focus, textarea:focus {
    background: #8888884d !important;
}

/* トグルスイッチ（Checkbox） */
input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; margin-right: 10px;
    width: 40px; height: 20px; cursor: pointer; background-color: #e4e4e4;
    border-radius: 20px; position: relative; transition: background-color 0.3s ease;
    vertical-align: middle; margin-top: -0.2em;
}
input[type="checkbox"]::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    background-color: white; border-radius: 50%; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
input[type="checkbox"]:checked { background-color: var(--accent-color); }
input[type="checkbox"]:checked::after { transform: translateX(20px); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }

/* レンジスライダー */
input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; outline: none;
    border-radius: var(--glass-radius);
    backdrop-filter: blur(15px) saturate(150%) contrast(110%) brightness(102%);
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.1) 100%), radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.3), inset -4px -4px 15px rgba(255, 255, 255, 0.1), inset 1px 1px 3px rgba(255, 255, 255, 0.8);
    border: var(--glass-border); border-top: 1px solid rgba(255, 255, 255, 0.8);
}
input[type="range"]::-webkit-slider-runnable-track, input[type="range"]::-moz-range-track { height: 100%; background: transparent; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px;
    background: #ffffff; border: 2px solid var(--accent-color); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
input[type="range"]::-moz-range-thumb {
    width: 20px; height: 20px; background: #ffffff; border: 2px solid var(--accent-color); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ボタン調整 */
input[type="submit"], input[type="button"], button {
    width: 100%; padding: 12px; font-size: 16px; cursor: pointer;
    transition: background-color 0.3s ease; margin-top: 40px; margin-bottom: 10px;
    border-radius: var(--glass-radius); /* CSS関数 var() で呼び出し */
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover { background-color: var(--accent-hover); }

button[name="edit"], button[name="userchange"], button[name="logout"] { margin: 0 10px; width: 70px; font-size: 36px; }
#red_btn:hover { background: #ff0000; }

/* --- プロフィール --- */
.profile-section { border-radius: 10px; }
.profile-header { text-align: center; }
.profile-icon { width: 200px; height: 200px; border-radius: 50%; border: 3px solid var(--accent-color); margin-bottom: 1rem; }
.profile-name { font-size: 2rem; font-weight: bold; margin: 0.5rem 0; }
.profile-bio { margin-top: 1rem; text-align: center; }
.profile-control { display: flex; }

.icon-gallery { width: 100%; display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.icon-option { position: relative; display: inline-block; overflow-y: auto; height: 200px; }
#icon_selecter { display: none; padding: 20px; border: 1px solid #99999944; background: #88888833; border-radius: 5px; }
.icon-thumbnail { width: 60px; height: 60px; border-radius: 50%; border: 2px solid transparent; transition: transform 0.3s, border-color 0.3s; cursor: pointer; }
.icon-option input { display: none; }
.icon-option input:checked+.icon-thumbnail { border-color: #007bff; transform: scale(1.1); }

/* --- テーマ・設定 --- */
.theme-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-bottom: 20px; transition: 0.2s; }
.theme-container input[type="radio"] { display: none; }
.theme-item {
    cursor: pointer; display: flex; width: 260px; height: 120px; align-items: center; gap: 16px; padding: 10px; transition: 0.2s;
    border-radius: 20px; /* 一括設定から上書きしたいプロパティだけここに書く */
}
.theme-item:hover { transform: scale(1.05); background: var(--theme-hover-bg) !important; }
input[type="radio"]:checked+.theme-item { background: var(--accent-color) !important; transform: scale(1.05); }

.thumbnail { width: 100px; height: 100px; display: flex; flex-direction: column; justify-content: space-around; padding: 10px; font-size: 14px; text-align: center; border-radius: 10px; }
.theme-info { flex: 1; text-align: left; }
.theme-title { font-size: 20px; margin-bottom: 10px; }
.theme-description { font-size: 14px; line-height: 1.5; }

.color-thumbnail { display: inline-block; width: 40px; height: 40px; margin: 5px; cursor: pointer; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); background-size: cover; background-position: center; background-repeat: no-repeat; max-width: 40px; max-height: 40px; }
.color-thumbnail:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0, 180, 216, 0.2); border-color: var(--accent-color); }

.color-picker-button { display: inline-block; position: relative; width: 40px; height: 40px; margin: 5px; cursor: pointer; border-radius: 50%; border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.color-picker-button:hover { transform: scale(1.05); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); }
input[type="color"] { position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; cursor: pointer; border-radius: 50%; }

.color-picker-preview { border: 2px solid transparent; border-radius: 50%; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
.color-picker-preview:hover { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2); }

.font-selector { margin: 15px 0; }

/* --- ユーティリティ --- */
.description { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.error { color: #ff0000; width: 100%; font-size: 8px; padding: 0 10px; border-radius: 50px; }
.success-message { color: var(--accent-color); text-align: center; margin-bottom: 20px; }

/* テーブル */
table { width: 100%; border-collapse: collapse; margin: 20px 0; }
table, th, td { border: 1px solid var(--text-muted); }
th, td { padding: 12px; text-align: left; }
th { background-color: #99999950; }
tr { background-color: #77777750; }
tr:nth-child(even) { background-color: #88888850; }

kbd { display: inline-block; padding: 6px 10px; margin: 0 5px; font-size: 14px; font-weight: bold; color: #333; background-color: #eee; border-radius: 4px; border: 1px solid #ccc; box-shadow: 0 1px 0 #fff, 0 2px 0 #ccc inset; font-family: 'Courier New', Courier, monospace; }

/* --- メッセージ・タブ・アニメーション --- */
.message {
    color: var(--accent-color) !important; font-size: 12px; padding: 5px; width: 350px; position: fixed;
    bottom: 20px; left: 50%; text-align: center; transform: translateX(-50%); z-index: 100000;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInOut { 0% { opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }

.shake-once { animation: shakeonce 2.0s ease-in-out 1; transform-origin: center; }
@keyframes shakeonce {
    0% { transform: scale(1) rotate(0deg); }
    10%, 20% { transform: scale(2) rotate(0deg); text-shadow: 0 0 10px #ff660090; color: #ffaa00; }
    25%, 35% { transform: scale(2) rotate(-12deg); text-shadow: 0 0 10px #ff660090; color: #ffaa00; }
    30%, 40% { transform: scale(2) rotate(12deg); text-shadow: 0 0 10px #ff660090; color: #ffaa00; }
    45%, 90% { transform: scale(2) rotate(0deg); text-shadow: 0 0 10px #ff660090; color: #ffaa00; }
    100% { transform: scale(1) rotate(0deg); }
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }

.tab-item { width: 100px; padding: 10px 0; text-align: center; cursor: pointer; border-radius: 8px !important; }
.tab-item i { font-size: 24px; }
.tab-item input + i { animation: pop 0.35s ease; transition: 0.2s; color: #f0f0f050; cursor: pointer; }
.tab-item input:active + i { color: var(--accent-color); transform: scale(0.5); }
.tab-item input:checked + i { color: var(--accent-color); text-shadow: 0 0 5px var(--accent-color); transform: scale(1.2); }
.tab-name { display: block; margin-top: 6px; font-size: 12px; opacity: .8; }

@keyframes pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.5); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (prefers-color-scheme: dark) {
    .tab-item + i { color: #a4a4a4; }
}

@media screen and (max-width: 390px) {
    body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
    .theme-container { grid-template-columns: repeat(1, 1fr); }
}

/* =========================================
   6. 追加されたカスタム設定パネル用スタイル
      （HTMLを変更せずにスタイルを液状化で統一）
   ========================================= */

.custom-section {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: var(--glass-bg-strong);
    box-shadow: var(--glass-shadow-strong);
    border: var(--glass-border);
    border-top: var(--glass-border-top);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    color: var(--text-main);
}

.custom-section h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.color-palette {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.color-thumb {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.5);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.color-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.8);
    border-color: var(--accent-color);
}

.free-color-wrapper {
    position: relative;
    overflow: hidden;
}

.free-color-wrapper input[type="color"] {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 60px;
    height: 60px;
    opacity: 0;
    cursor: pointer;
}

.free-color-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 5px;
}

.free-color-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: bold;
}

#message-container {
    position: sticky;
    top: 10px;
    z-index: 1000;
    min-height: 50px;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* 既存のfont-previewを液状化で上書き */
#font-preview {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    background: var(--glass-bg-light) !important;
    box-shadow: var(--glass-shadow-light);
    border: var(--glass-border) !important;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1em;
}
