/* =========================================
   AI名前ジェネレーター - スタイルシート
   ========================================= */

:root {
    --bg: #f8efff;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-hover: rgba(255, 255, 255, 0.95);
    --border: rgba(222, 191, 255, 0.6);
    --border-active: rgba(196, 140, 255, 0.8);
    --text-primary: #3f2660;
    --text-secondary: #7c5b99;
    --accent: #c996ff;
    --accent-glow: rgba(201, 150, 255, 0.35);
    --accent2: #ffb7cd;
    --accent2-glow: rgba(255, 183, 205, 0.35);
    --gold: #fbbf24;
    --success: #6aa6ff;
    --radius: 24px;
    --radius-sm: 16px;
    --transition: 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top left, #ffe6ff 0%, #fff5ff 35%, #fdf4fb 65%, #ffffff 100%);
    color: var(--text-primary);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    line-height: 1.7;
    overflow-x: hidden;
}

/* 背景オーブ */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}

.orb1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -200px; left: -200px;
    animation-delay: 0s;
}

.orb2 {
    width: 500px; height: 500px;
    background: var(--accent2);
    bottom: -100px; right: -100px;
    animation-delay: 3s;
}

.orb3 {
    width: 300px; height: 300px;
    background: #60a5fa;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* レイアウト */
.wrapper {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 52px 24px 72px;
}

/* ヘッダー */
.site-header {
    text-align: center;
    margin-bottom: 36px;
}

.header-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(255, 183, 205, 0.95), rgba(201, 150, 255, 0.95));
    color: #58286a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 999px;
    margin-bottom: 20px;
    box-shadow: 0 18px 40px rgba(255, 183, 205, 0.18);
}

.site-title {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(32px, 6vw, 52px);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-sub {
    display: block;
    font-size: 0.45em;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    -webkit-text-fill-color: var(--text-secondary);
    margin-bottom: 4px;
}

.site-desc {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.info-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.info-sep {
    color: var(--border);
}

/* メインカード */
.main-card {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(222, 191, 255, 0.75);
    border-radius: 36px;
    padding: 40px;
    backdrop-filter: blur(20px);
    margin-bottom: 32px;
    box-shadow: 0 30px 90px rgba(168, 113, 255, 0.12);
}

/* ステップ */
.step {
    margin-bottom: 32px;
    padding-bottom: 34px;
    border-bottom: 1px solid rgba(196, 140, 255, 0.2);
}

.step:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.step-num {
    font-family: 'Shippori Mincho', serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.6;
    line-height: 1;
    min-width: 48px;
}

.step-title {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 2px;
}

.step-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 選択カウンター */
.selected-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    transition: all var(--transition);
}

.selected-counter.has-selection {
    color: var(--accent);
    border-color: var(--border-active);
    background: var(--accent-glow);
}

#countNum {
    font-weight: 700;
    font-size: 15px;
}

/* タググリッド */
.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.tag-item {
    cursor: pointer;
}

.tag-item input[type="checkbox"] {
    display: none;
}

.tag-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(222, 191, 255, 0.65);
    background: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    color: #6f4d92;
    transition: all var(--transition);
    user-select: none;
    white-space: nowrap;
}

.tag-item input:checked + .tag-inner {
    background: linear-gradient(135deg, rgba(255, 229, 244, 0.95), rgba(220, 235, 255, 0.95));
    border-color: rgba(196, 140, 255, 0.8);
    color: #4f2c7f;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(210, 182, 255, 0.22);
}

.tag-inner:hover {
    background: rgba(255,255,255,1);
    border-color: rgba(196, 140, 255, 0.9);
    color: #4f2c7f;
}

.tag-icon {
    font-size: 14px;
}

.tags-group {
    margin-bottom: 22px;
}

.tags-group-title {
    font-size: 14px;
    font-weight: 700;
    color: #7b5f97;
    margin-bottom: 10px;
}

