/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Keep the landing page palette scoped to the logged-out home. */
:root {
  --font-japanese-sans: "YakuHanJPs", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-japanese-sans);
}

body > :is(header, main, footer, #flash_messages) {
  flex-shrink: 0;
}

body > footer {
  margin-top: auto;
}

@media (min-width: 640px) {
  .mobile-copy-break {
    display: none;
  }
}

#header-menu {
  border-radius: 12px;
  overflow: hidden;
}

#header-menu :is(a, button) {
  transition: background-color 250ms ease;
}

#header-menu :is(a, button):is(:hover, :active) {
  background-color: #e8f4f5;
  transform: none;
  box-shadow: none;
}

body:has(.landing-page) {
  background-color: #fcf9ef;
}

main:has(.landing-page) {
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding-inline: 0;
}

.landing-hero {
  background-color: #fcf9ef;
  padding-inline: max(24px, calc((100% - 960px) / 2));
}

.landing-top-logo {
  display: block;
  width: min(65%, 280px);
  height: auto;
  margin: 0 auto 24px;
}

.landing-hero-sheet {
  max-width: 720px;
  margin-inline: auto;
  padding-top: 16px;
}

.landing-title,
.landing-section-title {
  font-family: var(--font-japanese-sans);
  font-weight: 700;
}

.landing-title {
  padding-inline: 12px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.25;
  letter-spacing: 0.015em;
}

.landing-hero-image {
  display: block;
  width: min(90%, 480px);
  height: auto;
  margin: 24px auto 0;
  object-fit: contain;
}

.landing-cta {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  border-radius: 16px;
  background-color: #b9471d;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.035em;
  cursor: pointer;
  transition: background-color 250ms;
}

.landing-cta:hover {
  background-color: #cc491c;
}

.landing-cta--secondary {
  border: 1px solid #c9dbd7;
  background-color: transparent;
  color: #204d49;
  font-weight: 500;
}

.landing-cta--secondary:hover {
  background-color: #f2f5f3;
}

.landing-details {
  max-width: 1008px;
  margin-inline: auto;
  padding-inline: 24px;
}

.landing-about {
  padding: 20px 16px;
  border: 1px solid #c7d5bb;
  border-radius: 20px;
  background-color: #edf2e6;
}

.landing-about-heading,
.walk-example-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.landing-section-title.landing-about-heading {
  font-size: clamp(20px, 2.8vw, 26px);
}

.location-information-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-about-icon,
.location-information-icon,
.walk-example-heading-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.walk-example-heading-icon {
  transform: translateY(3px);
}

.landing-how-to-card {
  margin-top: 36px;
  padding-block: 28px;
}

.landing-section-title {
  color: #204d49;
  font-size: clamp(23px, 3.5vw, 32px);
  line-height: 1.5;
}

.landing-rule-title {
  display: flex;
  font-size: clamp(28px, 4vw, 40px);
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.landing-step-number {
  color: #b9471d;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .landing-hero-sheet {
    padding-top: 24px;
  }

  .landing-about {
    padding: 1.25rem 1.75rem;
  }

  .landing-how-to-card {
    margin-top: 48px;
    padding-block: 40px;
  }

}

body:has(.landing-page) > footer {
  color: #204d49;
  border-color: #c9dbd7;
}

.landing-page :is(a, button):focus-visible {
  outline: 3px solid #204d49;
  outline-offset: 4px;
}

body:has(.home-page) {
  background: #fcf9ef;
}

body:has(.completion-page) {
  background: #fcf9ef;
}

main:has(.completion-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 8px;
  background: #fcf9ef;
}

.completion-page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 24px;
}

.completion-sheet {
  padding: 28px 16px 48px;
  border: 1px solid rgb(32 77 73 / 8%);
  border-radius: 12px;
  background: #fff;
}

.completion-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0 0;
  color: #204d49;
}

.completion-stats > div {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid #c9dbd7;
  border-radius: 12px;
  background: #e8f4f5;
  text-align: center;
}

.completion-stats dt {
  font-size: clamp(0.6875rem, 2.8vw, 0.875rem);
}

.completion-stats dd {
  font-size: clamp(1rem, 3.5vw, 1.125rem);
  font-variant-numeric: tabular-nums;
}

