:root {
    --brand-gradient: linear-gradient(135deg, #7928ca, #ff0080);
    --brand-primary: #7928ca;
    --text-deep: #2a1b3d;
    --brand-medium: #a64bf4;
    --brand-light: #f3eaff;
    --border-purple: #e0d4fc;
    --bg-main: #f8f9fa;
    --color-gold: #f59f00;
    --surface: #ffffff;
    --text-muted: #777777;
    --border-light: #e5e5e5;
    --input-bg: #fcfcfc;
    --danger-text: #c0392b;
    --danger-bg: #fff0f0;
}

[data-theme="dark"] {
    --brand-primary: #b388f5;
    --text-deep: #f1ecfb;
    --brand-medium: #c49bf7;
    --brand-light: #33294a;
    --border-purple: #453a63;
    --bg-main: #14111c;
    --color-gold: #ffc94d;
    --surface: #211c2e;
    --text-muted: #a79cc0;
    --border-light: #3a3350;
    --input-bg: #2a2438;
    --danger-text: #ff7a7a;
    --danger-bg: #3a2030;
}

/* エラーバナー（ルーム画面と同じ見た目・同じ挙動） */
.error-banner {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    background: var(--danger-bg); color: var(--danger-text); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 20px; font-size: 0.9em; font-weight: bold; line-height: 1.5;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.error-banner.fade-out { opacity: 0; transform: translateY(-8px); }
.error-banner button { background: none; border: none; color: inherit; font-weight: bold; cursor: pointer; font-size: 1em; flex-shrink: 0; }
/* 右上固定の.theme-toggle（top:16px right:16px width:42px）が、画面が狭いと
   バナー右端の✕に重なって押せなくなるため、その幅ぶんだけ内側に寄せる */
@media (max-width: 640px) {
    .error-banner { padding-right: 56px; }
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-main); color: var(--text-deep); margin: 0; transition: background-color 0.2s, color 0.2s;
}
.container { max-width: 480px; margin: 0 auto; padding: 20px; padding-bottom: 60px; }

.box {
    padding: 25px; border-radius: 16px; margin-bottom: 24px; background: var(--surface);
    box-shadow: 0 10px 30px -5px rgba(121, 40, 202, 0.15); border: 1px solid rgba(121, 40, 202, 0.05);
    box-sizing: border-box;
}

.theme-toggle {
    position: fixed; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border-purple); cursor: pointer;
    font-size: 1.1em; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(121, 40, 202, 0.15); z-index: 100; transition: all 0.2s;
}
.theme-toggle:hover { transform: translateY(-2px); }

h1, h2, h3 { margin-top: 0; font-weight: bold; color: var(--brand-primary); }

/* --- ヒーロー --- */
.hero { text-align: center; margin-top: 36px; margin-bottom: 32px; }
.logo {
    font-size: 2.2em; font-weight: 900; letter-spacing: 1px;
    background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 8px;
}
.hero p.catch { font-size: 1.05em; font-weight: bold; margin: 6px 0 4px; }
.hero p.sub { font-size: 0.9em; color: var(--text-muted); margin: 0; }
.badge-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border-purple); color: var(--brand-primary);
    font-size: 0.78em; font-weight: bold; box-shadow: 0 2px 8px rgba(121, 40, 202, 0.08);
}

/* --- 利用シーン --- */
.usecase-box { padding: 20px 25px; }
.usecase-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.usecase-chip {
    padding: 8px 16px; border-radius: 20px; background: var(--brand-light);
    color: var(--brand-primary); font-size: 0.85em; font-weight: 600;
}

/* --- 使い方ガイド --- */
.guide-box { padding: 20px 25px; }
.guide-step { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.guide-step:last-child { margin-bottom: 0; }
.guide-num {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-gradient);
    color: white; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 0.9em;
}
.guide-text { padding-top: 3px; }
.guide-text .title { font-weight: bold; font-size: 0.95em; margin-bottom: 2px; }
.guide-text .desc { font-size: 0.85em; color: var(--text-muted); line-height: 1.5; }

