:root {
    --accent: #6BBFFF;
    --bg-field: #f2f2f7;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
}

body, html { 
    margin: 0; padding: 0; height: 100%; width: 100%;
    background: #000; overflow: hidden; font-family: -apple-system, sans-serif; 
}
button, select, input { border: none; outline: none; background: none; font-family: inherit; }

/* 自動非表示 */
.autohide { transition: opacity 0.6s ease, transform 0.6s ease; opacity: 1; }
.autohide.is-hidden { opacity: 0; pointer-events: none; }
.ui-container.is-hidden { transform: translateY(20px); }
body.hide-cursor { cursor: none; }

/* 初期画面のデザイン強化 */
.setup-overlay { position: fixed; inset: 0; background: #fff; z-index: 5000; display: flex; justify-content: center; align-items: center; }
.setup-card { text-align: center; width: 90%; max-width: 600px; animation: fadeInScale 0.8s cubic-bezier(0.2, 0, 0.2, 1); }
.hero-icon-box { 
    width: 140px; height: 140px; background: linear-gradient(135deg, #f5f5f7 0%, #e5e5ea 100%); 
    border-radius: 40px; display: flex; justify-content: center; align-items: center; margin: 0 auto 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.hero-icon-box img { width: 70px; height: 70px; opacity: 0.8; }
.setup-card h1 { font-size: 42px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.setup-card p { font-size: 18px; color: var(--text-sub); margin-bottom: 40px; }
.flat-start-btn { 
    background: var(--accent); color: #fff; padding: 18px 48px; border-radius: 16px; 
    font-size: 18px; font-weight: 700; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 15px rgba(0,122,255,0.3);
}
.flat-start-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* 全画面スライド配置 */
.slide-box { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; background: #000; width: 100vw; height: 100vh; }
.slide-box img, .slide-box canvas { width: 100%; height: 100%; object-fit: contain; }

/* 設定ウィンドウ */
.settings-window { background: #fff; width: 90%; max-width: 440px; border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,0.4); overflow: hidden; }
.settings-content { padding: 0 24px 30px; }
.grid-row { display: flex; gap: 12px; }
.field-group { flex: 1; margin-top: 16px; }
.pure-select, .pure-input {
    background: var(--bg-field); border-radius: 12px; padding: 12px 16px; font-size: 15px;
    font-weight: 600; width: 100%; box-sizing: border-box; color: var(--text-main);
}

/* 共通パネルアイテム (BGM・フォルダ用) */
.panel-item { display: flex; align-items: center; gap: 14px; background: var(--bg-field); border-radius: 12px; padding: 16px; cursor: pointer; transition: 0.2s; }
.panel-item:hover { background: #e5e5ea; }
.panel-icon { width: 40px; height: 40px; background: #fff; border-radius: 10px; display: flex; justify-content: center; align-items: center; color: var(--accent); }
.panel-icon svg { width: 22px; height: 22px; }
.panel-title { display: block; font-size: 14px; font-weight: 700; color: var(--text-main); }
.panel-hint { display: block; font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.vol-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pure-range { flex: 1; accent-color: var(--accent); }

/* 操作パネル */
.ui-container { position: fixed; bottom: 30px; left: 0; right: 0; display: flex; justify-content: center; z-index: 1000; }
.dock-bar { background: rgba(255,255,255,0.92); padding: 12px 24px; border-radius: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); min-width: 580px; backdrop-filter: blur(10px); }
.progress-bg { height: 4px; background: #e5e5ea; border-radius: 2px; margin-bottom: 10px; overflow: hidden; }
#progress-bar { height: 100%; background: var(--accent); width: 0%; }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.icon-btn-flat, .text-btn-flat { background: #f2f2f7; border-radius: 8px; padding: 8px 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.sep { width: 1px; height: 24px; background: #ddd; margin: 0 4px; }
.flip { transform: scaleX(-1); }

/* カウンター */
.glass-counter { position: fixed; top: 20px; left: 20px; background: rgba(0,0,0,0.5); color: #fff; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; z-index: 1000; backdrop-filter: blur(5px); }

/* モーダル */
.modal-dimmer { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 3000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.settings-header { padding: 24px 24px 0; display: flex; justify-content: space-between; align-items: center; }
.x-btn { font-size: 20px; color: var(--text-sub); cursor: pointer; }
.field-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 6px; }

/* アニメーション */
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.fx-fade { opacity: 0; z-index: 2; transition: opacity var(--s) ease; }
.fx-fade-in { opacity: 1; }
.fx-swipe { transform: translateX(100%); z-index: 2; transition: transform var(--s) cubic-bezier(0.2, 0, 0.2, 1); }
.fx-swipe-in { transform: translateX(0); }
.fx-swipe-out { transform: translateX(-100%); }

.hidden { display: none !important; }