/* JustChat Mahjong Solitaire — Phase 1 styles.
 * The Porch palette (the Solitaire suite's table, §11/M7): walnut
 * darks, warm cream, lantern gold. Functional styling for Phase 1 —
 * the full realistic art pass is Phase 2; the photographic Porch
 * plate (the suite's own) already carries the table. */
:root {
  --ink: #2b1d12;
  --cream: #f6ecd9;
  --cream-dim: #d9c9a8;
  --gold: #e9b44c;
  --gold-deep: #b9822e;
  --panel: rgba(38, 26, 17, 0.88);
  --panel-edge: #6b4e2e;
  --red: #a63a2e;
  --good: #7fb069;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  background: #241a12 url('assets/plate-porch.webp') center / cover fixed no-repeat;
  color: var(--cream);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; padding: 10px 12px 28px; }
.screen { animation: fade .18s ease-in; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- title ---------- */
.title-plate {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 26px 16px 18px;
  margin-top: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.lockup {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: .5px;
  color: var(--cream);
  text-shadow: 0 2px 0 #17100a, 0 0 22px rgba(233,180,76,.35);
}
/* §11.5 title lockup: typeset lamplight lettering over the Porch
 * photograph with the Turtle laid out (assets/title-lockup.webp,
 * built by hidden_files/phase3-tools/make_lockup.py). The DOM h1
 * stays for semantics, visually carried by the image. */
.lockup-img {
  width: 100%; height: auto; display: block;
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,.5);
  margin-bottom: 6px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.promise { color: var(--gold); font-size: 16px; margin: 14px 0 4px; }
.subpromise { color: var(--cream-dim); font-size: 14px; margin: 0; font-style: italic; }
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: linear-gradient(#f3e5c3, #e2cd9c);
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.btn:active { transform: translateY(1px); }
.btn.big { font-size: 19px; padding: 13px 18px; }
.btn.small { font-size: 14px; padding: 7px 13px; }
.btn.round { border-radius: 50%; width: 38px; height: 38px; padding: 0; font-size: 18px; }
.btn.off { opacity: .45; }
.btn-sub { display: block; font-size: 12.5px; color: #6d5326; margin-top: 1px; }
.record-strip { text-align: center; color: var(--cream-dim); font-size: 13.5px; min-height: 18px; margin: 12px 0 0; text-shadow: 0 1px 3px #000; }

/* ---------- bars ---------- */
.bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.bar h2 { margin: 0; font-size: 20px; color: var(--cream); text-shadow: 0 1px 3px #000; flex: 0 1 auto; }
.bar-spacer { flex: 1; }
.bar .btn.small { flex: 0 0 auto; }

/* ---------- picker ---------- */
.picker-promise { text-align: center; color: var(--gold); margin: 2px 0 12px; text-shadow: 0 1px 3px #000; }
.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.layout-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  color: var(--cream);
  font: inherit;
  cursor: pointer;
}
.layout-card:active { transform: translateY(1px); }
.layout-card canvas { width: 100%; height: auto; display: block; background: rgba(0,0,0,.25); border-radius: 6px; }
.layout-card h3 { margin: 8px 0 2px; font-size: 17px; color: var(--cream); }
.layout-card p { margin: 0 0 4px; font-size: 12.5px; color: var(--cream-dim); line-height: 1.35; }
.layout-card .rec { font-size: 12px; color: var(--gold); min-height: 15px; }
.layout-card .soon {
  display: inline-block; font-size: 11.5px; color: var(--ink);
  background: var(--cream-dim); border-radius: 999px; padding: 2px 9px; margin-top: 4px;
}
.layout-card.locked { cursor: default; opacity: .82; }

/* ---------- how to ---------- */
.howto-page {
  background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: 12px; padding: 16px 18px; line-height: 1.55; font-size: 15.5px;
}
.howto-page h3 { margin-top: 0; color: var(--gold); }
.howto-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
#howto-dots { color: var(--cream-dim); font-size: 13px; }

/* ---------- game ---------- */
#board-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  background: rgba(20, 13, 8, .35);
  touch-action: none;
}
#board { display: block; width: 100%; }
#overlay {
  position: absolute; inset: 0;
  background: rgba(16, 10, 6, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
#overlay[hidden] { display: none; }
.overlay-card {
  background: var(--panel); border: 1px solid var(--gold-deep);
  border-radius: 14px; padding: 18px; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 12px 34px rgba(0,0,0,.6);
}
.overlay-card h3 { margin: 0 0 8px; color: var(--gold); font-size: 21px; }
.overlay-card p { margin: 0 0 14px; line-height: 1.5; font-size: 15px; white-space: pre-line; }
.overlay-buttons { display: flex; flex-direction: column; gap: 8px; }
.status {
  min-height: 22px; margin: 10px 2px 6px; font-size: 15px; color: var(--cream);
  text-shadow: 0 1px 3px #000; text-align: center;
}
.token-row { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.token {
  font: inherit; font-size: 14.5px; color: #3a2410; font-weight: bold;
  /* the wooden token (§8.3/§9): the suite's own wood texture, the
   * Solitaire token recipe — texture over a warm wood base colour */
  background-image: url('assets/token-wood.webp');
  background-size: cover; background-position: center;
  background-color: #c39a58;
  border: 2px solid #6b4a26; border-radius: 999px;
  padding: 9px 13px; cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,240,200,.45);
  box-shadow: inset 0 0 0 2px rgba(96,64,28,.35), inset 0 2px 3px rgba(255,238,196,.55), 0 3px 7px rgba(0,0,0,.4);
}
.token:active { transform: translateY(1px); }
.token:disabled { opacity: .42; cursor: default; }
.tok-count {
  display: inline-block; min-width: 19px; text-align: center;
  background: var(--ink); color: var(--gold); border-radius: 999px;
  font-size: 12px; padding: 1px 4px; margin-left: 2px;
}
.counters { text-align: center; color: var(--cream-dim); font-size: 14px; margin: 10px 0 0; text-shadow: 0 1px 3px #000; }
.shake { animation: shake .3s ease-in-out; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
