body[data-theme="shoreline"] {
  color-scheme: light;
  --bg: #eaf5f2;
  --panel: #f7fbf8;
  --panel-strong: #dbeee8;
  --ink: #173f49;
  --muted: #49686d;
  --line: #aac7c5;
  --accent: #126f69;
  --accent-strong: #a8dfd1;
  --warn: #8a5512;
  --danger: #b13d4e;
  --sky: #126c95;
  --violet: #7057a0;
  --page-background: #addae0;
  --surface-background: #f5fbf8;
  --control-background: #f5fbf8;
  --popover-background: #f5fbf8;
  --hud-background: #f5fbf8;
  --primary-background: #b6e6d7;
}

/* Outside the animated main menu, the same island is a still backdrop.
   Reading surfaces stay opaque and the board keeps its own rendering. */
body[data-theme="shoreline"]:not([data-shoreline-menu="true"])::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("./shoreline/portrait-v101.png") center / cover no-repeat;
}
body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) .app-shell { background: #eff7f3; }
body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) .top-bar {
  position: relative;
  isolation: isolate;
  min-height: 70px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid #8bbab6;
}
body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) .top-bar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12px -12px 0;
  background: url("./shoreline/landscape-v101.png") 58% 37% / cover;
  opacity: .38;
  pointer-events: none;
}
body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) h1 { font: 600 19px/1.2 Georgia, "Times New Roman", serif; }
body[data-theme="shoreline"] .screen-heading {
  flex-wrap: wrap;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}
