:root {
  --bg: #1e2124;
  --surface: #2c2f33;
  --border: #4a4e54;
  --text: #e8e3db;
  --text-dim: #8a9198;
  --accent: #e88a6f;
  --hour: #f0e6d3;
  --minute: #d4d0c8;
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
  --pixel: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Courier New', Courier, monospace; -webkit-font-smoothing: antialiased; }

.scene {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background-image: radial-gradient(circle, #35383c 1px, transparent 1px);
  background-size: 24px 24px;
}

.clock {
  position: relative; width: min(320px, 80vmin); aspect-ratio: 1;
  background: var(--surface); border: var(--pixel) solid var(--border);
  border-radius: 24px;
  box-shadow:
    var(--shadow),
    inset 0 0 0 var(--pixel) rgba(255,255,255,0.05),
    0 0 48px -8px var(--accent),
    0 0 80px -16px rgba(232,138,111,0.25);
  display: flex; align-items: center; justify-content: center;
  image-rendering: pixelated; transition: transform 0.2s ease, box-shadow 0.4s ease;
}
.clock:hover {
  transform: scale(1.02);
  box-shadow:
    var(--shadow),
    inset 0 0 0 var(--pixel) rgba(255,255,255,0.05),
    0 0 56px -4px var(--accent),
    0 0 100px -12px rgba(232,138,111,0.35);
}

.marks { position: absolute; inset: 16px; border-radius: 16px; }
.tick {
  position: absolute; left: 50%; top: 0; width: 4px; height: 14px;
  background: var(--text-dim); transform-origin: 50% 110px;
  border-radius: 2px; box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.tick:nth-child(3n) { height: 18px; background: var(--text); width: 6px; }

.hand {
  position: absolute; bottom: 50%; left: 50%; width: 6px; height: 45%;
  background: var(--hour); transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(-90deg); border-radius: 4px;
  box-shadow: 0 0 6px rgba(0,0,0,0.6); transition: height 0.2s ease 0.1s;
}
.hand.minute { height: 60%; background: var(--minute); width: 5px; z-index: 2; }
.hand.second {
  height: 65%; background: var(--accent); width: 3px; z-index: 3;
  transition: transform 0.25s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}
.hand:hover { box-shadow: 0 0 10px var(--accent); }

.dot { position: absolute; width: 12px; height: 12px; background: var(--bg); border: 2px solid var(--accent); border-radius: 50%; z-index: 4; }

.readout {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 14px; letter-spacing: 1px; color: var(--text-dim);
  background: rgba(30,33,36,0.8); padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--border); pointer-events: none;
}

.toggle {
  background: var(--surface); border: 2px solid var(--border); color: var(--text);
  padding: 12px 24px; border-radius: 12px; font: inherit; font-weight: bold; font-size: 16px;
  cursor: pointer; box-shadow: var(--shadow); transition: all 0.15s ease;
  min-height: 44px; min-width: 44px;
}
.toggle:hover { background: var(--border); transform: translateY(-2px); }
.toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.pause-overlay {
  position: fixed; inset: 0; background: rgba(30,33,36,0.85);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 10;
  cursor: pointer;
}
.pause-msg {
  background: var(--surface); border: 2px solid var(--accent); padding: 16px 24px;
  border-radius: 12px; color: var(--text); font-weight: bold; letter-spacing: 0.5px;
  box-shadow: var(--shadow); user-select: none; text-align: center;
}
.pause-msg:hover { background: var(--border); }

@media (max-width: 320px) {
  .clock { width: 85vw; border-width: 3px; }
  .tick { transform-origin: 50% calc(85vw/2 - 8px); }
  .readout { font-size: 12px; bottom: 12px; }
}
