/* ===================================
   Your App Library - スタイルシート
   Modern App Launcher Design
   =================================== */

/* CSS変数 - デザインシステム */
:root {
    /* カラーパレット */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #1e1e2e;
    --accent: #22d3ee;
    --accent-pink: #f472b6;

    /* ブランドカラー */
    --twitch: #9147ff;
    --twitch-dark: #772ce8;
    --youtube: #ff0000;
    --youtube-dark: #cc0000;
    --instagram-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    --instagram: #e4405f;

    /* 背景色 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-hover: rgba(139, 92, 246, 0.1);
    --bg-active: rgba(139, 92, 246, 0.2);

    /* テキスト */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* グラス効果 */
    --glass-bg: rgba(18, 18, 26, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: rgba(255, 255, 255, 0.05);

    /* サイズ */
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;

    /* トランジション */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* シャドウ */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
}

/* リセット & ベース */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: inherit;
    background: transparent;
}

input {
    font-family: inherit;
    font-size: inherit;
}

.hidden {
    display: none !important;
}

/* ===================================
   アプリコンテナ & 背景エフェクト
   =================================== */
.app-container {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(34, 211, 238, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 20% 90%, rgba(244, 114, 182, 0.1), transparent);
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: rgba(139, 92, 246, 0.15);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: rgba(34, 211, 238, 0.1);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: rgba(244, 114, 182, 0.1);
    bottom: 20%;
    left: 10%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

/* ===================================
   メインコンテンツ
   =================================== */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px 100px;
}

/* ===================================
   ヘッダー
   =================================== */
.app-header {
    text-align: center;
    margin-bottom: 80px;
}

.main-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    text-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
}

.title-icon {
    font-size: 0.5em;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===================================
   セクションタイトル
   =================================== */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.section-icon {
    font-size: 0.7em;
    color: var(--primary-light);
}

/* ===================================
   Original-App セクション
   =================================== */
.original-apps-section {
    margin-bottom: 80px;
}

.original-apps-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

/* アプリカード（長方形ボタン） */
.app-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 40px;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, var(--glass-shine) 50%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.15);
}

.app-card:hover::before {
    opacity: 1;
}

.app-card:active {
    transform: translateY(-4px);
}

.app-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: transform var(--transition-fast);
}

.app-card:hover .brand-icon {
    transform: scale(1.1);
}

.app-card-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.app-card-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 70%);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.app-card:hover .app-card-shine {
    transform: translateX(100%) rotate(45deg);
}

/* Twitch スタイル */
.app-card-twitch {
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.15), rgba(145, 71, 255, 0.05));
    border-color: rgba(145, 71, 255, 0.3);
}

.app-card-twitch:hover {
    border-color: var(--twitch);
    box-shadow: 0 8px 40px rgba(145, 71, 255, 0.3);
}

.twitch-icon {
    color: var(--twitch);
}

/* YouTube スタイル */
.app-card-youtube {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(255, 0, 0, 0.04));
    border-color: rgba(255, 0, 0, 0.3);
}

.app-card-youtube:hover {
    border-color: var(--youtube);
    box-shadow: 0 8px 40px rgba(255, 0, 0, 0.25);
}

.youtube-icon {
    color: var(--youtube);
}

/* Instagram スタイル */
.app-card-instagram {
    background: linear-gradient(135deg, rgba(228, 64, 95, 0.12), rgba(188, 24, 136, 0.08));
    border-color: rgba(228, 64, 95, 0.3);
}

.app-card-instagram:hover {
    border-color: var(--instagram);
    box-shadow: 0 8px 40px rgba(228, 64, 95, 0.25);
}

.instagram-icon {
    color: var(--instagram);
}

/* ===================================
   Library セクション
   =================================== */
.library-section {
    margin-bottom: 40px;
}

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

.library-header .section-title {
    margin-bottom: 0;
}

.add-folder-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.add-folder-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}

.add-folder-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Library グリッド */
.library-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    min-height: 150px;
    padding: 20px;
    /* 背景と枠線を削除して完全に透過 */
}