.completion-illustration {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin-inline: auto;
}

.completion-primary-cta {
  display: inline-flex;
  width: min(100%, 360px);
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 14px;
  background: #b9471d;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  transition: background-color 250ms;
}

.completion-primary-cta:hover {
  background: #cc491c;
}

.completion-primary-cta:focus-visible {
  outline: 3px solid #204d49;
  outline-offset: 4px;
}

.completion-photo-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem auto 0;
}

.completion-photo-grid--one {
  max-width: 28rem;
  grid-template-columns: minmax(0, 1fr);
}

.completion-photo-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.completion-photo-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 640px) {
  main:has(.completion-page) {
    padding: 24px;
  }

  .completion-page {
    margin-bottom: 56px;
  }

  .completion-sheet {
    padding: 40px 56px 56px;
    border-radius: 20px;
  }

  .completion-photo-grid {
    gap: 1rem;
  }
}

main:has(.home-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding-inline: 0;
}

.home-page {
  color: #204d49;
}

.home-content,
.home-recent {
  width: min(100% - 48px, 720px);
  margin-inline: auto;
}

.home-primary {
  padding-block: 40px 16px;
}

.home-active-card,
.home-start-card {
  padding: 24px;
  border: 1px solid #c9dbd7;
  border-radius: 18px;
  background: #fff;
}

.home-meta-label {
  color: #52645f;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-eyebrow {
  margin: 0;
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
}

.home-target {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #e8f4f5;
  text-align: center;
}

.home-target > h2 {
  font-size: 0.875rem;
  font-weight: 700;
}

.home-target-char {
  margin-top: -2px;
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-size: clamp(4rem, 20vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
}

.home-connected-count {
  margin-top: 8px;
  color: #315d55;
  font-size: 0.875rem;
  font-weight: 700;
}

.home-latest-step {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #d9e4e1;
}

.home-latest-step-image {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.home-latest-word,
.home-recent-word {
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-weight: 700;
}

.home-latest-word {
  font-size: 1.5rem;
}

.home-first-word-note {
  margin-top: 20px;
  color: #52645f;
  font-size: 0.875rem;
  text-align: center;
}

.home-recent-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-primary-cta {
  display: flex;
  min-height: 56px;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  background: #b9471d;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.home-primary-cta:hover {
  background: #cc491c;
}

.home-start-card {
  padding-block: 40px 32px;
  border-color: #c9dbd7;
  border-radius: 12px;
  text-align: center;
}

.home-start-card h1 {
  margin-top: 10px;
  font-family: var(--font-japanese-sans);
  font-size: clamp(1.75rem, 7.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.35;
}

.home-start-description {
  max-width: 26rem;
  margin: 16px auto 0;
  color: #303b3c;
  font-size: 0.9375rem;
  line-height: 1.8;
}

.home-location-note {
  margin-top: 14px;
  color: #567169;
  font-size: 0.75rem;
  line-height: 1.7;
}

.home-recent {
  padding-block: 48px 56px;
}

.home-recent-title,
.active-walk-latest-heading {
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-size: 1.5rem;
  font-weight: 700;
}

.home-recent-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.home-recent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #c9dbd7;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.home-recent-card:hover {
  border-color: #88a485;
}

.home-recent-start-char,
.walk-index-start-char {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 4px 10px;
  border: 1px solid #c9dbd7;
  border-radius: 999px;
  background: #fcf9ef;
  color: #204d49;
  font-size: 0.8125rem;
  font-weight: 700;
}

.home-recent-image {
  display: block;
  aspect-ratio: 3 / 2;
  width: 100%;
  object-fit: cover;
}

.home-recent-no-image {
  display: grid;
  place-items: center;
  background: #e8f4f5;
  color: #567169;
  font-size: 0.875rem;
  font-weight: 700;
}

.home-recent-card-body {
  padding: 12px 16px 0;
}

.home-recent-word {
  font-size: 1.125rem;
}

.home-recent-stats {
  min-height: 52px;
  align-items: stretch;
  margin-top: auto;
  padding: 8px 16px 16px;
  color: #52645f;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.home-recent-stats > div,
.walk-index-card-meta > div {
  padding: 8px;
  border: 1px solid #c9dbd7;
  border-radius: 8px;
  background: #f2f5f3;
  text-align: center;
}

.home-recent-stats dt,
.walk-index-card-meta dt {
  font-size: 0.75rem;
}

.home-recent-stats dd,
.walk-index-card-meta dd {
  margin-top: 2px;
  color: #204d49;
  font-size: 0.875rem;
  font-weight: 700;
}

.home-recent-grid > li,
.home-recent-grid > li > article {
  display: flex;
}

.home-more-link {
  color: #b9471d;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.home-no-walks {
  margin-top: 20px;
  color: #567169;
  font-size: 0.875rem;
  text-align: center;
}

/* Walk index */
body:has(#finished_walk_view),
main:has(#finished_walk_view) {
  background: #fcf9ef;
}

body:has(.walk-index-page) {
  background: #fcf9ef;
}

main:has(.walk-index-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding-inline: 0;
}

.walk-index-page {
  width: 100%;
  padding: 40px 16px 64px;
  background: #fcf9ef;
}

.walk-index-content {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.walk-index-title,
.walk-index-heading,
.walk-index-card-title {
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-weight: 700;
}

.walk-index-title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.75rem);
  line-height: 1.2;
}

.walk-index-section,
.walk-index-empty {
  margin-top: 40px;
}

.walk-index-heading {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.35;
}

.walk-index-heading-icon {
  font-size: 1.25em;
  transform: translateY(0.225em);
}

.walk-index-heading-icon-active {
  color: #b9471d;
  transform: translateY(0.125em);
}

.walk-index-heading-icon-finished {
  color: #204d49;
}

.walk-index-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

#active-walks-heading + .walk-index-list {
  margin-top: 20px;
}

#finished-walks-heading + .walk-index-list {
  margin-top: 24px;
}

.walk-index-start-action {
  margin-top: 32px;
  text-align: center;
}

.walk-index-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(80px, 30%) minmax(0, 1fr);
  width: 100%;
  min-height: 152px;
  border: 1px solid #c9dbd7;
  border-radius: 12px;
  background: #fff;
  color: #303b3c;
  text-decoration: none;
}

