/* 上映スケジュール比較アプリのスタイル（スマホ優先） */
:root {
  --bg: #ffffff;
  --panel: #f4f5f7;
  --panel2: #eceef2;
  --text: #1d2129;
  --sub: #6b7280;
  --accent: #3b6fd4;
  --line: #e2e4e9;
  --col-alt: #f5f6f8;   /* 交互カラムのごく薄いグレー */
  --gold: #c99a1e;
  --gutter-w: 3.2rem;
  --col-w: 7.9rem;
  --px-per-min: 0.8px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }  /* class側のdisplay指定よりhidden属性を優先 */
html, body { height: 100%; }
body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  overscroll-behavior: none;
}

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: max(env(safe-area-inset-top), 8px) 12px 8px;
}
.title-row { display: flex; align-items: baseline; justify-content: space-between; }
h1 { font-size: 1.05rem; }
.generated-at { font-size: .65rem; color: var(--sub); }

.date-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.date-tabs::-webkit-scrollbar { display: none; }
.date-tab {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 10px;
  background: var(--panel); color: var(--sub);
  border: 1px solid var(--line); font-size: .8rem; line-height: 1.2;
  text-align: center; cursor: pointer;
}
.date-tab .dow { display: block; font-size: .65rem; }
.date-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.date-tab .sat { color: #2e6bd6; } .date-tab .sun { color: #d6452e; }
.date-tab.active .sat, .date-tab.active .sun { color: #fff; }

.movie-bar { display: flex; gap: 8px; align-items: flex-start; padding-top: 6px; }
.pick-btn {
  flex: 0 0 auto; padding: 8px 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; padding: 6px 8px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; cursor: pointer;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .x { color: var(--sub); font-weight: 700; }

/* ---------- ボード ---------- */
.board-wrap { flex: 1; overflow: auto; position: relative; }
.empty-msg { color: var(--sub); font-size: .85rem; padding: 32px 20px; text-align: center; line-height: 1.7; }
.board { display: flex; width: max-content; min-width: 100%; }

.time-gutter {
  position: sticky; left: 0; z-index: 20;
  width: var(--gutter-w); flex: 0 0 var(--gutter-w);
  background: var(--bg); border-right: 1px solid var(--line);
}
.time-label {
  position: absolute; right: 6px; transform: translateY(-50%);
  font-size: .65rem; color: var(--sub);
}
.gutter-head { position: sticky; top: 0; height: 2.6rem; background: var(--bg); z-index: 21; border-bottom: 1px solid var(--line); }

.columns { display: flex; }
.col { width: var(--col-w); flex: 0 0 var(--col-w); border-right: 1px solid var(--line); position: relative; }
.col:nth-child(even) { background: var(--col-alt); }  /* カラムを交互に薄グレーに */
.col-head {
  position: sticky; top: 0; z-index: 10; height: 2.6rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
  gap: 5px;
  font-size: .72rem; font-weight: 600; line-height: 1.25; padding: 0 6px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.col-head .logo {
  width: 16px; height: 16px; flex: 0 0 16px;
  border-radius: 4px; background: #fff;
}
.col:nth-child(even) .col-head { background: var(--panel2); }
.col-body { position: relative; }
.hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.gutter-body { position: relative; }

.show-block {
  position: absolute;
  border-radius: 8px; padding: 4px 6px; overflow: hidden;
  font-size: .68rem; line-height: 1.3; cursor: pointer;
  border: 1px solid rgba(0,0,0,.1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.show-block .t { color: var(--movie-color, var(--text)); filter: brightness(.75); }
.show-block .meta { color: var(--sub); }
/* プレミアムシートのあるスクリーンはゴールドの縁取り */
.show-block.premium {
  border: 4px solid var(--gold);
  box-shadow: 0 0 6px rgba(201,154,30,.5);
}
.show-block .t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.show-block .time { font-variant-numeric: tabular-nums; opacity: .95; }
.show-block .meta { opacity: .85; font-size: .62rem; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid #ff5252; z-index: 5; pointer-events: none; }

/* ---------- シート（映画選択・詳細） ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh;
  background: var(--panel); border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-head { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
#movie-search {
  flex: 1; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: .9rem; outline: none;
}
.close-btn { border: none; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 14px; font-weight: 600; cursor: pointer; }
.movie-list { list-style: none; overflow-y: auto; padding: 6px 0; }
.movie-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  font-size: .85rem; cursor: pointer;
}
.movie-list li .cnt { margin-left: auto; color: var(--sub); font-size: .7rem; flex: 0 0 auto; }
.movie-list li .cb {
  width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px;
  border: 2px solid var(--sub); display: grid; place-items: center; font-size: .7rem;
}
.movie-list li.sel .cb { background: var(--accent); border-color: var(--accent); color: #fff; }

.detail-body { padding: 16px 16px 24px; gap: 6px; }
.detail-body h2 { font-size: 1rem; margin-bottom: 8px; }
.detail-body .row { display: flex; gap: 8px; font-size: .85rem; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.detail-body .row .k { color: var(--sub); flex: 0 0 7em; }
.note { color: var(--sub); font-size: .7rem; margin-top: 10px; line-height: 1.6; }
