/* The bounty board's only stylesheet: one full-height app - header, toolbar, then a single
   scrolling bounty table (cards on phones) with the claim banner above it. Torment website
   palette: soot, ember, gold. Dark only, on purpose. Nothing here is fetched from the network,
   and the fonts are the stacks the mockup used, so the local fallbacks are what ship. */
:root {
  color-scheme: dark;
  --bg: #0a0807;
  --panel: #15100c;
  --raised: #1f1710;
  --line: #3d2e20;
  --fg: #efe6d8;
  --muted: #b8a994;
  --gold: #d4ae66;
  --gold-hi: #ecc987;
  --ember: #b3401a;
  --ember-hi: #e0703f;
  --open: #7cc47f;
  --review: #c9a4f5;
  --danger: #e06a5a;
  --urgent: #e0483a;
  --barb: #e8795a;
  --wiz: #b890f2;
  --discord: #2b2d31;
  --discord-hi: #383a40;
  --discord-fg: #dbdee1;
  --discord-blurple: #5865f2;
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r: 4px;
}
html, body { height: 100%; }
/* The app is the whole window: without this the default body margin pushes the footer under the
   fold and leaves the page 8px taller than the viewport. */
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
/* The wall, the drawers and the banner all set a display of their own, which would otherwise
   beat the browser's own rule for the hidden attribute and leave them on screen. */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* The board row is the one that flexes, so the table scrolls instead of the page. */
.app { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding-inline: 16px; max-width: 1500px; margin: 0 auto; box-sizing: border-box; }

/* header */
header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-block: 14px 10px; }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 3vw, 28px); letter-spacing: .06em; color: var(--gold-hi); text-wrap: balance; }
.brand span { color: var(--muted); font-size: 14px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--open); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--open); box-shadow: 0 0 0 0 var(--open); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(124,196,127,.6); } 70% { box-shadow: 0 0 0 7px rgba(124,196,127,0); } 100% { box-shadow: 0 0 0 0 rgba(124,196,127,0); } }
.counts { display: flex; gap: 14px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counts b { color: var(--fg); font-weight: 700; }
.counts button { background: none; border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.counts button:hover { border-color: var(--line); color: var(--fg); }
.counts button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hi); background: var(--raised); }
.counts button:disabled { opacity: .55; cursor: default; }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.who .av { width: 26px; height: 26px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--gold); }
.role { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r); border: 1px solid; }
.role.tester { color: #7fd6a0; border-color: #2f6b47; }
.role.staff { color: var(--ember-hi); border-color: var(--ember); }
.role.member { color: var(--muted); border-color: var(--line); }
.btn { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 12px; color: var(--fg); white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); }
.btn.primary { background: var(--ember); border-color: var(--ember-hi); color: #fff6ea; font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--ember-hi); color: #fff6ea; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* your claim banner */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; margin-bottom: 10px; background: linear-gradient(90deg, rgba(179,64,26,.22), rgba(179,64,26,.06)); border: 1px solid var(--ember); border-radius: var(--r); font-size: 15px; }
.banner .t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ember-hi); }
.banner .hint { color: var(--muted); font-size: 14px; }

/* paused bar */
.paused { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; margin-bottom: 10px; border: 1px solid var(--gold); border-radius: var(--r); background: rgba(212,174,102,.1); color: var(--gold-hi); font-size: 15px; }
.paused b { font-family: var(--font-display); letter-spacing: .08em; }

/* toolbar */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-block: 0 10px; }
.tools input, .tools select { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; }
.tools input { flex: 1 1 220px; min-width: 0; }
.tools .spacer { flex: 1 0 0; }

