/* ============================================================
 * Stage Timetable — Full Redesign
 * - Hero / Notice / Mプロ・Aステ Intro / Day Tabs
 * - Desktop: time grid (vertical=time, horizontal=stage)
 * - Mobile (<768px): card list view (no horizontal scroll)
 * - Current-time red line with pulsing dot
 * - Legend
 * ============================================================ */

body { background: #f6dc9f; color: #1a1207; }

.timetable_main {
  min-height: 100vh;
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* ---- Hero ---- */
.tt_hero {
  position: relative;
  padding: 130px 24px 50px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.45), transparent 55%),
    linear-gradient(180deg, #dab584 0%, #f6dc9f 100%);
}

.tt_label {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(26,18,7,.5);
  margin-bottom: 14px;
}

.tt_hero h1 {
  font-family: "Zen Old Mincho", serif;
  font-weight: 900;
  font-size: clamp(30px, 6vw, 54px);
  letter-spacing: .08em;
  line-height: 1.2;
}

.tt_hero p:last-child {
  max-width: 780px;
  margin: 18px auto 0;
  font-family: "Shippori Mincho", serif;
  line-height: 1.95;
  color: rgba(26,18,7,.7);
}

/* ---- Weather Notice ---- */
.tt_notice {
  max-width: 1080px;
  margin: 24px auto 0;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(26,18,7,.08);
  box-shadow: 0 12px 34px rgba(26,18,7,.08);
  font-family: "Noto Sans JP", sans-serif;
  text-align: left;
  transition: .3s ease;
}

.tt_notice[data-weather="sunny"] {
  border-color: rgba(224,159,39,.45);
  background: linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,231,159,.7));
}

.tt_notice[data-weather="sunny"] .tt_notice_icon { color: #e09a27; }

.tt_notice[data-weather="rainy"] {
  border-color: rgba(71,111,159,.4);
  background: linear-gradient(135deg, rgba(255,255,255,.85), rgba(184,211,238,.7));
}

.tt_notice[data-weather="rainy"] .tt_notice_icon { color: #476f9f; }

.tt_notice[data-weather="error"] {
  border-color: rgba(223,31,37,.4);
  background: linear-gradient(135deg, rgba(255,255,255,.85), rgba(255,210,210,.7));
}

.tt_notice_icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.6);
}

.tt_notice_text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  font-size: 15px;
  color: #1a1207;
}

.tt_notice_text strong { font-weight: 800; font-size: 16px; }

.tt_notice_sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(26,18,7,.55);
  letter-spacing: .06em;
}

/* ---- Mプロ・Aステ description ---- */
.tt_stage_intro {
  max-width: 1080px;
  margin: 18px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tt_intro_card {
  padding: 22px 22px 20px;
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(26,18,7,.08);
  box-shadow: 0 10px 28px rgba(26,18,7,.07);
}

.tt_intro_head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tt_intro_mark {
  font-family: "Zen Old Mincho", serif;
  font-size: 26px;
  color: #8b6914;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(139,105,20,.25));
}

.tt_intro_card h2 {
  font-family: "Zen Old Mincho", serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
}

.tt_intro_card p {
  white-space: pre-line;
  font-family: "Shippori Mincho", serif;
  line-height: 1.95;
  color: rgba(26,18,7,.74);
  font-size: 15px;
}

/* ---- Day Tabs ---- */
.tt_day_tabs {
  max-width: 760px;
  margin: 26px auto 18px;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-radius: 999px;
  background: rgba(26,18,7,.08);
  border: 1px solid rgba(26,18,7,.06);
}

.tt_day_tab {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: transparent;
  color: rgba(26,18,7,.65);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: .25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tt_day_tab_label { font-size: 15px; }

.tt_day_tab_date {
  font-weight: 400;
  opacity: .75;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26,18,7,.06);
}

.tt_day_tab.active {
  background: #1a1207;
  color: #f6dc9f;
  box-shadow: 0 8px 18px rgba(26,18,7,.18);
}

.tt_day_tab.active .tt_day_tab_date {
  background: rgba(246,220,159,.18);
  color: #f6dc9f;
}

.tt_day_tab:focus-visible {
  outline: 2px solid #8b6914;
  outline-offset: 3px;
}

/* ---- Board section ---- */
.tt_board_section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.tt_board_meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tt_meta_chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(26,18,7,.1);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  color: rgba(26,18,7,.78);
}

.tt_meta_chip strong {
  font-weight: 800;
  color: #1a1207;
}

.tt_board_hint {
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  color: rgba(26,18,7,.6);
}

.tt_board_hint svg { flex: 0 0 auto; }

