/* DeepSeek Hours - web front end. Pure CSS, no dependencies. */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  user-select: none;
  color: #e8eaf0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  background:
    radial-gradient(1200px 600px at 18% 8%, rgba(58, 74, 120, 0.55), transparent 62%),
    radial-gradient(1000px 520px at 86% 92%, rgba(120, 54, 84, 0.45), transparent 62%),
    #12151c;
}

body.dragging,
body.dragging * {
  cursor: grabbing !important;
}

#stage {
  position: fixed;
  inset: 0;
}

/* --------------------------------------------------------------- clock panel */

.clock {
  position: absolute;
  left: 0;
  top: 0;
  width: 265px;
  height: 170px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 78, 196, 1);
  cursor: grab;
  touch-action: none;
  z-index: 10;
}

.clock[hidden] {
  display: none;
}

/* Sits below the blue panel and moves with it, since it is anchored to the
   clock element. Clicks must not start a panel drag. */
.below-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

/* Pinned to the bottom of the blue panel. */
.brand-link {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  cursor: pointer;
}

.brand-link:hover {
  color: #fff;
  text-decoration: underline;
}

.brand-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.face {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.title-row {
  min-height: 22px;
}

.status {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.reason {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.1;
}

.title-spacer {
  flex: 1 1 auto;
}

.icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
}

.icon:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}

.gear {
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
}

.localtime {
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}

/* ---------------------------------------------------------------- the day bar */

.bar {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 3px;
  overflow: hidden;
}

.spans {
  position: absolute;
  inset: 0;
}

.span {
  position: absolute;
  top: 0;
  bottom: 0;
}

.nowline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
}

.ticks {
  position: relative;
  width: 100%;
  height: 14px;
  font-size: 11px;
}

.tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.tick.first {
  transform: none;
}

.tick.last {
  transform: translateX(-100%);
}

/* ------------------------------------------------------------------ text rows */

.line {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- opacity menu */

.menu {
  position: absolute;
  min-width: 170px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: #2b2f3a;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  cursor: default;
  z-index: 20;
}

.menu[hidden] {
  display: none;
}

.menu-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.menu hr {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.menu-pct {
  margin-top: 2px;
  font-size: 11px;
  text-align: right;
  opacity: 0.8;
}

#reset {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

#reset:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Range input rendered as a thin track with a circular handle. */
input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

/* ------------------------------------------------------- page chrome and popout */

.page-note {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  font-size: 12px;
  color: rgba(232, 234, 240, 0.55);
  z-index: 5;
}

/* The footer doubles as a link to DeepSeek's published rates. It keeps the
   muted footnote look until hovered, so it does not read as a button. */
.rates-link {
  color: inherit;
  text-decoration: none;
}

.rates-link:hover {
  color: #fff;
  text-decoration: underline;
}

.rates-link:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

#popout {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

#popout:hover {
  background: rgba(255, 255, 255, 0.3);
}

#popout[hidden] {
  display: none;
}

/* The clock fills the picture-in-picture window. */
body.pip {
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

.clock.in-pip {
  /* Inline left/top are set while dragging, so override them here. */
  left: 0 !important;
  top: 0 !important;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
}

/* The popout button belongs to the page, not the floating window, which is only
   tall enough for the clock face. */
.clock.in-pip .below-panel {
  display: none;
}