.library-grid:empty::after {
    content: 'ウェブサイトを追加してライブラリを作成しましょう';
    color: var(--text-muted);
    font-size: 0.95rem;
    width: 100%;
    text-align: center;
    padding: 40px;
}

/* Library アイテム（Original-App風の横長カード） */
.library-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    min-width: 220px;
    background: linear-gradient(135deg, rgba(var(--item-color-rgb, 255, 255, 255), 0.15), rgba(var(--item-color-rgb, 255, 255, 255), 0.05));
    border: 1px solid rgba(var(--item-color-rgb, 255, 255, 255), 0.3);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

.library-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.library-item:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(var(--item-color-rgb, 255, 255, 255), 0.2), rgba(var(--item-color-rgb, 255, 255, 255), 0.08));
    border-color: var(--item-color, var(--primary));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(var(--item-color-rgb, 139, 92, 246), 0.3);
}

.library-item:hover::before {
    opacity: 1;
}

.library-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.library-item.drag-over {
    background: var(--bg-active);
}



.library-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}


.library-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.library-icon.default-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.library-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
}

.library-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* フォルダアイテム */
.library-item.folder-item {
    border-left: 4px solid var(--item-color, var(--primary));
    background: rgba(var(--item-color-rgb, 139, 92, 246), 0.05);
}

.library-item.folder-item .library-icon {
    background: linear-gradient(135deg, rgba(var(--item-color-rgb, 139, 92, 246), 0.2), rgba(var(--item-color-rgb, 139, 92, 246), 0.05));
    border-color: rgba(var(--item-color-rgb, 139, 92, 246), 0.3);
}

.library-item.folder-item:hover {
    background: rgba(var(--item-color-rgb, 139, 92, 246), 0.1);
    box-shadow: 0 0 25px rgba(var(--item-color-rgb, 139, 92, 246), 0.2);
}

.folder-icon {
    fill: var(--item-color, var(--primary-light)) !important;
}

/* Twitch風ライブラリアイテム */
.library-item.library-item-twitch {
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.15), rgba(145, 71, 255, 0.05));
    border: 1px solid rgba(145, 71, 255, 0.3);
    border-left: 4px solid #9147ff;
}

.library-item.library-item-twitch .library-icon {
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.3), rgba(145, 71, 255, 0.1));
}

.library-item.library-item-twitch .library-name {
    color: #bf94ff;
}

.library-item.library-item-twitch:hover {
    border-color: #9147ff;
    box-shadow: 0 8px 40px rgba(145, 71, 255, 0.35), 0 0 20px rgba(145, 71, 255, 0.3);
    background: linear-gradient(135deg, rgba(145, 71, 255, 0.2), rgba(145, 71, 255, 0.08));
}

/* YouTube風ライブラリアイテム */
.library-item.library-item-youtube {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(255, 0, 0, 0.04));
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-left: 4px solid #ff0000;
}

.library-item.library-item-youtube .library-icon {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.25), rgba(255, 0, 0, 0.08));
}

.library-item.library-item-youtube .library-name {
    color: #ff6b6b;
}

.library-item.library-item-youtube:hover {
    border-color: #ff0000;
    box-shadow: 0 8px 40px rgba(255, 0, 0, 0.3), 0 0 20px rgba(255, 0, 0, 0.25);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.18), rgba(255, 0, 0, 0.06));
}

/* アイテム追加ボタン */
.add-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin: 32px auto 0;
    padding: 16px 32px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius-lg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.add-item-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.add-item-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ===================================
   モーダル
   =================================== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 420px;
    padding: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    backdrop-filter: blur(24px);
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border-radius: 50%;
    font-size: 24px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* フォーム */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.form-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 24px;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-secondary);
}

