/* COLOR IT IN: the sheet is the screen.
 *
 * Jade, 2026-09-22: "a game where you get the coloring sheet inside the
 * studio and every time you say the correct word a piece gets colored in."
 * Same cream and the same foot as FILL, so the two games are one family.
 * Nothing moves when it is tapped: the pieces are painted into a canvas
 * that is already there, and the button never changes size.
 */
:root {
  --desk: #f6ecd9; --leaf: #fffdf9; --edge: #e6dac4;
  --ink: #2b2620; --soft: #6d6158; --word: #6f8f83; --faint: #cabfa9;
  --gold: #e0a32a; --green: #2f7a48; --amber: #c08a1e; --red: #b4483a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--desk); color: var(--ink); display: flex; flex-direction: column;
  font-family: Geist, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }

.topbar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.back {
  flex: none; font-size: 12.5px; color: var(--soft); text-decoration: none;
  border: 1px solid rgba(0,0,0,.12); border-radius: 999px; padding: 7px 13px;
  background: rgba(255,253,249,.7); font-weight: 600;
}
.title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.title b { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title span { font-size: 12px; color: var(--soft); white-space: nowrap; }
.target { flex: none; display: flex; align-items: center; gap: 4px; }
.target[hidden] { display: none; }
.target span { font-size: 11px; color: var(--soft); margin-right: 4px; }
.target button {
  width: 34px; height: 30px; border: 1px solid var(--edge); border-radius: 8px;
  background: var(--leaf); color: var(--soft); font-weight: 700; font-size: 13px;
}
.target button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* MARK: the sheet */

.stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 6px 12px;
}
.arrow {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); background: rgba(255,253,249,.92);
  color: var(--soft); font-size: 24px; line-height: 1; display: grid; place-items: center;
}
.sheet {
  flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
}
/* the paper: square, as big as the stage allows, a white page with a soft edge */
#page {
  display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100% - 52px);
  aspect-ratio: 1; background: #fff; border: 1px solid var(--edge); border-radius: 14px;
  box-shadow: 0 10px 24px -16px rgba(70,52,24,.5);
}
.word { flex: none; font-size: clamp(22px, 5vw, 36px); font-weight: 900; color: var(--word); line-height: 1.1; }

/* MARK: the foot, the same as FILL's */

.foot { flex: none; padding: 6px 14px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.of { font-size: 13px; color: var(--soft); min-height: 1.2em; }
.sayit {
  width: min(100%, 520px); border: 0; border-radius: 16px; padding: 18px; font-size: clamp(20px, 5vw, 28px);
  font-weight: 900; background: var(--gold); color: #24190a; box-shadow: 0 6px 0 #b8801c;
}
.sayit:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8801c; }
.keys { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; width: min(100%, 520px); }
.keys[hidden] { display: none; }
.key {
  border: 1px solid var(--edge); border-radius: 12px; padding: 10px 6px;
  background: #fff; font-weight: 700; font-size: 13px; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.key kbd { font: 600 10px Geist, system-ui, sans-serif; color: var(--faint); text-transform: uppercase; }
.key.ok { color: var(--green); } .key.ap { color: var(--amber); } .key.no { color: var(--red); }

.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: 14px; white-space: nowrap; max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
.toast[hidden] { display: none; }

/* MARK: media queries, last in the file, always */
@media (max-width: 520px) {
  .arrow { display: none; }
  .key kbd { display: none; }
  .target span { display: none; }
  .title b { font-size: 14px; }
}
