@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/press-start-2p-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

@keyframes ambientGlow {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.04); }
  100% { filter: brightness(1); }
}

body {
  background-color: #020502;
  color: #00ff66;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 0 20px;
  position: relative;
  animation: ambientGlow 8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 120% 120% at 50% 50%,
    transparent 0%,
    transparent 75%,
    rgba(0, 0, 0, 0.25) 95%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
  pointer-events: none;
  z-index: 2;
}

.terminal {
  flex: 1;
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 0;
  min-height: 0;
}

.schedule-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  min-height: 0;

  padding-left: clamp(0.3rem, calc((100vw - 733px) / 2), 12rem);
  padding-right: clamp(0.3rem, calc((100vw - 733px) / 2), 12rem);

  padding-bottom: calc(50vh + 7rem);

  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;

  -webkit-mask-image: linear-gradient(to bottom,
      transparent 0,
      rgba(0, 0, 0, 0.35) 0.5rem,
      rgba(0, 0, 0, 0.75) 1.2rem,
      #000 2.2rem,
      #000 calc(100% - 8rem),
      rgba(0, 0, 0, 0.6) calc(100% - 5rem),
      rgba(0, 0, 0, 0.28) calc(100% - 3.2rem),
      transparent calc(100% - 2.2rem));
  mask-image: linear-gradient(to bottom,
      transparent 0,
      rgba(0, 0, 0, 0.35) 0.5rem,
      rgba(0, 0, 0, 0.75) 1.2rem,
      #000 2.2rem,
      #000 calc(100% - 8rem),
      rgba(0, 0, 0, 0.6) calc(100% - 5rem),
      rgba(0, 0, 0, 0.28) calc(100% - 3.2rem),
      transparent calc(100% - 2.2rem));
}
.schedule-scroll::-webkit-scrollbar {
  display: none;
}

.schedule {
  width: 100%;
  max-width: 900px;

  padding: 2.2rem 0 1rem;
  min-width: 0;

  text-align: center;
}

.site-footer {
  position: fixed;

  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 1rem 1.25rem;
  font-size: 0.55em;

  color: #00ddff;
  opacity: 0.6;
  text-shadow: 0 0 2px rgba(0, 221, 255, 0.5), 0 0 6px rgba(0, 221, 255, 0.25);
  text-align: center;
}
.site-footer a {
  color: inherit;
  text-decoration: none;

  margin-right: 1.4em;
}
.site-footer a:hover {
  text-decoration: underline;
}

.header {
  position: fixed;

  top: 0;
  right: 0;
  z-index: 100;

  padding: calc(1rem - 10px) 1.25rem 1rem;
  opacity: 1;

  font-size: 0.8em;
  text-align: right;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  overflow: visible;
}

.time-row {
  display: flex;
  align-items: center;

  gap: 0.3em;
  margin-bottom: 0.25rem;
  min-width: 0;
  overflow: visible;
}

.current-time-row {
  margin-bottom: 0.4rem;
  cursor: pointer;
}
.current-time-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}
.current-time {
  color: #ff88dd;
  font-size: 1em;
  opacity: 1;
  text-shadow: 0 0 2px #ff88dd, 0 0 6px rgba(255, 136, 221, 0.6), 0 0 12px rgba(255, 136, 221, 0.35), 0 0 20px rgba(255, 136, 221, 0.2);
}

.label {
  color: #006633;
  opacity: 0.85;
}

.value {
  color: #00ff66;
  text-shadow: 0 0 2px #00ff66, 0 0 6px rgba(0, 255, 102, 0.6), 0 0 12px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.2);
}