.form-group select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ボタン */
.btn-primary {
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* 確認ダイアログ */
.confirm-dialog {
    text-align: center;
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ===================================
   フォルダビュー
   =================================== */
.folder-view-overlay {
    background: rgba(10, 10, 15, 0.95);
}

.folder-view-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    padding: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    animation: folderOpen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
}

@keyframes folderOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.folder-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.folder-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.folder-back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.folder-back-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.folder-view-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.folder-actions {
    display: flex;
    gap: 8px;
}

.folder-edit-btn,
.folder-delete-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.folder-edit-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-light);
}

.folder-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.folder-edit-btn svg,
.folder-delete-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.folder-view-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    justify-content: center;
    min-height: 100px;
    padding: 10px;
}

.folder-view-grid:empty::after {
    content: 'フォルダが空です';
    color: var(--text-muted);
    grid-column: 1 / -1;
    text-align: center;
}

.add-to-folder-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.add-to-folder-btn:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    color: var(--text-primary);
}

.add-to-folder-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ===================================
   トースト通知
   =================================== */
#toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    border-color: rgba(34, 211, 238, 0.4);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.4);
}

.toast-message {
    font-weight: 500;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ===================================
   コンテキストメニュー
   =================================== */
.context-menu {
    position: fixed;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
    padding: 8px 0;
    min-width: 160px;
    z-index: 1500;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.15s ease;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    transition: background var(--transition-fast);
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item.danger {
    color: #ef4444;
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.context-menu-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ===================================
   レスポンシブ
   =================================== */
@media (max-width: 768px) {
    :root {
        --border-radius: 10px;
        --border-radius-lg: 16px;
    }

    html {
        font-size: 14px;
    }

    .main-content {
        padding: 30px 16px 60px;
    }

    .app-header {
        margin-bottom: 40px;
    }

    .main-title {
        flex-direction: column;
        gap: 8px;
        font-size: 3rem;
    }

    .title-icon {
        display: none;
    }

    .original-apps-section {
        margin-bottom: 40px;
    }

    .app-card {
        min-width: 160px;
        padding: 14px 20px;
        gap: 12px;
    }

    .app-card-icon {
        width: 32px;
        height: 32px;
    }

    .app-card-name {
        font-size: 1.1rem;
    }

    .library-header {
        margin-bottom: 24px;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(76px, 1px));
        /* Scaled down */
        gap: 16px;
        padding: 16px;
    }

    .library-icon {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .library-name {
        font-size: 0.7rem;
        max-width: 76px;
    }

    .add-item-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        margin-top: 24px;
    }

    .modal-content {
        padding: 24px;
    }

    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 40px 16px 80px;
    }

    .main-title {
        gap: 10px;
        margin-bottom: 8px;
    }

    .original-apps-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 8px;
    }

    .app-card {
        min-width: 100%;
        padding: 16px 24px;
        justify-content: flex-start;
        gap: 12px;
    }

    .app-card-name {
        font-size: 1.2rem;
    }

    .app-card-icon {
        width: 36px;
        height: 36px;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .library-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .add-folder-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 80px));
        gap: 16px;
        padding: 12px;
    }

    .library-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .library-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }
}

/* ===================================
   Information リンクスタイル
   =================================== */
.info-link-section {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.info-entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 24px 32px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
}

.info-entry-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(34, 211, 238, 0.2);
}

.info-card-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-card-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.info-card-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.info-card-text {
    display: flex;
    flex-direction: column;
}

.info-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    /* ネオンパープル */
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.info-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-card-arrow {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.info-entry-card:hover .info-card-arrow {
    transform: translateX(5px);
    color: var(--accent);
}

.info-card-arrow svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

@media (max-width: 480px) {
    .info-entry-card {
        padding: 20px;
    }

    .info-card-title {
        font-size: 1.3rem;
    }

    .info-card-desc {
        font-size: 0.8rem;
    }

    .info-card-icon {
        width: 44px;
        height: 44px;
    }

    .info-card-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ===================================
   ドラッグ＆ドロップ
   =================================== */
.library-item[draggable="true"] {
    cursor: grab;
}

.library-item[draggable="true"]:active {
    cursor: grabbing;
}

.drag-placeholder {
    background: var(--bg-active);
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius);
    opacity: 0.5;
}