
/* Layout: a full-window canvas; HUD along the top edge; menus float over the living forest. One night-time look. */
:root {
  color-scheme: dark;
  --night: #04060e;
  --panel: rgba(14, 19, 40, 0.9);
  --line: rgba(255, 226, 160, 0.2);
  --ink: #f4efe0;
  --mist: #a9bcd6;
  --glow: #ffd873;
  --glow-deep: #ffab55;
  --on-glow: #2a1806;
  --leaf: #8ff0c6;
  --rose: #ff6f8d;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--night); color: var(--ink); }
body { font-family: var(--body); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
[hidden] { display: none !important; }
#app { position: relative; width: 100%; height: 100%; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#app.playing #view { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='7' fill='none' stroke='%23ffe6a8' stroke-width='1.4' stroke-opacity='.85'/%3E%3Ccircle cx='12' cy='12' r='1.6' fill='%23fff6d8'/%3E%3C/svg%3E") 12 12, crosshair; }
button { font-family: var(--body); color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; }

/* ---- heads-up display ---- */
#hud { position: absolute; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 1fr minmax(0, 340px) 1fr; gap: 12px; align-items: start; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); pointer-events: none; text-shadow: 0 1px 8px #000, 0 0 3px #000; }
#hearts { display: flex; flex-wrap: wrap; gap: 5px; }
#hearts svg { width: 24px; height: 24px; filter: drop-shadow(0 0 6px rgba(255, 111, 141, 0.7)); }
#hearts svg.empty { filter: none; opacity: 0.45; }
#hearts svg.shield { filter: drop-shadow(0 0 6px rgba(140, 225, 255, 0.9)); }
#found { margin-top: 7px; font-size: 13px; font-weight: 600; color: var(--leaf); font-variant-numeric: tabular-nums; }
#nightBox { text-align: center; min-width: 0; }
#nightName { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nightName small { font: inherit; }
#nightName small::after { content: " · "; }
#progress { position: relative; height: 5px; margin: 9px 8px 0; border-radius: 3px; background: rgba(190, 205, 255, 0.18); }
#progress i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #8aa8ff, var(--glow)); width: 0; transition: width 0.35s; }
#progress b { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff3cf; box-shadow: 0 0 10px 3px rgba(255, 224, 140, 0.75); transition: left 0.35s; }
#progress.boss i { background: linear-gradient(90deg, #ff4f86, #ffab6e); }
#progress.boss b { background: #ffb7c8; box-shadow: 0 0 10px 3px rgba(255, 80, 130, 0.8); }
#right { display: flex; justify-content: flex-end; gap: 12px; align-items: flex-start; }
#scoreBox { text-align: right; }
#score { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.05; font-variant-numeric: tabular-nums; }
#chain { font-size: 13px; font-weight: 700; min-height: 18px; }
#chainBar { height: 3px; margin-left: auto; width: 0; border-radius: 2px; background: currentColor; }
.round { pointer-events: auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 14, 32, 0.65); display: grid; place-items: center; padding: 0; flex: none; }
.round svg { width: 16px; height: 16px; fill: var(--ink); }

#banner { position: absolute; left: 0; right: 0; top: 26%; text-align: center; padding: 0 20px; pointer-events: none; text-shadow: 0 2px 18px #000, 0 0 5px #000; animation: banner 2.6s ease both; }
#banner small { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); }
#banner h2 { margin: 4px 0 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(34px, 7vw, 62px); color: #ffeabc; text-wrap: balance; }
@keyframes banner { 0% { opacity: 0; transform: translateY(12px); } 14%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

#hint { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: min(560px, calc(100% - 32px)); box-sizing: border-box; padding: 11px 18px; border-radius: 16px; background: rgba(9, 13, 30, 0.86); border: 1px solid var(--line); font-size: 15.5px; line-height: 1.4; text-align: center; pointer-events: none; animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#app.touch #hint { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
#skip { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: 74px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 14, 32, 0.75); font-size: 13px; font-weight: 600; }
#dashBtn { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: 78px; height: 78px; border-radius: 50%; border: 2px solid rgba(191, 243, 255, 0.7); background: rgba(20, 44, 66, 0.55); font-weight: 700; font-size: 15px; touch-action: none; }
#dashBtn.spent { opacity: 0.4; }

/* ---- menus ---- */
.screen { position: absolute; inset: 0; display: flex; overflow: auto; touch-action: pan-x pan-y; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(ellipse at 50% 42%, rgba(5, 8, 20, 0.7), rgba(3, 4, 12, 0.88)); animation: fade 0.45s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.panel { margin: auto; width: 100%; max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.panel.wide { max-width: 860px; }
h1 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(54px, 13vw, 112px); line-height: 0.98; letter-spacing: -0.015em; color: #ffe8ad; text-shadow: 0 0 22px rgba(255, 190, 80, 0.7), 0 0 70px rgba(255, 150, 60, 0.45); padding: 0 0.08em; }
h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(32px, 7vw, 52px); color: #ffeabc; text-wrap: balance; }
p { margin: 0; line-height: 1.55; max-width: 44ch; text-wrap: pretty; }
.tag { font-size: clamp(16px, 2.6vw, 19px); color: #dbe6f6; }
.small { font-size: 13.5px; color: var(--mist); }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn { min-height: 48px; padding: 12px 26px; border-radius: 999px; border: 1px solid rgba(255, 228, 165, 0.38); background: rgba(24, 31, 60, 0.82); font-size: 16px; font-weight: 700; transition: transform 0.12s, box-shadow 0.2s, background 0.2s; }
.btn:hover { background: rgba(46, 56, 98, 0.9); transform: translateY(-1px); }
.btn.primary { border-color: transparent; background: linear-gradient(180deg, #ffe599, var(--glow-deep)); color: var(--on-glow); box-shadow: 0 0 28px rgba(255, 184, 84, 0.5); font-size: 18px; padding: 14px 34px; }
.btn.primary:hover { box-shadow: 0 0 42px rgba(255, 194, 94, 0.75); }
.toggles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.toggle { padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(170, 190, 230, 0.26); background: rgba(12, 17, 38, 0.7); font-size: 13px; font-weight: 600; color: var(--mist); }
.toggle[aria-pressed="true"] { color: var(--ink); border-color: rgba(143, 240, 198, 0.65); background: rgba(34, 82, 76, 0.6); }
.toggle[aria-pressed="true"]::before { content: "✓ "; color: var(--leaf); }

.fliers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.flier { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 15px 7px 11px; border-radius: 14px; border: 1px solid rgba(170, 190, 230, 0.26); background: rgba(12, 17, 38, 0.78); font-size: 14px; font-weight: 700; }
.flier i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px 3px var(--c); }
.flier[aria-pressed="true"] { border-color: var(--glow); background: rgba(70, 52, 30, 0.75); }
.flier.more { border-style: dashed; color: var(--mist); padding-left: 15px; }

.worlds { display: flex; justify-content: center; gap: 0; border: 1px solid rgba(170, 190, 230, 0.26); border-radius: 999px; background: rgba(12, 17, 38, 0.72); padding: 3px; }
.world { min-height: 34px; padding: 6px clamp(9px, 3.2vw, 20px); border: 0; border-radius: 999px; background: transparent; font-size: 14px; font-weight: 700; color: var(--mist); white-space: nowrap; }
.world[aria-pressed="true"] { color: var(--ink); background: rgba(40, 86, 90, 0.85); box-shadow: 0 0 16px rgba(143, 240, 198, 0.25); }
.world.shut { opacity: 0.55; }
/* A small padlock in front of a world that is not yet open. */
.world.shut::before {
  content: ""; display: inline-block; width: 9px; height: 11px; margin-right: 5px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath fill-rule='evenodd' d='M2 5V3.5a3 3 0 0 1 6 0V5h1v7H1V5zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath fill-rule='evenodd' d='M2 5V3.5a3 3 0 0 1 6 0V5h1v7H1V5zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 360px) { .world { padding-inline: 8px; font-size: 13px; } }

/* A single firefly, used as the sign for the currency. */
.mote { display: inline-block; width: 8px; height: 8px; margin: 0 7px 1px 5px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 8px 3px rgba(255, 214, 110, 0.8); vertical-align: middle; }
.bank { font-size: 15px; color: var(--mist); }
.bank b { font-family: var(--display); font-size: 24px; color: #ffeabc; font-variant-numeric: tabular-nums; margin-right: 2px; }
.wares { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
.ware { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 12px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ware strong { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 17px; color: #ffeabc; }
.ware .spark { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px 3px var(--c); flex: none; }
.ware span { font-size: 12.5px; line-height: 1.4; color: #cddaf0; }
.pips { display: flex; gap: 6px; margin-top: auto; padding-top: 2px; }
.pips:empty { padding: 0; }
.pips i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--glow); opacity: 0.65; }
.pips i.on { background: var(--glow); opacity: 1; box-shadow: 0 0 7px 1px rgba(255, 216, 115, 0.8); }
.pips:empty + .buy { margin-top: auto; }
.buy { min-height: 40px; width: 100%; padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(255, 228, 165, 0.38); background: rgba(24, 31, 60, 0.9); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.buy.can { border-color: transparent; background: linear-gradient(180deg, #ffe599, var(--glow-deep)); color: var(--on-glow); }
.buy.can .mote { background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.9); }
.buy.short { color: var(--mist); border-style: dashed; }
.buy.armed { border-color: var(--leaf); background: rgba(34, 82, 76, 0.95); }
.buy[aria-pressed="true"] { border-color: var(--glow); background: rgba(70, 52, 30, 0.8); }
.buy:disabled { opacity: 0.6; cursor: default; }
.locked .buy { pointer-events: none; }
#shopNote { min-height: 1.55em; max-width: 70ch; }

.harvest { font-size: 16px; color: #ffeabc; }
.harvest b { font-family: var(--display); font-size: 24px; font-variant-numeric: tabular-nums; }
.harvest small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mist); }
.btn.ad { border-color: rgba(143, 240, 198, 0.7); background: rgba(28, 76, 70, 0.9); }
.btn.ad:hover { background: rgba(38, 100, 90, 0.95); }
.adNote:empty { display: none; }
.small a { display: inline-block; padding: 6px 10px; color: var(--leaf); }
.home { margin: -4px 0 0; }
.home a { color: var(--mist); text-decoration: none; border-bottom: 1px solid rgba(169, 188, 214, 0.35); }
.home a:hover { color: var(--ink); border-bottom-color: var(--ink); }
#adPreview { background: #15171f; }
/* Fixed places, so a button never slides out from under a second press. */
.starts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 440px; }
.starts .btn { padding-inline: 10px; white-space: nowrap; }
#resumeRunBtn { grid-column: 1 / -1; }
#flierNote { min-height: 3.1em; max-width: 58ch; }

.card.fusion { border-color: var(--glow); background: linear-gradient(180deg, rgba(78, 52, 24, 0.95), rgba(34, 22, 44, 0.94)); box-shadow: 0 0 34px rgba(255, 190, 80, 0.45); }
.card.fusion em { color: var(--glow); }
.card.pairs em { color: var(--glow); }
.owned span.fused { color: var(--on-glow); background: linear-gradient(180deg, #ffe599, var(--glow-deep)); }

.toggle.plain { color: var(--ink); min-height: 38px; padding-inline: 18px; }
.lang { align-items: center; }
select.toggle { font-family: var(--body); cursor: pointer; }
select.toggle option { background: #0e1328; color: var(--ink); }
.toggle.plain[aria-pressed="true"]::before { content: none; }
#touchRow { align-items: center; }

.paths { display: flex; justify-content: center; gap: 10px; width: 100%; }
.path { flex: 0 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; text-align: left; border-radius: 14px; border: 1px solid rgba(170, 190, 230, 0.24); background: rgba(12, 17, 38, 0.82); }
.path strong { font-family: var(--display); font-size: 16px; }
.path span { font-size: 12.5px; line-height: 1.4; color: var(--mist); }
.path[aria-pressed="true"] { border-color: var(--leaf); background: rgba(30, 72, 68, 0.78); }
.path.omen strong { color: #ffb3c2; }
.path.omen[aria-pressed="true"] { border-color: var(--rose); background: rgba(96, 28, 52, 0.85); box-shadow: 0 0 24px rgba(255, 80, 120, 0.4); }
.path[aria-pressed="true"] span { color: var(--ink); }
.path[aria-pressed="true"] strong::before { content: "✓ "; }

.pages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; }
.page { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.page canvas { width: 108px; height: 92px; max-width: 100%; }
.page strong { font-family: var(--display); font-size: 16px; color: #ffeabc; }
.page span { font-size: 12px; line-height: 1.4; color: #cddaf0; }
.page em { margin-top: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--leaf); }
.page.unmet strong, .page.unmet span, .page.unmet em { color: var(--mist); }
.pages.deeds { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 700px; }
.deeds .page { align-items: flex-start; text-align: left; padding: 11px 14px; }
.deeds .page.done { border-color: var(--glow); background: rgba(70, 52, 28, 0.82); }
.deeds .page.done strong::before { content: "✦ "; color: var(--glow); }

#toast { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); box-sizing: border-box; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--glow); background: rgba(40, 28, 16, 0.92); font-size: 14px; font-weight: 700; color: #ffeabc; text-align: center; pointer-events: none; box-shadow: 0 0 26px rgba(255, 190, 80, 0.4); z-index: 3; animation: rise 0.35s ease both; }
#nightName small.omened { color: #ff9db2; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 100%; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 24px 16px 20px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s; animation: deal 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
@keyframes deal { from { opacity: 0; transform: translateY(26px) scale(0.94); } to { opacity: 1; transform: none; } }
.card:hover, .card:focus-visible { border-color: var(--glow); box-shadow: 0 0 34px rgba(255, 196, 90, 0.35); transform: translateY(-4px); }
.card svg { width: 58px; height: 58px; fill: none; stroke: var(--glow); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(255, 190, 80, 0.8)); }
.card strong { font-family: var(--display); font-weight: 700; font-size: 22px; color: #ffeabc; }
.card span { font-size: 14.5px; line-height: 1.45; color: #cddaf0; }
.card em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--leaf); letter-spacing: 0.06em; margin-top: auto; }
.card kbd { position: absolute; top: 10px; left: 12px; font: 700 12px var(--body); color: var(--mist); border: 1px solid rgba(170, 190, 230, 0.3); border-radius: 5px; padding: 1px 6px; }
#app.touch kbd { display: none; }
.locked .card, .locked .btn { pointer-events: none; }
#giftHarvest { color: #ffeabc; font-weight: 700; margin-top: -8px; }
.owned { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.owned span { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(30, 40, 76, 0.75); color: var(--mist); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; width: 100%; max-width: 440px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stats div { background: var(--panel); padding: 12px 6px; }
.stats b { display: block; font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--mist); }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 10vw, 62px); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.newbest { color: var(--leaf); font-weight: 700; }
#rekindle { background: radial-gradient(ellipse at 50% 50%, rgba(40, 22, 6, 0.55), rgba(2, 2, 8, 0.9)); }
.btn:disabled { opacity: 0.5; cursor: default; }
#dawn { background: radial-gradient(ellipse at 50% 30%, rgba(80, 40, 60, 0.4), rgba(14, 8, 28, 0.82)); }
/* The title sits over a live demonstration, so keep the forest visible around it. */
#title { background: radial-gradient(ellipse 72% 46% at 50% 46%, rgba(4, 6, 18, 0.74) 0%, rgba(4, 6, 18, 0.5) 55%, rgba(4, 6, 18, 0.08) 100%); }
#title p { text-shadow: 0 1px 10px #000, 0 0 3px #000; }

@media (max-width: 620px) {
  #hud { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding-top: 10px; }
  #hearts { max-width: 90px; gap: 3px; }
  #hearts svg { width: 20px; height: 20px; }
  #nightName { font-size: 15px; line-height: 1.15; }
  #nightName small { display: block; font: 700 10.5px var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist); }
  #nightName small::after { content: none; }
  #score { font-size: 19px; }
  .round { width: 36px; height: 36px; }
  .cards { grid-template-columns: 1fr; gap: 10px; max-width: 420px; }
  .starts .btn { font-size: 15.5px; }
  .card { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; text-align: left; padding: 14px 16px; }
  .card svg { width: 44px; height: 44px; grid-row: 1 / 4; align-self: center; }
  .card kbd { display: none; }
  .panel { gap: 13px; }
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pages.deeds { grid-template-columns: 1fr; }
  .path { padding: 8px 11px; }
  .wares { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ware { padding: 10px 8px; }
  .ware strong { font-size: 15.5px; }
  .ware span { font-size: 12px; }
}
@media (max-height: 560px) {
  .panel { gap: 9px; }
  h1 { font-size: clamp(44px, 13vh, 80px); }
  .screen { padding-block: 10px; }
  #banner { top: 20%; }
}
/* Phones held sideways: everything on one screen. */
@media (max-height: 460px) {
  .panel { gap: 7px; max-width: 720px; }
  .path { padding: 5px 12px; }
  .path span { font-size: 11.5px; }
  .pages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .flier { min-height: 30px; padding: 4px 11px 4px 9px; font-size: 13px; }
  .world { min-height: 26px; padding: 3px 16px; font-size: 13px; }
  .panel.wide { max-width: 860px; }
  h1 { font-size: clamp(38px, 13vh, 60px); }
  h2 { font-size: 30px; }
  .tag { font-size: 14.5px; max-width: 70ch; }
  .small { font-size: 12.5px; max-width: 80ch; }
  .btn, .btn.primary { min-height: 38px; padding: 8px 20px; font-size: 15px; }
  .wares { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .ware { gap: 3px; padding: 8px; }
  .ware strong { font-size: 15px; }
  .ware span { font-size: 11px; }
  .buy { min-height: 32px; padding: 4px 8px; font-size: 13px; }
  /* The count of fireflies serves as the shop's heading, so that Done stays in view. */
  #shop .panel { gap: 5px; }
  #shop h2 { display: none; }
  #shop .btn { min-height: 34px; padding-block: 6px; }
  .harvest b { font-size: 19px; }
  .harvest small { display: inline; margin-left: 10px; }
  .starts { max-width: 680px; grid-template-columns: minmax(0, 1.65fr) repeat(2, minmax(0, 1fr)); gap: 8px; }
  .starts:has(#resumeRunBtn[hidden]) { max-width: 420px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #resumeRunBtn { grid-column: auto; }
  #flierNote { min-height: 1.55em; }
  .toggle { padding: 5px 11px; }
  .card { gap: 4px; padding: 12px 10px; }
  .card svg { width: 34px; height: 34px; }
  .card strong { font-size: 18px; }
  .card span { font-size: 12.5px; }
  .stats { max-width: 620px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats div { padding: 6px 3px; }
  .stats b { font-size: 18px; }
  .stats span { font-size: 10.5px; }
  .big { font-size: 34px; }
  #hint { font-size: 13.5px; padding: 8px 14px; }
  #app.touch #hint { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 220px); }
}
/* Other languages. Chinese, Japanese and Korean have no true italic, and Korean breaks lines between words. */
:lang(ja) h2, :lang(ja) #dawn h1, :lang(ja) #nightName, :lang(ko) h2, :lang(ko) #dawn h1, :lang(ko) #nightName, :lang(zh) h2, :lang(zh) #dawn h1, :lang(zh) #nightName { font-style: normal; }
:lang(ko) { word-break: keep-all; }
/* A very long name breaks, with a hyphen where the language allows, rather than leave its card. */
.page strong, .page span { max-width: 100%; overflow-wrap: break-word; }
:lang(de) .page, :lang(de) .ware, :lang(de) .card, :lang(ru) .page, :lang(ru) .ware, :lang(ru) .card { hyphens: auto; -webkit-hyphens: auto; }
@media (prefers-reduced-motion: reduce) {
  .screen, .card, #hint { animation: none; }
}

/* The public play page adds only a line of advice for browsers without scripts. */
.nojs { max-width: 40ch; margin: 18vh auto; padding: 0 24px; text-align: center; color: #dbe6f6; font-size: 17px; line-height: 1.5; }
