:root {
  --bg: #0f1115;
  --panel: rgba(20, 24, 32, 0.9);
  --text: #e6e8ee;
  --muted: #a7adbb;
  --accent: #3b82f6;
  --accent-weak: rgba(59, 130, 246, 0.2);
  --btn: #1b2230;
  --btn-hover: #223147;
  --btn-active: #2b3f63;
  --border: #2a3242;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --selector-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

#app {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-rows: 1fr var(--selector-h);
  overflow: hidden;
}

/* 左上タイトル */
.title-badge {
  position: fixed;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(35, 46, 68, 0.9), rgba(25, 32, 48, 0.9));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 10;
  user-select: none;
}

/* iframe ビューア */
.viewer {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0b0d12;
}

.viewer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #0b0d12;
}

/* 下部セレクター */
.selector {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: saturate(120%) blur(8px);
}

.selector-inner {
  max-width: 100%;
  margin: 0 auto;
  height: var(--selector-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  justify-content: flex-start;
  overflow-x: auto;       /* 横スクロール許可 */
  overflow-y: hidden;
  white-space: nowrap;    /* 折り返さない */
  -webkit-overflow-scrolling: touch; /* iOS慣性スクロール */
}

.sel-btn {
  flex: 0 0 auto;         /* ボタン幅固定で縮まない */
}

.sel-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--btn);
  color: var(--text);
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.02s ease, border-color 0.15s ease;
}

.sel-btn:hover:not(:disabled) {
  background: var(--btn-hover);
  border-color: #35425a;
}

.sel-btn:active:not(:disabled) {
  background: var(--btn-active);
  transform: translateY(1px);
}

.sel-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.sel-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