.bedtime-select {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ff66' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 40%;
  background-size: 1.3em auto;
  border: none;
  color: #00ff66;
  text-shadow: 0 0 2px #00ff66, 0 0 6px rgba(0, 255, 102, 0.6), 0 0 12px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.2);
  font-family: inherit;
  font-size: inherit;
  padding: 2px 1.35em 2px 0;
  outline: none;
  cursor: pointer;

  min-width: 0;
  flex-shrink: 0;
  opacity: 0.95;
  text-align: left;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.bedtime-select:hover,
.bedtime-select:focus {
  opacity: 1;
}

.bedtime-select:focus-visible,
.dd-trigger:focus-visible,
.mute-btn:focus-visible,
.current-time-row:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.noscript-msg {
  margin: 3rem auto;
  max-width: 30em;
  padding: 0 1.5rem;
  font-size: 0.8em;
  line-height: 2;
  text-align: center;
  color: #00ff66;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
}

.bedtime-select option {
  background: #0a0a0a;
  color: #00ff66;
}

.dd {
  display: none;
  position: relative;
}

.dd-trigger {
  font-family: inherit;
  font-size: inherit;
  line-height: 1.4;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ff66' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 40%;
  background-size: 1.3em auto;
  border: none;
  padding: 2px 1.35em 2px 0;
  color: #00ff66;
  text-shadow: 0 0 2px #00ff66, 0 0 6px rgba(0, 255, 102, 0.6), 0 0 12px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.2);
  cursor: pointer;
  opacity: 0.95;
  text-align: left;
}
.dd-trigger:hover,
.dd-trigger:focus-visible {
  opacity: 1;
}

.dd-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  margin: 0;
  padding: 0.25em 0;
  list-style: none;
  min-width: 100%;
  max-height: 14em;
  overflow-y: auto;
  background: #050a05;
  border: 1px solid rgba(0, 255, 102, 0.3);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.85);
  text-align: left;
  outline: none;

  scrollbar-width: thin;
  scrollbar-color: #00aa55 rgba(0, 255, 102, 0.08);
}
.dd-list::-webkit-scrollbar {
  width: 8px;
}
.dd-list::-webkit-scrollbar-track {
  background: rgba(0, 255, 102, 0.07);
}
.dd-list::-webkit-scrollbar-thumb {
  background: #00aa55;
}
.dd-list::-webkit-scrollbar-thumb:hover {
  background: #00ff66;
}

.dd-opt {
  padding: 0.25em 0.9em;
  color: #00cc55;
  white-space: nowrap;
  cursor: pointer;
}
.dd-opt.is-active,
.dd-opt:hover {
  background: rgba(0, 255, 102, 0.14);
  color: #00ff66;
}
.dd-opt.is-selected {
  color: #00ff66;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .dd {
    display: inline-block;
  }
  .bedtime-select {
    display: none;
  }
}

.mute-btn {

  margin-top: 0.5rem;
  margin-bottom: 0;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #ffcc00;
  opacity: 0.9;
  text-shadow: 0 0 2px #ffcc00, 0 0 6px rgba(255, 204, 0, 0.6), 0 0 12px rgba(255, 204, 0, 0.35), 0 0 20px rgba(255, 204, 0, 0.2);
}
.mute-btn:hover { opacity: 1; }
.mute-btn .mute-icon { display: none; }
.mute-btn .mute-icon.muted { display: inline-block; }
.mute-btn .mute-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 2px #ffcc00) drop-shadow(0 0 6px rgba(255, 204, 0, 0.6)) drop-shadow(0 0 10px rgba(255, 204, 0, 0.35));
}

.session-header {
  color: #007744;

  opacity: 0.45;
  margin: 1.25rem 0 0.5rem 0;

  font-size: 11px;
  white-space: nowrap;
}

.session-header.session-current {
  opacity: 1;
  color: #00ff66;
  text-shadow: 0 0 6px rgba(0, 255, 102, 0.5);
}

.session-header:first-child {
  margin-top: 0;
}

.session-header.past {
  opacity: 0.35;
}

.schedule-row.past:hover,
.schedule-row.past.in-current-session:hover,
.session-header.past:hover {
  opacity: 0.85;
}

.schedule-row,
.session-header {
  display: block;

  padding: 0.12rem 0;
  transition: opacity 0.2s ease, transform 0.25s ease;

  transform-origin: center center;
}

.schedule-row {

  opacity: 0.5;

  font-size: 12px;
}

.schedule-row.past,
.schedule-row.past.in-current-session {
  opacity: 0.35;
}

.schedule-row.row-pomo {
  color: #008855;
}
.schedule-row.row-pomo:not(.past):not(.in-current-session):not(.active) {
  color: #008855;
  text-shadow: 0 0 2px rgba(0, 136, 85, 0.4), 0 0 4px rgba(0, 136, 85, 0.2);
}

