/* My Side Quest — shared styles. Colours and fonts match the Side Quest page on attokit.com.au. */
:root {
  --bg: #F3EAD3;
  --bg-band: #E9DCBC;
  --panel: #FBF6E8;
  --ink: #1E2622;
  --ink-soft: #5B5A4C;
  --rule: #CDB98C;
  --forest: #184443;
  --forest-deep: #0E3533;
  --on-forest: #F6ECCF;
  --gold: #E3AE42;
  --gold-ink: #8A5A0B;
  --teal: #2AA6B3;
  --frame: #B98A2E;
  --danger: #A8322D;
  --ok: #1F7A4D;
  --g-mini: #6B7C79;
  --g-amethyst: #8B55D3; --g-topaz: #E39A1E; --g-sapphire: #2443C9;
  --g-emerald: #189B63; --g-ruby: #C72A44; --g-diamond: #7FBFD3; --g-obsidian: #23202B;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--forest); }
a:hover { color: var(--gold-ink); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* Header */
.site-header {
  background: var(--forest);
  color: var(--on-forest);
  border-bottom: 3px solid var(--frame);
}
.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { height: 48px; width: auto; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: var(--on-forest);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(246, 236, 207, 0.14); color: #fff; }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 48px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }

h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.lede { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 24px; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 0 rgba(115, 85, 30, 0.08);
}
.panel + .panel { margin-top: 18px; }

/* Forms */
label { display: block; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(42, 166, 179, 0.35); border-color: var(--teal); }
.pin-input { letter-spacing: 0.5em; font-size: 1.4rem; text-align: center; max-width: 9em; }
.hint { font-size: 0.88rem; color: var(--ink-soft); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  text-decoration: none;
  background: var(--forest);
  color: var(--on-forest);
}
.btn:hover { background: var(--forest-deep); color: #fff; }
.btn.gold { background: var(--gold); color: #2A1F06; }
.btn.gold:hover { background: #D79D2F; color: #2A1F06; }
.btn.ghost { background: transparent; color: var(--forest); border: 1px solid var(--rule); }
.btn.ghost:hover { background: #fff; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #DDB3AF; }
.btn.danger:hover { background: #FCEDEC; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, .site-nav a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Messages */
.msg { border-radius: 6px; padding: 10px 14px; margin: 0 0 16px; font-size: 0.95rem; }
.msg.error { background: #FCEDEC; color: var(--danger); border: 1px solid #EBC3BF; }
.msg.ok { background: #E8F4EC; color: var(--ok); border: 1px solid #BFDCC9; }
.msg.info { background: #EAF5F6; color: #155E66; border: 1px solid #B9DDE1; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.tabs button {
  font: inherit; font-weight: 600; color: var(--ink-soft);
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 8px 14px; cursor: pointer; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #E6DAB9; vertical-align: middle; }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
td.pin { font-variant-numeric: tabular-nums; letter-spacing: 0.15em; }
.table-wrap { overflow-x: auto; }

/* Gem badge */
.gem {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 0.85rem;
  padding: 3px 10px; border-radius: 999px;
  background: var(--gc, var(--g-mini)); color: #fff;
}
.gem[data-gem="amethyst"] { --gc: var(--g-amethyst); }
.gem[data-gem="topaz"] { --gc: var(--g-topaz); color: #2A1F06; }
.gem[data-gem="sapphire"] { --gc: var(--g-sapphire); }
.gem[data-gem="emerald"] { --gc: var(--g-emerald); }
.gem[data-gem="ruby"] { --gc: var(--g-ruby); }
.gem[data-gem="diamond"] { --gc: var(--g-diamond); color: #0E2A33; }
.gem[data-gem="obsidian"] { --gc: var(--g-obsidian); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg-band); }
.site-footer .inner {
  max-width: 1080px; margin: 0 auto; padding: 18px 16px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--ink-soft);
}

.spinner { color: var(--ink-soft); padding: 40px 0; text-align: center; }

@media (max-width: 560px) {
  .brand span { display: none; }
  .brand img { height: 40px; }
  .panel { padding: 16px; }
}

.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