.walk-record-card {
  position: relative;
}

.walk-record-char {
  position: absolute;
  top: -10px;
  left: -10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid #204d49;
  border-radius: 50%;
  background: #fcf9ef;
  color: #204d49;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
}

.walk-index-card:hover {
  border-color: #88a485;
}

.walk-index-card:focus-visible {
  outline: 3px solid #b9471d;
  outline-offset: 3px;
}

.walk-index-card-image {
  border-radius: 12px 0 0 12px;
  min-height: 152px;
  max-height: 260px;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 639px) {
  .walk-index-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .walk-index-card-image {
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 12px 12px 0 0;
  }
}

.walk-index-no-image {
  padding: 12px;
  text-align: center;
  display: grid;
  place-items: center;
  background: #f2f5f3;
}

.walk-index-placeholder-logo {
  width: 80%;
  max-width: 144px;
  height: auto;
  opacity: 0.22;
  filter: grayscale(1);
}

.walk-index-card-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  column-gap: 12px;
  min-width: 0;
  padding: 18px 16px 16px;
}

.walk-index-status {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  min-width: 4.5rem;
  text-align: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.walk-index-status-active {
  background: #b9471d;
  color: #fff;
}

.walk-index-status-finished {
  background: #e2efdf;
  color: #204d49;
}

.walk-index-card-title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.45;
}

.walk-index-card-meta {
  grid-column: 1 / -1;
  align-self: start;
  justify-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, max-content));
  max-width: 100%;
  gap: 8px;
  margin-top: 12px;
  color: #52645f;
  font-size: 0.875rem;
  line-height: 1.5;
}



.walk-index-thumbnails {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.walk-index-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

.walk-index-card-active .walk-index-card-content {
  grid-template-rows: auto auto 1fr auto;
  align-content: stretch;
}

.walk-index-card-active .walk-index-thumbnails {
  align-self: start;
}

.walk-index-resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  grid-column: 1 / -1;
  grid-row: 4;
  justify-self: end;
  align-self: end;
  min-height: 44px;
  margin: 10px 0 0;
  padding: 10px 16px;
  border-radius: 10px;
  background-color: #b9471d;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 800;
  transition: background-color 250ms ease;
}

