/* D:\laragon\www\personaljigsaw\assets\css\site.css
 * Styles for the sender's pages (make/ and make/done.php). The puzzle page has its own puzzle.css.
 * Mobile first: one column, big tap targets. */
* { box-sizing: border-box; }

:root {
  --bg: #2b2f36;
  --panel: #1d2025;
  --panel2: #3a3f47;
  --line: #555b65;
  --text: #eee;
  --muted: #a9afb8;
  --accent: #4c8bf5;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}

/* Without this, the display:block on .btn would stop the hidden attribute from hiding things */
[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  padding: 12px 16px;
  font-weight: 700;
}
.top a { color: inherit; text-decoration: none; }

/* "someone@example.com  [Log out]" in the top bar */
.who { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; font-size: .85rem; font-weight: 400; color: var(--muted); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button {
  font: inherit;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

main { max-width: 34rem; margin: 0 auto; padding: 16px 16px 56px; }
h1 { font-size: 1.4rem; margin: .4rem 0 1rem; }

.card { background: var(--panel); border-radius: 12px; padding: 16px; margin-bottom: 16px; }

.field-title { display: block; font-weight: 600; margin: 22px 0 6px; }
.field-title:first-child,
input[type=hidden] + .field-title { margin-top: 0; }   /* no extra gap at the top of a card */
.hint { color: var(--muted); font-weight: 400; font-size: .88rem; }

/* ---------- Choosing the photo ---------- */
.drop {
  position: relative;
  display: block;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
}
.drop:hover, .drop:focus-within { border-color: var(--accent); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop strong { display: block; font-size: 1.05rem; }

.preview { display: none; margin-top: 12px; text-align: center; }
.preview img { max-width: 100%; max-height: 45vh; border-radius: 8px; }
.preview .name { color: var(--muted); font-size: .85rem; margin-top: 6px; word-break: break-all; }

/* ---------- Message ---------- */
textarea {
  display: block;
  width: 100%;
  font: inherit;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.counter { text-align: right; color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* ---------- Choice buttons (pieces, expiry) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; }
.pills input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pills span {
  display: block;
  min-width: 4rem;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel2);
}
.pills input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pills input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn.alt { background: var(--panel2); }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- Messages ---------- */
.error {
  background: #4a2326;
  border: 1px solid #a44;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.warn { color: #ffcf8a; font-size: .9rem; margin-top: 8px; }

/* ---------- The "your link" page ---------- */
.link {
  display: block;
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.meta { color: var(--muted); font-size: .92rem; margin: 14px 0 0; }
.meta strong { color: var(--text); }

/* ---------- Login and join forms ---------- */
.input {
  display: block;
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.showpw { display: block; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.meta a { color: #8db6ff; }

/* ---------- Links under the top bar: Make a puzzle | My puzzles ---------- */
.subnav { display: flex; background: var(--panel); border-top: 1px solid var(--bg); border-bottom: 1px solid var(--line); }
.subnav a {
  flex: 1 1 0;
  text-align: center;
  padding: 11px 8px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.subnav a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

/* ---------- My puzzles ---------- */
.notice {
  background: #1f3a2a;
  border: 1px solid #3f8f5f;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.usage { margin: 0 0 14px; }

.item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 4px 12px;
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.item .thumb {
  grid-row: 1;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: .75rem;
  text-align: center;
}
.item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item .info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .info .meta { margin: 0; }
.item .note {
  color: var(--muted);
  font-size: .88rem;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item .btns { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.item .btns form { margin: 0; flex: 1 1 0; }
.item .btns .btn { margin: 0; width: 100%; flex: 1 1 0; }
.btn.small { padding: 10px 8px; font-size: .92rem; }
.btn.danger { background: #5a2a2e; }

/* ---------- Front page (index.php) ---------- */
.hero { padding-top: 28px; }
.hero h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 14px; }
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 14px; }
.examples { margin: 0 0 24px; }
.quote {
  background: var(--panel);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 8px;
  font-style: italic;
}
.center { text-align: center; }
