:root {
  --bg1: #eef2f4;
  --bg2: #dde3e8;
  --room-background-image: url("../image/clock-background.svg");
  --panel: rgba(255, 255, 255, 0.72);
  --text: #11181f;
  --muted: rgba(17, 24, 31, 0.84);
  --clock-face: #fdfefe;
  --clock-ring: #c0c8cf;
  --clock-ring-dark: #9ca5ad;
  --clock-ring-light: #eef3f6;
  --tick: #121920;
  --hand: #11181f;
  --second: #d85063;
  --shadow: 0 22px 60px rgba(59, 70, 81, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
}

body {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.82), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.app {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.room {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08)),
    var(--room-background-image) center / cover no-repeat;
}

.room::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(10, 16, 22, 0.18));
}

.app.background-visible .room {
  opacity: 1;
}

.credit {
  display: none;
}

.centerpiece {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.clock-wrap {
  position: relative;
  width: min(88vw, 720px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.12));
}

.clock {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 18px solid transparent;
  background:
    radial-gradient(circle at 50% 45%, #ffffff 0%, var(--clock-face) 72%, #edf1f4 100%) padding-box,
    linear-gradient(145deg, var(--clock-ring-dark), var(--clock-ring-light) 24%, #fafcfd 35%, var(--clock-ring) 70%, #f5f8fa 100%) border-box;
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    inset 0 0 18px rgba(153, 163, 171, 0.14);
  overflow: hidden;
}

.clock::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 2px solid rgba(166, 176, 183, 0.24);
  box-shadow: inset 0 0 22px rgba(187, 194, 199, 0.08);
}

.tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 46%;
  transform-origin: 50% 100%;
  margin-left: -4px;
  margin-top: -46%;
}

.tick::before {
  content: "";
  display: block;
  width: 2px;
  height: 18px;
  margin: 0 auto;
  border-radius: 1px;
  background: var(--tick);
}

.tick.major::before {
  width: 8px;
  height: 28px;
  border-radius: 1px;
}

.number {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -36px;
  display: grid;
  place-items: center;
  color: #0e151c;
  font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.5rem, 6.8vw, 5.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: lining-nums tabular-nums;
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(0deg);
  background: var(--hand);
}

.hand.hour {
  width: 26px;
  height: 31%;
  clip-path: polygon(24% 100%, 76% 100%, 64% 12%, 36% 12%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.hand.minute {
  width: 14px;
  height: 43%;
  clip-path: polygon(28% 100%, 72% 100%, 62% 7%, 38% 7%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.hand.second {
  width: 4px;
  height: 46%;
  background: linear-gradient(180deg, #ef6a7b, var(--second));
}

.pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #eb6677 0 36%, #f9fbfc 37% 54%, #7a838a 55% 72%, #1a2128 73% 100%);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
}

.digital {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(117, 127, 135, 0.34);
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(66, 79, 88, 0.08);
}

.meta {
  position: static;
  z-index: 2;
  margin-top: 18px;
  padding: 0;
  text-align: center;
  background: transparent;
  box-shadow: none;
  max-width: min(520px, calc(100vw - 32px));
}

.meta .date {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.meta .message {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(17, 24, 31, 0.82);
}

.controls {
  position: static;
  z-index: 2;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: min(520px, calc(100vw - 32px));
}

button {
  border: 1px solid rgba(160, 169, 176, 0.42);
  background: rgba(255, 255, 255, 0.76);
  color: #1a2229;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  box-shadow: 0 8px 22px rgba(66, 79, 88, 0.08);
}

button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(114, 123, 131, 0.48);
}

button.active {
  background: rgba(17, 24, 31, 0.92);
  color: #f5f7f8;
  border-color: rgba(17, 24, 31, 0.92);
}

@media (max-width: 768px) {
  .app {
    min-height: 100vh;
  }

  .clock-wrap {
    width: min(94vw, 560px);
  }

  .number {
    width: 58px;
    height: 58px;
    margin-left: -29px;
    margin-top: -29px;
    font-size: clamp(2rem, 8.4vw, 4.3rem);
  }

  .hand.hour {
    width: 20px;
  }

  .hand.minute {
    width: 12px;
  }

  .meta {
    margin-top: 14px;
  }

  .controls {
    margin-top: 16px;
  }

  button {
    flex: 1 1 calc(50% - 10px);
  }
}
