:root {
  --bg: #100e12;
  --bg-2: #18141c;
  --ink: #f4ead8;
  --muted: #b7a894;
  --amber: #e3a04a;
  --amber-dim: #8b6230;
  --line: rgba(227, 160, 74, 0.28);
  --danger: #c47a62;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(227, 160, 74, 0.12), transparent 55%),
    linear-gradient(180deg, #161218 0%, var(--bg) 40%);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.masthead h1 {
  margin: 0.15rem 0 0.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.dial {
  margin-top: 1.6rem;
  padding: 1.35rem 1.25rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgba(227, 160, 74, 0.08), transparent 40%),
    var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dial-lights {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.dial-lights span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--amber-dim);
  animation: pulse 1.6s ease-in-out infinite;
}

.dial-lights span:nth-child(2) { animation-delay: 0.15s; }
.dial-lights span:nth-child(3) { animation-delay: 0.3s; }
.dial-lights span:nth-child(4) { animation-delay: 0.45s; }
.dial-lights span:nth-child(5) { animation-delay: 0.6s; }

.dial.is-talk .dial-lights span,
.dial.is-empty .dial-lights span {
  animation: none;
  background: #4a3d46;
}

.dial.is-talk {
  border-color: rgba(196, 122, 98, 0.45);
}

.header {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title {
  margin: 0.45rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.3;
}

.meta,
.note {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.tz-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.tz-picker select {
  appearance: none;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.35rem 1.8rem 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23e3a04a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}

.tz-picker select:focus {
  outline: none;
  border-color: var(--amber);
}

button,
.telegram {
  appearance: none;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.9rem 0.8rem;
  font: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button {
  background: var(--amber);
  color: #24170a;
  font-weight: 650;
}

button:active {
  transform: translateY(1px);
}

.telegram {
  display: block;
  margin-top: 0.75rem;
  background: #2a7ad4;
  color: white;
  font-weight: 650;
}

.telegram.is-disabled {
  background: #3a3340;
  color: #8d8493;
  pointer-events: none;
}

.telegram-hint {
  min-height: 1.2rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.recent {
  margin-top: 1.6rem;
}

.recent-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.recent h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

#recent-stamp {
  color: var(--muted);
  font-size: 0.8rem;
}

.recent-window {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(16, 14, 18, 0.7);
}

.track {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.7rem;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid rgba(227, 160, 74, 0.12);
}

.track:last-child {
  border-bottom: 0;
}

.track time {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.empty {
  margin: 0;
  padding: 1rem 0.7rem;
  color: var(--muted);
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; background: var(--amber); }
}

@media (max-width: 520px) {
  .controls {
    grid-template-columns: 1fr;
  }
}
