:root {
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #06060b;
  color: #f5f6f7;
  line-height: 1.5;
  font-weight: 400;
  --panel-bg: rgba(18, 18, 28, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent: #5b8ef1;
  --accent-strong: #2d64f0;
  --muted: rgba(255, 255, 255, 0.7);
  --muted-strong: rgba(255, 255, 255, 0.85);
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(91, 142, 241, 0.25), transparent 55%),
    radial-gradient(circle at 70% 0%, rgba(255, 76, 130, 0.2), transparent 60%),
    var(--background, #05050a);
  padding-bottom: 4rem;
}

.guide-page {
  --panel-bg: rgba(9, 9, 20, 0.92);
}

main,
.hero {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: 3rem 0 1.5rem;
}

.hero-content h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0.5rem 0;
}

.hero-content p {
  max-width: 640px;
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 1.75rem;
  margin-top: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.field-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 5, 15, 0.65);
  color: #fff;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 142, 241, 0.3);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.5rem;
}

.form-meta {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
}

.guide-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
}

button,
.button {
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(91, 142, 241, 0.35);
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
  box-shadow: none;
}

.button.ghost,
button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.banner {
  margin: 1.5rem auto 0;
  width: min(1100px, 92vw);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 86, 86, 0.4);
  background: rgba(255, 86, 86, 0.12);
  color: #ffb3b3;
}

.banner.hidden {
  display: none;
}

.hidden {
  display: none;
}

.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.subtle {
  color: var(--muted);
  margin-top: 0.25rem;
}

.helper-text {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.helper-text code {
  font-family: "JetBrains Mono", "Space Mono", ui-monospace, SFMono-Regular, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.guide-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-nav a {
  color: var(--muted);
  text-decoration: none;
}

.guide-nav strong {
  color: var(--muted-strong);
}

.mono {
  font-family: "JetBrains Mono", "Space Mono", ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.04em;
  color: var(--muted-strong);
}

.embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.embed-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.notice {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--muted);
}

.notice.hidden {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.4rem;
  margin: 0.35rem 0 0;
}

.playlist-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.playlist-card {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  transition: border 0.2s ease, transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.playlist-card:hover {
  border-color: var(--accent);
  background: rgba(91, 142, 241, 0.08);
  transform: translateY(-2px);
}

.playlist-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--muted-strong);
  word-break: break-word;
}

.playlist-card p {
  margin: 0.1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

th {
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

tr.active {
  background: rgba(91, 142, 241, 0.15);
}

tr.future td {
  color: rgba(255, 255, 255, 0.85);
}

.title-cell {
  font-weight: 500;
}

.channel-nav {
  width: min(1100px, 92vw);
  margin: 1rem auto 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.channel-nav button {
  min-width: 160px;
}

.player-panel {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  align-items: center;
  gap: 2rem;
}

.guide-embed {
  border-radius: 24px;
  overflow: hidden;
}

.large-embed {
  padding-bottom: 46%;
}

.schedule-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sort-label {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sort-label select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  padding: 0.35rem 0.75rem;
}

.guide-table {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guide-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: center;
}

.guide-channel {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.channel-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-weight: 600;
}

.channel-name {
  margin: 0;
  font-weight: 600;
}

.guide-timeline {
  display: flex;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.guide-segment {
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.9rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
  border-width: 1px;
  border-style: solid;
}

.guide-segment + .guide-segment {
  box-shadow: -1px 0 0 rgba(255, 255, 255, 0.08);
}

.guide-segment,
.guide-segment:focus {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.guide-segment strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.guide-segment span {
  font-size: 0.8rem;
  color: var(--muted);
}

.guide-segment.live {
  border-color: var(--accent-strong);
  background: rgba(91, 142, 241, 0.2);
}

.guide-segment.active {
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(91, 142, 241, 0.35);
}

.guide-segment.standby {
  opacity: 0.6;
  font-style: italic;
}

.timezone-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 900px) {
  .player-panel {
    grid-template-columns: 1fr;
  }

  .large-embed {
    padding-bottom: 56.25%;
  }

  .guide-row {
    grid-template-columns: 1fr;
  }

  .guide-timeline {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .panel {
    padding: 1.25rem;
  }

  .hero {
    padding-top: 2.25rem;
  }

  .table-wrapper {
    margin: 0 -1rem;
  }
}
