:root {
  --olive: #3f4325;
  --olive-hover: #30331c;
  --charcoal: #2b2926;
  --muted: #77746d;
  --soft-olive: rgba(63, 67, 37, 0.08);
  --focus-ring: rgba(63, 67, 37, 0.24);
  --shadow: 0 10px 30px rgba(31, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: transparent;
  color: var(--charcoal);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.deck {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 20px 28px;
  text-align: center;
}

.draw-area {
  margin: 0 auto 22px;
}

.draw-copy {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.card-stage {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.card-image {
  display: block;
width: min(100%, 600px);
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.card-image.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

.status {
  padding: 42px 20px;
  color: var(--muted);
  font-size: 1rem;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.button {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--olive);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.button--primary {
  min-width: 140px;
  padding: 9px 17px;
  background: var(--olive);
  color: #ffffff;
  font-size: 0.9rem;
}

.button--primary:hover {
  background: var(--olive-hover);
  border-color: var(--olive-hover);
}

.button--secondary {
  background: transparent;
  color: var(--olive);
}

.button--secondary:hover {
  background: var(--soft-olive);
}

.counter {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

@media (max-width: 620px) {
  .deck {
    padding: 8px 10px 22px;
  }

  .draw-area {
    margin-bottom: 18px;
  }

  .card-stage {
    min-height: 210px;
  }

  .card-image {
    width: min(100%, 520px);
  }

  .controls {
    gap: 10px;
    margin-top: 18px;
  }

  .button {
    padding-inline: 16px;
  }
}

@media (max-width: 420px) {
  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .button--secondary {
    width: 100%;
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-image,
  .button {
    transition: none;
  }
}
