.standalone {
  min-height: 100svh;
  --standalone-header: max(64px, 54px + env(safe-area-inset-top));
  --bg: #eaf0e5;
  --text: #233d36;
  --accent: #355c4a;
  --paper: #f4f5e8;
  --border: #acbfad;
  background: radial-gradient(ellipse at 50% 0, #fcf8df, transparent 65%), var(--bg);
}
.standalone-words {
  --bg: #ece1ca;
  --text: #392b38;
  --accent: #754351;
  --paper: #f6ecd9;
  --border: #c6ad92;
  background: radial-gradient(ellipse at 50% 0, #fff4dc, transparent 70%), var(--bg);
}
.standalone-bookworm {
  --bg: #edf0e5;
  --text: #294138;
  --accent: #46664d;
  --paper: #f9f6e6;
  --border: #aec1aa;
  background: radial-gradient(ellipse at 50% 0, #fffbe0, transparent 70%), var(--bg);
}
.standalone-chuzzle {
  --bg: #1b1033;
  --text: #f6efff;
  --accent: #f2a7e5;
  --paper: #2b1c52;
  --border: #7156ad;
  /* A still purple sky behind everything; the board window keeps the living one. */
  background:
    radial-gradient(ellipse at 18% 10%, #5a2f8e66, transparent 42%),
    radial-gradient(ellipse at 84% 16%, #3c2f8e55, transparent 44%),
    radial-gradient(ellipse at 72% 86%, #8b38c24d, transparent 42%),
    radial-gradient(ellipse at 22% 82%, #461e8870, transparent 45%),
    #150b29;
}
html:has(.standalone-chuzzle) { overflow: auto; height: auto; }
.game-site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
}
.future-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--text);
  font: 13px/1.4 'EB Garamond', Georgia, serif;
  text-decoration: none;
  white-space: nowrap;
}
.future-return:hover { filter: brightness(.95); }
.future-return:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.game-site-identity { margin-left: auto; text-align: right; }
.game-site-identity h1 { margin: 0; font: 48px/1 'Jacquard 24', Georgia, serif; }
.standalone-words .game-site-identity h1 { font-style: italic; }
.game-site-identity p { margin: 8px 0 0; font-size: 16px; }
.standalone-loading { padding: 48px 24px; text-align: center; }
.shop-open {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--paper);
  font: 14px/1.4 'EB Garamond', Georgia, serif;
  cursor: pointer;
}
/* Its room is kept while the shop loads, so the title does not shift */
.shop-open[hidden] { display: inline-block; visibility: hidden; }
.shop-open:focus-visible, .standalone-shop-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.standalone-shop { width: min(100% - 24px, 1024px); max-height: min(900px, 100dvh - 24px); border: 1px solid var(--border); padding: 52px 0 0; color: var(--text); background: var(--bg); }
.standalone-shop::backdrop { background: rgb(20 15 12 / 72%); backdrop-filter: blur(3px); }
.standalone-shop .game-shop { display: block; }
.standalone-shop .shop { width: min(100% - 2rem, 960px); padding-bottom: 2rem; }
.standalone-shop-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; color: var(--text); background: var(--paper); font-size: 24px; line-height: 1; cursor: pointer; }
.standalone main { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.standalone-chuzzle .future-return {
  margin: 8px max(14px, env(safe-area-inset-left)) 0;
  width: fit-content;
  align-self: start;
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: #2b1c52d9;
  color: #f2a7e5;
  font: 12px/1.3 'Baloo 2', 'EB Garamond', Georgia, serif;
}
.standalone-run .game-container.full > .future-return {
  position: absolute;
  z-index: 10;
  right: var(--edge-r);
  bottom: var(--edge-b);
  cursor: pointer;
}
.standalone #wb-mobile-exit { display: none; }
.standalone-bookworm #wb-mobile-mode { display: none; }
.standalone.standalone-bookworm .wb-mobile-header { display: none; }
@media (max-width: 640px) and (orientation: portrait) {
  .standalone-words .wb,
  .standalone-bookworm .wb { height: calc(100dvh - var(--standalone-header)); }
}
@media (max-width: 620px) {
  .game-site-header { gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .game-site-identity h1 { font-size: 34px; }
  .game-site-identity p { display: none; }
  .shop-open { padding: 10px 12px; }
}
