:root {
  --bg: #10131a;
  --panel: #181c27;
  --panel-alt: #212636;
  --border: #2b3142;
  --text: #f2f0e9;
  --text-muted: #8b90a3;
  --text-dim: #565c70;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -10%, rgba(108, 92, 231, 0.14), transparent 55%), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  padding-top: max(28px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

.board {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.board__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.brand__slash {
  color: var(--text-dim);
  font-weight: 500;
}
.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}

.live-clock {
  text-align: right;
  min-width: 0;
}
.live-clock__date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: capitalize;
}
.live-clock__time {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-variant-numeric: tabular-nums;
}

.status-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 5vw, 24px);
}

.status-card__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}
.pulse-dot--idle {
  background: var(--text-dim);
  animation: none;
  box-shadow: none;
}
.pulse-dot--break {
  background: #ffd93d;
  animation: pulse-break 1.8s infinite;
}
@keyframes pulse-break {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(255, 217, 61, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 217, 61, 0);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.status-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 6vw, 1.7rem);
  font-weight: 700;
  margin: 0 0 4px;
  overflow-wrap: break-word;
}
.status-card__title--muted {
  color: var(--text);
}

.status-card__guru {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.status-card__times {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.time-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.time-block__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.time-block__value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.time-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-top: 14px;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: var(--panel-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}
.progress-fill--warn {
  animation: warn-pulse 1.2s infinite;
}
@keyframes warn-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.35);
  }
}

.time-remaining {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.88rem;
}
.time-remaining__label {
  color: var(--text-muted);
}
.time-remaining__value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.next-up {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--panel-alt);
  border-left: 3px solid var(--accent, var(--text-dim));
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.next-up__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.next-up__mapel {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.next-up__guru-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.next-up__guru {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.next-up__countdown {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.next-up__countdown strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--avatar-bg, var(--panel-alt));
  color: var(--avatar-color, var(--text-muted));
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 1.05rem;
}
.avatar--md {
  width: 40px;
  height: 40px;
  font-size: 0.85rem;
}
.avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 0.62rem;
}

.status-card__guru-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.next-day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.list-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 14px;
  background: var(--panel-alt);
  border-left: 3px solid var(--accent, var(--text-dim));
  border-radius: var(--radius-sm);
}
.list-item__time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 104px;
  font-variant-numeric: tabular-nums;
}
.list-item__mapel {
  font-weight: 600;
  flex: 1 1 140px;
}
.list-item__guru-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.list-item__guru {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.day-picker {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px 24px;
}
.day-picker__heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.day-picker__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.day-pill {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.day-pill:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.day-pill.active {
  color: #10131a;
  background: var(--text);
  border-color: var(--text);
}
.day-pill.is-today::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2ecc71;
  margin-left: 6px;
  vertical-align: middle;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.3s ease,
    margin-top 0.35s ease;
}
.day-list.open {
  max-height: 900px;
  opacity: 1;
  margin-top: 16px;
}

.board__footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  padding-top: 8px;
}

@media (max-width: 560px) {
  body {
    padding-top: 20px;
    padding-bottom: 32px;
  }
  .board {
    gap: 16px;
  }

  .board__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .live-clock {
    text-align: left;
  }

  .day-picker {
    padding: 16px;
  }

  .day-picker__buttons {
    gap: 8px;
  }
  .day-pill {
    flex: 1 1 28%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .status-card__guru {
    margin-bottom: 16px;
  }
  .status-card__times {
    gap: 12px;
  }
  .time-block__value {
    font-size: 1rem;
  }

  .list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .list-item__time {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .progress-fill--warn {
    animation: none;
  }
  .progress-fill,
  .day-list,
  .day-pill {
    transition: none;
  }
}