:root {
  color-scheme: light;
  --bg: #d9f5ff;
  --bg-deep: #8bd7f0;
  --surface: #f7fdff;
  --ink: #153846;
  --muted: #52707b;
  --primary: #0077a8;
  --primary-dark: #005b82;
  --line: #a9dcea;
  --shadow: 0 18px 45px rgba(15, 88, 121, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.88), transparent 24rem),
    linear-gradient(180deg, var(--bg) 0%, #bdeeff 46%, var(--bg-deep) 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.counter-panel {
  width: min(100%, 430px);
  min-height: min(720px, calc(100svh - 36px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 30px 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(247, 253, 255, 0.9);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0;
}

.number-wrap {
  display: grid;
  place-items: center;
  gap: 16px;
  align-self: stretch;
}

.count {
  width: min(78vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 10px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e8fbff 100%);
  color: var(--primary);
  font-size: clamp(6rem, 28vw, 10.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 -14px 28px rgba(0, 119, 168, 0.09), 0 12px 26px rgba(0, 119, 168, 0.14);
}

.message {
  min-height: 1.8em;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.controls {
  width: 100%;
  display: grid;
  gap: 12px;
}

button {
  width: 100%;
  min-height: 58px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
.sound-toggle:focus-within {
  outline: 4px solid rgba(0, 119, 168, 0.22);
  outline-offset: 3px;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-button:not(:disabled):active {
  background: var(--primary-dark);
}

.sound-toggle {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.sound-toggle input {
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
}

@media (max-height: 650px) {
  .counter-panel {
    min-height: calc(100svh - 24px);
    gap: 12px;
    padding: 18px;
  }

  .count {
    width: min(58vh, 70vw, 250px);
  }

  button {
    min-height: 50px;
  }
}
