:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #4b4560;
  background: #fffaf7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 213, 221, 0.62), transparent 25rem),
    radial-gradient(circle at 92% 84%, rgba(201, 233, 224, 0.58), transparent 28rem),
    #fffaf7;
}

button {
  font: inherit;
}

.game-shell {
  width: min(100% - 2rem, 920px);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 5rem) 0 3rem;
}

.game-header,
.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.game-header {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #a582a1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #5b536f;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.header-actions,
.site-nav,
.game-actions,
.card-heading {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 1rem;
}

.site-nav {
  gap: 0.9rem;
}

.site-nav a {
  color: #887b96;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover {
  color: #a582a1;
}

.site-nav a:focus-visible,
.outline-button:focus-visible,
.duck-button:focus-visible,
.modal-close:focus-visible,
.score-modal input:focus-visible {
  outline: 3px solid #f4c4cf;
  outline-offset: 3px;
}

.score-card {
  display: grid;
  min-width: 7rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 0.7rem 2rem rgba(145, 123, 151, 0.1);
  text-align: right;
}

.score-label {
  color: #a89ab0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.score-card strong {
  color: #71647e;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
}

.game-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.55);
  box-shadow:
    0 1.5rem 4rem rgba(145, 123, 151, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(0.7rem);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  padding: clamp(0.6rem, 2vw, 1rem);
  background: #f8e9e9;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  border-radius: 1rem;
  background: #cfe9e5;
  box-shadow: 0 0.5rem 1.5rem rgba(91, 83, 111, 0.12);
}

.canvas-badge {
  position: absolute;
  top: 1.45rem;
  left: 1.8rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: #776d82;
  background: rgba(255, 250, 247, 0.75);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.game-footer {
  padding: 1rem clamp(1rem, 3vw, 1.5rem) 1.2rem;
}

.game-actions {
  gap: 0.65rem;
}

.instructions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  color: #93879d;
  font-size: 0.85rem;
}

.instructions span:first-child {
  padding: 0.3rem 0.55rem;
  border: 1px solid #e8d9e3;
  border-bottom-width: 2px;
  border-radius: 0.45rem;
  color: #776d82;
  background: #fffaf7;
  font-size: 0.72rem;
  font-weight: 800;
}

.start-button {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  color: #fff;
  background: #b89ac2;
  box-shadow: 0 0.35rem 0 #9e82aa;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.duck-button,
.outline-button {
  border: 1px solid #d9c6dc;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  color: #806b89;
  background: rgba(255, 250, 247, 0.8);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.duck-button {
  display: none;
}

.duck-button:hover,
.outline-button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.start-button:hover {
  background: #aa8eb6;
  transform: translateY(-1px);
}

.start-button:active {
  box-shadow: 0 0.15rem 0 #9e82aa;
  transform: translateY(2px);
}

.start-button:focus-visible {
  outline: 3px solid #f4c4cf;
  outline-offset: 3px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-card {
  min-height: 13rem;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1rem 2.5rem rgba(145, 123, 151, 0.1);
}

.card-kicker {
  margin: 0 0 0.45rem;
  color: #a582a1;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.info-card h2,
.score-modal h2 {
  margin: 0;
  color: #5b536f;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.how-to-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.how-to-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #81758b;
  font-size: 0.85rem;
}

.key-chip {
  display: inline-grid;
  min-width: 2rem;
  min-height: 1.8rem;
  place-items: center;
  padding: 0.25rem 0.45rem;
  border: 1px solid #e8d9e3;
  border-bottom-width: 2px;
  border-radius: 0.45rem;
  color: #776d82;
  background: #fffaf7;
  font-size: 0.72rem;
  font-weight: 800;
}

.card-heading {
  justify-content: space-between;
  gap: 1rem;
}

.coming-soon {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  color: #8d7994;
  background: #f7e3e5;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.placeholder-copy,
.modal-copy,
.form-status,
.modal-score,
.play-tip {
  color: #93879d;
  font-size: 0.85rem;
  line-height: 1.55;
}

.placeholder-copy {
  min-height: 1.4rem;
  margin: 1.1rem 0 0.75rem;
}

.play-tip {
  margin: 1rem 0 0;
  color: #a582a1;
  font-size: 0.78rem;
}

.leaderboard-list {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.52);
  color: #81758b;
  font-size: 0.78rem;
}

.leaderboard-rank {
  color: #a582a1;
  font-weight: 800;
}

.leaderboard-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  color: #71647e;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.leaderboard-date {
  color: #a89ab0;
  font-size: 0.68rem;
}

.form-status {
  min-height: 1.2rem;
  margin: 0;
}

.form-status.error {
  color: #b46d78;
}

.score-modal {
  width: min(calc(100% - 2rem), 25rem);
  padding: 0;
  border: 0;
  border-radius: 1.35rem;
  color: inherit;
  background: transparent;
  box-shadow: 0 1.5rem 4rem rgba(91, 83, 111, 0.22);
}

.score-modal::backdrop {
  background: rgba(91, 83, 111, 0.28);
  backdrop-filter: blur(0.25rem);
}

.modal-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  padding: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.35rem;
  background: #fffaf7;
}

.modal-copy {
  margin: 0 0 0.35rem;
}

.modal-score {
  margin: 0;
  color: #71647e;
  font-weight: 800;
}

.modal-card label {
  color: #776d82;
  font-size: 0.78rem;
  font-weight: 800;
}

.score-modal input {
  width: 100%;
  border: 1px solid #e8d9e3;
  border-radius: 0.7rem;
  padding: 0.75rem 0.85rem;
  color: #5b536f;
  background: #fff;
  font: inherit;
}

.modal-submit {
  margin-top: 0.35rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.8rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  color: #8d7994;
  background: #f7e3e5;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 540px) {
  .game-shell {
    width: min(100% - 1.25rem, 920px);
    padding-top: 1.5rem;
  }

  .game-header,
  .game-footer {
    align-items: flex-start;
  }

  .game-header {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-nav {
    order: 2;
  }

  .game-footer {
    flex-direction: column;
  }

  .game-actions {
    width: 100%;
  }

  .duck-button {
    display: inline-block;
    flex: 0 0 auto;
  }

  .start-button {
    flex: 1;
  }

  .start-button {
    width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-button,
  .duck-button,
  .outline-button {
    transition: none;
  }
}
