:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #64736f;
  --line: #d8eeec;
  --surface: #ffffff;
  --background: #ffffff;
  --accent: #15c7c1;
  --accent-dark: #0ba6a1;
  --accent-soft: #e8fbfa;
  --success: #0c8f8a;
  --success-soft: #e9fbfa;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.9), transparent 42rem),
    var(--background);
  color: var(--ink);
}

body.dice-is-open {
  overflow: hidden;
}

button,
select {
  color: inherit;
  font: inherit;
}

button,
a,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
select,
label {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible + span,
.switch-row input:focus-visible ~ .switch-control {
  outline: 3px solid rgba(21, 199, 193, 0.35);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
}

.app-shell {
  display: flex;
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 48px) 36px;
  flex-direction: column;
}

.site-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
}

.wordmark {
  display: inline-flex;
  width: min(100%, 320px);
  height: 132px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-logo-frame {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 31%;
}

.wordmark-pip {
  display: block;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: var(--accent);
}

.wordmark-mobile-die {
  display: none;
  width: 2.55rem;
  height: 2.55rem;
  font-size: 2.55rem;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 0.45rem;
  border: 3px solid var(--accent);
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 0.25rem 0.7rem rgba(21, 199, 193, 0.2);
}

.wordmark-mobile-die .wordmark-pip {
  width: 0.13em;
  height: 0.13em;
}
.wordmark-pip--tl {
  grid-row: 1;
  grid-column: 1;
}

.wordmark-pip--tr {
  grid-row: 1;
  grid-column: 3;
}

.wordmark-pip--mm {
  grid-row: 2;
  grid-column: 2;
}

.wordmark-pip--bl {
  grid-row: 3;
  grid-column: 1;
}

.wordmark-pip--br {
  grid-row: 3;
  grid-column: 3;
}

.wordmark-accent {
  color: var(--accent);
}

main {
  width: 100%;
  margin: auto 0;
  padding: clamp(52px, 12vh, 116px) 0 44px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: none;
  margin-bottom: 38px;
  font-size: clamp(2.1rem, 8vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.95;
  white-space: nowrap;
}

.pick-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  padding: 0 70px;
  border: 0;
  border-radius: 22px;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(21, 199, 193, 0.18);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.pick-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 14px 32px rgba(21, 199, 193, 0.25);
  transform: translateY(-1px);
}

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

.pick-button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.76;
}

.button-die {
  position: absolute;
  right: 24px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
}

.button-die--left {
  right: auto;
  left: 24px;
}
.button-die-face {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 5px;
  border: 2px solid var(--accent);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(11, 166, 161, 0.22);
}

.button-die-pip {
  width: 5px;
  height: 5px;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: var(--accent);
}

.button-die-pip--tl {
  grid-row: 1;
  grid-column: 1;
}

.button-die-pip--tr {
  grid-row: 1;
  grid-column: 3;
}

.button-die-pip--mm {
  grid-row: 2;
  grid-column: 2;
}

.button-die-pip--bl {
  grid-row: 3;
  grid-column: 1;
}

.button-die-pip--br {
  grid-row: 3;
  grid-column: 3;
}
.secondary-actions {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 0;
}

.secondary-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.secondary-action:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.action-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}

.action-icon--sliders {
  font-size: 0.9rem;
}

.action-icon svg {
  width: 15px;
  height: 15px;
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 1.25;
}

.filters-toggle[aria-expanded="true"] {
  background: var(--surface);
  color: var(--ink);
}

.filter-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1;
}