body[data-theme="shoreline"] .screen-heading h2 { flex: 1 1 auto; overflow: visible; white-space: normal; font: 500 28px/1.2 Georgia, "Times New Roman", serif; letter-spacing: 0; }
body[data-theme="shoreline"] .brand-mark { background: transparent; border: 0; box-shadow: none; }
body[data-theme="shoreline"] .brand-flag-pole { stroke: #173f49; }
body[data-theme="shoreline"] :is(.icon-button, .help-action, .secondary-action, .control-button) { border-color: var(--line); box-shadow: none; }
body[data-theme="shoreline"] :is(.icon-button, .help-action, .secondary-action):hover { background: #dbeee8; }
body[data-theme="shoreline"] .destructive-action { color: #9b382e; border-color: #bd8079; }
body[data-theme="shoreline"] .primary-action { box-shadow: none; border-color: #71b6a6; }
body[data-theme="shoreline"] .top-menu-popover { box-shadow: 0 8px 24px #173f4929; }
body[data-theme="shoreline"] .difficulty-launcher { gap: 0; }
body[data-theme="shoreline"] .difficulty-start-button {
  --risk-color: #25786c;
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px;
  transform: none;
}
body[data-theme="shoreline"] .difficulty-start-button:hover { background: #d8ebe5; }
body[data-theme="shoreline"] .difficulty-start-button.is-selected { background: #d5eae3; box-shadow: inset 3px 0 var(--accent); }
body[data-theme="shoreline"] .difficulty-start-button[data-risk-level="2"] { --risk-color: #287899; }
body[data-theme="shoreline"] .difficulty-start-button[data-risk-level="3"] { --risk-color: #a57423; }
body[data-theme="shoreline"] .difficulty-start-button[data-risk-level="4"] { --risk-color: #b25932; }
body[data-theme="shoreline"] .difficulty-start-button[data-risk-level="5"] { --risk-color: #a74256; }
body[data-theme="shoreline"] .difficulty-start-button .difficulty-label { font-size: 16px; font-weight: 650; }
body[data-theme="shoreline"] .difficulty-start-button .difficulty-detail { font-size: 12px; font-weight: 500; }
body[data-theme="shoreline"] .difficulty-meter i { background: #bed2ce; }
body[data-theme="shoreline"] .difficulty-meter i.is-active { background: var(--risk-color); }
body[data-theme="shoreline"] #modeLeaderboardButton { margin-top: 12px; }
body[data-theme="shoreline"] .hud-stat { border: 0; border-bottom: 2px solid #91c7bd; border-radius: 0; background: transparent; box-shadow: none; }
body[data-theme="shoreline"] .hud-stat span { color: var(--muted); letter-spacing: 0; }
body[data-theme="shoreline"] .hud-stat strong { font-size: 18px; }
body[data-theme="shoreline"] .pb-notice { background: #f4e8c6; border-color: #b79455; box-shadow: 0 4px 14px #173f4920; }
body[data-theme="shoreline"] .pb-notice span { color: #785718; }
body[data-theme="shoreline"] .pb-notice button { color: #fff; background: #247d70; }
body[data-theme="shoreline"] .summary-grid { gap: 0 16px; }
body[data-theme="shoreline"] .summary-grid div { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0; background: none; }
body[data-theme="shoreline"] .summary-score strong { font: 600 42px/1.1 Georgia, serif; }
body[data-theme="shoreline"] .achievement-item { padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
body[data-theme="shoreline"] .achievement-item strong { font-size: 14px; }
body[data-theme="shoreline"] .achievement-item span { font-size: 12px; font-weight: 500; }
body[data-theme="shoreline"] .cosmetic-item strong { font-size: 14px; }
body[data-theme="shoreline"] .cosmetic-item span { font-weight: 500; }
@media (max-height: 620px) {
  body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) .top-bar { min-height: 54px; padding-bottom: 8px; margin-bottom: 4px; }
}
body[data-theme="shoreline"] :is(.control-icon-location, .control-icon-flag) { color: currentColor; }
body[data-theme="shoreline"] .control-button.is-active .control-icon-flag { color: #a52f43; }
body[data-theme="shoreline"] .settings-grid label { border-color: var(--line); }
body[data-theme="shoreline"] :is(.settings-section h3, .settings-grid label > span, .settings-build span) { letter-spacing: 0; font-weight: 650; }
body[data-theme="shoreline"] :is(select, input[type="text"], textarea) { background: #f9fcfa; color: var(--ink); border-color: var(--line); }
body[data-theme="shoreline"] .toggle-row input { background: #cadbd7; }
body[data-theme="shoreline"] .toggle-row input:checked { background: #187d71; border-color: #187d71; }
body[data-theme="shoreline"] .toggle-row input::after { background: #fff; box-shadow: 0 1px 3px #173f4930; }
body[data-theme="shoreline"] .tutorial-panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
body[data-theme="shoreline"] .tutorial-dialog { background: #f5fbf8; border-color: var(--line); border-top-color: var(--accent); box-shadow: none; backdrop-filter: none; }
body[data-theme="shoreline"] .tutorial-prompt { font-weight: 650; }
body[data-theme="shoreline"] :is(.run-dialog, .settings-dialog, .mode-help-dialog, .tutorial-invite-dialog, .reset-confirm-dialog) { box-shadow: 0 12px 40px #173f493d; }
body[data-theme="shoreline"] :is(.run-dialog, .mode-help-dialog, .tutorial-invite-dialog, .reset-confirm-dialog) h2 { font: 500 26px/1.2 Georgia, "Times New Roman", serif; }
body[data-theme="shoreline"] :is(.run-overlay, .reset-confirm-overlay, .mode-help-overlay, .tutorial-invite-overlay) { background: #143e4970; backdrop-filter: none; }

@media (min-aspect-ratio: 6/5) {
  body[data-theme="shoreline"]:not([data-shoreline-menu="true"])::before { background-image: url("./shoreline/landscape-v101.png"); }
}
@media (max-width: 360px) {
  body[data-theme="shoreline"]:not([data-shoreline-menu="true"]) h1 { font-size: 16px; }
}

.shoreline-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #83cde1;
}

.shoreline-scene[hidden], .shoreline-art-landscape { display: none; }
.shoreline-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.shoreline-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, 66.666667vh);
  height: max(150vw, 100vh);
}
.shoreline-art-landscape .shoreline-stage { width: max(100vw, 150vh); height: max(66.666667vw, 100vh); }
.shoreline-plate, .shoreline-water, .shoreline-details, .shoreline-foreground { position: absolute; inset: 0; width: 100%; height: 100%; }
.shoreline-water[hidden] { display: none; }
.shoreline-clues { fill: #917f55; font: 700 38px Georgia, serif; }
.shoreline-sand-grid { fill: none; stroke-linecap: round; }
.shoreline-grid-light { stroke: #fff1bd; stroke-width: 1.4; opacity: .55; }
.shoreline-grid-groove { stroke: #a77a45; stroke-width: 1.2; opacity: .5; }
.music-credit { font-size: 12px; line-height: 1.5; margin: 4px 0; }
.music-credit a { color: inherit; text-underline-offset: 2px; }
.shoreline-cloth { will-change: transform; animation: shoreline-breeze 3.8s ease-in-out infinite; }
.shoreline-cloth-1 { animation-delay: -1.8s; animation-duration: 4.6s; }
.shoreline-cloth-2 { animation-delay: -3.1s; animation-duration: 5.2s; }
.shoreline-palm-anchor, .shoreline-mine-anchor { position: absolute; }
.shoreline-palm-anchor.is-mirrored { transform: scaleX(-1); }
.shoreline-palm, .shoreline-mine { width: 100%; height: 100%; will-change: transform; }
.shoreline-palm { transform-origin: 24% 98%; animation: shoreline-sway 9s ease-in-out infinite; }
.shoreline-palm-1 { animation-duration: 7.8s; animation-delay: -2.4s; }
.shoreline-palm-2 { animation-duration: 10.5s; animation-delay: -5.8s; }
.shoreline-mine {
  opacity: .9;
  filter: saturate(.72) contrast(.84);
  mask-image: linear-gradient(to bottom, #000 55%, #000b 74%, #0000 94%);
  transform-origin: 50% 70%;
  animation: shoreline-bob 8s ease-in-out infinite;
}
.shoreline-mine-anchor::before {
  content: "";
  position: absolute;
  left: 8%; right: 4%; bottom: 13%; height: 23%;
  background: #185e6630;
  border-radius: 50%;
  filter: blur(3px);
}
.shoreline-mine-anchor::after {
  content: "";
  position: absolute;
  left: -6%; right: -8%; bottom: 14%; height: 22%;
  border: 1.5px solid #bafde2a0;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-8deg);
}
.shoreline-scene[data-paused="true"] *, .shoreline-art[data-paused="true"] * { animation-play-state: paused; }

@keyframes shoreline-breeze {
  0%, 100% { transform: skewY(-7deg) scaleX(.87); }
  50% { transform: skewY(8deg) scaleX(1); }
}
@keyframes shoreline-bob {
  0%, 100% { transform: translate(-2%, 3%) rotate(-3deg); }
  50% { transform: translate(2%, -4%) rotate(3deg); }
}
@keyframes shoreline-sway {
  0%, 100% { transform: rotate(-2.5deg) skewX(-.8deg); }
  50% { transform: rotate(2.5deg) skewX(1.2deg); }
}

body[data-shoreline-menu="true"] { --ink: #123c47; --warn: #123c47; background: #83cde1; }
body[data-shoreline-menu="true"] .app-shell {
  display: block;
  width: 100%;
  padding: 0;
  isolation: isolate;
}
body[data-shoreline-menu="true"] .top-bar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  padding: 0;
  z-index: 3;
}
body[data-shoreline-menu="true"] .brand-lockup {
  position: fixed;
  top: max(60px, 8svh);
  left: 50%;
  width: calc(100% - 40px);
  max-width: 550px;
  transform: translateX(-50%);
  display: block;
  text-align: center;
  pointer-events: none;
}
body[data-shoreline-menu="true"] .brand-mark,
body[data-shoreline-menu="true"] #statusText,
body[data-shoreline-menu="true"] .mode-icon { display: none; }
body[data-shoreline-menu="true"] h1 {
  max-width: none;
  overflow: visible;
  font: 500 64px/1.02 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  white-space: normal;
}
body[data-shoreline-menu="true"] h1 span { display: block; }
body[data-shoreline-menu="true"] #menuButton {
  color: #123c47;
  border-color: transparent;
  background: #edf9ebd9;
  box-shadow: none;
}
body[data-shoreline-menu="true"] #menuButton:hover { background: #ffffff40; }
body[data-shoreline-menu="true"] .top-menu-popover { left: 0; right: auto; color: var(--ink); }
body[data-shoreline-menu="true"] .storage-notice { color: #fff1d5; }
body[data-shoreline-menu="true"] .menu-screen {
  height: 100%;
  display: block;
  padding: max(205px, 30svh) 20px max(28px, env(safe-area-inset-bottom));
}
body[data-shoreline-menu="true"] .main-menu-list {
  width: min(300px, 100%);
  margin: 0 auto;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
body[data-shoreline-menu="true"] .menu-list-button {
  display: block;
  min-height: 46px;
  border: 0;
  padding: 6px 12px;
  color: #123c47;
  font: 500 25px/1.3 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow: visible;
  background: transparent;
  text-shadow: 0 1px 2px #e7fcf0;
}
body[data-shoreline-menu="true"] .menu-list-button.is-active { color: #123c47; background: transparent; box-shadow: none; }
body[data-shoreline-menu="true"] .menu-list-button::before,
body[data-shoreline-menu="true"] .menu-list-button::after { content: none; }
body[data-shoreline-menu="true"] .menu-list-button.is-active > span:last-child {
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 1px;
}
body[data-shoreline-menu="true"] .menu-list-button:hover { background: #e6fff02e; }
body[data-shoreline-menu="true"] .menu-list-spaced { margin-top: 15px; border-top: 0 !important; }

@media (min-aspect-ratio: 6/5) {
  .shoreline-art-portrait { display: none; }
  .shoreline-art-landscape { display: block; }
}
@media (max-width: 600px) {
  body[data-shoreline-menu="true"] h1 { font-size: 46px; }
  body[data-shoreline-menu="true"] .menu-list-button { font-size: 23px; min-height: 44px; }
  body[data-shoreline-menu="true"] .menu-screen { padding-top: max(168px, 29svh); }
}
@media (max-width: 360px) {
  body[data-shoreline-menu="true"] h1 { font-size: 38px; }
  body[data-shoreline-menu="true"] .menu-list-button { font-size: 21px; }
}
@media (max-height: 650px) {
  body[data-shoreline-menu="true"] .app-shell { overflow: auto; }
  body[data-shoreline-menu="true"] .brand-lockup { position: absolute; top: 36px; width: calc(100% - 8px); }
  body[data-shoreline-menu="true"] h1 { font-size: 38px; }
  body[data-shoreline-menu="true"] .menu-screen { padding-top: 147px; height: auto; min-height: 100%; overflow: visible; }
  body[data-shoreline-menu="true"] .menu-list-button { min-height: 44px; font-size: 21px; }
}
body.reduced-motion .shoreline-scene * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .shoreline-scene * { animation: none !important; }
}
