/* -------------------------
   0) Design Tokens
------------------------- */
:root{
  /* base */
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#4B5563;
  --muted:#6b7280;
  --line:rgba(17,24,39,.12);
  --accent:#2563eb;
  --accent2:#7c3aed;
  --shadow: 0 14px 40px rgba(17,24,39,.10);
  --radius: 18px;
  --btn-size: 44px;
  --btn-gap: 10px;
  --ctrl-width: calc(var(--btn-size) * 5 + var(--btn-gap) * 4);
  --sb-accent: #9ACD32;
  --sb-hover: rgba(154,205,50,.18);
  --sb-active-shadow: 0 4px 10px rgba(154,205,50,.18);
}

/* -------------------------
   1) Base / Reset
------------------------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  position: relative;
}

/* -------------------------
   2) Background Image
------------------------- */
.main::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;

  background: url("images/bg.jpg") calc(50% + 130px) 50% / cover no-repeat;

  filter: blur(10px);
  transform: scale(1.05);
}

body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 10% 0%, rgba(37,99,235,.08), transparent 55%),
    radial-gradient(900px 500px at 100% 10%, rgba(124,58,237,.06), transparent 55%),
    rgba(246,247,251,.70);
}

/* -------------------------
   3) Layout
------------------------- */
.layout{
  min-height: 100vh;
  display: flex;
}

/* -------------------------
   4) Sidebar (fixed)
------------------------- */
.sidebar{
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  overflow: hidden;

  padding: 18px 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
}

.sidebar-bottom{
  margin-top: auto;
  padding-top: 20px;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius);
  box-shadow: none;
  background: transparent;
}

.dot{
  width:36px;
  height:36px;
  border-radius: 10px;
  background: url("images/logo.png") center / cover no-repeat;
}

.brand-title{ font-weight:900; }
.brand-sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.menu{
  margin-top: 14px;
  display:grid;
  gap: 10px;
}

.menu-item{
  display:flex;
  align-items:center;
  gap:12px;

  padding: 10px 14px;
  border-radius: 14px;
  text-decoration:none;

  font-size: 12px;
  color: #6B7280;
  background: #ffffff;
  border: 1px solid transparent;

  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}

.menu-item:hover{
  background: var(--sb-hover);
  color: var(--sb-accent);
}

.menu-item.active{
  background: var(--sb-accent);
  color:#ffffff;
  box-shadow: var(--sb-active-shadow);
}

.mi-icon{
  width: 30px;
  height: 30px;
  display:grid;
  place-items:center;
  border-radius: 8px;
  background: rgba(17,24,39,.04);
  flex: 0 0 auto;
}

.menu-item.active .mi-icon{
  background: rgba(255,255,255,.20);
}

