/* ItsGridPick — calm, simple, easy on the eyes. Same palette as
   the ItsGridPick site: ink, green accent, mist, gold for winners. */
:root {
  --ink: #22303a;
  --soft: #5a6b76;
  --accent: #1d7a44;
  --accent-dark: #166636;
  --paper: #ffffff;
  --mist: #f2f6f3;
  --line: #dde6df;
  --gold-bg: #fdf3d7;
  --gold-line: #e3c766;
  --danger: #b3372f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
.hidden { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.soft { color: var(--soft); }
.hint { color: var(--soft); font-size: .86rem; font-weight: 400; }
h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1.02rem; margin: 14px 0 8px; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand-icon { width: 34px; height: 34px; border-radius: 8px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.account-name { color: var(--soft); font-size: .92rem; }

/* buttons + forms */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0; cursor: pointer;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 1rem; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn-quiet { background: var(--mist); color: var(--ink); }
.btn-quiet:hover { background: var(--line); }
.btn-small { padding: 7px 14px; font-size: .92rem; }
.btn-wide { width: 100%; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #93291f; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: .95rem; padding: 0; text-decoration: underline; }
label { display: block; font-weight: 600; margin-bottom: 12px; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: max(16px, 1em);
  font-family: inherit; color: var(--ink); background: #fff; font-weight: 400;
}
.stack-form { margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form input { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-message { min-height: 1.2em; color: var(--accent-dark); font-weight: 600; }
.form-message.error { color: var(--danger); }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 6px; }
.size-option { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; cursor: pointer; }
.size-option input { width: auto; margin-top: 5px; }

/* auth */
.auth-card {
  max-width: 430px; margin: 34px auto; border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 24px; text-align: center; background: #fff;
}
.auth-logo { width: 76px; height: 76px; border-radius: 16px; }
.auth-card h1 { margin-top: 10px; }
.tagline { color: var(--soft); margin: 0 0 18px; }
.auth-intent {
  background: var(--mist); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin: 0 0 16px; font-size: .95rem;
}
.auth-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.auth-tab {
  border: 1px solid var(--line); background: var(--mist); color: var(--ink);
  border-radius: 999px; padding: 8px 18px; cursor: pointer; font-weight: 600;
}
.auth-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-form { text-align: left; }
.auth-alt { text-align: center; }

/* cards + home */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 16px 0; background: #fff; }
.board-list { display: grid; gap: 12px; margin: 14px 0 6px; }
.board-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer; background: var(--mist); text-align: left; width: 100%; font: inherit; color: var(--ink);
}
.board-card:hover { border-color: var(--accent); }
.board-card .bc-name { font-weight: 700; font-size: 1.05rem; }
.board-card .bc-meta { color: var(--soft); font-size: .9rem; }
.stage-pill {
  background: var(--mist); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.freeline {
  background: #eaf5ee; border: 1px solid var(--line); border-radius: 12px;
  text-align: center; padding: 10px 14px; font-weight: 600; margin: 12px 0;
}

/* board view */
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 6px; }
.board-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.board-teams-top { text-align: center; font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.board-grid-wrap { display: flex; gap: 6px; }
.board-teams-side {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; padding-top: 26px;
}
.sq-grid { display: grid; gap: 3px; flex: 1; }
.sq-cell {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; background: #fff; color: var(--soft); padding: 0;
  overflow: hidden; text-align: center; line-height: 1.1;
}
.sq-cell.head { background: var(--mist); font-weight: 700; color: var(--ink); font-size: .78rem; }
.sq-cell.corner { background: transparent; border-color: transparent; }
button.sq-cell { cursor: pointer; font-family: inherit; }
button.sq-cell:hover { border-color: var(--accent); }
.sq-cell.claimed { background: var(--mist); color: var(--ink); font-weight: 600; }
.sq-cell.mine { background: #d8ecdd; border-color: var(--accent); color: var(--ink); font-weight: 700; }
.sq-cell.winner { background: var(--gold-bg); border-color: var(--gold-line); font-size: .8rem; }
.board-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* side panels */
.invite-link-row { display: flex; gap: 8px; }
.invite-link-row input { margin-top: 0; }
.qr-box { display: flex; justify-content: center; padding: 10px 0 2px; }
.qr-box svg { max-width: 180px; height: auto; }
.people-list { display: grid; gap: 6px; }
.person-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff;
}
.person-row .p-name { font-weight: 600; }
.person-row .p-meta { color: var(--soft); font-size: .86rem; }
.person-row.selected { border-color: var(--accent); background: #eef7f0; }
.scores-list { display: grid; gap: 8px; }
.score-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.score-row .s-label { font-weight: 700; }
.score-row .s-line { color: var(--soft); font-size: .92rem; }
.stage-steps { display: grid; gap: 4px; margin-bottom: 10px; }
.stage-step { color: var(--soft); font-size: .92rem; }
.stage-step.done { color: var(--ink); }
.stage-step.now { color: var(--accent-dark); font-weight: 700; }
.gc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.settings-details { margin-top: 12px; }
.settings-details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.check-list { display: grid; gap: 4px; margin-bottom: 10px; }
.check-list label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.check-list input { width: auto; margin: 0; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }
.record-list { display: grid; gap: 6px; font-size: .92rem; max-height: 320px; overflow: auto; }
.record-row { border-bottom: 1px solid var(--mist); padding-bottom: 5px; }
.record-row .r-time { color: var(--soft); font-size: .8rem; }
.seat-list { display: grid; gap: 8px; margin: 10px 0; text-align: left; }
.seat-btn {
  border: 1px solid var(--line); background: var(--mist); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; font: inherit; text-align: left; color: var(--ink);
}
.seat-btn:hover { border-color: var(--accent); }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 36px; padding: 22px 0 40px; color: var(--soft); }
.site-footer a { color: var(--accent); }
.site-footer .other-apps { font-size: 13px; }

/* print */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  #printSheet, #printSheet * { visibility: visible; }
  .print-only { display: block; }
  #printSheet { position: absolute; inset: 0; padding: 12px; color: #000; }
  #printSheet table { border-collapse: collapse; margin: 10px 0; }
  #printSheet td, #printSheet th { border: 1px solid #999; width: 34px; height: 34px; text-align: center; font-size: 11px; }
  #printSheet td.head, #printSheet th { background: #eee; font-weight: 700; }
  #printSheet td.winner { background: var(--gold-bg); }
}

@media (max-width: 860px) {
  .board-layout { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .sq-cell { font-size: .58rem; }
}
