/* Sadbot's Journey To Bliss — page styles.
   Layout: a slim account bar, one 16:9 game screen centred on an ash-dark page, controls legend below.
   Deliberately single-theme (night/ash world). */
:root {
  --bg: #0f0e0d;
  --panel: #1b1916;
  --line: #3b3631;
  --ink: #e9e1d3;
  --muted: #9b9288;
  --gold: #e8c27a;
  --rust: #b0643a;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --mono: "Courier Prime", "Courier New", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  padding-inline: 16px;
  padding-block: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.topbar {
  width: 100%;
  max-width: min(1280px, calc((100vh - 130px) * 16 / 9));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.brand { font-family: var(--display); font-size: 20px; letter-spacing: 0.04em; }
.brand em { color: var(--gold); }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.account span { overflow-wrap: anywhere; }
button {
  font: 700 13px var(--mono);
  color: var(--bg);
  background: var(--gold);
  border: 0;
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.stage {
  position: relative;
  width: 100%;
  max-width: min(1280px, calc((100vh - 130px) * 16 / 9));
  aspect-ratio: 16 / 9;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px #2a2622;
  outline: none;
  touch-action: none;
}
canvas:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
/* PayPal donate link, shown only on the title screen (toggled from game.js) */
.donate {
  position: absolute;
  top: 2.4%;
  right: 1.6%;
  font: 700 13px var(--mono);
  color: #1c1a17;
  background: #ffc439;
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.donate:hover { background: #ffd56b; }
.donate:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 600px) { .donate { font-size: 11px; padding: 6px 10px; } }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--muted); max-width: 1280px; }
kbd { font-family: var(--mono); color: var(--ink); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel); }
.touch { position: absolute; inset: auto 0 0 0; display: none; justify-content: space-between; align-items: flex-end; padding: 10px; pointer-events: none; }
.touch.on { display: flex; }
.touch .group { display: flex; gap: 10px; align-items: flex-end; }
.touch button {
  pointer-events: auto;
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(20, 18, 16, 0.5);
  border: 1px solid rgba(232, 194, 122, 0.55);
  color: var(--ink);
  font: 700 12px var(--mono);
  letter-spacing: 0.05em;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch button.big { width: 76px; height: 76px; }
dialog {
  width: min(420px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
dialog::backdrop { background: rgba(5, 4, 3, 0.7); }
dialog h2 { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 30px; color: var(--gold); margin: 0 0 8px; }
dialog p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
dialog label { display: block; font-size: 13px; margin-bottom: 6px; }
dialog input {
  width: 100%;
  font: 16px var(--mono);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
}
dialog .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
dialog #signin-msg { margin: 14px 0 0; min-height: 1.5em; color: var(--ink); }
.foot { font-size: 12px; color: var(--muted); }
.foot a { color: var(--muted); }
@media (max-width: 600px) {
  .legend { font-size: 12px; }
  .touch button { width: 52px; height: 52px; font-size: 11px; }
  .touch button.big { width: 62px; height: 62px; }
}