/* --- フォーム --- */
.input-field {
    padding: 14px; border: 2px solid var(--border-purple); border-radius: 12px;
    font-size: 16px; width: 100%; box-sizing: border-box; background: var(--input-bg); transition: 0.2s; color: var(--text-deep);
}
.input-field:focus { outline: none; border-color: var(--brand-primary); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-light); }

.field-label { display: block; font-size: 0.85em; font-weight: bold; color: var(--brand-primary); margin-bottom: 6px; }
.member-fields input { margin-bottom: 8px; }
.member-fields input:last-child { margin-bottom: 0; }

.btn-create-room {
    width: 100%; margin-top: 22px; padding: 16px; background: var(--brand-gradient); color: white; border: none;
    border-radius: 12px; font-weight: 900; font-size: 1.1em; cursor: pointer; letter-spacing: 1px;
    box-shadow: 0 10px 25px -5px rgba(121, 40, 202, 0.5); transition: all 0.3s; box-sizing: border-box;
}
.btn-create-room:hover { transform: translateY(-3px) scale(1.02); filter: brightness(1.1); }

.btn-create-room-hero { display: block; text-align: center; text-decoration: none; margin-top: 24px; }

.footer-note { text-align: center; font-size: 0.8em; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }

/* --- クイック作成画面（ルーム内の「新しいルーム」から来た時の最短ルート） --- */
/* 右上のテーマ切替ボタン(position:fixed)と重なってボタンが押せなくなるため、
   その幅ぶんの余白を右に確保しておく */
.quick-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; margin-bottom: 28px; padding-right: 46px; }
.quick-header .logo { font-size: 1.4em; margin-bottom: 0; }

.btn-small {
    padding: 10px 14px; min-height: 40px; box-sizing: border-box; display: inline-flex; align-items: center;
    font-size: 13px; cursor: pointer; background: var(--brand-light); border: none; border-radius: 20px;
    color: var(--brand-primary); text-decoration: none; transition: 0.2s; font-weight: bold;
    white-space: nowrap; flex-shrink: 0;
}
.btn-small:hover { filter: brightness(0.95); }

/* --- ルーム一覧 --- */
.hidden { display: none !important; }
.my-rooms-entry {
    display: inline-block; margin-top: 16px; font-size: 0.85em; font-weight: bold;
    color: var(--brand-primary); text-decoration: none; padding: 8px 16px; border-radius: 20px;
    border: 1px solid var(--border-purple); background: var(--surface); transition: 0.2s;
}
.my-rooms-entry:hover { filter: brightness(0.97); }
.my-rooms-box { padding: 20px 25px; }
.my-rooms-empty { font-size: 0.85em; color: var(--text-muted); line-height: 1.6; margin: 0 0 14px; }
.my-room-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; border-radius: 12px; background: var(--brand-light);
    margin-bottom: 8px;
}
.my-room-item:last-child { margin-bottom: 0; }
.my-room-link {
    color: var(--brand-primary); font-weight: bold; text-decoration: none; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.my-room-remove {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--surface); color: var(--text-muted); font-size: 0.85em;
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.my-room-remove:hover { filter: brightness(0.95); }
/* 貼り付けて追加＝この画面の正規の手順なので、一覧と区切って見出しを付ける */
.my-room-add-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-light); }
.my-room-add-label { font-size: 0.85em; font-weight: bold; color: var(--brand-primary); margin: 0 0 8px; }
.my-room-add-help { font-size: 0.78em; color: var(--text-muted); line-height: 1.6; margin: 10px 0 0; }
.my-room-add-row { display: flex; gap: 8px; }
.my-room-add-row .input-field { padding: 10px 12px; font-size: 0.9em; }
.my-room-add-btn {
    flex-shrink: 0; padding: 0 18px; border-radius: 12px; border: none; cursor: pointer;
    background: var(--brand-primary); color: white; font-weight: bold; font-size: 0.9em; transition: 0.2s;
}
.my-room-add-btn:hover { filter: brightness(1.1); }
.my-room-add-btn:disabled { opacity: 0.6; cursor: default; }
/* 追加結果の案内。成功・失敗どちらもここに出す（.is-error の時だけ赤くする） */
.my-room-status { font-size: 0.8em; color: var(--text-muted); margin: 10px 0 0; line-height: 1.6; }
.my-room-status.is-error { color: var(--danger-text); }

