:root {
  --neon: #98ff00;
  --neon-soft: #5ee500;
  --ink: #030504;
  --ball-size: clamp(310px, min(78vw, 76vh), 720px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #050706;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: #efffe3;
  background:
    radial-gradient(circle at 50% 30%, rgba(77, 125, 36, 0.12), transparent 35%),
    linear-gradient(145deg, #121713 0%, #050706 55%, #090d09 100%);
  font-family: "Arial Narrow", "Trebuchet MS", Arial, sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.app-shell::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(142, 255, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 255, 0, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  pointer-events: none;
}

.ambient {
  position: absolute;
  width: 38vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.08;
  background: var(--neon);
  pointer-events: none;
}

.ambient-one {
  top: -18vw;
  left: -10vw;
}

.ambient-two {
  right: -15vw;
  bottom: -22vw;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.bounce-stage {
  position: relative;
  display: grid;
  width: var(--ball-size);
  height: calc(var(--ball-size) + 42px);
  place-items: start center;
}

.bouncing-ball {
  position: relative;
  z-index: 2;
  width: var(--ball-size);
  height: var(--ball-size);
  transform-origin: 50% 100%;
  animation: bounce 2.15s cubic-bezier(0.35, 0, 0.65, 1) infinite;
  will-change: transform;
}

.sphere-shadow {
  position: absolute;
  z-index: 1;
  bottom: 4px;
  left: 17%;
  width: 66%;
  height: 8%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 36px 10px rgba(0, 0, 0, 0.72);
  animation: shadow-pulse 2.15s cubic-bezier(0.35, 0, 0.65, 1) infinite;
  filter: blur(8px);
}

.sphere {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: clamp(3px, 0.55vw, 7px) solid #191d1a;
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 22%, rgba(255, 255, 255, 0.11), transparent 17%),
    radial-gradient(circle at 58% 43%, #111510 0%, #050706 48%, #000 74%, #111 97%);
  box-shadow:
    inset -32px -38px 62px #000,
    inset 20px 22px 45px rgba(255, 255, 255, 0.07),
    inset 0 0 0 2px rgba(255, 255, 255, 0.09),
    0 22px 46px rgba(0, 0, 0, 0.62),
    0 0 50px rgba(124, 255, 0, 0.05);
}

.sphere::after {
  position: absolute;
  inset: 2.2%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.sphere-glare {
  position: absolute;
  z-index: 3;
  top: 7%;
  left: 9%;
  width: 33%;
  height: 43%;
  border-radius: 70% 28% 70% 35%;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.035) 45%, transparent 60%);
  filter: blur(1px);
  opacity: 0.66;
  transform: rotate(23deg);
  pointer-events: none;
}

.sphere-content {
  position: absolute;
  z-index: 2;
  inset: 8.5% 12% 9%;
  display: grid;
  grid-template-rows: 24% 25% 13% 1fr;
  align-items: center;
  text-align: center;
}

.calendar-block {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(137, 255, 0, 0.5);
}

.calendar-block::after,
.weekday-wrap::after {
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 18%;
  height: 5px;
  background: radial-gradient(ellipse, #fff 0%, var(--neon) 18%, transparent 72%);
  content: "";
  transform: translateX(-50%);
}

.field-label {
  margin-bottom: -0.02em;
  color: var(--neon);
  font-size: clamp(12px, calc(var(--ball-size) * 0.036), 27px);
  font-weight: 800;
  letter-spacing: 0.17em;
  line-height: 1;
  text-shadow: none;
}

.date-number,
.month-name,
.weekday,
.digital-time strong {
  color: var(--neon);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.015em;
  text-shadow: none;
}

.date-number {
  font-size: clamp(50px, calc(var(--ball-size) * 0.16), 116px);
}

.month-name {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(32px, calc(var(--ball-size) * 0.092), 66px);
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
}

.weekday-wrap {
  position: relative;
  display: grid;
  height: 100%;
  place-items: center;
  border-bottom: 1px solid rgba(137, 255, 0, 0.5);
}

.weekday {
  font-size: clamp(23px, calc(var(--ball-size) * 0.062), 45px);
  letter-spacing: 0.09em;
}

.clock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5.5%;
  padding-top: 3%;
}

.analog-clock {
  width: 31%;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 2px solid var(--neon);
  border-radius: 50%;
  background: radial-gradient(circle, #0b1108 0%, #010301 72%);
  box-shadow: 0 0 6px var(--neon), inset 0 0 13px rgba(121, 255, 0, 0.35), 0 0 19px rgba(108, 255, 0, 0.26);
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
}

.tick {
  --tick: 0;
  position: absolute;
  top: 3%;
  left: calc(50% - 0.5px);
  width: 1px;
  height: 4%;
  background: var(--neon);
  transform: rotate(calc(var(--tick) * 6deg));
  transform-origin: 50% 1175%;
  box-shadow: 0 0 3px var(--neon);
}

.tick-hour {
  width: 2px;
  height: 7%;
}

.clock-number {
  position: absolute;
  color: var(--neon);
  font-size: clamp(8px, calc(var(--ball-size) * 0.025), 18px);
  line-height: 1;
  text-shadow: none;
}

.n12 { top: 11%; left: 50%; transform: translateX(-50%); }
.n3 { top: 50%; right: 10%; transform: translateY(-50%); }
.n6 { bottom: 10%; left: 50%; transform: translateX(-50%); }
.n9 { top: 50%; left: 10%; transform: translateY(-50%); }

.hand {
  position: absolute;
  bottom: 50%;
  left: calc(50% - 1px);
  width: 2px;
  border-radius: 999px;
  background: var(--neon);
  box-shadow: 0 0 5px var(--neon);
  transform-origin: 50% 100%;
}

.hour { height: 25%; width: 3px; }
.minute { height: 34%; }
.second { height: 38%; width: 1px; background: #e8ffc5; }

.clock-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7%;
  aspect-ratio: 1;
  border: 1px solid #dfffad;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 6px var(--neon);
  transform: translate(-50%, -50%);
}

.digital-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: rgba(220, 255, 196, 0.66);
  text-align: left;
}

.digital-time span {
  font-size: clamp(8px, calc(var(--ball-size) * 0.018), 13px);
  font-weight: 700;
  letter-spacing: 0.2em;
}

.digital-time strong {
  margin-top: 0.16em;
  font-family: Consolas, "Courier New", monospace;
  font-size: clamp(18px, calc(var(--ball-size) * 0.05), 36px);
  letter-spacing: 0.02em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.action {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid rgba(151, 255, 41, 0.28);
  border-radius: 999px;
  color: #dcffc0;
  background: rgba(15, 22, 14, 0.82);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.action:hover {
  border-color: rgba(151, 255, 41, 0.7);
  background: rgba(55, 85, 28, 0.62);
  transform: translateY(-1px);
}

.action:focus-visible {
  outline: 3px solid rgba(151, 255, 41, 0.5);
  outline-offset: 3px;
}

.action.primary {
  color: #071002;
  border-color: var(--neon);
  background: var(--neon);
  box-shadow: 0 0 18px rgba(128, 255, 0, 0.24);
}

.hint {
  margin: 10px 0 0;
  color: rgba(222, 255, 208, 0.38);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: center;
}

.install-note {
  max-width: 520px;
  margin: 10px 0 0;
  padding: 9px 14px;
  border: 1px solid rgba(151, 255, 41, 0.18);
  border-radius: 12px;
  color: rgba(230, 255, 216, 0.72);
  background: rgba(7, 12, 6, 0.72);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.wallpaper-mode .actions,
.wallpaper-mode .hint,
.wallpaper-mode .install-note {
  display: none;
}

.wallpaper-mode .bounce-stage {
  height: calc(var(--ball-size) + 42px);
}

.exit-wallpaper {
  position: fixed;
  z-index: 10;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  min-width: 64px;
  min-height: 36px;
  border: 1px solid rgba(151, 255, 41, 0.23);
  border-radius: 999px;
  color: rgba(228, 255, 208, 0.62);
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  font-size: 12px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(35px) scaleX(1.035) scaleY(0.965); }
  12% { transform: translateY(22px) scaleX(0.985) scaleY(1.015); }
  48%, 52% { transform: translateY(-18px) scaleX(1) scaleY(1); }
  88% { transform: translateY(22px) scaleX(0.99) scaleY(1.01); }
}

@keyframes shadow-pulse {
  0%, 100% { opacity: 0.86; transform: scaleX(1); }
  48%, 52% { opacity: 0.28; transform: scaleX(0.62); }
}

@media (max-width: 520px) {
  :root {
    --ball-size: min(91vw, 68vh);
  }

  .app-shell {
    align-items: center;
    padding-inline: 8px;
  }

  .bounce-stage {
    height: calc(var(--ball-size) + 36px);
  }

  .sphere-content {
    inset: 8.5% 10.5% 9%;
  }

  .month-name {
    font-size: calc(var(--ball-size) * 0.085);
  }

  .weekday {
    font-size: calc(var(--ball-size) * 0.056);
  }

  .hint {
    max-width: 290px;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  :root {
    --ball-size: 72vh;
  }

  .app-shell {
    padding-block: 8px;
  }

  .hero {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }

  .actions {
    max-width: 160px;
    flex-direction: column;
  }

  .hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bouncing-ball,
  .sphere-shadow {
    animation-duration: 5s;
  }
}