/* table */
.board { position: relative; min-height: 0; display: flex; }
.scroll { flex: 1; min-width: 0; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); }
table { width: 100%; border-collapse: collapse; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--raised); text-align: left; font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(61,46,32,.6); vertical-align: top; }
tbody tr:hover { background: rgba(212,174,102,.04); }
tbody tr.mine { background: rgba(179,64,26,.12); box-shadow: inset 3px 0 0 var(--ember-hi); }
tbody tr.urgent { outline: 2px solid var(--urgent); outline-offset: -2px; background: rgba(224,72,58,.07); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 2px; }
.badge.urgent { background: var(--urgent); color: #fff; }
.badge.new { border: 1px solid var(--gold); color: var(--gold-hi); }
tbody tr.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(236,201,135,.22); } to { background: transparent; } }
.tag { font-family: var(--font-mono); font-size: 13px; color: var(--gold); white-space: nowrap; }
.title { font-weight: 700; min-width: 12ch; }
.desc { color: var(--muted); font-size: 15px; max-width: 62ch; }
.desc p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
tr.open-desc .desc p { display: block; -webkit-line-clamp: none; overflow: visible; }
.more { background: none; border: 0; padding: 0; color: var(--gold); font-size: 13px; }
.cls { white-space: nowrap; font-size: 14px; }
.cls.Barbarian { color: var(--barb); }
.cls.Wizard { color: var(--wiz); }
.cls.Any { color: var(--fg); }
.cls.NA { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.open { color: var(--open); border-color: rgba(124,196,127,.4); }
.pill.claimed { color: var(--ember-hi); border-color: rgba(224,112,63,.45); }
.pill.review { color: var(--review); border-color: rgba(201,164,245,.4); }
.timer { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.timer.low { color: var(--danger); }
.timer .sub { display: block; font-size: 12px; color: var(--muted); }
.dim { color: var(--muted); }
.act { white-space: nowrap; }
.act .note { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.act .row { display: flex; gap: 6px; flex-wrap: nowrap; }
td.c-act { min-width: 10em; }
td.c-timer { min-width: 5.5em; }
td.c-held { min-width: 9em; }
.held { font-size: 14px; white-space: nowrap; }
.held .sub { display: block; font-size: 12px; color: var(--muted); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Signed out: the table behind the wall is decoration only, so every cell is a blank bar and
   no bounty text is ever put in the DOM (brief). */
.skel { display: block; height: 10px; border-radius: 3px; background: var(--raised); }
.skel.sh { height: 26px; }
.skel.w1 { width: 4em; }
.skel.w2 { width: 14em; }
.skel.w3 { width: min(30em, 100%); }
.skel.w4 { width: 5em; }
.skel.w5 { width: 7em; }
.skel.w6 { width: 6em; }
.skel.w7 { width: 9em; }

/* frosted sign-in wall */
.board.locked .scroll { filter: blur(7px) saturate(.7); pointer-events: none; user-select: none; }
.wall { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(10,8,7,.35); backdrop-filter: blur(2px); }
.wall-card { max-width: 420px; text-align: center; background: rgba(21,16,12,.88); border: 1px solid var(--line); border-radius: 6px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.wall-card h2 { font-family: var(--font-display); color: var(--gold-hi); margin: 0 0 8px; font-size: 22px; letter-spacing: .05em; }
.wall-card p { color: var(--muted); margin: 0 0 18px; }
.wall-card small { display: block; color: var(--muted); margin-top: 14px; font-size: 13px; }
.discord-btn { background: var(--discord-blurple); border: 0; border-radius: var(--r); color: #fff; font-weight: 700; padding: 10px 18px; }

/* drawer + dialog */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; display: flex; justify-content: flex-end; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; }
.drawer { width: min(360px, 100%); height: 100%; overflow: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.drawer h2, .dialog h2 { font-family: var(--font-display); color: var(--gold-hi); font-size: 18px; letter-spacing: .06em; margin: 0 0 4px; }
.drawer p, .dialog p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.drawer.wide { width: min(560px, 100%); }
.drawer-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.histwrap { overflow-x: auto; }
.hist { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.hist th { text-align: right; font-weight: 500; color: var(--gold); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.hist th:first-child, .hist td:first-child { text-align: left; }
.hist td { text-align: right; padding: 8px 4px; border-bottom: 1px solid rgba(61,46,32,.6); }
.hist .nm { background: none; border: 0; padding: 0; color: var(--fg); text-align: left; }
.hist .nm:hover { color: var(--gold-hi); }
.hist .watch { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--urgent); border-radius: 3px; padding: 1px 5px; margin-left: 6px; }
.hist tr.log td { text-align: left; color: var(--muted); padding: 4px 4px 10px 14px; }
.hist tr.log ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.hist tr.log time { display: inline-block; min-width: 5.5em; color: var(--muted); }
.hist .g { color: var(--open); } .hist .b { color: var(--danger); } .hist .q { color: var(--review); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.dialog { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 20px; box-sizing: border-box; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--gold); letter-spacing: .04em; }
.field input, .field select, .field textarea { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; min-width: 0; }
.field textarea { min-height: 90px; resize: vertical; }
.field textarea.tall { min-height: 160px; }
.field .hint { font-size: 12px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.tabs2 { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs2 button { background: none; border: 0; padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs2 button[aria-selected="true"] { color: var(--gold-hi); border-color: var(--gold); }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 30; max-width: min(380px, calc(100% - 32px)); }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--r); padding: 9px 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: tin .25s ease-out; }
.toast.warn { border-left-color: var(--ember-hi); }
@keyframes tin { from { transform: translateY(8px); opacity: .3; } }


footer { font-size: 12px; color: var(--muted); padding-block: 8px; }

/* phones: rows become cards */
@media (max-width: 760px) {
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  tbody td { padding: 0; border: 0; }
  td.c-tag { grid-column: 1; }
  td.c-title { grid-column: 2; }
  td.c-cls { grid-column: 3; text-align: right; }
  td.c-desc { grid-column: 1 / -1; }
  td.c-status { grid-column: 1 / 3; display: flex; align-items: center; gap: 10px; }
  td.c-held { grid-column: 1 / -1; }
  td.c-timer { grid-column: 3; text-align: right; }
  td.c-act { grid-column: 1 / -1; }
  td.c-act .btn { width: 100%; }
  td.c-act .row .btn { width: auto; flex: 1; }
  .counts { width: 100%; order: 3; }
  .hdr-right { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