.walk-index-card:is(:hover, :focus-visible) .walk-index-resume {
  background-color: #cc491c;
}

.walk-index-empty {
  padding: 24px;
  border: 1px solid #c9dbd7;
  border-radius: 12px;
  background: #fff;
  color: #52645f;
}

.walk-index-empty > p {
  margin: 12px 0 0;
  font-size: 0.9375rem;
}

.walk-index-start-button {
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px;
  border: 0;
  border-radius: 8px;
  background: #b9471d;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.walk-index-start-button:hover {
  background: #cc491c;
}

/* Active walk target */
.active-walk-target-section {
  margin-top: 24px;
  color: #204d49;
  text-align: center;
}

.active-walk-target-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font-family: var(--font-japanese-sans);
  font-size: 1.25rem;
  font-weight: 700;
}

.active-walk-target-visual {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-block: 16px 24px;
  border-bottom: dashed 1px #054643;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
}

.active-walk-target-char-card {
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #204d49;
  border-radius: 16px;
  background: #fcf9ef;
}

.active-walk-target-char {
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
}

.active-walk-target-copy {
  isolation: isolate;
  margin: -0.5rem 0 0;
  color: #303b3c;
  font-size: 1.125rem;
  line-height: 1.65;
}

.active-walk-target-copy::before {
  content: "";
  position: relative;
  z-index: -1;
  display: block;
  width: 10em;
  max-width: 100%;
  height: 4px;
  margin: 0 auto -4px;
  background: #fff;
  transform: translateY(calc(0.5rem - 2px));
}

/* Active walk */
body:has(.active-walk-page) {
  background: #fcf9ef;
}

main:has(.active-walk-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 8px;
  background: #fcf9ef;
}

.active-walk-page {
  width: 100%;
  max-width: 768px;
  margin: 0 auto 24px;
  color: #303b3c;
}

.active-walk-card {
  padding: 24px 16px 48px;
  border: 1px solid rgb(201 219 215);
  border-radius: 12px;
  background: #fff;
  color: #303b3c;
}

.active-walk-title {
  margin: 0;
  color: #204d49;
  font-family: var(--font-japanese-sans);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.active-walk-target-number {
  color: #52645f;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.active-walk-allowed-chars {
  max-width: 440px;
  margin: 12px auto 0;
  padding: 0 8px;
  color: #52645f;
  text-align: center;
}

.active-walk-allowed-chars p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.active-walk-allowed-chars p span {
  color: #204d49;
  font-weight: 800;
}

.active-walk-photo-section {
  margin-top: 24px;
  text-align: center;
}

.active-walk-photo-button {
  display: inline-flex;
  width: min(100%, 440px);
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 0;
  border-radius: 14px;
  background: #b9471d;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.active-walk-photo-button:hover {
  background: #cc491c;
}

.active-walk-photo-button:focus-visible {
  outline: 3px solid #204d49;
  outline-offset: 4px;
}

.active-walk-latest-section {
  margin-top: 24px;
}

.active-walk-latest-heading {
  margin: 0 0 24px;
}

.active-walk-latest-heading i {
  margin-right: 0.3em;
  color: #204d49;
}

#latest_step {
  padding-left: 0.5rem;
}

.active-walk-latest-link::after {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  content: "";
}

.active-walk-latest-card {
  border: 1px solid rgb(201 219 215);
}

.active-walk-latest-card:hover {
  background-color: #f2f7f3;
}

.active-walk-latest-link:focus-visible {
  outline: none;
}

.active-walk-latest-link:focus-visible::after {
  outline: 2px solid #204d49;
  outline-offset: 2px;
}

.active-walk-latest-actions {
  display: flex;
  justify-content: flex-end;
}

