/* Flip clock page (/flipclock). Colors come from flipclock-themes.js as --fc-* tokens.
   The cards are the Chrome extension's, sized by --cw from flipclock.js. */

.fc {
  --fc-line: color-mix(in srgb, var(--fc-ink) 18%, transparent);
  --fc-soft: color-mix(in srgb, var(--fc-ink) 10%, transparent);
  --fc-muted: color-mix(in srgb, var(--fc-ink) 74%, transparent);
  --fc-surface: color-mix(in srgb, var(--fc-bg) 90%, var(--fc-ink));
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
  background: var(--fc-bg);
  color: var(--fc-ink);
  transition: background .25s ease, color .25s ease;
}
.fc:fullscreen { width: 100%; height: 100%; }

.fc-home {
  position: absolute; top: 14px; left: 16px; z-index: 3;
  display: block; border-radius: 10px;
  transition: opacity .35s ease;
}
.fc-home img { width: 36px; height: 36px; border-radius: 9px; }
.fc-home:focus-visible { outline: 3px solid var(--fc-ink); outline-offset: 3px; }

.fc-stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 58px 20px 10px;
}
.fc.is-hidden .fc-stage { padding-top: 20px; padding-bottom: 20px; }

.fc-live {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- The cards ---- */
.flipclock {
  --cw: 140px;
  --ch: calc(var(--cw) * 1.4);
  --radius: calc(var(--cw) * 0.11);
  display: flex; align-items: flex-start; justify-content: center;
  user-select: none; -webkit-user-select: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.flipclock .group { position: relative; display: flex; gap: calc(var(--cw) * 0.08); }
.flipclock .card {
  position: relative;
  width: var(--cw); height: var(--ch);
  border-radius: var(--radius);
  font-size: calc(var(--ch) * 0.74);
  color: var(--fc-digit);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
  perspective: calc(var(--ch) * 4);
}
.flipclock .half {
  position: absolute; left: 0; right: 0; height: 50%;
  overflow: hidden;
  background: var(--fc-card);
}
.flipclock .half.upper {
  top: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: color-mix(in srgb, var(--fc-card) 93%, #FFFFFF);
}
.flipclock .half.lower { bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.flipclock .glyph {
  position: absolute; left: 0; right: 0;
  height: var(--ch); line-height: var(--ch);
  text-align: center;
  transform: translateY(0.02em); /* centers Poppins numerals on the hinge */
}
.flipclock .half.upper .glyph { top: 0; }
.flipclock .half.lower .glyph { bottom: 0; }
.flipclock .hinge {
  position: absolute; left: 0; right: 0; top: calc(50% - 1px);
  height: 2px; z-index: 3;
  background: rgba(0, 0, 0, .32);
}
/* The falling leaf: front = old upper half, back = new lower half */
.flipclock .leaf {
  position: absolute; left: 0; right: 0; top: 0; height: 50%;
  z-index: 2;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  animation: fc-fall .6s cubic-bezier(.45, .05, .55, .95) forwards;
}
.flipclock .leaf .half { height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipclock .leaf .leaf-front { top: 0; }
.flipclock .leaf .leaf-back { top: 0; bottom: auto; transform: rotateX(180deg); }
.flipclock .leaf .leaf-front::after,
.flipclock .leaf .leaf-back::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  animation: fc-shade .6s ease-in forwards;
}
.flipclock .leaf .leaf-front::after { background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent); }
.flipclock .leaf .leaf-back::after { background: linear-gradient(to bottom, rgba(0, 0, 0, .35), transparent); animation-direction: reverse; }
@keyframes fc-fall { from { transform: rotateX(0deg); } to { transform: rotateX(-180deg); } }
@keyframes fc-shade { from { opacity: 0; } to { opacity: 1; } }
.flipclock .separator {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: calc(var(--ch) * 0.2);
  width: calc(var(--cw) * 0.42); height: var(--ch);
}
.flipclock .dot {
  width: calc(var(--cw) * 0.1); height: calc(var(--cw) * 0.1);
  border-radius: 50%;
  background: var(--fc-muted);
}
.fc[data-phase="ringing"] .flipclock { animation: fc-glow 1.6s ease-in-out infinite; }
@keyframes fc-glow { 50% { opacity: .55; } }

/* ---- The controls ---- */
.fc-panel {
  position: relative; z-index: 2;
  flex: none;
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 6px 0 20px;
  display: grid; gap: 10px;
  transition: opacity .35s ease;
}
.fc.is-hidden .fc-panel { display: none; }
.fc.is-quiet .fc-panel,
.fc.is-quiet .fc-home,
.fc.is-quiet .fc-music { opacity: 0; pointer-events: none; }
.fc.is-quiet { cursor: none; }

.fc-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }
.fc-primary {
  min-width: 148px; height: 50px; padding: 0 28px;
  border: 0; border-radius: 14px;
  background: var(--fc-accent); color: var(--fc-on-accent);
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .1s ease;
}
.fc-primary:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc-accent) 55%, transparent); }
.fc-primary:active { transform: translateY(1px); }
.fc-primary:focus-visible { outline: 3px solid var(--fc-ink); outline-offset: 3px; }
.fc-primary[hidden] { display: none; }

.fc-icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--fc-ink);
  cursor: pointer;
  transition: background .15s ease;
}
.fc-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.fc-icon:hover, .fc-icon[aria-expanded="true"] { background: var(--fc-soft); }
.fc-icon:focus-visible { outline: 3px solid var(--fc-ink); outline-offset: 1px; }
.fc-icon[hidden] { display: none; }
#fc-sound[aria-pressed="false"] .sound-on,
#fc-sound[aria-pressed="true"] .sound-off { display: none; }
#fc-music-toggle[aria-pressed="true"] { background: var(--fc-accent); color: var(--fc-on-accent); }
[data-fc-mode="dark"] .mode-moon,
[data-fc-mode="light"] .mode-sun { display: none; }
.fc.is-full .full-enter,
.fc:not(.is-full) .full-exit { display: none; }

