/* Carcass Front – shared look (parchment, ink and blood red, like the old Scorecard). */
:root {
  --parchment: #E1D4BA; --parchment-2: #EADFC9; --head: #CDB893; --line: #897961; --ink: #2B2118;
  --muted: #5d4f3f; --blood: #7A1C1C; --blood-dark: #3C0A0A; --ok: #1b5e20; --err: #b00020;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--parchment); color: var(--ink); font-family: "EB Garamond", Georgia, serif; font-size: 17px; line-height: 1.35; }
a { color: var(--blood); }
h1, h2, h3, .title { font-family: "Pirata One", Georgia, serif; color: var(--blood); font-weight: normal; letter-spacing: .3px; }
h1 { font-size: 40px; margin: 0; line-height: 1.05; }
h2 { font-size: 27px; margin: 18px 0 6px; border-bottom: 2px solid var(--blood); padding-bottom: 2px; }
h3 { font-size: 21px; margin: 14px 0 4px; }
.muted { color: var(--muted); font-style: italic; }
.small { font-size: 14px; }

/* top bar */
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; background: var(--blood-dark); color: #f4ead8; padding: 6px 16px; }
.nav .brand { font-family: "Pirata One", Georgia, serif; font-size: 23px; color: #fff; text-decoration: none; margin-right: 8px; }
.nav a { color: #f4ead8; text-decoration: none; padding: 3px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { border-bottom-color: #e9b0a0; }
.nav .grow { flex: 1; }
.nav .who { font-size: 15px; opacity: .9; }
.nav button { background: transparent; color: #f4ead8; border: 1px solid #9c6b5f; border-radius: 5px; padding: 2px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 14px 16px 40px; }

/* Warbands menu */
.wbmenu { position: relative; }
.nav .wbmenu button { font-size: 16px; padding: 3px 12px; }
.nav .wbmenu button.on { border-color: #e9b0a0; }
.wbdrop { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; background: var(--parchment-2); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.35); min-width: 320px; max-height: 75vh; overflow: auto; padding: 4px; }
.wbdrop.open { display: block; }
.nav .wbdrop a { display: flex; gap: 10px; align-items: center; color: var(--ink); padding: 6px 8px; border-radius: 6px; border: none; font-size: 15px; line-height: 1.2; }
.nav .wbdrop a:hover, .nav .wbdrop a.cur { background: var(--head); }
.wbdrop img { width: 34px; height: 34px; flex: none; }
.wbdrop b { color: var(--blood); }

/* tables like the sheet */
table.sheet { border-collapse: collapse; width: 100%; background: var(--parchment-2); }
table.sheet th { background: var(--head); font-weight: 700; text-align: center; padding: 4px 6px; border: 1px solid var(--line); font-size: 15px; }
table.sheet td { padding: 4px 6px; border: 1px solid #b5a789; vertical-align: middle; }
table.sheet tr:nth-child(even) td { background: #e4d7bd; }
table.sheet td.num, table.sheet th.num { text-align: center; }
table.sheet td.lbl { background: var(--head); font-weight: 700; white-space: nowrap; }
.scroll { overflow-x: auto; }

/* buttons */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--blood); color: #fff; border: 2px solid var(--blood-dark); border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: #8e2626; }
.btn.light { background: var(--parchment-2); color: var(--blood); border-color: var(--line); }
.btn.small { padding: 4px 10px; font-size: 14px; border-width: 1px; border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; font-size: 16px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fffaf0; color: var(--ink); }
.card { background: var(--parchment-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.err { color: var(--err); } .ok { color: var(--ok); }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { background: var(--parchment-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; min-width: 110px; }
.tile .v { font-family: "Pirata One", Georgia, serif; font-size: 30px; color: var(--blood); line-height: 1; }
.tile .k { font-size: 14px; color: var(--muted); }

/* login */
.login { max-width: 380px; margin: 9vh auto; background: var(--parchment-2); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; }
.login label { display: block; margin: 10px 0 3px; font-weight: 700; }
.login input { width: 100%; }
.login .btn { width: 100%; margin-top: 16px; }

/* tooltip */
.tip { position: fixed; z-index: 90; pointer-events: none; background: #1d140d; color: #f4ead8; border: 1px solid #9c6b5f; border-radius: 6px;
  padding: 6px 10px; font-size: 15px; max-width: 300px; box-shadow: 0 4px 14px rgba(0,0,0,.35); display: none; }
.tip b { font-family: "Pirata One", Georgia, serif; font-weight: normal; font-size: 19px; color: #fff; display: block; }

@media (max-width: 700px) { h1 { font-size: 31px; } body { font-size: 16px; } }
@media print { .nav, .noprint { display: none !important; } body { background: #fff; } }

.nav .campsel { font: inherit; font-size: 14px; padding: 4px 6px; margin-right: 8px; border-radius: 5px; border: 1px solid rgba(255,255,255,.45); background: rgba(0,0,0,.25); color: #fff; max-width: 260px; }
.nav .campsel option { color: #222; background: #fff; }
.nav .campname { font-size: 13px; opacity: .8; margin-right: 10px; white-space: nowrap; }
@media (max-width: 700px) { .nav .campname { display: none; } }

details.mem { position: relative; min-width: 210px; }
details.mem summary { cursor: pointer; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 14px; list-style: none; }
details.mem summary::after { content: ' ▾'; color: var(--muted); }
details.mem[open] summary { border-color: var(--blood); }
details.mem label { display: block; font-size: 14px; padding: 3px 8px; white-space: nowrap; }
details.mem[open] { z-index: 5; }
details.mem[open] > :not(summary) { background: #fff; }
details.mem[open] label:first-of-type { border-bottom: 1px solid var(--line); font-weight: 700; }

/* warband icon editor */
.icov { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 12px; }
.icbox { background: var(--parchment-2); border-radius: 8px; padding: 12px 16px; max-width: 760px; width: 100%; }
.icrow { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.icstage { position: relative; line-height: 0; user-select: none; touch-action: none; max-width: 100%; }
.icstage img { max-width: min(460px, 86vw); max-height: 60vh; display: block; }
.icsq { position: absolute; border: 2px dashed #fff; border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; }
.icsq .hd { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; background: #fff; border: 2px solid var(--blood); border-radius: 3px; cursor: nwse-resize; }
.icprev { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .icprev canvas { background: #d9c6a0; border-radius: 50%; }
