:root {
  color-scheme: light;
  --ink: #173e50;
  --teal: #155766;
  --muted: #62818b;
  --paper: #eaf5f8;
  --green: #d4e87a;
  --orange: #c65939;
  --line: #c9dfe4;
  font-family:
    'Hiragino Maru Gothic ProN', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #df8b3d;
  outline-offset: 5px;
}
button {
  border: 0;
  background: none;
}
button:hover {
  filter: brightness(0.92);
}
button:active {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
.site-header {
  max-width: 1240px;
  margin: auto;
  padding: 23px 40px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.07em;
}
.brand svg {
  width: 26px;
  height: 32px;
  color: var(--teal);
}
nav {
  display: flex;
  gap: 25px;
}
.text-button {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 0;
}
.text-button span {
  margin-left: 8px;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 0 32px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 26px;
}
.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.tiny-wave {
  font-size: 23px;
  vertical-align: -2px;
  margin-right: 6px;
  color: var(--teal);
}
h1 {
  margin: 0;
  font-size: clamp(32px, 4.1vw, 52px);
  line-height: 1.3;
  letter-spacing: -0.07em;
  font-weight: 800;
}
h1 span {
  position: relative;
  display: inline-block;
}
h1 span:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 2px;
  right: 10px;
  height: 6px;
  background: var(--green);
  border-radius: 100%;
  z-index: -1;
}
.intro-copy {
  font-size: 12px;
  line-height: 1.95;
  margin: 14px 0 0 30px;
  letter-spacing: 0.035em;
}
.intro-copy strong {
  font-weight: 600;
}
.play-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 400px) 242px;
  gap: 37px;
  justify-content: center;
  align-items: start;
}
.left-side {
  padding-top: 27px;
}
.score-panel {
  background: var(--teal);
  border-radius: 18px 18px 45px 18px;
  color: white;
  padding: 23px 25px 20px;
  position: relative;
  overflow: hidden;
}
.score-panel:after {
  content: '≈';
  font-size: 135px;
  position: absolute;
  right: -8px;
  top: 3px;
  opacity: 0.07;
  pointer-events: none;
}
.small-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0 0 8px;
}
.score {
  font-size: 63px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 20px;
  font-family: 'Avenir Next', Avenir, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.best-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ffffff35;
  padding-top: 12px;
  font-size: 10px;
}
.best-row strong {
  font-size: 15px;
  font-family: 'Avenir Next', sans-serif;
}
.best-heading {
  margin: 8px 0 4px;
  font-size: 10px;
}
.next-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 2px 18px;
  border-bottom: 1px solid var(--line);
}

/* 両方の難易度の記録は縦持ち・横持ちでもスコアの下に表示する。 */
.score-panel .difficulty-bests .best-row {
  position: static;
  display: flex;
  gap: 8px;
  padding: 3px 0 0;
  border: 0;
  font-size: 10px;
  text-align: left;
}
.score-panel .difficulty-bests .best-row strong {
  display: inline;
  margin: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.next-panel p:last-child {
  font-size: 12px;
  margin: 0;
  font-weight: 600;
}
.next-panel img {
  width: 68px;
  height: 68px;
}
.controls-note {
  margin: 26px 0 20px;
}
.controls-note h2 {
  font-size: 14px;
  margin: 0 0 12px;
}
.controls-note p {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
}
.keyboard-hint {
  line-height: 2.5 !important;
}
kbd {
  display: inline-block;
  min-width: 23px;
  text-align: center;
  border: 1px solid #c3d8de;
  border-radius: 5px;
  box-shadow: 0 2px #c3d8de;
  font-family: inherit;
  font-size: 10px;
  background: #f8fcfd;
  line-height: 20px;
  margin-right: 5px;
  padding: 0 4px;
}
.game-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.tool-button {
  font-size: 11px;
  padding: 3px 0;
  white-space: nowrap;
}
.tool-button span {
  display: inline-block;
  font-size: 16px;
  vertical-align: -1px;
  margin-right: 5px;
}
.lake-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin: 0 2px 12px;
  gap: 5px;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #56918b;
  border-radius: 50%;
  margin-right: 5px;
}
#drop-status {
  color: var(--muted);
  font-size: 9px;
}
.lake-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 400/550;
  overflow: hidden;
  border: 3px solid #75abb5;
  border-top: 0;
  border-radius: 6px 6px 46px 46px;
  background: #e2f1f2;
  box-shadow:
    0 8px 0 #c9e0e5,
    0 15px 30px #2864770b;
}
.lake-frame:after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  right: 0;
  height: 27px;
  background: #c2dcd7;
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  outline: none;
}
.lake-caption {
  font-size: 10px;
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}
.first-hint {
  position: absolute;
  top: 37%;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}