.schedule-row.row-pomo.in-current-session {
  color: #00ee99;
  opacity: 0.8;
  text-shadow: 0 0 2px rgba(0, 238, 153, 0.5), 0 0 6px rgba(0, 238, 153, 0.25);
}
.schedule-row.row-pomo.active {
  opacity: 1;
  color: #00ff66;
  text-shadow: 0 0 2px #00ff66, 0 0 6px rgba(0, 255, 102, 0.6), 0 0 12px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.2);
}

.schedule-row.row-short-break {
  color: #887722;
}
.schedule-row.row-short-break:not(.past):not(.in-current-session):not(.active) {
  color: #887722;
  text-shadow: 0 0 2px rgba(136, 119, 34, 0.4), 0 0 4px rgba(136, 119, 34, 0.2);
}
.schedule-row.row-short-break.in-current-session {
  color: #ddbb44;
  opacity: 0.8;
  text-shadow: 0 0 2px rgba(221, 187, 68, 0.5), 0 0 6px rgba(221, 187, 68, 0.25);
}

.schedule-row.row-long-break {
  color: #884422;
}
.schedule-row.row-long-break:not(.past):not(.in-current-session):not(.active) {
  color: #884422;
  text-shadow: 0 0 2px rgba(136, 68, 34, 0.4), 0 0 4px rgba(136, 68, 34, 0.2);
}
.schedule-row.row-long-break.in-current-session {
  color: #dd8866;
  opacity: 0.8;
  text-shadow: 0 0 2px rgba(221, 136, 102, 0.5), 0 0 6px rgba(221, 136, 102, 0.25);
}

.schedule-row.row-winding-down {
  color: #227766;
}
.schedule-row.row-winding-down:not(.past):not(.in-current-session):not(.active) {
  color: #227766;
  text-shadow: 0 0 2px rgba(34, 119, 102, 0.4), 0 0 4px rgba(34, 119, 102, 0.2);
}
.schedule-row.row-winding-down.active,
.schedule-row.row-winding-down.active .label,
.schedule-row.row-winding-down.active .time {
  color: #55ddcc;
  text-shadow: 0 0 2px #55ddcc, 0 0 6px rgba(85, 221, 204, 0.6), 0 0 12px rgba(85, 221, 204, 0.35), 0 0 20px rgba(85, 221, 204, 0.2);
}

.schedule-row.row-sleep {
  color: #116677;
  text-shadow: 0 0 2px rgba(17, 102, 119, 0.4), 0 0 4px rgba(17, 102, 119, 0.2);
}

.schedule-row.row-sleep.active,
.schedule-row.row-sleep.active .label,
.schedule-row.row-sleep.active .time {
  color: #00ddff;
  text-shadow: 0 0 2px #00ddff, 0 0 6px rgba(0, 221, 255, 0.6), 0 0 12px rgba(0, 221, 255, 0.35), 0 0 20px rgba(0, 221, 255, 0.2);
}

.schedule-row.active {
  position: relative;
  margin: 0.3rem 0;
  padding: 0.12rem 0;

  font-size: 12px;
  opacity: 1;
  filter: brightness(1.3);
  overflow: visible;
}

.schedule-row .row-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.7em;
  row-gap: 0.1em;
  overflow: visible;
}

.schedule-row .marker {
  display: none;
}
.schedule-row.active .marker {
  display: inline;
}
.schedule-row .time-end {
  display: none;
}

.schedule-row .time,
.schedule-row .label {
  white-space: nowrap;
}

.schedule-row .label {
  color: inherit;
  opacity: 1;
}

.live-inline .live-info-text {
  display: inline;
}

.schedule-row .live-inline {
  flex-basis: 100%;
  text-align: center;
  overflow: visible;
  white-space: nowrap;
}

.schedule-row.row-short-break.active,
.schedule-row.row-short-break.active .label,
.schedule-row.row-short-break.active .time {
  color: #ffcc00;
  text-shadow: 0 0 2px #ffcc00, 0 0 6px rgba(255, 204, 0, 0.6), 0 0 12px rgba(255, 204, 0, 0.35), 0 0 20px rgba(255, 204, 0, 0.2);
}