.active-walk-latest-cancel {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  color: #667773;
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.active-walk-latest-cancel:hover {
  color: #303b3c;
}

.active-walk-latest-empty {
  margin: 14px 0 0;
  color: #667773;
  font-size: 0.875rem;
  text-align: center;
}

.active-walk-end {
  margin-top: 48px;
  text-align: center;
}

.active-walk-end-button:focus-visible {
  outline: 2px solid #204d49;
  outline-offset: 2px;
}

.active-walk-end-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: #52645f;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color 150ms;
}

.active-walk-end-button:hover {
  color: #204d49;
  text-decoration: none;
}

body:has(.walk-step-detail-page) {
  background: #fcf9ef;
}

body:has(.how-to-play-page) {
  background: #fcf9ef;
}

main:has(.how-to-play-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 8px 16px;
  background: #fcf9ef;
}

.how-to-play-page {
  width: 100%;
  max-width: 768px;
  margin: 0 auto 24px;
}

.how-to-step {
  display: grid;
  gap: 20px;
  align-items: center;
}

.how-to-step-image {
  width: 160px;
  height: auto;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .how-to-step {
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 24px;
  }
}

.how-to-play-examples {
  margin-top: 32px;
}

body:has(.legal-page) {
  background: #fcf9ef;
}

main:has(.legal-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 8px;
  background: #fcf9ef;
}

.legal-page {
  width: 100%;
  max-width: 896px;
  margin: 0 auto 24px;
}

.legal-sheet {
  padding: 36px 20px 48px;
  border: 1px solid rgb(32 77 73 / 0.08);
  border-radius: 12px;
  background: #fff;
  color: #303b3c;
  font-size: 0.9375rem;
  line-height: 1.9;
}

.legal-sheet h2 {
  color: #204d49;
}

.legal-sheet a {
  color: #204d49;
}

.legal-sheet a:hover {
  color: #315d55;
}

.legal-sheet a:focus-visible {
  outline: 2px solid #204d49;
  outline-offset: 3px;
}

main:has(.walk-step-detail-page) {
  display: block;
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 8px;
  background: #fcf9ef;
}

.walk-step-detail-page {
  width: 100%;
  max-width: 768px;
  margin: 0 auto 24px;
}

.walk-step-detail-sheet {
  padding: 24px 16px 48px;
  border: 1px solid rgb(32 77 73 / 0.08);
  border-radius: 12px;
  background: #fff;
}

.walk-step-detail-heading {
  display: grid;
  gap: 8px;
}

.walk-step-detail-back a {
  border-color: #d9e4e1;
  color: #667773;
  font-weight: 400;
}

.walk-step-detail-back a:hover {
  background: #f4f7f6;
  color: #204d49;
}

@media (min-width: 640px) {
  main:has(.active-walk-page) {
    padding: 24px;
  }

  .active-walk-page {
    margin-bottom: 56px;
  }

  .active-walk-card {
    padding: 32px 48px 56px;
    border-radius: 20px;
  }

  main:has(.walk-step-detail-page) {
    padding: 24px;
  }

  main:has(.how-to-play-page) {
    padding: 24px;
  }

  main:has(.legal-page) {
    padding: 24px;
  }

  .walk-step-detail-page {
    margin-bottom: 56px;
  }

  .walk-step-detail-sheet {
    padding: 32px 48px 56px;
    border-radius: 20px;
  }

  .walk-step-detail-heading {
    grid-template-columns: 68px minmax(0, 1fr) 68px;
    align-items: start;
  }

  .walk-step-detail-back {
    position: relative;
    left: -2rem;
    top: -1rem;
    width: max-content;
  }

  .how-to-play-page {
    margin-bottom: 56px;
  }

  .legal-page {
    margin-bottom: 56px;
  }

  .legal-sheet {
    padding: 48px 64px 64px;
    border-radius: 20px;
  }
}

@media (min-width: 640px) {
  .walk-index-page {
    padding: 56px 32px 80px;
  }

  .walk-index-section,
  .walk-index-empty {
    margin-top: 48px;
  }

  .walk-index-card {
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 176px;
  }

  .walk-index-card-image {
    min-height: 176px;
  }

  .walk-index-card-content {
    padding: 20px 22px;
  }

  .walk-index-card-title {
    font-size: 1.25rem;
  }

  .walk-index-card-meta {
    font-size: 0.8125rem;
  }

  .walk-index-start-button {
    width: auto;
    min-width: 200px;
  }

  .active-walk-target-char-card {
    width: 172px;
  }

  .active-walk-target-char {
    font-size: 6.5rem;
  }
}