.first-hint span {
  display: block;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.first-hint small {
  display: block;
  font-size: 10px;
  margin-top: 10px;
  color: var(--muted);
}
.pause-overlay {
  position: absolute;
  inset: 0;
  background: #eaf5f8e8;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.pause-overlay h2 {
  font-size: 22px;
  margin: 20px 0 30px;
}
.pause-symbol {
  font-size: 50px;
  color: var(--teal);
}
.primary-button {
  display: block;
  padding: 15px 25px;
  border-radius: 10px;
  background: var(--teal);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.right-side {
  padding-top: 26px;
}
.field-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}
.field-heading > span:last-child {
  font-size: 23px;
  font-weight: 400;
}
.note-image-wrap {
  position: relative;
  text-align: center;
  margin: 5px 0 4px;
  min-height: 145px;
}
.note-image-wrap img {
  width: 145px;
  height: 145px;
}
.badge {
  display: inline-block;
  font-size: 10px;
  border-radius: 20px;
  padding: 5px 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.note-image-wrap .badge {
  position: absolute;
  left: 0;
  top: 15px;
  z-index: 1;
}
.badge.native {
  background: #d7e8df;
  color: #386d64;
}
.badge.alien {
  background: #f7d6c8;
  color: #9e4931;
}
.species-tag {
  font-size: 10px;
  letter-spacing: 0.02em;
  margin: 0 0 7px;
  color: var(--muted);
}
.creature-note h2 {
  font-size: 24px;
  margin: 0 0 13px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}
.species-fact {
  font-size: 11px;
  line-height: 1.9;
  min-height: 63px;
  margin: 0 0 8px;
}
.source-link {
  font-size: 9px;
  color: var(--muted);
  text-underline-offset: 4px;
}
.source-link span {
  padding-left: 5px;
}
.pressure-panel {
  margin-top: 23px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pressure-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.pressure-heading strong {
  font-size: 23px;
  font-family: 'Avenir Next', sans-serif;
}
.pressure-heading strong span {
  font-size: 12px;
  margin-left: 2px;
}
.pressure-track {
  height: 6px;
  border-radius: 6px;
  background: #d3e3e6;
  margin: 9px 0;
}
.pressure-track > div {
  width: 0;
  height: 100%;
  background: var(--orange);
  border-radius: 6px;
  transition: width 0.4s;
}
.pressure-panel p {
  font-size: 8px;
  line-height: 1.7;
  color: var(--muted);
}
.lake-message {
  font-size: 12px;
  line-height: 1.8;
  font-weight: 700;
  margin-top: 22px;
  padding-left: 13px;
  border-left: 3px solid var(--green);
}
.chain-section {
  margin-top: 32px;
  padding: 22px 0 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 32px;
}
.chain-heading {
  width: 155px;
  flex-shrink: 0;
}
.chain-heading h2 {
  font-size: 14px;
  margin: 0 0 12px;
}
.chain-heading p {
  font-size: 9px;
  margin: 0 0 8px;
}
.legend-native,
.legend-alien {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71a394;
  margin-right: 3px;
}
.legend-alien {
  background: #d77e5e;
  margin-left: 10px;
}
.chain-heading small {
  font-size: 8px;
  color: var(--muted);
}
.species-chain {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 12px;
}
.species-choice {
  position: relative;
  min-width: 0;
  flex: 1;
  padding: 0;
  border-radius: 10px;
}
.species-choice:not(:last-child):after {
  content: '›';
  position: absolute;
  right: -9px;
  top: 24px;
  color: #84a5ad;
  font-size: 19px;
}
.species-choice img {
  display: block;
  width: 62px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 6px;
  transition: transform 0.2s;
}
.species-choice:hover img {
  transform: translateY(-4px);
}
.species-choice[aria-pressed='true'] img {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 50%;
}
.species-choice span {
  font-size: 9px;
  white-space: nowrap;
  display: block;
  text-align: center;
}
.species-choice.alien:before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--orange);
  position: absolute;
  top: 2px;
  right: 2px;
  border-radius: 50%;
}
.ecology-note {
  font-size: 9px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 25px;
}
.ecology-note strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 7px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 17px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
footer > span {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.8;
}
footer .text-button {
  font-size: 10px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  background: var(--ink);
  color: white;
  border-radius: 12px;
  padding: 15px 23px;
  font-size: 12px;
  max-width: 90vw;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
dialog {
  border: 0;
  border-radius: 23px;
  color: var(--ink);
  width: min(520px, calc(100% - 32px));
  padding: 0;
  background: #f3fafb;
  box-shadow: 0 25px 100px #143a5350;
  max-height: 88dvh;
}
dialog::backdrop {
  background: #123b4f80;
  backdrop-filter: blur(6px);
}
.dialog-inner {
  padding: 40px;
  position: relative;
}
.dialog-inner h2 {
  font-size: 31px;
  line-height: 1.5;
  letter-spacing: -0.035em;
  margin: 10px 0 20px;
}
.dialog-inner h3 {
  font-size: 14px;
  margin: 22px 0 8px;
}
.dialog-inner p,
.dialog-inner li {
  font-size: 12px;
  line-height: 1.9;
}
.dialog-inner ul,
.dialog-inner ol {
  padding-left: 20px;
}
.dialog-inner .primary-button {
  width: 100%;
  margin-top: 25px;
}
.dialog-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 29px;
}
.dialog-inner a {
  text-underline-offset: 3px;
}
.dialog-inner .kicker {
  font-size: 11px;
}
.result-label {
  margin: 16px 0 0;
}
.end-score {
  font-size: 64px !important;
  line-height: 1.2 !important;
  margin: 0;
  font-family: 'Avenir Next', sans-serif;
  font-weight: 600;
}
.reflection {
  background: #e4eff0;
  border-radius: 12px;
  padding: 1px 20px 8px;
  margin-top: 23px;
}
.reflection h3 {
  margin-top: 17px;
}
.dialog-inner > .text-button {
  display: block;
  margin: 13px auto 0;
}
.step-number {
  display: inline-block;
  width: 23px;
  height: 23px;
  line-height: 23px;
  text-align: center;
  margin-right: 7px;
  background: var(--green);
  border-radius: 50%;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.mobile-only {
  display: none;
}
@media (min-width: 1400px) {
  .intro {
    padding-top: 35px;
    padding-bottom: 32px;
  }
  .play-layout {
    gap: 45px;
  }
  .chain-section {
    margin-top: 38px;
  }
}
@media (max-width: 1000px) {
  .play-layout {
    grid-template-columns: 160px minmax(0, 380px) 195px;
    gap: 24px;
  }
  .score-panel {
    padding: 20px;
  }
  .score {
    font-size: 54px;
  }
  .intro-copy {
    font-size: 11px;
  }
  .species-fact {
    font-size: 10px;
  }
  .next-panel {
    gap: 7px;
  }
  .next-panel img {
    width: 55px;
    height: 55px;
  }
  .note-image-wrap img {
    width: 125px;
    height: 125px;
  }
  .note-image-wrap {
    min-height: 125px;
  }
  .chain-section {
    gap: 20px;
  }
  .chain-heading {
    width: 140px;
  }
  .species-choice span {
    font-size: 8px;
  }
  .species-choice img {
    width: 55px;
  }
  .game-tools {
    gap: 10px 12px;
  }
}
@media (max-width: 800px) {
  .site-header {
    padding: 15px 20px;
  }
  .brand {
    font-size: 11px;
    gap: 9px;
  }
  .brand svg {
    width: 21px;
    height: 26px;
  }
  nav {
    gap: 15px;
  }
  .text-button {
    font-size: 10px;
  }
  nav .text-button:last-child {
    display: none;
  }
  main {
    padding: 0 20px;
    max-width: 620px;
  }
  .intro {
    padding: 25px 0 22px;
    display: block;
  }
  .intro-copy {
    margin: 13px 0 0;
    font-size: 10px;
    line-height: 1.7;
  }
  .intro-copy br:last-of-type {
    display: none;
  }
  .intro-copy strong {
    display: block;
  }
  h1 {
    font-size: 42px;
  }
  .kicker {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .play-layout {
    grid-template-columns: 1fr;
    gap: 19px;
  }
  .left-side {
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .score-panel {
    border-radius: 12px 12px 25px 12px;
    padding: 13px 16px;
  }
  .score {
    font-size: 37px;
    margin: 0;
  }
  .small-label {
    font-size: 9px;
    margin-bottom: 4px;
  }
  .best-row {
    position: absolute;
    right: 15px;
    top: 16px;
    border: 0;
    display: block;
    text-align: right;
    font-size: 8px;
    padding: 0;
  }
  .best-row strong {
    display: block;
    font-size: 13px;
    margin-top: 4px;
  }
  .next-panel {
    border-bottom: 0;
    padding: 12px 9px 12px 13px;
    background: #dcecf0;
    border-radius: 12px;
    justify-content: space-around;
  }
  .next-panel img {
    width: 60px;
    height: 60px;
  }
  .next-panel p:last-child {
    font-size: 11px;
  }
  .controls-note {
    display: none;
  }
  .game-tools {
    grid-column: 1/-1;
    justify-content: flex-end;
    gap: 22px;
    margin-top: -2px;
  }
  .tool-button {
    font-size: 10px;
  }
  .lake-section {
    width: min(100%, 400px);
    justify-self: center;
  }
  .lake-topline {
    font-size: 10px;
  }
  .lake-caption {
    font-size: 9px;
    margin-top: 14px;
  }
  .right-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 9px 0 0;
  }
  .field-heading {
    grid-column: 1/-1;
    padding-top: 13px;
  }
  .creature-note {
    grid-column: 1/-1;
    min-height: 140px;
    padding-left: 135px;
    position: relative;
  }
  .note-image-wrap {
    position: absolute;
    left: 0;
    top: -3px;
    width: 120px;
    min-height: 120px;
  }
  .note-image-wrap img {
    width: 120px;
    height: 120px;
  }
  .note-image-wrap .badge {
    left: 0;
    top: 0;
    font-size: 8px;
  }
  .creature-note h2 {
    font-size: 23px;
    margin-bottom: 9px;
  }
  .species-tag {
    font-size: 9px;
    margin-top: 6px;
  }
  .species-fact {
    min-height: 0;
    font-size: 11px;
    margin-bottom: 7px;
  }
  .pressure-panel {
    margin: 0;
    padding: 12px 0 0;
  }
  .pressure-panel p {
    font-size: 8px;
  }
  .lake-message {
    margin: 9px 0 0 10px;
    font-size: 11px;
    align-self: center;
  }
  .chain-section {
    display: block;
    margin-top: 26px;
    padding-top: 20px;
  }
  .chain-heading {
    width: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-bottom: 18px;
  }
  .chain-heading h2,
  .chain-heading p {
    margin: 0;
  }
  .chain-heading small {
    flex-basis: 100%;
    margin-top: 1px;
  }
  .species-chain {
    gap: 9px;
  }
  .species-choice img {
    width: 53px;
  }
  .species-choice span {
    font-size: 8px;
    writing-mode: vertical-rl;
    margin: auto;
    letter-spacing: 0.1em;
    margin-top: 9px;
  }
  .species-choice:not(:last-child):after {
    right: -7px;
    top: 15px;
    font-size: 15px;
  }
  .ecology-note {
    margin-top: 3px;
    font-size: 9px;
  }
  footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 15px;
    gap: 4px;
  }
  .mobile-only {
    display: block;
  }
  footer > span {
    font-size: 9px;
  }
  .dialog-inner {
    padding: 30px 26px;
  }
  .dialog-inner h2 {
    font-size: 27px;
  }
  .toast {
    font-size: 11px;
    padding: 13px 18px;
    bottom: 16px;
    line-height: 1.7;
  }
}
@media (max-width: 360px) {
  h1 {
    font-size: 35px;
  }
  .intro-copy {
    font-size: 9px;
  }
  .creature-note {
    padding-left: 108px;
  }
  .note-image-wrap,
  .note-image-wrap img {
    width: 100px;
  }
  .creature-note h2 {
    font-size: 20px;
  }
  .species-tag {
    font-size: 8px;
  }
  .species-chain {
    gap: 6px;
  }
  .best-row {
    right: 10px;
  }
  .game-tools {
    gap: 16px;
  }
  .next-panel img {
    width: 50px;
  }
}
@media (max-width: 800px) {
  .site-header {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .intro {
    padding: 18px 0 16px;
  }
  h1 {
    font-size: clamp(24px, 7.45vw, 37px);
    white-space: nowrap;
  }
  .intro-copy {
    margin-top: 8px;
    font-size: 9px;
    line-height: 1.65;
  }
  .score-panel {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .next-panel {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .next-panel img {
    width: 55px;
    height: 55px;
  }
  .play-layout {
    gap: 14px;
  }
  .lake-frame {
    max-height: 550px;
  }
  .chain-section {
    margin-top: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.settings-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  margin: 0 0 24px;
}
.look-settings {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.look-settings legend {
  float: left;
  font-size: 10px;
  font-weight: 700;
  line-height: 32px;
  margin: 0 12px 0 0;
  padding: 0;
}
.segmented {
  display: flex;
  gap: 3px;
  background: #d7e8ec;
  padding: 3px;
  border-radius: 9px;
}
.segmented button {
  font-size: 10px;
  padding: 7px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.segmented button[aria-pressed='true'] {
  background: var(--teal);
  color: white;
}
.difficulty-setting {
  display: flex;
  align-items: center;
  gap: 10px;
}
.difficulty-setting label {
  font-size: 10px;
  font-weight: 700;
}
.difficulty-setting select {
  font: inherit;
  font-size: 11px;
  padding: 8px 26px 8px 10px;
  border: 1px solid #aac9d0;
  border-radius: 7px;
  background: #f7fcfd;
  color: var(--ink);
  max-width: 100%;
  cursor: pointer;
}
.difficulty-setting select:focus-visible {
  outline: 3px solid #df8b3d;
  outline-offset: 3px;
}
.difficulty-summary {
  flex: 1;
  min-width: 210px;
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
.score-panel .small-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.small-label #score-difficulty {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  background: #ffffff1f;
  padding: 3px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.lake-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 12px;
}
.lake-caption #throw-count {
  font-weight: 700;
  color: var(--ink);
}
body[data-look='realistic'] .note-image-wrap img {
  width: 160px;
  height: 160px;
}
body[data-look='realistic'] .note-image-wrap {
  min-height: 160px;
}
@media (max-width: 1000px) {
  .settings-bar {
    gap: 10px 20px;
  }
  .difficulty-summary {
    flex-basis: 100%;
  }
  .small-label #score-difficulty {
    font-size: 7px;
    padding: 2px 4px;
  }
}
@media (max-width: 800px) {
  .settings-bar {
    padding: 10px 0;
    margin-bottom: 17px;
    gap: 9px 13px;
  }
  .look-settings {
    flex: 1;
  }
  .look-settings legend {
    display: none;
  }
  .segmented {
    gap: 2px;
    padding: 2px;
  }
  .segmented button {
    font-size: 9px;
    padding: 7px 9px;
  }
  .difficulty-setting {
    gap: 6px;
  }
  .difficulty-setting label {
    font-size: 9px;
  }
  .difficulty-setting select {
    font-size: 10px;
    padding: 6px 5px;
    max-width: 117px;
  }
  .difficulty-summary {
    font-size: 8px;
    flex-basis: 100%;
    line-height: 1.6;
    min-width: 0;
  }
  .score-panel .small-label {
    display: block;
    margin-right: 48px;
    white-space: nowrap;
  }
  .small-label #score-difficulty {
    display: none;
  }
  .best-row {
    font-size: 7px;
    right: 10px;
    top: 13px;
  }
  .lake-caption {
    font-size: 8px;
    gap: 3px 8px;
  }
  body[data-look='realistic'] .note-image-wrap img {
    width: 120px;
    height: 120px;
  }
  body[data-look='realistic'] .note-image-wrap {
    min-height: 120px;
  }
}
@media (max-width: 360px) {
  .settings-bar {
    gap: 8px;
  }
  .segmented button {
    font-size: 8px;
    padding: 7px;
  }
  .difficulty-setting label {
    display: none;
  }
  .difficulty-setting select {
    font-size: 9px;
    max-width: 112px;
  }
  body[data-look='realistic'] .note-image-wrap img {
    width: 100px;
    height: 100px;
  }
}
@media (max-width: 800px) {
  .intro {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .intro-copy {
    display: none;
  }
  .settings-bar {
    margin-bottom: 12px;
  }
}
@media (max-width: 500px) {
  .lake-section {
    width: min(100%, 312px);
  }
}
.species-choice[aria-pressed='true'] img {
  outline: none;
  border-radius: 0;
}
.species-choice[aria-pressed='true'] {
  background: #d5e8ed;
  box-shadow: 0 3px var(--teal);
}

/* ── スマホ横画面（landscape）最適化 ── */
@media (orientation: landscape) and (max-height: 500px) {
  .site-header {
    padding: 6px 16px;
  }
  .brand {
    font-size: 12px;
  }
  .intro {
    padding: 4px 0;
  }
  .intro h1 {
    font-size: 18px;
  }
  .settings-bar {
    margin-bottom: 6px;
    gap: 12px;
  }
  .play-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
  }
  .lake-section {
    width: auto;
    flex-shrink: 0;
  }
  .lake-frame {
    max-height: 65vh;
  }
  .lake-frame canvas {
    max-height: 65vh;
    width: auto;
  }
  .left-side,
  .right-side {
    max-width: 160px;
    font-size: 10px;
  }
  .creature-note img {
    width: 60px;
    height: 60px;
  }
  dialog .dialog-inner {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 16px;
  }
}

/* タッチ端末では、設定と一時停止も盤面と同じ感覚で押せる。 */
@media (any-pointer: coarse) {
  button,
  a,
  select {
    touch-action: manipulation;
  }
  button,
  select,
  .site-header a {
    min-height: 44px;
  }
  .site-header a {
    display: inline-flex;
    align-items: center;
  }
  .site-header {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  .site-header nav {
    flex-wrap: wrap;
    gap: 4px 16px;
  }
  .site-header .text-button {
    font-size: 12px;
  }
  .segmented button {
    font-size: 12px;
    padding: 8px 10px;
  }
  .difficulty-setting select {
    font-size: 16px;
    max-width: 140px;
  }
  .difficulty-setting label {
    font-size: 12px;
  }
  .difficulty-summary {
    font-size: 12px;
  }
  .game-tools {
    gap: 8px;
    flex-wrap: wrap;
  }
  .tool-button {
    font-size: 12px;
    padding: 8px 10px;
  }
  .lake-topline,
  .lake-caption {
    font-size: 12px;
  }
  .settings-bar {
    flex-wrap: wrap;
  }
  .look-settings {
    flex: 0 1 auto;
  }
  .species-fact,
  .ecology-note,
  .pressure-panel p {
    font-size: 14px;
    line-height: 1.8;
  }
  .dialog-inner {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
  main > footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* 横持ちは盤面を先に見せ、スコアと操作を横へ寄せる。 */
@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  body {
    overflow: hidden;
  }
  .site-header {
    display: none;
  }
  main {
    position: relative;
    max-width: none;
    height: calc(100dvh - var(--lake-site-header-height, 48px));
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
  }
  .intro {
    display: none;
  }
  .settings-bar {
    margin: 0;
    padding: 0;
    gap: 8px 16px;
    flex-wrap: nowrap;
    border: 0;
  }
  .look-settings legend,
  .difficulty-summary {
    display: none;
  }
  .segmented button {
    font-size: 11px;
    padding: 6px 10px;
  }
  .difficulty-setting select {
    font-size: 14px;
    min-height: 44px;
  }
  .play-layout {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(120px, 1fr);
    gap: 16px;
    min-height: 0;
    align-items: start;
    padding: 0;
  }
  .left-side {
    display: flex;
    flex-direction: column;
    max-width: 220px;
    min-width: 0;
    padding: 0;
    gap: 6px;
  }
  .score-panel {
    padding: 8px 12px;
    margin: 0;
  }
  .score {
    font-size: 32px;
  }
  .best-row {
    display: none;
  }
  .next-panel {
    padding: 6px 10px;
    min-height: 48px;
    margin: 0;
  }
  .next-panel img {
    width: 40px;
    height: 40px;
  }
  .next-panel p:last-child {
    font-size: 12px;
  }
  .controls-note {
    display: none;
  }
  .game-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 4px;
    margin: 0;
  }
  .tool-button,
  .game-tools .landscape-help {
    font-size: 11px;
    padding: 4px 6px;
    min-height: 44px;
  }
  .lake-section {
    width: auto;
    margin: 0;
  }
  .lake-topline {
    height: 20px;
    font-size: 10px;
    margin-bottom: 4px;
  }
  .lake-topline > span:first-child {
    display: none;
  }
  .lake-frame {
    width: calc(
      (100dvh - var(--lake-site-header-height, 48px) - 84px - env(safe-area-inset-bottom)) * 400 /
        550
    );
    max-height: none;
  }
  .lake-frame canvas {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
  }
  .lake-caption {
    font-size: 10px;
    margin: 2px 0 0;
  }
  .right-side {
    display: block;
    max-width: 220px;
    min-width: 0;
    max-height: calc(100dvh - var(--lake-site-header-height, 48px) - 56px);
    overflow-y: auto;
    padding: 0;
  }
  .field-heading {
    font-size: 12px;
    padding: 0 0 6px;
  }
  .creature-note {
    padding: 0;
    min-height: 0;
  }
  .note-image-wrap {
    position: relative;
    width: auto;
    min-height: 0 !important;
  }
  .note-image-wrap img,
  body[data-look='realistic'] .note-image-wrap img {
    width: 64px;
    height: 64px;
  }
  .creature-note h2 {
    font-size: 17px;
  }
  .species-fact {
    font-size: 12px;
    line-height: 1.7;
  }
  .pressure-panel,
  .lake-message,
  .chain-section,
  .ecology-note,
  main > footer {
    display: none;
  }
}

/* ── 2026-11-07 スマホ横向き主軸：盤面を高さいっぱいに。左に点数・つぎ・設定、右に生き物ノート ── */
.mobile-only {
  display: none;
}
@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  body.lake-site-page {
    --lake-site-header-height: 0px;
  }
  .lake-site-header {
    display: none !important;
  }
  .mobile-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
  }
  main {
    height: 100dvh;
    padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
      max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    grid-template-columns: minmax(150px, 1fr) auto minmax(140px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 6px;
  }
  .play-layout {
    display: contents;
  }
  .settings-bar {
    grid-column: 1;
    grid-row: 1;
    flex-wrap: wrap;
    gap: 4px;
  }
  .segmented button {
    min-height: 34px;
    padding: 4px 8px;
  }
  .difficulty-setting label {
    display: none;
  }
  .difficulty-setting select {
    min-height: 34px;
    font-size: 12px;
  }
  .left-side {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    overflow-y: auto;
  }
  .score-panel {
    padding: 6px 12px;
  }
  .score {
    font-size: 30px;
  }
  .game-tools {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }
  .tool-button,
  .game-tools .landscape-help {
    min-height: 40px;
    font-size: 11px;
    padding: 2px 4px;
  }
  .lake-section {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .lake-frame {
    width: calc(
      (
          100dvh - 20px - 26px - max(8px, env(safe-area-inset-top)) -
            max(6px, env(safe-area-inset-bottom))
        ) *
        400 / 550
    );
  }
  .lake-caption {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .pause-overlay h2 {
    font-size: 18px;
  }
  .right-side {
    grid-column: 3;
    grid-row: 1 / span 2;
    max-height: none;
  }
}