.filters-panel {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  animation: panel-in 180ms ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.section-heading h2 {
  margin-top: 3px;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.section-kicker {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.clear-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.clear-button:hover {
  color: var(--ink);
}

fieldset {
  min-width: 0;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.option-grid--budget {
  gap: 8px;
}

.filter-option {
  position: relative;
  display: block;
}

.filter-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.filter-option span {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: #4f4e48;
  font-size: 0.9rem;
  font-weight: 650;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.filter-option span:hover {
  border-color: #b9b7ac;
}

.filter-option input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.filter-row {
  display: grid;
  gap: 14px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.distance-control {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-right: 15px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.distance-control select {
  max-width: 190px;
  padding: 9px 28px 9px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.switch-row {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  font-size: 0.9rem;
}

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 43px;
  height: 25px;
  border-radius: 999px;
  background: #d1d0c8;
  transition: background 140ms ease;
}

.switch-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  content: "";
  transition: transform 140ms ease;
}

.switch-row input:checked ~ .switch-control {
  background: var(--ink);
}

.switch-row input:checked ~ .switch-control::after {
  transform: translateX(18px);
}

.location-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.result-area {
  margin-top: 46px;
  animation: panel-in 220ms ease-out;
}

.result-card {
  padding: 25px;
  border: 1px solid #bde8e4;
  border-radius: 24px;
  background: var(--success-soft);
}

.result-kicker {
  margin-bottom: 12px;
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.result-card h2 {
  max-width: 16ch;
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.result-summary {
  margin-top: 15px;
  color: #176f6c;
  font-size: 0.98rem;
  line-height: 1.45;
}

.result-location {
  min-height: 1.4em;
  margin-top: 7px;
  color: #428582;
  font-size: 0.84rem;
}

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 22px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 140ms ease;
}

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

.result-attribution {
  margin-top: 16px;
  color: #568f8b;
  font-size: 0.7rem;
  font-weight: 650;
}

.browse-area {
  margin-top: 38px;
  animation: panel-in 220ms ease-out;
}

.browse-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.browse-heading h2 {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.browse-heading p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.browse-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.browse-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.browse-item h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.025em;
}

.browse-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.browse-item a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
}

.browse-attribution {
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.7rem;
}

.status-message {
  min-height: 1.4em;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.noscript-message {
  margin-top: 30px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.dice-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  isolation: isolate;
}

.dice-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  animation: dice-backdrop-in 180ms ease-out;
}

@keyframes dice-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.dice-dialog {
  display: flex;
  width: min(100%, 420px);
  min-height: 330px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  animation: dice-dialog-in 220ms ease-out;
}

@keyframes dice-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dice-kicker {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.dice-dialog h2 {
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(1.7rem, 7vw, 2.45rem);
  letter-spacing: -0.06em;
}

.dice-stage {
  display: grid;
  width: 286px;
  height: 206px;
  place-items: center;
  perspective: 760px;
}

.dice-pair {
  display: flex;
  align-items: center;
  gap: 16px;
  transform: rotate(-3deg);
}

.dice--second {
  margin-top: 28px;
}

.dice {
  position: relative;
  width: 112px;
  height: 112px;
  transform: rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice[data-face="1"] {
  transform: rotateX(0deg) rotateY(0deg);
}

.dice[data-face="2"] {
  transform: rotateX(0deg) rotateY(-90deg);
}

.dice[data-face="3"] {
  transform: rotateX(0deg) rotateY(-180deg);
}

.dice[data-face="4"] {
  transform: rotateX(0deg) rotateY(90deg);
}

.dice[data-face="5"] {
  transform: rotateX(-90deg) rotateY(0deg);
}

.dice[data-face="6"] {
  transform: rotateX(90deg) rotateY(0deg);
}

.dice.is-rolling {
  animation: dice-roll 1.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  transition: none;
}

.dice--second.is-rolling {
  animation-delay: -0.42s;
}

@keyframes dice-roll {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }

  35% {
    transform: rotateX(105deg) rotateY(155deg) rotateZ(10deg);
  }

  70% {
    transform: rotateX(235deg) rotateY(340deg) rotateZ(-8deg);
  }

  100% {
    transform: rotateX(360deg) rotateY(540deg) rotateZ(0deg);
  }
}

.dice-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 18px;
  border: 2px solid var(--accent);
  border-radius: 19px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), #e8fbfa),
    #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 20px 45px rgba(21, 199, 193, 0.22);
  backface-visibility: hidden;
  gap: 4px;
}

.dice-face--front {
  transform: translateZ(56px);
}

.dice-face--right {
  transform: rotateY(90deg) translateZ(56px);
}

.dice-face--back {
  transform: rotateY(180deg) translateZ(56px);
}

.dice-face--left {
  transform: rotateY(-90deg) translateZ(56px);
}

.dice-face--top {
  transform: rotateX(90deg) translateZ(56px);
}

.dice-face--bottom {
  transform: rotateX(-90deg) translateZ(56px);
}

.pip {
  width: 16px;
  height: 16px;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.pip--tl {
  grid-row: 1;
  grid-column: 1;
}

.pip--tm {
  grid-row: 1;
  grid-column: 2;
}

.pip--tr {
  grid-row: 1;
  grid-column: 3;
}

.pip--ml {
  grid-row: 2;
  grid-column: 1;
}

.pip--mm {
  grid-row: 2;
  grid-column: 2;
}

.pip--mr {
  grid-row: 2;
  grid-column: 3;
}

.pip--bl {
  grid-row: 3;
  grid-column: 1;
}

.pip--bm {
  grid-row: 3;
  grid-column: 2;
}

.pip--br {
  grid-row: 3;
  grid-column: 3;
}

.dice-total {
  min-height: 1.4em;
  margin-top: -2px;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.dice-yum {
  min-height: 1em;
  margin-top: -4px;
  color: var(--accent-dark);
  font-size: clamp(3.15rem, 15vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.1em;
  line-height: 0.86;
  animation: yum-pop 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes yum-pop {
  from {
    opacity: 0;
    transform: scale(0.72) rotate(-4deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.dice-message {
  min-height: 1.45em;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 16px 18px 28px;
  }

  .site-header {
    min-height: 0;
  }

  .wordmark {
    width: min(100%, 240px);
    height: 96px;
  }

  .brand-logo-frame {
    display: block;
  }

  .wordmark-mobile-die {
    display: none;
  }

  main {
    padding: clamp(28px, 6vh, 52px) 0 32px;
  }

  .hero {
    align-items: center;
  }

  h1 {
    width: 100%;
    margin-bottom: 28px;
    font-size: clamp(2.2rem, 9.8vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.085em;
    text-align: center;
  }

  .pick-button {
    min-height: 74px;
    padding-inline: 60px;
  }

  .secondary-actions {
    width: 100%;
    gap: 1px;
    margin-top: 14px;
  }

  .secondary-action {
    min-height: 44px;
  }
}

@media (min-width: 521px) {
  .wordmark-mobile-die {
    display: none;
  }
}

@media (min-width: 640px) {
  .pick-button {
    min-height: 78px;
    padding-inline: 30px;
    font-size: 1.25rem;
  }

  .result-card {
    padding: 32px;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .switch-row {
    border-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .dice.is-rolling {
    animation: none !important;
  }
}

@media (max-width: 360px) {
  .wordmark {
    width: min(100%, 214px);
    height: 86px;
  }

  h1 {
    font-size: clamp(2rem, 9.5vw, 2.45rem);
    letter-spacing: -0.095em;
  }
}