.tt_board_hint_red {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 999px;
  background: #df1f25;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ---- Desktop grid view ---- */
.tt_board_wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(26,18,7,.08);
  box-shadow: 0 18px 44px rgba(26,18,7,.1);
  scrollbar-width: thin;
}

.tt_board_wrap::-webkit-scrollbar { height: 8px; }
.tt_board_wrap::-webkit-scrollbar-thumb { background: rgba(26,18,7,.25); border-radius: 99px; }
.tt_board_wrap::-webkit-scrollbar-track { background: rgba(26,18,7,.05); }

.tt_board {
  --time-col: 76px;
  position: relative;
  min-width: 1000px;
  height: var(--tt-height);
  padding-left: var(--time-col);
  box-sizing: border-box;
}

/* ---- Time rail ---- */
.tt_corner {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--time-col);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(26,18,7,.6);
  background: rgba(246,220,159,.95);
  border-right: 1px solid rgba(26,18,7,.1);
  border-bottom: 1px solid rgba(26,18,7,.12);
  z-index: 6;
}

.tt_time_label {
  position: absolute;
  left: 0;
  width: var(--time-col);
  transform: translateY(-50%);
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 11px;
  color: rgba(26,18,7,.5);
  z-index: 5;
  pointer-events: none;
  padding: 2px 4px;
  line-height: 1;
}

/* FIXED: hour labels always visible with solid background */
.tt_time_label.is_hour {
  font-weight: 800;
  font-size: 13px;
  color: #1a1207;
  background: rgba(246,220,159,.92);
  border-radius: 4px;
  padding: 3px 6px;
  z-index: 6;
}

/* Non-hour labels: subtle background to prevent overlap */
.tt_time_label:not(.is_hour) {
  background: rgba(246,220,159,.7);
  border-radius: 3px;
}

.tt_grid_line {
  position: absolute;
  left: var(--time-col);
  right: 0;
  height: 1px;
  background: rgba(26,18,7,.06);
  z-index: 1;
}

.tt_grid_line.is_hour {
  background: rgba(26,18,7,.18);
  height: 1.5px;
}

/* ---- Stage columns ---- */
.tt_stage_columns {
  position: absolute;
  left: var(--time-col);
  right: 0;
  top: 0;
  display: grid;
}

.tt_stage_col {
  position: relative;
  border-right: 1px solid rgba(26,18,7,.07);
  min-width: 160px;
}

.tt_stage_col:nth-child(odd) { background: rgba(255,255,255,.18); }
.tt_stage_col:last-child { border-right: 0; }

.tt_stage_head {
  height: 52px;
  padding: 7px 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: center;
  background: rgba(246,220,159,.95);
  border-bottom: 1px solid rgba(26,18,7,.12);
  position: sticky;
  top: 0;
  z-index: 3;
}

.tt_stage_head strong {
  font-family: "Zen Old Mincho", serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.2;
}

.tt_stage_head span {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 10px;
  color: rgba(26,18,7,.55);
}

.tt_stage_lane {
  position: absolute;
  inset: 0 7px 0;
}

/* ---- Event block ---- */
.tt_event {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  box-sizing: border-box;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--event-color), color-mix(in srgb, var(--event-color), #111 26%));
  box-shadow: 0 7px 16px rgba(26,18,7,.2);
  /* FIXED: prevent overflow with proper clipping */
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.18);
}

.tt_event::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}

.tt_event:hover,
.tt_event:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(26,18,7,.28);
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 2px;
  z-index: 10;
  overflow: visible;
}

.tt_event_time {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 10px;
  font-weight: 600;
  opacity: .92;
  position: relative;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.tt_event_title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.28;
  position: relative;
  letter-spacing: .02em;
  /* FIXED: text overflow handling */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.tt_event_group {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 10px;
  opacity: .88;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt_event_foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  flex-shrink: 0;
}

.tt_event_badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

.tt_event_link {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Now line (red) — FIXED ---- */
.tt_now_line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  background: #df1f25;
  z-index: 12;
  display: none;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.7),
    0 0 18px rgba(223,31,37,.5);
  pointer-events: none;
}

.tt_now_line.visible { display: block; }

.tt_now_line::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #df1f25;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(223,31,37,.6);
  animation: tt_now_pulse 1.8s ease-in-out infinite;
}

@keyframes tt_now_pulse {
  0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
  50%      { transform: translateY(-50%) scale(1.2); opacity: .65; }
}

.tt_now_label {
  position: absolute;
  right: 8px;
  top: -14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #df1f25;
  color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}

.tt_now_time {
  position: absolute;
  right: 62px;
  top: -14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: #df1f25;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid rgba(223,31,37,.35);
}

