:root {
  --bg-0: #050709;
  --bg-1: #110b08;
  --bg-2: #1a1110;
  --gold: #cca97a;
  --gold-soft: #e0c7a6;
  --amber: #4a2c00;
  --text: #f8f1e6;
  --muted: #c6b196;
  --card: rgba(14, 20, 29, 0.62);
  --card-border: rgba(255, 220, 159, 0.22);
  --ok: #cca97a;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: "Sora", sans-serif;
  color: var(--text);
  background:
    radial-gradient(120% 120% at 15% 5%, #4a2c00 0%, rgba(74, 44, 0, 0.18) 38%, transparent 60%),
    radial-gradient(90% 90% at 85% 85%, rgba(204, 169, 122, 0.16) 0%, transparent 55%),
    linear-gradient(130deg, var(--bg-0), var(--bg-1) 46%, var(--bg-2));
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  z-index: 1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.3) 0.5px, transparent 0.5px);
  background-size: 2px 2px;
  mix-blend-mode: soft-light;
}

.aurora {
  position: fixed;
  inset: -20%;
  z-index: 0;
  filter: blur(48px);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.28;
}

.orb-a {
  width: 42rem;
  height: 42rem;
  background: #cca97a;
  top: 4%;
  left: -8%;
  animation: orbFloatA 20s ease-in-out infinite;
}

.orb-b {
  width: 30rem;
  height: 30rem;
  background: #4a2c00;
  top: 22%;
  right: 8%;
  animation: orbFloatB 23s ease-in-out infinite;
}

.orb-c {
  width: 36rem;
  height: 36rem;
  background: #9e7344;
  bottom: -10%;
  left: 26%;
  animation: orbFloatC 18s ease-in-out infinite;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, 92vw);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 0 2.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.42rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 219, 162, 0.2);
  backdrop-filter: blur(7px);
  transition: transform 0.28s ease, border-color 0.28s ease, background-color 0.28s ease;
}

.brand:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 219, 162, 0.5);
  background-color: rgba(255, 255, 255, 0.03);
}

.brand img {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

.brand-copy small {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(204, 169, 122, 0.5);
  color: var(--ok);
  background: rgba(74, 44, 0, 0.24);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(204, 169, 122, 0.18);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease, color 0.24s ease;
  animation: pulseChip 2.1s ease-in-out infinite;
}

.status-chip-icon {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 auto;
}

.status-chip:hover,
.status-chip:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(204, 169, 122, 0.95);
  color: #f5e6d0;
  background: rgba(204, 169, 122, 0.2);
  box-shadow: 0 0 0 4px rgba(204, 169, 122, 0.14), 0 8px 22px rgba(74, 44, 0, 0.3);
}

.status-chip:active {
  transform: translateY(0) scale(0.98);
}

.hero {
  margin: auto 0;
  text-align: center;
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 3.4px;
  color: var(--gold-soft);
}

h1 {
  font-family: "Cinzel", serif;
  line-height: 0.92;
  text-wrap: balance;
}

h1 span {
  display: block;
  font-size: clamp(2.6rem, 10vw, 8.2rem);
  font-weight: 700;
  letter-spacing: 1.4px;
  text-shadow: 0 0 24px rgba(204, 169, 122, 0.35), 0 0 54px rgba(74, 44, 0, 0.3);
  animation: riseIn 0.9s ease both;
}

h1 span:last-child {
  animation-delay: 0.12s;
}

.subtitle {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.9rem, 2.1vw, 1.03rem);
  line-height: 1.6;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.time-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-radius: 1.05rem;
  padding: 1rem 0.8rem;
  min-height: 8.7rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
}

.card-glow {
  position: absolute;
  inset: auto -24% -62% -24%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 191, 99, 0.32), transparent 62%);
  pointer-events: none;
}

.label {
  font-size: 0.77rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.6px;
}

.value {
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 6vw, 3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.value.tick {
  transform: none;
  opacity: 1;
}

.progress-wrap {
  margin-top: 0.55rem;
  width: min(640px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 219, 162, 0.2);
  background: rgba(0, 0, 0, 0.28);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4a2c00, #cca97a, #4a2c00);
  transition: width 0.8s ease;
}

.info-row {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.info-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 0.44rem 0.86rem;
  color: #decbb0;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 0.46rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cca97a;
  box-shadow: 0 0 0 0 rgba(204, 169, 122, 0.6);
  animation: ping 2s ease infinite;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: 0.8rem;
  padding: 0.76rem 1.05rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 0.85rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
  border-radius: 50%;
  flex: 0 0 auto;
  -webkit-user-drag: none;
}

.btn-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.btn-note {
  margin-top: 0.16rem;
  font-size: 0.62rem;
  letter-spacing: 0.2px;
  opacity: 0.82;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-solid {
  color: #2f1f04;
  background: linear-gradient(90deg, #f8d89d, #f1b557);
  box-shadow: 0 9px 24px rgba(241, 181, 87, 0.3);
}

.btn-ghost {
  color: #ecdcc6;
  border: 1px solid rgba(204, 169, 122, 0.26);
  background: rgba(255, 255, 255, 0.04);
}

.page-copyright {
  margin-top: auto;
  padding: 0.8rem 0 0.25rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  color: rgba(224, 199, 166, 0.76);
}

.burst-dot {
  position: fixed;
  inset: 50% auto auto 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle, #fff, #cca97a);
  animation: burst 1.15s ease-out forwards;
}

.music-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid rgba(204, 169, 122, 0.5);
  background: rgba(22, 12, 6, 0.88);
  color: #f2dfc3;
  border-radius: 999px;
  padding: 0.54rem 0.86rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.music-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(204, 169, 122, 0.9);
  background: rgba(38, 20, 9, 0.94);
}

.music-toggle:active {
  transform: translateY(0);
}

.music-toggle-icon {
  font-size: 0.86rem;
  line-height: 1;
}

.finish .status-chip {
  color: #2b1900;
  border-color: rgba(204, 169, 122, 0.65);
  background: rgba(204, 169, 122, 0.9);
  animation: none;
}

.finish .subtitle {
  color: #f1ddbf;
}

.finish .time-card {
  border-color: rgba(204, 169, 122, 0.45);
  background: linear-gradient(145deg, rgba(204, 169, 122, 0.2), rgba(74, 44, 0, 0.18));
}

.finish .progress-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #4a2c00, #cca97a);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbFloatA {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(8%, 12%); }
}

@keyframes orbFloatB {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12%, -6%); }
}

@keyframes orbFloatC {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4%, -14%); }
}

@keyframes pulseChip {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 169, 122, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(204, 169, 122, 0); }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(204, 169, 122, 0.62); }
  100% { box-shadow: 0 0 0 8px rgba(204, 169, 122, 0); }
}

@keyframes burst {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.2);
  }
}

@media (max-width: 860px) {
  .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .status-chip {
    align-self: flex-start;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(1120px, 94vw);
    padding-top: 0.8rem;
  }

  .count-grid {
    gap: 0.65rem;
  }

  .time-card {
    min-height: 7.6rem;
  }

  .value {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
  }

  .label {
    font-size: 0.68rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .music-toggle {
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 0.5rem 0.78rem;
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