.input-textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(222, 191, 255, 0.7);
    background: rgba(255,255,255,0.95);
    color: #5f2c7f;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    box-shadow: inset 0 6px 18px rgba(0,0,0,0.04);
}

.input-textarea::placeholder {
    color: #b18bcc;
}

.count-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.count-item {
    cursor: pointer;
    flex: 1;
    min-width: 90px;
}

.count-item input[type="radio"] {
    display: none;
}

.count-inner {
    display: block;
    text-align: center;
    padding: 14px 18px;
    border-radius: 24px;
    border: 1px solid rgba(222, 191, 255, 0.7);
    background: rgba(255,255,255,0.95);
    font-size: 14px;
    color: #7b5f97;
    transition: all var(--transition);
}

.count-item input:checked + .count-inner {
    background: linear-gradient(135deg, rgba(255, 229, 244, 0.95), rgba(220, 235, 255, 0.95));
    border-color: rgba(196, 140, 255, 0.8);
    color: #4f2c7f;
    font-weight: 700;
}

.count-inner:hover {
    background: rgba(255,255,255,1);
}

/* クイックアクション */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.quick-btn:hover {
    border-color: rgba(255,255,255,0.2);
    color: var(--text-primary);
    background: var(--surface);
}

/* 言語オプション */
.lang-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lang-item {
    cursor: pointer;
    flex: 1;
    min-width: 100px;
}

.lang-item input[type="radio"] {
    display: none;
}

.lang-inner {
    display: block;
    text-align: center;
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    transition: all var(--transition);
    user-select: none;
}

.lang-item input:checked + .lang-inner {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 500;
}

.lang-inner:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* 生成ボタン */
.generate-btn {
    width: 100%;
    margin-top: 32px;
    padding: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 32px rgba(167, 139, 250, 0.3);
}

.generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    transition: opacity var(--transition);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(167, 139, 250, 0.5);
}

.generate-btn:hover::before { opacity: 0.08; }

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 結果カード */
.result-card {
    margin-top: 32px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(255, 246, 255, 0.95), rgba(244, 247, 255, 0.95));
    border: 1px solid rgba(222, 191, 255, 0.7);
    border-radius: 28px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 1.1, 0.45, 1);
}

.result-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #a673d4;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.result-name {
    margin-bottom: 24px;
}

.result-pre {
    margin: 0;
    padding: 0;
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    color: #4f2c7f;
    line-height: 1.2;
    white-space: pre-wrap;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 20px;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
}

.copy-btn,
.text-btn,
.keep-btn,
.doc-btn {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(222, 191, 255, 0.7);
    color: #5f2c7f;
}

.copy-btn:hover,
.text-btn:hover,
.keep-btn:hover,
.doc-btn:hover {
    background: rgba(255,255,255,1);
    transform: translateY(-1px);
}

.copy-btn {
    background: rgba(255,255,255,0.95);
    border-color: rgba(222, 191, 255, 0.8);
    color: #5f2c7f;
}

.dl-btn {
    background: rgba(255, 229, 244, 0.85);
    border: 1px solid rgba(196, 140, 255, 0.8);
    color: #5f2c7f;
}

.dl-btn:hover {
    background: rgba(255, 233, 244, 0.95);
}

/* 履歴セクション */
.history-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 32px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.history-title {
    font-size: 15px;
    font-weight: 500;
}

.clear-history-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.clear-history-btn:hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    gap: 8px;
}

.history-item:hover {
    background: var(--surface-hover);
    border-color: var(--border-active);
}

.history-name {
    font-size: 14px;
    font-family: 'Shippori Mincho', serif;
    font-weight: 700;
}

.history-copy {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* フッター */
.site-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--success);
    color: #0d2a1f;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 28px;
    border-radius: 100px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* エラーバナー */
.error-banner {
    background: rgba(1, 1, 1, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #dc2626; /* 鮮やかな赤に変更 */
    font-weight: 700;
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .main-card {
        padding: 24px 20px;
    }

    .lang-options {
        gap: 8px;
    }

    .history-list {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}
