:root {
  color-scheme: dark;
  --bg: #1c1c1c;
  --card-bg: #2b2b2b;
  --card-shadow: #0a0a0a;
  --text: #f2f2f2;
  --accent: #c8a25a;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: radial-gradient(circle at center, #262626 0%, #141414 100%);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  padding-inline: 16px;
}

.wrap {
  text-align: center;
  padding-block: 40px 28px;
  max-width: 100%;
  width: 100%;
}

h1 {
  margin: 0 0 32px;
  text-align: center;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.15em;
}

.flip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 3vw, 28px);
}

.flip-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.flip-card {
  position: relative;
  width: clamp(64px, 18vw, 100px);
  height: clamp(72px, 20vw, 112px);
  border-radius: 10px;
  background: linear-gradient(to bottom, #3a3a3a, #232323);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-value {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 700;
  color: #fff;
}

.flip-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #1c1c1c;
  }
}

.banner-link {
  /* fit-content shrink-wraps the link to the image. A plain `display: block`
     stretches it to the full width of .wrap, which made the hover shadow
     paint as a page-wide bar either side of the image. */
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-block-start: clamp(20px, 2.5vw, 30px);
  margin-inline: auto;
  border-radius: 12px;
  outline-offset: 4px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

/* <picture> is inline by default; its line-height would add a few stray
   pixels below the image inside the shrink-wrapped link. */
.banner-link picture {
  display: block;
  font-size: 0;
  line-height: 0;
}

.banner-link:hover,
.banner-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
}

.banner {
  display: block;
  /* Cap by BOTH axes so the page always fits one screen: width keeps the
     image from overflowing narrow phones, max-height keeps its 4:3 ratio
     from pushing the banner below the fold on short laptop viewports.
     The 330px subtracted is the measured chrome above and below the banner
     (40 pad + 38 h1 + 32 margin + 112 tile + 14 gap + 15 label + 28 gap
     + 28 bottom pad ~= 307, plus a small safety margin). Keep it in sync
     if you change .wrap padding, h1 margin, or .flip-card height. */
  width: auto;
  max-width: min(100%, 1100px);
  max-height: calc(100dvh - 330px);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}

/* Phones are tall enough for the full-width image, and shrinking it by
   height there would waste horizontal space - so lift the height cap. */
@media (max-width: 700px) {
  .banner {
    width: 100%;
    max-height: none;
  }
}
