:root {
  --ink: #fff4d6;
  --orange: #ffaa35;
  --navy: #031342;
  --navy-deep: #010a29;
  --panel: rgba(2, 14, 53, 0.94);
  --violet: #7652a0;
  --line: #5257d9;
  --muted: rgba(242, 242, 242, 0.72);
  --segment-off: rgba(130, 151, 203, 0.08);
  --focus: #ffbd5a;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--navy); }
body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: #f2f2f2;
  background:
    radial-gradient(ellipse 78% 45% at 50% 55%, rgba(22, 71, 188, 0.32), transparent 72%),
    radial-gradient(ellipse 90% 38% at 50% 103%, rgba(139, 86, 162, 0.82), transparent 78%),
    linear-gradient(180deg, #010a2c 0%, #031342 35%, #082974 72%, #7652a0 120%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.009) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 85%, transparent);
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: 7%; height: 18%;
  background: rgba(100, 117, 255, 0.14);
  filter: blur(80px);
  border-radius: 50%;
}
.glow-line {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(80, 128, 240, 0.2), transparent);
  filter: blur(1px);
  opacity: 0.7;
  animation: breathe 7s ease-in-out infinite alternate;
}
.line-1 { width: 15%; left: 4%; top: 9%; }
.line-2 { width: 22%; right: 6%; top: 12%; animation-delay: -2s; }
.line-3 { width: 13%; left: 12%; top: 23%; animation-delay: -5s; }
.line-4 { width: 25%; left: 38%; top: 21%; animation-delay: -1s; }
.line-5 { width: 20%; left: 1%; top: 34%; animation-delay: -3s; }
.line-6 { width: 30%; right: 16%; top: 37%; animation-delay: -6s; }
.line-7 { width: 18%; left: 29%; bottom: 17%; }
.line-8 { width: 28%; right: 7%; bottom: 26%; animation-delay: -4s; }

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(72px, 10vh, 112px) 36px 128px;
}
.countdown-section { width: 100%; text-align: center; }
.timer-frame {
  position: relative;
  width: min(1470px, calc(100vw - 72px));
  margin: 0 auto;
  filter: drop-shadow(0 34px 36px rgba(17, 46, 171, 0.32));
}
.timer-frame::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 10%; right: 10%; bottom: -34px; height: 44px;
  border-radius: 50%;
  background: rgba(73, 91, 255, 0.46);
  filter: blur(30px);
}
.timer-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 280px) 1px minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(20px, 2vw, 34px);
  min-height: 248px;
  padding: 30px clamp(26px, 2.4vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(109, 112, 255, 0.94);
  border-radius: 28px 28px 24px 24px;
  background:
    linear-gradient(105deg, rgba(12, 30, 88, 0.32), transparent 42%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(159, 164, 255, 0.2),
    inset 0 0 0 3px rgba(36, 63, 151, 0.34),
    0 0 0 1px rgba(49, 79, 186, 0.32),
    0 0 36px rgba(55, 84, 225, 0.22);
  backdrop-filter: blur(18px);
}
.timer-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.045), transparent 20%, transparent 78%, rgba(89,97,255,0.06));
}
.raised-tab {
  position: absolute;
  z-index: 2;
  right: 5%; top: -24px;
  width: 92px; height: 26px;
  border: 1px solid #686fe2;
  border-bottom: 0;
  border-radius: 8px 9px 0 0;
  background: linear-gradient(145deg, #4552bf, #151a61 76%);
  box-shadow: inset 0 1px rgba(255,255,255,0.18), 0 -8px 20px rgba(74,77,230,0.18);
  transform: skewX(13deg);
}
.raised-tab::after {
  content: "";
  position: absolute;
  left: 10px; right: -1px; bottom: -1px; height: 10px;
  border-top: 1px solid rgba(114,120,240,0.86);
  background: #111951;
}
.brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  letter-spacing: 0.075em;
}
.brand-copy h1 {
  margin: 0 0 8px;
  color: #f4f4f6;
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(21px, 1.75vw, 28px);
  font-weight: 700;
  white-space: nowrap;
}
.brand-copy p {
  margin: 0 0 14px;
  color: var(--orange);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(20px, 1.55vw, 25px);
  font-weight: 700;
}
.brand-copy p span { margin-left: 0.3em; }
.arc-logo { width: 86px; height: 86px; display: block; flex: 0 0 auto; object-fit: contain; }
.brand-divider {
  position: relative;
  z-index: 1;
  width: 1px;
  margin: 22px 0;
  background: linear-gradient(transparent, var(--orange) 10%, var(--orange) 90%, transparent);
  box-shadow: 0 0 9px rgba(255,170,53,0.42);
}
.timer-area { position: relative; z-index: 1; display: grid; align-items: center; min-width: 0; }
.timer-grid {
  --digit-w: clamp(38px, 3.45vw, 61px);
  --digit-h: calc(var(--digit-w) * 1.72);
  display: grid;
  grid-template-columns: minmax(112px,1fr) 32px minmax(112px,1fr) 32px minmax(112px,1fr) 32px minmax(112px,1fr);
  align-items: center;
  width: 100%;
}
.time-unit { display: grid; justify-items: center; min-width: 0; }
.unit-label {
  display: block;
  margin-bottom: 17px;
  color: rgba(247,247,249,0.92);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(14px, 1.25vw, 20px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
.digits { display: flex; justify-content: center; gap: calc(var(--digit-w) * 0.12); }
.digit { position: relative; width: var(--digit-w); height: var(--digit-h); flex: 0 0 var(--digit-w); }
.segment {
  position: absolute;
  display: block;
  opacity: 1;
  background: var(--segment-off);
  transition: background-color 120ms linear, filter 120ms linear;
}
.segment.on {
  background: var(--ink);
  filter: drop-shadow(0 0 4px rgba(255,244,214,0.24));
}
.segment.a, .segment.g, .segment.d {
  left: 12%; width: 76%; height: 9%;
  clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%);
}
.segment.a { top: 0; }
.segment.g { top: 45.5%; }
.segment.d { bottom: 0; }
.segment.b, .segment.c, .segment.e, .segment.f {
  width: 12%; height: 43%;
  clip-path: polygon(50% 0, 100% 8%, 100% 92%, 50% 100%, 0 92%, 0 8%);
}
.segment.b { right: 0; top: 4%; }
.segment.c { right: 0; bottom: 4%; }
.segment.e { left: 0; bottom: 4%; }
.segment.f { left: 0; top: 4%; }
.separator { display: grid; align-content: center; justify-items: center; gap: 27px; padding-top: 33px; }
.separator i {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 10px rgba(255,170,53,0.46);
}
.live-message {
  margin: 10px 0 0;
  color: var(--orange);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.target-note {
  margin: 36px 0 0;
  color: rgba(242,242,242,0.74);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 24px; }
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 750;
  letter-spacing: 0.015em;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: 0.48; }
.button-primary {
  color: #071135;
  background: linear-gradient(135deg, #fff4d6, #ffbe63);
  box-shadow: 0 10px 30px rgba(255,170,53,0.18);
}
.button-secondary {
  color: #f5f5f8;
  border-color: rgba(110,118,239,0.72);
  background: rgba(5,17,58,0.68);
  box-shadow: inset 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
}
.button-secondary:hover:not(:disabled) { background: rgba(31,44,107,0.84); border-color: #777cf1; }
.button-spark { width: 8px; height: 8px; border-radius: 50%; background: #ff8c2c; box-shadow: 0 0 0 4px rgba(255,140,44,0.15); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.site-footer { position: fixed; z-index: 2; left: 0; right: 0; bottom: 24px; display: flex; justify-content: center; padding: 0 20px; }
.footer-copy { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.35em; margin: 0; color: rgba(242,242,242,0.76); font-size: 14px; text-align: center; }
.footer-copy a { color: #fff; font-weight: 700; text-underline-offset: 4px; text-decoration-color: rgba(255,170,53,0.72); }
.footer-copy a:hover { color: #ffd58e; }

.card-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  padding: clamp(18px, 3vw, 30px);
  overflow: auto;
  color: #f4f4f7;
  border: 1px solid rgba(110,117,239,0.9);
  border-radius: 24px;
  background: #020e35;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6), 0 0 40px rgba(70,77,219,0.24);
}
.card-dialog::backdrop { background: rgba(0,6,28,0.82); backdrop-filter: blur(9px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; text-align: left; }
.dialog-kicker { margin: 0 0 5px; color: var(--orange); font-family: "Courier New", monospace; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; }
.dialog-head h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
.icon-button { min-width: 72px; height: 42px; padding: 0 14px; border: 1px solid rgba(255,255,255,0.15); border-radius: 12px; color: #fff; background: rgba(255,255,255,0.06); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.canvas-wrap { overflow: hidden; border: 1px solid rgba(97,104,220,0.66); border-radius: 16px; background: #031342; }
#social-card { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.card-size { margin: 10px 0 0; color: rgba(242,242,242,0.5); font-family: "Courier New", monospace; font-size: 12px; text-align: right; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 32px; width: min(520px, calc(100vw - 32px)); padding: 14px 18px; transform: translateX(-50%); border: 1px solid rgba(255,170,53,0.6); border-radius: 13px; color: #fff; background: rgba(2,14,53,0.96); box-shadow: 0 18px 50px rgba(0,0,0,0.38); text-align: center; }
.noscript { position: fixed; top: 0; left: 0; right: 0; z-index: 20; margin: 0; padding: 12px; color: #1b1034; background: #ffce80; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes breathe { from { opacity: 0.28; transform: translateX(-8px); } to { opacity: 0.74; transform: translateX(8px); } }

@media (max-width: 1180px) {
  .timer-panel { grid-template-columns: 210px 1px minmax(0,1fr); gap: 22px; padding-inline: 26px; }
  .timer-grid { --digit-w: clamp(33px, 3.3vw, 47px); grid-template-columns: minmax(90px,1fr) 22px minmax(90px,1fr) 22px minmax(90px,1fr) 22px minmax(90px,1fr); }
  .separator i { width: 10px; height: 10px; }
}

@media (max-width: 820px) {
  body { min-height: 100%; }
  .stage { place-items: start center; min-height: calc(100svh - 62px); padding: 72px 16px 56px; }
  .timer-frame { width: 100%; max-width: 660px; }
  .timer-panel { grid-template-columns: 1fr; grid-template-rows: auto 1px auto; gap: 22px; padding: 25px 22px 26px; border-radius: 24px; }
  .brand-block { flex-direction: row; justify-content: center; gap: 24px; }
  .brand-copy { text-align: left; }
  .brand-copy p { margin-bottom: 0; }
  .arc-logo { width: 64px; height: 64px; }
  .brand-divider { width: auto; height: 1px; margin: 0 8%; background: linear-gradient(90deg, transparent, var(--orange) 14%, var(--orange) 86%, transparent); }
  .timer-grid { --digit-w: clamp(36px, 9vw, 58px); grid-template-columns: repeat(2, minmax(0,1fr)); gap: 26px 18px; }
  .separator { display: none; }
  .time-unit { position: relative; padding: 10px 4px 14px; border-radius: 16px; background: rgba(12,30,86,0.2); }
  .time-unit::after { content: ""; position: absolute; right: 10px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); opacity: 0.78; }
  .unit-label { margin-bottom: 13px; font-size: 14px; }
  .target-note { margin-top: 26px; }
  .site-footer { position: relative; bottom: auto; padding: 0 20px 28px; }
  .raised-tab { right: 8%; width: 76px; }
}

@media (max-width: 460px) {
  .stage { padding: 54px 10px 42px; }
  .timer-frame { width: 100%; }
  .timer-panel { gap: 18px; padding: 22px 14px 20px; border-radius: 20px; }
  .brand-block { gap: 16px; }
  .brand-copy h1 { font-size: 19px; }
  .brand-copy p { font-size: 18px; }
  .arc-logo { width: 56px; height: 56px; }
  .timer-grid { --digit-w: clamp(29px, 9.2vw, 42px); gap: 14px 10px; }
  .time-unit { padding-inline: 1px; }
  .unit-label { font-size: 11px; letter-spacing: 0.03em; }
  .actions { display: grid; grid-template-columns: 1fr; padding: 0 10px; }
  .button { width: 100%; }
  .target-note { font-size: 10px; letter-spacing: 0.1em; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .card-dialog { border-radius: 18px; }
}

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