.schedule-row.row-long-break.active,
.schedule-row.row-long-break.active .label,
.schedule-row.row-long-break.active .time {
  color: #ff6644;
  text-shadow: 0 0 2px #ff6644, 0 0 6px rgba(255, 102, 68, 0.6), 0 0 12px rgba(255, 102, 68, 0.35), 0 0 20px rgba(255, 102, 68, 0.2);
}

.schedule-row .live-inline {
  color: #ff66cc;
  opacity: 0.9;
  text-shadow: 0 0 2px #ff66cc, 0 0 6px rgba(255, 102, 204, 0.6), 0 0 12px rgba(255, 102, 204, 0.35), 0 0 20px rgba(255, 102, 204, 0.2);
}
.schedule-row.active .live-inline {
  opacity: 1;
  filter: brightness(0.9);
}

.schedule-row.row-pomo.active .label,
.schedule-row.row-pomo.active .time {
  color: #00ff66;
  text-shadow: 0 0 2px #00ff66, 0 0 6px rgba(0, 255, 102, 0.6), 0 0 12px rgba(0, 255, 102, 0.35), 0 0 20px rgba(0, 255, 102, 0.2);
}

@media (max-width: 750px) {

  .header {
    position: static;
    width: 100%;
    flex: 0 0 auto;

    order: 2;
    padding: 0 0 2.9rem;
    text-align: center;

    font-size: min(11px, calc(3.33vw - 1.4px));
  }
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.25em 0.9em;
    white-space: nowrap;

    flex-wrap: wrap;
  }
  .header-inner::before {
    content: '';
    order: 1;
    flex-basis: 100%;
    height: 0;
  }

  .header-inner .time-row { order: 2; }
  .header-inner .current-time-row { order: 0; }
  .schedule-row.active {

    transform: none !important;
  }

  .mute-btn {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 101;
    padding: 0.9rem;
  }
  .mute-btn .mute-icon svg {
    width: 1.7em;
    height: 1.7em;
  }

  .dd-list {
    top: auto;
    bottom: calc(100% + 4px);
  }
  .time-row,
  .current-time-row,
  .mute-btn {
    margin-top: 0;
    margin-bottom: 0;
  }

  .terminal {
    order: 1;
  }

  .schedule-scroll {
    padding-left: 1rem;
    padding-right: 1rem;

    scroll-padding-bottom: 4rem;
  }
  .time-row {
    min-height: 1.5em;
    padding: 2px 0;
  }

  .site-footer {
    font-size: 7.2px;
    padding: 1rem 0.5rem;
  }
}

@media (min-width: 751px) {
  .schedule {
    text-align: left;
  }

  .schedule-row,
  .session-header {
    padding: 0.2rem 0;
    transform-origin: left center;
  }

  .schedule-row { font-size: 1em; }
  .session-header { font-size: 0.9em; }

  .schedule-row.active {
    font-size: 0.9em;
    margin: 0.4rem 0;
    padding: 0.2rem 1ch 0.2rem 0.5rem;
  }

  .schedule-row .row-content {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    column-gap: 0.75rem;
  }

  .schedule-row .marker {
    display: inline;
    visibility: hidden;
  }
  .schedule-row.active .marker { visibility: visible; }
  .schedule-row .time-end { display: inline; }

  .schedule-row.active .marker { order: 0; }
  .schedule-row.active .label { order: 1; }
  .schedule-row.active .time { order: 2; }
  .schedule-row.active .live-inline { order: 3; }
  .schedule-row.active .time::before,
  .schedule-row.active .live-inline::before {
    content: '>';
    margin-right: 0.75rem;
    opacity: 0.75;
  }

  .schedule-row .live-inline {
    flex-basis: auto;
    width: 10.5em;
    padding-right: 0.5em;
    text-align: left;
  }

  .site-footer {
    left: auto;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35em;
    text-align: right;
  }

  .site-footer .copyright { order: 0; }
  .site-footer a {
    order: 1;
    margin-right: 0;
  }

  .header-inner .mute-btn {
    order: -1;
  }

  .header-inner .current-time-row {
    margin-right: 4px;
  }

}