.fc-range {
  --fill: 0%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 28px; margin: 0;
  background: transparent;
  cursor: pointer;
}
.fc-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(to right, var(--fc-accent) var(--fill), var(--fc-line) var(--fill));
}
.fc-range::-moz-range-track { height: 6px; border-radius: 6px; background: var(--fc-line); }
.fc-range::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--fc-accent); }
.fc-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px;
  border: 2px solid var(--fc-ink); border-radius: 50%;
  background: var(--fc-accent);
}
.fc-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border: 2px solid var(--fc-ink); border-radius: 50%;
  background: var(--fc-accent);
}
.fc-range:focus-visible { outline: 3px solid var(--fc-ink); outline-offset: 2px; border-radius: 8px; }

.fc-length { display: grid; gap: 0; }
.fc-marks { position: relative; height: 26px; }
.fc-marks button {
  position: absolute; top: 0;
  left: calc(11px + (100% - 22px) * var(--at));
  transform: translateX(-50%);
  min-width: 34px; height: 26px; padding: 0 4px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--fc-muted);
  font-family: var(--font-body); font-size: .82rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.fc-marks button:hover { color: var(--fc-ink); }
.fc-marks button[aria-pressed="true"] { color: var(--fc-ink); font-weight: 700; }
.fc-marks button:focus-visible { outline: 3px solid var(--fc-ink); }

.fc-tools { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; }
.fc-size { display: flex; align-items: center; gap: 8px; width: 132px; margin: 0 8px; color: var(--fc-ink); }
.fc-size svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.fc-themes {
  position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 4;
  transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(4, 34px); gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--fc-surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
}
.fc-themes[hidden] { display: none; }
.fc-swatch {
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  cursor: pointer;
}
.fc-swatch[aria-pressed="true"] { outline: 3px solid var(--fc-ink); outline-offset: 2px; }
.fc-swatch:focus-visible { outline: 3px solid var(--fc-ink); outline-offset: 2px; }

.fc-show {
  display: none;
  position: absolute; left: 50%; bottom: 10px; z-index: 3;
  transform: translateX(-50%);
  color: var(--fc-muted);
  transition: opacity .35s ease;
}
.fc.is-hidden .fc-show { display: inline-flex; }
.fc.is-hidden.is-quiet .fc-show { opacity: 0; }

.fc-music {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  width: 300px; padding: 8px;
  border-radius: 16px;
  background: var(--fc-surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
  transition: opacity .35s ease;
}
.fc-music[hidden] { display: none; }
.fc-music-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px 8px; font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.fc-music-head .fc-icon { width: 32px; height: 32px; }
.fc-music-head .fc-icon svg { width: 16px; height: 16px; }
.fc-music-body { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.fc-music-body iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 900px) {
  .fc-music { right: 16px; left: 16px; bottom: auto; top: 60px; width: auto; max-width: 340px; margin: 0 auto; }
}
@media (max-height: 560px) {
  /* A phone on its side: the clock gets the room, the controls share one row */
  .fc-stage { padding-top: 12px; padding-bottom: 4px; }
  .fc-panel { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 24px); padding-bottom: 6px; }
  .fc-actions { flex: none; gap: 2px; }
  .fc-primary { min-width: 92px; height: 42px; padding: 0 16px; font-size: .98rem; }
  .fc-length { flex: 1 1 120px; max-width: 260px; min-width: 0; }
  .fc-marks { display: none; }
  .fc-tools { flex: none; flex-wrap: nowrap; }
  .fc-tools .fc-icon { width: 40px; height: 40px; }
  .fc-size { display: none; }
  .fc-home { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flipclock .leaf { display: none; }
  .fc[data-phase="ringing"] .flipclock { animation: none; }
}

/* ---- Below the clock ---- */
.fc-noscript { font-family: var(--font-head); font-weight: 600; }
.fc-crumbs { justify-content: center; margin-bottom: 18px; }
.fc-subhead { max-width: 620px; margin: 34px auto 14px; font-size: 1.3rem; text-align: center; }
.fc-quick { max-width: 620px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fc-quick a {
  padding: 7px 14px; border: 2px solid var(--ink); border-radius: 12px;
  background: var(--white); color: var(--ink);
  font-weight: 600; font-size: .92rem; text-decoration: none;
}
.fc-quick a:hover { background: var(--lemon); }
.fc-quick a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.fc-guide { max-width: 620px; margin: 0 auto; text-align: center; }
.fc-guide p { margin: 0; color: var(--ink-muted); }
.fc-guide a { color: var(--ink); font-weight: 600; text-decoration-color: var(--lemon-deep); text-underline-offset: 3px; }
.fc-about .section-head { margin-bottom: 26px; }
.fc-points { max-width: 620px; margin: 0 auto; padding: 0 0 0 20px; display: grid; gap: 8px; color: var(--ink-muted); }
.fc-extension { max-width: 620px; margin: 40px auto 0; text-align: center; }
.fc-extension p { margin: 0 0 14px; color: var(--ink-muted); }
.fc-loki { padding-top: 0; }
.fc-loki-inner { max-width: 620px; margin: 0 auto; text-align: center; }
.fc-loki-inner p { margin: 14px 0 22px; color: var(--ink-muted); }
.fc-loki-inner .store-badge { display: inline-block; }
.fc-faq { padding-top: 0; }
