/* /happy-new-year/ (assets/new-year.js): over the split (split.css), the list on the left and the globe on the
   right on a wide screen (the owner, 31 October 2026: "on the left different timezones & cities"), the globe on top
   on a phone; over the globe, what's going on (or the city picked) and the timeline along its foot, on night glass. */

/* MARK: The split, this way round */

@media (min-width: 960px) {
  .ny .split { flex-direction: row-reverse; }
}
/* A phone: more of the screen for the globe, the timeline and the words over it. */
@media (max-width: 959px) {
  .ny .stage { height: clamp(470px, 74vh, 760px); }
}
.ny .stage { background: radial-gradient(120% 90% at 50% 35%, #0e1a33 0%, #050811 70%); }
/* nothing over the globe is text to select: a drag on the timeline or the globe never highlights it */
.ny-stage, .ny-stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* MARK: Over the globe */

.ny-top, .ny-dock { position: absolute; z-index: 3; left: 14px; right: 14px; }
.ny-top { top: 14px; display: flex; justify-content: center; pointer-events: none; }
.ny-top > * { pointer-events: auto; }

.ny-banner, .ny-card, .ny-dock {
  color: #fff;
  background: rgba(10, 15, 32, 0.56);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 14px 34px rgba(0, 0, 0, 0.35);
}

.ny-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(100%, 560px);
  min-height: 62px;
  padding: 9px 20px 9px 12px;
  border-radius: 22px;
  cursor: pointer;
  animation: ny-in 0.35s ease both;
}
.ny-banner > span:last-child { display: grid; min-width: 0; }
.ny-banner i { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.ny-banner.is-now i { color: #ffd27a; }
.ny-banner b { font-size: 17px; font-weight: 900; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ny-banner > span:last-child > span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ny-banner .ny-flags img { width: 26px; height: 26px; }
@keyframes ny-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* The city picked */
.ny-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 520px);
  padding: 10px 10px 10px 12px;
  border-radius: 22px;
  animation: ny-in 0.3s ease both;
}
.ny-card .row-lead.flag { width: 44px; height: 44px; }
.ny-card .row-lead.flag img { width: 38px; height: 38px; }
.ny-card-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ny-card-body b { font-size: 18px; font-weight: 900; }
.ny-card-body span { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.ny-card-body span:last-child { color: #ffd27a; }
.ny-close {
  flex: none;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.ny-close:hover { background: rgba(255, 255, 255, 0.2); }

/* MARK: The timeline */

.ny-dock {
  bottom: 14px;
  border-radius: 24px;
  padding-top: 8px;
  overflow: hidden;
}
/* a phone: clear of the sheet's rounded top, which comes up over the pane */
@media (max-width: 959px) { .ny-dock { bottom: calc(var(--radius-sheet) + 10px); } }

.ny-dock-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}
.ny-dock-head #ny-play { justify-self: start; }
.ny-dock-head #ny-now { justify-self: end; }
.ny-readout { display: grid; justify-items: center; line-height: 1.15; }
.ny-readout b { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.ny-readout span { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.62); white-space: nowrap; }

.ny-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.ny-btn:hover { background: rgba(255, 255, 255, 0.2); }
.ny-btn:active { transform: scale(0.96); }
.ny-btn[hidden] { display: none; }
.ny-btn .ic { font-size: 15px; }
.ny-btn.is-live { background: rgba(255, 79, 106, 0.18); color: #ffb3bf; cursor: default; }
.ny-btn.is-live:active { transform: none; }
.ny-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4f6a; box-shadow: 0 0 0 0 rgba(255, 79, 106, 0.6); animation: ny-pulse 1.6s ease-out infinite; }
@keyframes ny-pulse { to { box-shadow: 0 0 0 8px rgba(255, 79, 106, 0); } }
@media (max-width: 420px) {
  .ny-btn { padding: 0 11px; }
  .ny-btn:not(.is-live) span { display: none; }
}

.ny-track {
  position: relative;
  height: 86px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  outline: none;
}
.ny-track::-webkit-scrollbar { display: none; }
.ny-track.is-dragging { cursor: grabbing; }
.ny-track:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0 0 24px 24px; }
.ny-rail { position: relative; height: 100%; }
.ny-rail > * { position: absolute; }

.ny-axis { left: 0; right: 0; top: 54px; height: 1px; background: rgba(255, 255, 255, 0.22); }
.ny-tick { top: 54px; width: 1px; height: 5px; background: rgba(255, 255, 255, 0.3); }
.ny-tick.is-hour { height: 10px; background: rgba(255, 255, 255, 0.6); }
.ny-hour, .ny-day {
  top: 66px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ny-day { color: #fff; font-weight: 900; }

/* each zone's New Year: its flag on a stem down to the time */
.ny-mark {
  top: 26px;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  padding: 2px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.ny-mark.is-row1 { top: 2px; }
.ny-mark::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 4px; background: rgba(255, 255, 255, 0.55); }
.ny-mark.is-row1::after { height: 28px; }
.ny-mark img, .ny-mark span { display: block; width: 20px !important; height: 20px !important; border-radius: 50%; object-fit: cover; font-size: 14px !important; line-height: 20px !important; }
.ny-mark:hover { transform: scale(1.18); }
.ny-mark.is-you { box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(0, 0, 0, 0.35); }
.ny-you-mark {
  top: 47px;
  transform: translateX(-50%);
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 14px;
}

/* the moment shown: a line through the middle */
.ny-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 86px;
  width: 2px;
  margin-left: -1px;
  background: #ffd27a;
  box-shadow: 0 0 10px rgba(255, 210, 122, 0.8);
  pointer-events: none;
}
.ny-needle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #ffd27a;
}

@media (max-width: 600px) {
  .ny-readout b { font-size: 18px; }
  .ny-top, .ny-dock { left: 10px; right: 10px; }
  .ny-top { top: 10px; }
  .ny-banner { padding-right: 16px; min-height: 56px; }
  .ny-banner b { font-size: 15px; }
}

/* MARK: The page: your countdown, the list */

.ny-count { margin-top: 20px; padding: 16px 18px 14px; }
.ny-count-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 800; color: var(--muted); }
.ny-count-head span:first-child { text-transform: uppercase; letter-spacing: 1.3px; }
.ny-count-head span:last-child { color: var(--faint); }
.ny-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 8px; }
.ny-digits span { display: grid; justify-items: center; padding: 10px 4px 8px; border-radius: 16px; background: var(--line); }
.ny-digits b { font-size: clamp(26px, 4.4vw, 36px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.ny-digits i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 4px; }
.ny-count-foot { font-size: 14px; font-weight: 700; color: var(--muted); }
.ny-wish { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; font-size: 28px; }
.ny-wish .ic { color: var(--sun); }
.ny-wish b { font-weight: 900; }

/* The zone the page's times are in: a pill under the subtitle, the zone's name the part you change. */
.ny-tz {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 16px;
  padding: 0 6px 0 14px;
  height: 40px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}
.ny-tz .ic { font-size: 16px; flex: none; }
.ny-tz span { flex: none; }
.ny-tz select {
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.ny-tz select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ny-list { padding: 4px 14px; }
/* whose time the left column is, and what the rows are */
.ny-list-head {
  display: flex;
  gap: 14px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.ny-list-head span:first-child { width: 82px; flex: none; }
@media (max-width: 420px) { .ny-list-head span:first-child { width: 70px; } }
.ny-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}
.ny-row:last-child { border-bottom: 0; }
.ny-row:hover .row-title { color: var(--accent); }
.ny-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.ny-row .row-title, .ny-row .row-detail { display: block; }
.ny-row .row-detail { display: flex; align-items: center; gap: 7px; }
.ny-row .row-detail > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ny-when { flex: none; width: 82px; display: grid; line-height: 1.2; }
.ny-when b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ny-when span { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ny-when.is-end { justify-items: end; text-align: right; width: auto; }

.ny-flags { display: inline-flex; flex: none; }
.ny-flags img, .ny-flags > span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1.5px var(--card);
  background: var(--card);
}
.ny-flags > * + * { margin-left: -5px; }

.ny-you-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  vertical-align: 2px;
}

.ny-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.ny-status.is-now { background: linear-gradient(#ffe08a, #f2b705); color: #4a3500; box-shadow: 0 2px 0 #c48f00; }
.ny-status.is-done { background: none; color: var(--grass); padding-right: 0; }
.ny-row.is-past .row-title, .ny-row.is-past .ny-when b { color: var(--muted); }
/* the zone the globe is on */
.ny-row.is-showing { position: relative; }
.ny-row.is-showing::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #f2b705;
}

@media (max-width: 420px) {
  .ny-when { width: 70px; }
  .ny-when b { font-size: 15.5px; }
  .ny-row { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ny-banner, .ny-card { animation: none; }
  .ny-dot { animation: none; }
  .ny-mark { transition: none; }
}

/* the three numbers on a phone: each time on one line */
.ny .facts .v { white-space: nowrap; font-size: clamp(17px, 5.2vw, 24px); }