.mi-svg{
  width:16px;
  height:16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill:none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mi-text{
  font-weight: 600;
  letter-spacing: .1px;
}

.x-link{
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;

  border-radius: 12px;
  text-decoration: none;

  background: rgba(17,24,39,.04);
  color: #111827;

  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.x-link:hover{
  background: rgba(17,24,39,.08);
  transform: translateY(-2px);
}

.x-svg{
  width: 18px;
  height: 18px;
  display: block;
}

/* -------------------------
   5) Main
------------------------- */
.main{
  position: relative;
  flex: 1;
  padding: 22px;
  margin-left: 260px;

  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.main > *{
  width: 100%;
  max-width: 1100px;
}

.stickyTop{
  position: sticky;
  top: 14px;
  z-index: 2;
  padding-bottom: 14px;
  background: transparent;
  backdrop-filter: none;
}

/* -------------------------
   6) Player
------------------------- */
.player{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding:16px;

  display:flex;
  justify-content:center;
  gap: 22px;
  align-items:center;
}

.player-left{
  flex: 0 1 520px;
  min-width: 280px;
  display:flex;
  align-items:center;
  gap:14px;
}

.cover{
  width:90px;
  height:90px;
  border-radius:22px;
  object-fit: cover;
  background: rgba(17,24,39,.04);
  border:1px solid var(--line);
  flex: 0 0 auto;
}

.meta{ min-width:0; }

.marquee{
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

#titleWrap .marquee-inner{
  font-family: "Noto Serif JP", serif;
  font-weight: 900;
  font-size: 18px;
}

#subWrap .marquee-inner{
  color: var(--muted);
  font-size: 13px;
}

.marquee.on .marquee-inner{
  display: inline-block;
  padding-left: 100%;
  animation: marquee 12s linear infinite;
}

@keyframes marquee{
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.player-right{
  flex: 0 0 var(--ctrl-width);
  width: var(--ctrl-width);
  min-width: 0;
}

.controls{
  display:grid;
  grid-template-columns: repeat(5, var(--btn-size));
  gap: var(--btn-gap);
  align-items:center;
}

.btn{
  border:1px solid var(--line);
  background: rgba(17,24,39,.03);
  color: var(--text);
  border-radius: 14px;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(17,24,39,.22); }

.icon-btn{
  width: var(--btn-size);
  height: var(--btn-size);
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.icon{
  width:20px;
  height:20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.primary{
  border-color: rgba(37,99,235,.40);
  background: rgba(37,99,235,.12);
}

.play-btn{
  width: 48px;
  height: 48px;
}
.play-btn .icon{
  width:22px;
  height:22px;
}

.btn.toggle[aria-pressed="true"]{
  color: var(--accent);
  border-color: rgba(37,99,235,.45);
  background: rgba(37,99,235,.08);
}

.time, .vol{
  grid-column: 1 / -1;
  width: var(--ctrl-width);
}

.time{
  display:grid;
  grid-template-columns: 48px 1fr 48px;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-variant-numeric: tabular-nums;
}

.vol{
  display:grid;
  grid-template-columns: var(--btn-size) 1fr;
  align-items:center;
  gap:10px;
  color:var(--muted);
}

input[type="range"]{
  accent-color: var(--accent);
  width:100%;
}

/* -------------------------
   7) Library
------------------------- */
.library{
  position: relative;
  z-index: 1;
  margin-top: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding:16px;
  box-shadow: 0 10px 30px rgba(17,24,39,.06);
}

.library-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.library h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
  font-weight:900;
}

.library-tools{
  display:flex;
  align-items:center;
  gap:10px;
}

.search{
  width:min(360px, 100%);
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  color: var(--text);
}

.list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

.fav-filter{ flex: 0 0 auto; }

.fav-btn{
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  align-self: center;
}

.fav-btn svg{
  width: 20px;
  height: 20px;
  stroke: var(--muted);
  stroke-width: 1.9;
  fill: none;
}

.fav-btn:hover svg{ stroke: var(--accent); }

.fav-btn[aria-pressed="true"] svg{
  stroke: var(--accent);
  fill: var(--accent);
}

.fav-filter[aria-pressed="true"]{
  color: var(--accent);
  border-color: rgba(37,99,235,.45);
  background: rgba(37,99,235,.08);
}

.track{
  border:1px solid var(--line);
  border-radius: 16px;
  overflow:hidden;
  background: rgba(255,255,255,.92);
}
.track.playing{
  border-color: rgba(37,99,235,.40);
  background: rgba(37,99,235,.06);
}

.track-btn{
  width:100%;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  background: transparent;
  border:none;
  color: inherit;
  cursor:pointer;
  text-align:left;
}

.track-left{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width: 0;
}

.track-thumb{
  width:90px;
  height:90px;
  border-radius:18px;
  object-fit: cover;
  border:1px solid var(--line);
  background: rgba(17,24,39,.04);
  flex: 0 0 auto;
}

.track-main{
  display:grid;
  gap:4px;
  min-width:0;
}

.track-title{
  font-family: "Noto Serif JP", serif;
  font-weight:900;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}

.track-desc{
  color:#ACACAC;
  font-size:13px;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}

.track-tags{
  color: var(--muted);
  font-size:12px;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
}

.track-meta{
  color:var(--muted);
  font-variant-numeric: tabular-nums;
}

/* -------------------------
   8) Notice
------------------------- */
.notice{
  margin-top: 14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding:16px;
  box-shadow: 0 10px 30px rgba(17,24,39,.06);
}

.notice-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.notice h2{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
  font-weight:900;
}

.notice-body{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.notice-body p{ margin: 0; }

/* -------------------------
   9) Footer
------------------------- */
.footer{
  margin: 18px 0 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

/* -------------------------
   10) Timeline (History)
   - dot is drawn by tl-item::before
------------------------- */
.library .timeline{
  --line-x: 90px;
  --line-w: 4px;
  --line-color: rgba(17,24,39,.22);
  --dot: 12px;
  --space: 40px;
  --content-left: 140px;
  --dot-blue: var(--accent);
  --dot-gray: #2F343C;
  --text-dark: #2F343C;
  --text-light: #6B7280;

  position: relative;
  margin-top: 8px;
  padding-left: var(--content-left);
}

.library .timeline::before{
  content:"";
  position:absolute;
  left: var(--line-x);
  top: 6px;
  bottom: 6px;
  width: var(--line-w);
  background: var(--line-color);
  border-radius: 999px;
  transform: translateX(-50%);
  z-index: 1;
}

.library .timeline .tl-item{
  position: relative;
  margin-bottom: var(--space);
  transition: none;
}
.library .timeline .tl-item:hover{ transform: none; }

.library .timeline .tl-item::before{
  content:"";
  position:absolute;

  left: calc(var(--line-x) - var(--content-left));
  top: 14px;

  width: var(--dot);
  height: var(--dot);
  border-radius: 999px;
  background: var(--dot-color, var(--dot-blue));
  transform: translateX(-50%) scale(1);
  transform-origin: center;

  z-index: 2;
  transition: transform .18s ease, box-shadow .18s ease;
}

.library .timeline .tl-item:hover::before{
  transform: translateX(-50%) scale(1.6);
}

.library .timeline .tl-dot{ display: none !important; }

.library .timeline .tl-content{
  border: none;
  background: transparent;
}

.library .timeline .tl-year{
  font-family: "Noto Serif JP", serif;
  font-weight: var(--year-weight, 900);
  font-size: 20px;
  color: var(--year-color, var(--text-dark));
  letter-spacing: .2px;
}

.library .timeline .tl-text{
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-color, var(--text-dark));
}

.library .timeline a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.library .timeline a:hover{ text-decoration-thickness: 2px; }

/* ===== Timeline hover: ===== */
.library .timeline .tl-content{
  border-radius: 14px;
  padding: 10px 12px;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  box-shadow: none;
}

.library .timeline .tl-item:hover .tl-content{
  transform: translateX(6px);
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 24px rgba(17,24,39,.06);
}

.library .timeline .tl-item[style*="--dot-color: var(--dot-gray)"]:hover .tl-content{
  background: rgba(255,255,255,.55);
  box-shadow: 0 8px 18px rgba(17,24,39,.04);
}

/* -------------------------
   11) Index Cards
------------------------- */
.cards{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.card-link{
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 16px 16px;
  border-radius: 18px;

  text-decoration: none;
  color: inherit;

  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;

  min-height: 110px;
}

.card-link:hover{
  transform: translateY(-1px);
  border-color: rgba(17,24,39,.20);
  box-shadow: 0 12px 28px rgba(17,24,39,.08);
}

.card-link:focus-visible{
  outline: 2px solid rgba(37,99,235,.45);
  outline-offset: 3px;
}

.card-icon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(17,24,39,.04);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.card-svg{
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.card-title{
  font-weight: 900;
  letter-spacing: .2px;
  color: #2F343C;
}

.card-desc{
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.card-arrow{
  margin-left: auto;
  opacity: .55;
  transition: opacity .15s ease, transform .15s ease;
}
.card-link:hover .card-arrow{
  opacity: .9;
  transform: translateX(2px);
}

/* -------------------------
   12) Plans (card-like)
------------------------- */
.plans{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.plan-card{
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 16px 16px;
  border-radius: 18px;

  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);

  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;

  min-height: 110px;
}

.plan-card:hover{
  transform: translateY(-1px);
  border-color: rgba(17,24,39,.20);
  box-shadow: 0 12px 28px rgba(17,24,39,.08);
}

.plan-icon{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(17,24,39,.04);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.plan-body{
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.plan-title{
  font-weight: 900;
  letter-spacing: .2px;
  color: #2F343C;
}

.plan-desc{
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plan-badge{
  margin-left: auto;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.75);
  flex: 0 0 auto;
}

.plan-badge.done{
  color: var(--accent);
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.08);
}

.plan-badge.skip{
  color: #dc2626;
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.08);
}

/* -------------------------
   13) News
------------------------- */
.news-section .news-head{
  margin-bottom: 18px;
  display: grid;
  gap: 6px;
}

.news-section .news-title{
  margin: 0;
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
  color: #2F343C;
}

.news-section .news-meta{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .5px;
}

.news-section .news-content{
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.news-section .news-image{
  flex: 0 0 400px;
  max-width: 400px;
}

.news-section .news-image img{
  width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.news-section .news-text{
  flex: 1;
  min-width: 0;
}

.news-section .news-text p{
  margin: 0 0 12px 0;
  line-height: 1.9;
  font-size: 14px;
  color: #2F343C;
}

.news-title{
  position: relative;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-weight: 900;
  font-size: 18px;
  color: #2F343C;
}

.news-title.is-new::after{
  content: "NEW";
  display: inline-block;

  margin-left: 10px;
  padding: 2px 8px;

  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;

  color: #ffffff;
  background: linear-gradient(90deg, var(--accent), var(--accent2));

  border-radius: 999px;
  vertical-align: middle;
}

/* -------------------------
   14) Feature Video Section
------------------------- */
.feature-video{
  margin-top: 12px;
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.04);
}

.feature-video::before{
  content:"";
  display:block;
  padding-top: 56.25%;
}

.feature-video iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature-text{
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
}

/* -------------------------
   15) Section Head
------------------------- */
.section-head{
  margin-bottom: 22px;
  display: grid;
  gap: 8px;

  --section-line: linear-gradient(90deg, var(--accent), var(--accent2));
}

.section-head h2{
  margin: 0;
  font-weight: 900;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: .4px;
  color: #2F343C;
  position: relative;
}

.section-head h2::after{
  content:"";
  display:block;
  width: 60px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--section-line);
}

.section-sub{
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}

/* -------------------------
   16) General Head
------------------------- */
.general-head{
  margin: 6px 0 18px;
  padding: 0 0 14px;
}

.general-head h1{
  margin: 0;
  font-weight: 900;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.15;
  letter-spacing: .35px;
  color: #2F343C;
}

.general-head p{
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
  letter-spacing: .1px;
  max-width: 56ch;
}

.general-head::after{
  content:"";
  display:block;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: .95;
}

/* -------------------------
   17) Home Header Layout + Time Card
------------------------- */
.home-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;

  position: relative;
  padding-bottom: 14px;
}

.home-head::after{
  content:"";
  position: absolute;
  left: 0;
  bottom: 0;

  width: 44px;
  height: 3px;
  border-radius: 999px;

  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: .95;

  display: block;
  margin: 0;
}

.time-card{
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(17,24,39,.06);
  width: min(520px, 44vw);
  flex: 0 0 auto;
}

.time-status,
.time-next{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.time-label{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.current-time{
  font-size: 18px;
  font-weight: 900;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.time-status{
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.5;
}

.time-next{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* -------------------------
   18) Responsive
------------------------- */
@media (max-width: 900px){
  .news-section .news-content{ flex-direction: column; }
  .news-section .news-image{ max-width: 100%; flex: none; }
}

@media (max-width: 860px){
  .sidebar{ display:none; }

  .main{
    margin-left: 0;
    padding:16px;
  }

  .main::before{
    background-position: 50% 50%;
  }

  .player{
    flex-direction: column;
    align-items: stretch;
  }

  .player-right{
    width: 100%;
    flex-basis: auto;
  }

  .time, .vol{ width: 100%; }

  .list{ grid-template-columns: 1fr; }

  .library .timeline{
    --line-x: 28px;
    --content-left: 68px;
  }

  .cards{ grid-template-columns: 1fr; }
  .plans{ grid-template-columns: 1fr; }
}