.home-page :is(a, button):focus-visible {
  outline: 3px solid #204d49;
  outline-offset: 4px;
}

@media (min-width: 640px) {
  .home-active-card,
  .home-start-card {
    padding: 32px;
  }

  .home-recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-primary-cta {
    max-width: 440px;
    margin-inline: auto;
  }
}

@media (min-width: 1024px) {
  .home-primary {
    padding-top: 56px;
  }

  .home-recent {
    width: min(100% - 48px, 960px);
  }

  .home-recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* A small photo trail follows the word chain in reading order. */
.walk-example-grid {
  display: grid;
  gap: 184px;
  max-width: 640px;
  margin: 44px auto 24px;
  padding: 0 12px 12px;
  list-style: none;
}
.walk-example-stop {
  position: relative;
  width: 82%;
  max-width: 320px;
  justify-self: start;
}
.walk-example-stop:nth-child(even) { justify-self: end; }
.walk-example-stop:nth-child(odd) .walk-example-card { transform: rotate(-3deg); }
.walk-example-stop:nth-child(even) .walk-example-card { transform: rotate(3deg); }
.walk-example-card {
  position: relative;
  padding: 8px;
  border: 1px solid #dce5dc;
  border-radius: 16px;
  background: #fff;
  box-shadow: 3px 5px 0 #e8efdf;
}

.walk-example-caption {
  padding: 8px;
}
.walk-example-time {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.95);
  color: #204d49;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.walk-example-number {
  position: absolute;
  top: -20px;
  left: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f7bc4a;
  color: #204d49;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.walk-example-photo {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}
.walk-example-next {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8efdf;
  color: #204d49;
  font-size: 14px;
  font-weight: 700;
}
.walk-example-connector {
  position: absolute;
  top: calc(100% + 70px);
  left: 50%;
  width: 100px;
  aspect-ratio: 16 / 9;
}
.walk-example-arrow {
  display: block;
  width: 100%;
  height: 100%;
  color: #88a485;
}
.walk-example-stop:nth-child(even) .walk-example-connector {
  left: auto;
  right: 50%;
}
.walk-example-stop:nth-child(even) .walk-example-arrow { transform: scaleX(-1); }
.walk-example-arrow-label {
  position: absolute;
  top: 46.6667%;
  left: 47.5%;
  z-index: 3;
  margin: 0;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(27.98deg) translateY(-22px);
}
.walk-example-stop:nth-child(even) .walk-example-arrow-label {
  left: 52.5%;
  transform: translate(-50%, -50%) rotate(-27.98deg) translateY(-22px);
}
.walk-example-walker {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  z-index: 2;
  width: 180px;
  max-width: none;
  height: auto;
  pointer-events: none;
}
.walk-example-stop:nth-child(even) .walk-example-walker {
  left: auto;
  right: 0;
}
@media (min-width: 640px) {
  .walk-example-grid { gap: 224px; padding-inline: 20px; }
  .walk-example-stop { width: 62%; }
  .walk-example-connector { width: 180px; }
  .walk-example-walker { width: 240px; }
}

:where(a, button, input, textarea):focus-visible {
  outline: 3px solid #204d49;
  outline-offset: 3px;
}
:where(button, input, textarea) { font: inherit; }
:where(h1, h2, h3, p, dd) { overflow-wrap: anywhere; }

.walk-map-marker { display: block; position: relative; width: 56px; height: 56px; border: 3px solid white; border-radius: 50%; background: white; box-shadow: 0 2px 8px #204d4940; }
.leaflet-container .leaflet-marker-pane .walk-map-marker img { display: block; width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.walk-map-marker span { position: absolute; top: -6px; left: -6px; min-width: 24px; padding: 2px 5px; border-radius: 50%; background: #204d49; color: white; text-align: center; font-weight: 700; }
.walk-map-marker[aria-current], .walk-map-record[aria-current] { border-color: #b9471d; box-shadow: 0 0 0 2px #b9471d; }
#selected_walk_step { display: block; scroll-margin-block: 16px; }

.landing-cta.walk-start-cta,
.home-primary-cta.walk-start-cta {
  max-width: 320px;
  margin-inline: auto;
}

.walk-view-tabs {
  max-width: 240px;
  margin-inline: auto;
}

.walk-view-tabs .walk-view-tab-active {
  background: #204d49;
  color: #fff;
}

.walk-view-tabs .walk-view-tab-active:focus-visible {
  outline-color: #fff;
}

.walk-summary-header {
  margin-bottom: 32px;
}

.walk-history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #c9dbd7;
  border-radius: 8px;
  background: transparent;
  color: #52645f;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 250ms, border-color 150ms;
}

.walk-history-button:hover {
  border-color: #a7bfb8;
  background: #f2f5f3;
}

.walk-history-button:focus-visible {
  outline: 2px solid #204d49;
  outline-offset: 2px;
}

.walk-summary-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.walk-summary-heading {
  flex: 1 1 240px;
  margin: 0;
}

.walk-summary-stats {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.walk-summary-stat {
  padding: 6px 10px;
  border: 1px solid #c9dbd7;
  border-radius: 10px;
  background: #fff;
  text-align: center;
}

.walk-summary-stat dt {
  color: #52645f;
  font-size: 0.75rem;
}

.walk-summary-stat dd {
  margin: 2px 0 0;
  color: #204d49;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.walk-timeline-dot {
  width: 14px;
  height: 14px;
  border: 1px solid #d39a62;
  border-radius: 50%;
  background: #f8d7a5;
}

.walk-timeline-event {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 0;
  color: #303b3c;
  font-size: clamp(0.8125rem, 3.5vw, 1rem);
  white-space: nowrap;
}

.walk-timeline-event span {
  color: #204d49;
  font-weight: 500;
}

.notice-toast {
  position: fixed;
  inset: auto 16px calc(24px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: min(440px, calc(100% - 32px));
  margin-inline: auto;
  padding: 12px 12px 12px 20px;
  border: 1px solid #c9dbd7;
  border-radius: 14px;
  background: #204d49;
  color: #fff;
  box-shadow: 0 6px 24px rgb(32 77 73 / 0.2);
}

.notice-toast p {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}

.notice-toast-close {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.notice-toast-close:hover {
  background: rgb(255 255 255 / 0.15);
}

.notice-toast-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Shared feedback for buttons and links styled as buttons. */
:is(button, input[type="submit"], input[type="button"], .landing-cta, .home-primary-cta, .completion-primary-cta) {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 250ms ease, color 150ms ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :is(button, input[type="submit"], input[type="button"], .landing-cta, .home-primary-cta, .completion-primary-cta):not(.active-walk-end-button):not(.active-walk-latest-cancel):not(.walk-delete-button):not([aria-controls="header-menu"]):not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgb(32 77 73 / 0.18);
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(button, input[type="submit"], input[type="button"], .landing-cta, .home-primary-cta, .completion-primary-cta):not(:disabled):not([aria-disabled="true"]):not(.walk-delete-button):not(.active-walk-latest-cancel):not(.active-walk-end-button):active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
  }
}

.walk-delete-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Text actions stay in place and use color and underline feedback. */
:is(a.underline, .home-more-link, .legal-sheet a, footer a, .active-walk-latest-cancel, .active-walk-end-button):not(.walk-map-record) {
  transition: color 150ms ease;
}

:is(a.underline, .home-more-link, .legal-sheet a, footer a, .active-walk-latest-cancel, .active-walk-end-button):not(.walk-map-record):hover {
  color: #315d55;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.walk-delete-button:hover .underline {
  text-decoration: none;
}

/* Fade background feedback in and out without moving cards or links. */
.walk-record-card,
a.transition-colors {
  transition: background-color 250ms ease, border-color 250ms ease, color 150ms ease;
}

@media (prefers-reduced-motion: reduce) {
  :is(button, input[type="submit"], input[type="button"], .landing-cta, .home-primary-cta, .completion-primary-cta),
  #header-menu :is(a, button),
  .walk-record-card,
  .walk-history-button,
  a.transition-colors {
    transition: none;
  }
}
