:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: rgba(255, 255, 255, 0.72);
  --line: rgba(60, 60, 67, 0.12);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.10);
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9f0a;
  --pink: #ff2d55;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 122, 255, 0.18), transparent 20rem),
    radial-gradient(circle at 88% 14%, rgba(255, 45, 85, 0.12), transparent 22rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 62%, #efeff4 100%);
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.16;
}

.shell {
  position: relative;
  width: min(900px, calc(100% - 32px));
  min-height: min(640px, calc(100vh - 40px));
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
  grid-template-rows: auto minmax(230px, 1fr);
  gap: 14px;
}

.hero-panel,
.clock-card,
.calendar-card,
.game-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(150%);
}

.hero-panel {
  min-height: 260px;
  padding: clamp(24px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kicker,
.label,
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.kicker {
  color: var(--blue);
}

h1 {
  max-width: 12ch;
  margin: 18px 0 0;
  font-size: clamp(3rem, 5.4vw, 4.9rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

.construction {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 650;
  letter-spacing: 0;
}

.subline {
  max-width: 360px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.time-panel {
  display: grid;
  gap: 14px;
}

.clock-card,
.calendar-card,
.game-panel {
  padding: 20px;
}

#clock {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 3.4vw, 2.55rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
}

.calendar-head,
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-head strong,
.game-head strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.weekdays {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.calendar-grid {
  margin-top: 7px;
}

.day {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.day.today {
  color: #fff;
  background: var(--blue);
}

.game-panel {
  grid-column: 1 / -1;
}

canvas {
  width: 100%;
  height: 260px;
  margin-top: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(242, 242, 247, 0.88));
  display: block;
  object-fit: fill;
}

.hint {
  margin-top: 10px;
}

@media (max-width: 820px) {
  body {
    place-items: start center;
  }

  .shell {
    width: min(100% - 20px, 900px);
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 10px 0 22px;
  }

  .hero-panel {
    grid-row: auto;
    min-height: 230px;
  }

  .game-panel {
    grid-column: auto;
  }

  h1 {
    max-width: 10ch;
    font-size: clamp(2.8rem, 11vw, 4rem);
  }

  canvas {
    height: 210px;
  }
}

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