/* ---- Legend ---- */
.tt_legend {
  max-width: 1180px;
  margin: 30px auto 0;
  padding: 24px 28px;
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(26,18,7,.08);
  box-shadow: 0 12px 30px rgba(26,18,7,.08);
}

.tt_legend_title {
  font-family: "Zen Old Mincho", serif;
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 14px;
}

.tt_legend_list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.tt_legend_item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(26,18,7,.05);
  border: 1px solid rgba(26,18,7,.08);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1a1207;
}

.tt_legend_swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.tt_legend_note {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  color: rgba(26,18,7,.55);
  line-height: 1.6;
}

.tt_legend_note code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(26,18,7,.08);
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11px;
  color: #1a1207;
}

/* ---- Error state ---- */
.tt_error {
  padding: 60px 20px;
  font-family: "Noto Sans JP", sans-serif;
  text-align: center;
  color: rgba(26,18,7,.7);
  line-height: 1.8;
}

/* ============================================================
 * Mobile Card View (< 768px)
 * ============================================================ */
.tt_mobile_cards {
  display: none;
}

.tt_mobile_stage_section {
  margin-bottom: 24px;
}

.tt_mobile_stage_title {
  font-family: "Zen Old Mincho", serif;
  font-size: 18px;
  font-weight: 900;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(26,18,7,.06);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tt_mobile_stage_title small {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(26,18,7,.5);
}

.tt_mobile_event {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: var(--event-color, #8b6914);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(26,18,7,.12);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}

.tt_mobile_event::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent 60%);
  pointer-events: none;
}

.tt_mobile_event:hover,
.tt_mobile_event:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,18,7,.2);
}

.tt_mobile_event_time {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,.25);
  position: relative;
}

.tt_mobile_event_start,
.tt_mobile_event_end {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.tt_mobile_event_separator {
  font-size: 10px;
  opacity: .6;
  line-height: 1;
}

.tt_mobile_event_body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.tt_mobile_event_title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.tt_mobile_event_group {
  font-size: 12px;
  opacity: .85;
}

.tt_mobile_event_tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tt_mobile_event_tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  font-size: 10px;
  font-weight: 600;
}

/* Mobile now indicator */
.tt_mobile_now_badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #df1f25;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  animation: tt_now_pulse 1.8s ease-in-out infinite;
}

/* ============================================================
 *  Responsive
 * ============================================================ */
@media (max-width: 1023px) {
  .tt_board { min-width: 920px; }
}

@media (max-width: 767px) {
  .tt_hero { padding: 105px 18px 36px; }
  .tt_hero p:last-child { font-size: 14px; }
  .tt_notice { margin: 18px 12px 0; padding: 14px 16px; gap: 10px; }
  .tt_notice_icon { width: 30px; height: 30px; }
  .tt_notice_text { font-size: 13px; }
  .tt_notice_text strong { font-size: 14px; }
  .tt_stage_intro {
    grid-template-columns: 1fr;
    padding: 0 14px;
    margin: 16px auto;
  }
  .tt_intro_card { padding: 18px; }
  .tt_intro_card h2 { font-size: 19px; }
  .tt_intro_card p { font-size: 14px; }
  .tt_day_tabs {
    margin: 22px 14px 14px;
    max-width: none;
  }
  .tt_day_tab { padding: 11px 12px; font-size: 14px; gap: 6px; }
  .tt_day_tab_date { font-size: 12px; padding: 1px 7px; }

  /* HIDE grid, SHOW card view */
  .tt_board_section { display: none; }
  .tt_mobile_cards { display: block; padding: 0 14px; }

  .tt_legend { margin: 24px 12px 0; padding: 18px 16px; }
  .tt_legend_title { font-size: 16px; }
  .tt_legend_item { font-size: 12px; padding: 6px 10px; }
}

@media (max-width: 400px) {
  .tt_notice { margin: 14px 8px 0; }
  .tt_day_tabs { margin: 18px 8px 12px; padding: 5px; }
  .tt_day_tab { padding: 10px 8px; font-size: 13px; }
  .tt_day_tab_label { font-size: 13px; }
  .tt_intro_card p { font-size: 13px; }
  .tt_mobile_cards { padding: 0 8px; }
  .tt_legend { margin: 20px 8px 0; padding: 16px 14px; }
  .tt_now_label { right: 4px; font-size: 9px; padding: 1px 6px; }
  .tt_now_time { right: 48px; font-size: 9px; padding: 1px 6px; }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .tt_event, .tt_day_tab, .tt_notice { transition: none; }
  .tt_now_line::before { animation: none; }
  .tt_mobile_now_badge { animation: none; }
}
