@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgba(8, 8, 8, 0.92);
  --surface-muted: #121212;
  --border: rgba(255, 255, 255, 0.14);
  --text: #f2f2f2;
  --text-soft: #b4b4b4;
  --line-past: #2f2f2f;
  --line-today: #707070;
  --line-upcoming: #4a4a4a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  padding: 0;
}

body {
  background: radial-gradient(circle at 8% -12%, #111111 0%, rgba(17, 17, 17, 0) 46%),
    radial-gradient(circle at 86% 12%, #151515 0%, rgba(21, 21, 21, 0) 42%),
    var(--bg);
  color: var(--text);
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  line-height: 1.4;
}

.background-shape {
  filter: blur(40px);
  opacity: 0.3;
  position: fixed;
  z-index: -2;
}

.background-shape-a {
  background: #141414;
  border-radius: 50%;
  height: 240px;
  left: -80px;
  top: 65%;
  width: 240px;
}

.background-shape-b {
  background: #1a1a1a;
  border-radius: 50%;
  height: 270px;
  right: -110px;
  top: 18%;
  width: 270px;
}

.page {
  margin: 0 auto;
  max-width: 1440px;
  padding: 20px;
}

.timetable-shell {
  border-radius: calc(var(--radius) + 2px);
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.timetable {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  margin-top: 8px;
  min-width: 1240px;
}

.timetable-day {
  --line-color: var(--line-upcoming);
  min-width: 0;
}

.timetable-day.state-past {
  --line-color: var(--line-past);
}

.timetable-day.state-today {
  --line-color: var(--line-today);
}

.day-heading {
  backdrop-filter: none;
  background: transparent;
  border-bottom: 0;
  margin-bottom: 8px;
  padding: 6px 4px 9px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.day-title {
  align-items: baseline;
  display: flex;
  gap: 7px;
  margin: 0;
}

.day-name {
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
}

.day-date {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
}

.day-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot {
  display: flex;
  gap: 10px;
}

.slot-line {
  background: var(--line-color);
  border-radius: 4px;
  flex: 0 0 2px;
  width: 2px;
}

.slot-content {
  min-width: 0;
  width: 100%;
}

.slot-time {
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1;
  margin-bottom: 8px;
  padding-left: 2px;
  position: relative;
}

.slot-time::before {
  background: var(--line-color);
  border-radius: 999px;
  content: '';
  height: 8px;
  left: -15px;
  position: absolute;
  top: 2px;
  width: 8px;
}

.slot-time span {
  font-weight: 600;
}

.slot-time small {
  color: #9a9a9a;
  margin-left: 4px;
}

.anime-card {
  column-gap: 8px;
  display: grid;
  grid-template-areas:
    'poster title'
    'poster meta';
  grid-template-columns: 56px 1fr;
  margin-bottom: 8px;
}

.poster-link {
  grid-area: poster;
}

.poster {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  display: block;
  height: 80px;
  object-fit: cover;
  width: 56px;
}

.card-title {
  color: var(--text);
  display: block;
  font-size: 0.89rem;
  font-weight: 700;
  grid-area: title;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
  word-break: break-word;
}

.card-title:hover {
  text-decoration: underline;
}

.card-meta {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 500;
  grid-area: meta;
  margin-top: 2px;
  text-decoration: none;
}

.card-action {
  align-items: center;
  background: var(--surface-muted);
  border: 0;
  border-radius: 999px;
  color: #d2d2d2;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 700;
  grid-area: action;
  height: 20px;
  justify-content: center;
  margin-top: 6px;
  min-width: 46px;
  padding: 0 8px;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.card-action:hover {
  background: #1e1e1e;
}

.progress-btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: #b7b7b7;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 4px;
  grid-area: progress;
  justify-self: end;
  margin-top: 5px;
  padding: 0 4px;
}

.progress-btn::before {
  background: #1f1f1f;
  border-radius: 999px;
  color: #ececec;
  content: 'OK';
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1;
  padding: 3px 5px;
}

.empty-state {
  background: rgba(8, 8, 8, 0.88);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 0.95rem;
  padding: 16px;
}

@media (max-width: 1220px) {
  .timetable {
    gap: 14px;
    min-width: 1120px;
  }
}

@media (max-width: 740px) {
  .page {
    padding: 12px;
  }

  .timetable {
    gap: 12px;
    min-width: 1020px;
  }

  .day-name {
    font-size: 1.14rem;
  }

  .anime-card {
    grid-template-columns: 50px 1fr;
  }

  .poster {
    height: 72px;
    width: 50px;
  }
}
