* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #5b6861;
  --paper: #fbfaf5;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(23, 32, 28, 0.14);
  --green: #63806b;
  --moss: #dce8d3;
  --legacy-link: #45c86e;
  --brick: #a4483b;
  --steel: #49535f;
  --gold: #d7a84f;
  --shadow: 0 18px 48px rgba(23, 32, 28, 0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
  background:
    radial-gradient(circle at 4% 56vh, rgba(152, 251, 152, 0.28) 0 54px, rgba(153, 153, 153, 0.22) 55px 82px, transparent 83px),
    linear-gradient(90deg, rgba(251,250,245,0.96), rgba(251,250,245,0.82)),
    url("../img/Web.png") center / cover fixed;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.86);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: 0;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a,
.button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.button:hover {
  border-color: rgba(69, 200, 110, 0.72);
  background: #fff;
}

.button.primary {
  border-color: var(--brick);
  background: var(--brick);
  color: #fff;
}

.hero {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(44px, 8vw, 96px) 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  color: var(--brick);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: clamp(2.7rem, 7vw, 6.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

main > .section h1 {
  max-width: none;
  font-size: clamp(1.85rem, 3.6vw, 3rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  color: #38443e;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-photo {
  position: relative;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.hero-photo::after {
  position: absolute;
  right: 6%;
  bottom: 6%;
  width: 28%;
  aspect-ratio: 1;
  border: 14px solid rgba(215, 168, 79, 0.88);
  border-radius: 50%;
  content: "";
}

.legacy-wheel {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  margin-top: 28px;
  border: 18px solid #c0c0c0;
  border-radius: 50%;
  background:
    radial-gradient(circle, #a9a9a9 0 31%, transparent 32%),
    repeating-radial-gradient(circle, #999 0 10px, #b8b8b8 11px 18px);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6), 0 16px 36px rgba(23,32,28,0.14);
}

.legacy-wheel span {
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.wheel-link {
  position: absolute;
  min-width: 92px;
  min-height: 30px;
  padding: 3px 10px;
  border-radius: 0 8px 8px 0;
  background: #c0c0c0;
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.wheel-link:hover {
  background: var(--brick);
}

.wheel-link.top {
  top: -20px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
}

.wheel-link.search {
  top: 28px;
  right: -60px;
  transform: rotate(-45deg);
}

.wheel-link.map {
  top: 86px;
  right: -78px;
}

.wheel-link.post {
  right: -58px;
  bottom: 28px;
  transform: rotate(45deg);
}

.wheel-link.game {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

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

.section-header p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.feature-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature,
.card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.08);
}

.feature {
  padding: 22px;
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.feature p,
.card p,
.notice p {
  color: var(--muted);
}

.card {
  overflow: hidden;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--moss);
}

.card-body {
  padding: 14px;
}

.card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--moss);
  color: #2b4436;
  font-size: 0.78rem;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar input,
.toolbar select,
.admin-form-panel input,
.admin-form-panel textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-form-panel,
.admin-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 22px;
  box-shadow: 0 8px 28px rgba(23, 32, 28, 0.08);
}

.admin-form-panel h1 {
  max-width: none;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.admin-form-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-form-panel .check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 14px;
  color: var(--ink);
}

.admin-form-panel .check-control input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--green);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.geo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 12px;
}

.admin-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-note.inline {
  margin: 0;
  font-size: 0.82rem;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-item {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 10px;
}

.admin-item img {
  width: 108px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.admin-item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-item h3,
.admin-item p {
  margin-bottom: 6px;
}

.admin-item-title h3 {
  margin-bottom: 0;
}

.status-hidden {
  background: rgba(88, 98, 94, 0.15);
  color: #53615a;
}

.button.danger {
  border-color: rgba(164, 72, 59, 0.45);
  color: var(--brick);
}

.map-panel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(99, 128, 107, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(99, 128, 107, 0.11) 1px, transparent 1px),
    #eef3ea;
  background-size: 44px 44px;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.leaflet-ready {
  background: #eef3ea;
}

.leaflet-container {
  font: inherit;
}

.pin {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--brick);
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.24);
  transform: translate(-50%, -50%) rotate(-45deg);
  cursor: pointer;
}

.pin::after {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.map-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  width: min(360px, calc(100% - 36px));
  overflow: hidden;
}

.notice {
  padding: 22px;
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 42px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.site-footer a {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  background: var(--moss);
  color: var(--ink);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 4px solid #98fb98;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 28, 0.16);
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: back-to-top-bob 1.55s ease-in-out infinite;
}

.back-to-top::after {
  width: 10px;
  height: 10px;
  border-top: 3px solid #666;
  border-left: 3px solid #666;
  content: "";
  transform: translateY(3px) rotate(45deg);
}

.back-to-top:hover {
  background: #fff;
  border-color: #45c86e;
}

@keyframes back-to-top-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.workshop-link {
  margin: 24px 0 0;
  text-align: center;
}

.legacy-home {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: url("../img/Web.png") center / cover fixed;
  font-family: "Alegreya Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.legacy-home::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(255, 255, 255, 0.08);
  content: "";
  pointer-events: none;
}

.legacy-title {
  position: relative;
  z-index: 7;
  padding-top: 22px;
  color: #e0ffff;
  font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,0.22);
}

.legacy-title p {
  margin: 0;
}

.legacy-stage {
  position: relative;
  z-index: 6;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 110px);
  padding: 28px 16px 250px;
}

.legacy-sample {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  border: 3px solid #98fb98;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: clamp(22px, 4vw, 38px);
  color: #17201c;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.legacy-sample h1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0;
  max-width: none;
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 4.2vw, 2.55rem);
  line-height: 1.15;
  overflow-wrap: normal;
  text-align: center;
  white-space: normal;
}

.legacy-sample h1 span {
  display: inline-block;
}

.legacy-sample p {
  margin-bottom: 14px;
}

.legacy-copy span {
  display: block;
}

.legacy-sample a {
  color: var(--legacy-link);
  font-weight: 800;
}

.legacy-sample a:hover {
  color: #2fa85a;
}

.legacy-project {
  font-size: 0.95rem;
}

.legacy-project a span {
  display: inline-block;
}

.legacy-small {
  color: #5b6861;
  font-size: 0.82rem;
}

.legacy-arc,
.legacy-arc-color {
  position: fixed;
  right: 0;
  width: 100%;
  border-radius: 50% / 100% 100% 0 0;
  pointer-events: none;
}

.legacy-arc {
  z-index: 3;
  right: 0.5%;
  width: 99%;
  height: 175px;
  background: #999999;
}

.legacy-arc-color {
  z-index: 2;
  height: 180px;
  background: #98fb98;
}

.legacy-arc-top,
.legacy-arc-color-top {
  top: 0;
  transform: rotate(180deg);
}

.legacy-arc-bottom,
.legacy-arc-color-bottom {
  bottom: 0;
}

.legacy-click-menu {
  position: fixed;
  top: 52.5%;
  left: 3.3%;
  z-index: 12;
  box-sizing: content-box;
  width: 3em;
  height: 3em;
  transform: translateY(-50%) translateX(-50%);
}

.legacy-click-menu button {
  position: absolute;
  top: -1.55em;
  left: -1em;
  z-index: 2;
  appearance: none;
  box-sizing: content-box;
  width: 3em;
  height: 3em;
  min-width: 0;
  padding: 0;
  border: 1em solid #c0c0c0;
  border-radius: 5em;
  background: #a9a9a9;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
  outline: 0;
}

.legacy-click-menu button:focus,
.legacy-click-menu button:focus-visible {
  outline: 0;
}

.legacy-click-menu button::after {
  position: absolute;
  top: 1em;
  left: 1em;
  width: 1em;
  height: 0.2em;
  border-top: 0.6em double #fff;
  border-bottom: 0.2em solid #fff;
  content: "";
}

.legacy-click-menu ul {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: rotate(180deg) translateY(-2em);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.legacy-click-menu.is-open ul {
  transform: rotate(0deg) translateY(-1em);
  pointer-events: auto;
}

.legacy-click-menu li {
  position: absolute;
  width: 7em;
  height: 1.6em;
  padding: 0.1em;
  border-radius: 0 0.6em 0.5em 0;
  background: #c0c0c0;
  opacity: 0;
  text-align: center;
  transition: opacity 0.35s ease, background 0.25s ease;
}

.legacy-click-menu.is-open li {
  opacity: 1;
}

.legacy-click-menu li:hover {
  background: #45c86e;
}

.legacy-click-menu a {
  display: block;
  color: white;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.55em;
  text-decoration: none;
}

.legacy-click-menu li:nth-of-type(1) {
  top: -4.45em;
  left: -1.75em;
  transform: rotate(-90deg);
}

.legacy-click-menu li:nth-of-type(2) {
  top: -3.2em;
  left: 1.75em;
  transform: rotate(-45deg);
}

.legacy-click-menu li:nth-of-type(3) {
  top: 0.7em;
  left: 3.25em;
}

.legacy-click-menu li:nth-of-type(4) {
  top: 4.35em;
  left: 1.75em;
  transform: rotate(45deg);
}

.legacy-click-menu li:nth-of-type(5) {
  top: 6.2em;
  left: -1.75em;
  transform: rotate(90deg);
}

.legacy-bottom-nav {
  display: none;
}

.legacy-collection {
  position: relative;
  z-index: 6;
  padding-top: 20px;
}

.workshop-subtle {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.workshop-subtle:hover {
  border-color: rgba(69, 200, 110, 0.58);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.legacy-action-cards {
  position: absolute;
  left: 50%;
  bottom: 130px;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  width: min(680px, calc(100% - 32px));
  transform: translateX(-50%);
}

.legacy-action-cards a {
  display: grid;
  gap: 2px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 58px;
  padding: 8px 12px;
  border: 2px solid rgba(152, 251, 152, 0.78);
  border-radius: 8px;
  background: rgba(153, 153, 153, 0.72);
  color: #fff;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.legacy-action-cards a:hover {
  background: rgba(69, 200, 110, 0.86);
}

.legacy-action-cards strong {
  font-size: 0.9rem;
  line-height: 1.1;
}

.legacy-action-cards span {
  font-size: 0.78rem;
  line-height: 1.25;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 58px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid #98fb98;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  transform: translateX(-50%);
  animation: scroll-cue-bob 1.55s ease-in-out infinite;
}

.scroll-cue::after {
  width: 10px;
  height: 10px;
  border-right: 3px solid #666;
  border-bottom: 3px solid #666;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

@keyframes scroll-cue-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  max-width: none;
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.login-panel label,
.admin-user-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-users-panel {
  grid-column: 2;
}

.admin-user-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.admin-users {
  display: grid;
  gap: 8px;
}

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .legacy-title {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
  }

  .legacy-sample {
    width: min(620px, calc(100% - 48px));
  }

  .legacy-sample h1 {
    font-size: clamp(1.9rem, 5vw, 2.65rem);
  }

  .legacy-click-menu {
    top: 53%;
    left: 4%;
  }

  .legacy-action-cards {
    width: min(620px, calc(100% - 56px));
  }

  .admin-layout {
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100vw;
  }

  body {
    background-attachment: scroll;
  }

  .section {
    width: min(100% - 32px, 680px);
    padding: 32px 0;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    width: min(100% - 32px, 680px);
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-links a,
  .nav-links button,
  .button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.9rem;
  }

  .hero-grid,
  .feature-grid,
  .gallery-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-photo img {
    max-width: 430px;
    margin: 0 auto;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .map-panel {
    min-height: 440px;
  }

  .map-card {
    right: 12px;
    bottom: 12px;
    width: min(310px, calc(100% - 24px));
  }

  .legacy-wheel {
    width: 174px;
    height: 174px;
    margin-inline: auto;
  }

  .wheel-link {
    min-width: 78px;
    font-size: 0.72rem;
  }

  .admin-layout,
  .form-grid,
  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-users-panel {
    grid-column: auto;
  }

  .admin-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .admin-item img {
    width: 88px;
  }

  .legacy-title {
    padding-top: 18px;
    font-size: clamp(1.7rem, 8vw, 2.2rem);
    line-height: 1.15;
    text-align: center;
  }

  .legacy-stage {
    display: grid;
    align-content: start;
    justify-items: center;
    width: 100%;
    min-height: auto;
    padding: 38px 16px 48px;
    overflow: hidden;
  }

  .legacy-sample {
    width: min(calc(100vw - 40px), 430px);
    margin-inline: auto;
    padding: 18px;
  }

  .legacy-sample h1 {
    font-size: clamp(1.4rem, 7vw, 2rem);
    white-space: normal;
  }

  .legacy-sample p {
    font-size: 0.88rem;
    line-height: 1.85;
  }

  .legacy-copy {
    line-height: 1.68;
  }

  .legacy-sample a {
    overflow-wrap: anywhere;
  }

  .legacy-small {
    font-size: 0.76rem;
    line-height: 1.75;
  }

  .legacy-collection {
    padding-top: 12px;
  }

  .legacy-collection .section-header {
    margin-bottom: 12px;
  }

  .legacy-collection h2 {
    font-size: 1.6rem;
  }

  .legacy-click-menu {
    position: fixed;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom) + 156px);
    left: 32px;
    transform: scale(0.82);
    transform-origin: left center;
  }

  .legacy-action-cards {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(calc(100vw - 40px), 300px);
    max-width: 280px;
    margin: 22px auto 0;
    transform: none;
  }

  .scroll-cue {
    position: static;
    margin: 22px auto 0;
    transform: none;
    animation: scroll-cue-bob-mobile 1.55s ease-in-out infinite;
  }

  .back-to-top {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    width: 44px;
    height: 44px;
  }

  .legacy-arc,
  .legacy-arc-color {
    position: absolute;
  }
}

@keyframes scroll-cue-bob-mobile {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(8px);
  }
}

@media (max-width: 560px) {
  h1 {
    max-width: none;
    font-size: clamp(1.9rem, 10vw, 2.55rem);
    line-height: 1.08;
  }

  h2 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .site-header {
    position: static;
  }

  .nav {
    padding: 12px 0;
  }

  .brand strong {
    font-size: 1.1rem;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .nav-links a,
  .nav-links button,
  .button {
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 7px 8px;
    font-size: 0.82rem;
    text-align: center;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .feature,
  .notice,
  .admin-form-panel,
  .admin-list-panel,
  .login-panel {
    padding: 16px;
  }

  .login-screen {
    align-items: start;
    justify-items: start;
    padding: 28px 16px;
  }

  .login-panel {
    width: min(100%, 340px);
    margin-left: 0;
    margin-right: auto;
  }

  .admin-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
  }

  .admin-item img {
    width: 72px;
  }

  .admin-item .actions {
    gap: 6px;
  }

  .admin-user {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-panel {
    min-height: auto;
    overflow: visible;
  }

  .map-canvas {
    position: relative;
    height: 360px;
    border-radius: 8px;
    overflow: hidden;
  }

  .map-card {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .site-footer nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer a {
    display: grid;
    place-items: center;
    min-width: 0;
    text-align: center;
  }

  .legacy-home {
    background-attachment: scroll;
  }

  .legacy-title {
    padding-left: 0;
    padding-right: 0;
  }

  .legacy-stage {
    min-height: auto;
    padding: 28px 12px 44px;
  }

  .legacy-sample {
    width: min(calc(100vw - 32px), 360px);
    margin-left: auto;
    margin-right: auto;
    padding: 16px 14px;
    text-align: left;
  }

  .legacy-sample h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.7rem);
    line-height: 1.18;
    white-space: normal;
    text-align: center;
  }

  .legacy-project {
    font-size: 0.84rem;
    text-align: center;
  }

  .legacy-project a span {
    display: block;
  }

  .legacy-copy span {
    display: inline;
  }

  .legacy-sample p:not(.legacy-copy):not(.legacy-project) {
    text-align: left;
  }

  .legacy-action-cards {
    width: min(calc(100vw - 32px), 300px);
    max-width: none;
    gap: 8px;
    margin-left: auto;
    margin-right: auto;
  }

  .legacy-action-cards a {
    min-height: 54px;
    padding: 7px 8px;
  }

  .legacy-click-menu {
    left: 24px;
    bottom: calc(env(safe-area-inset-bottom) + 144px);
    transform: scale(0.78);
  }

  .legacy-arc {
    height: 150px;
  }

  .legacy-arc-color {
    height: 155px;
  }
}

@media (max-width: 390px) {
  .section,
  .nav {
    width: min(100% - 24px, 680px);
  }

  .nav-links,
  .site-footer nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legacy-title {
    font-size: 1.55rem;
  }

  .legacy-stage {
    min-height: auto;
    padding-inline: 10px;
  }

  .legacy-sample {
    width: min(calc(100vw - 28px), 336px);
    margin-left: auto;
    margin-right: auto;
    padding: 15px 12px;
  }

  .legacy-sample h1 {
    font-size: 1.28rem;
  }

  .legacy-action-cards {
    width: min(calc(100vw - 28px), 270px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .legacy-action-cards strong {
    font-size: 0.8rem;
  }

  .legacy-action-cards span {
    font-size: 0.7rem;
  }

  .legacy-click-menu {
    left: 20px;
    bottom: calc(env(safe-area-inset-bottom) + 132px);
    transform: scale(0.74);
  }
}
