
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #111111;
  font-family: Verdana, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

h1, h2, h3, h4 {
  color: #000000;
  font-weight: bold;
  margin: 0.6em 0 0.35em;
}
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

p { margin: 0.5em 0; }

a {
  color: #1a56db;
  text-decoration: underline;
}
a:visited { color: #5b3aa8; }
a:hover { color: #0d3ea3; }

.topbar {
  background: #2d2d2d;
  color: #ffffff;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
}
.topbar a {
  color: #ffffff;
  text-decoration: none;
}
.topbar a:hover { text-decoration: underline; }
.topbar .brand {
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar .brand-mark {
  height: 28px;
  width: auto;
  display: block;
  background: #ffffff;
}
.hub-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hub-header img {
  max-height: 120px;
  width: auto;
  display: block;
}
.hub-header h1 { margin: 0; }
.topbar .sep {
  color: #888888;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px 60px;
}
.wrap.wide { max-width: 1180px; }

.note, .box {
  background: #f4f4f2;
  border: 1px solid #bbbbbb;
  border-radius: 3px;
  padding: 8px 10px;
  margin: 10px 0;
}

.muted { color: #555555; }
.small { font-size: 12px; }

hr {
  border: none;
  border-top: 1px solid #cccccc;
  margin: 14px 0;
}

select, input[type="text"], input[type="search"], button {
  font: inherit;
  border: 1px solid #767676;
  border-radius: 3px;
  padding: 4px 6px;
  background: #ffffff;
  color: #111111;
}
button {
  background: #f0f0ee;
  cursor: pointer;
}
button:hover { background: #e6e6e2; }
button:active { background: #dcdcd8; }
label {
  display: block;
  font-weight: bold;
  margin: 0 0 2px;
}
.field { margin: 0 0 10px; }
.field select, .field input { width: 100%; max-width: 320px; }
.field-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.field-grid .field { flex: 1 1 200px; }

.table-scroll {
  overflow-x: auto;
  margin: 8px 0 14px;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
}
caption { text-align: left; font-weight: bold; margin-bottom: 4px; }
th, td {
  border: 1px solid #bbbbbb;
  padding: 4px 7px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f4f4f2;
  font-weight: bold;
}
td.num, th.num { text-align: right; }

.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.stat-square {
  border: 1px solid #333333;
  border-radius: 3px;
  min-width: 56px;
  text-align: center;
  padding: 5px 4px 4px;
  background: #ffffff;
}
.stat-square .stat-val {
  font-size: 19px;
  font-weight: bold;
  line-height: 1.1;
}
.stat-square .stat-label {
  font-size: 10px;
  color: #444444;
  margin-top: 1px;
}

.warscroll { border: 1px solid #bbbbbb; border-radius: 3px; padding: 10px 12px; margin: 10px 0 18px; }
.warscroll h2 { margin-top: 0; }
.warscroll .subname { color: #555555; font-weight: normal; font-size: 13px; }
.warscroll .keywords { font-size: 12px; color: #333333; margin: 6px 0; }
.warscroll .ability { margin: 6px 0; }
.warscroll .ability .ability-name { font-weight: bold; }
.warscroll .ability .ability-phase { color: #555555; font-size: 12px; }

.results-list { list-style: none; margin: 6px 0; padding: 0; }
.results-list li { padding: 3px 0; border-bottom: 1px solid #eeeeee; }
.results-list .sub { color: #555555; font-size: 12px; }

footer {
  background: #f4f4f2;
  border-top: 1px solid #cccccc;
  padding: 12px 16px;
  margin-top: 30px;
  font-size: 12px;
  color: #444444;
}
footer a { margin-right: 12px; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 6px 0; border-bottom: 1px solid #dddddd; }
.news-list .date { color: #555555; font-size: 12px; margin-right: 8px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
}

.right { text-align: right; }
.list-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }

details.unit-row summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
details.unit-row summary .pts { color: #444444; white-space: nowrap; }
details.unit-row .warscroll { margin: 6px 0 10px; }

.roster { border: 1px solid #bbbbbb; margin: 8px 0 14px; }
.roster-head {
  background: #f4f4f2;
  font-weight: bold;
  padding: 4px 7px;
  border-top: 1px solid #bbbbbb;
}
.roster-row {
  display: grid;
  grid-template-columns: 1fr 52px 78px;
  border-top: 1px solid #bbbbbb;
  background: #ffffff;
}
.roster-row > div { padding: 4px 7px; border-left: 1px solid #bbbbbb; }
.roster-row > div:first-child { border-left: none; }
.roster-row.roster-th { background: #f4f4f2; font-weight: bold; border-top: none; }
.roster-row.dragging { background: #eef2fa; border: 1px solid #767676; }
.drop { min-height: 10px; }
#export-preview {
  width: 100%;
  margin-top: 8px;
  font-family: "Courier New", Consolas, monospace;
  font-size: 12px;
}

.pick-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #eeeeee;
}
.pick-row .pts { color: #444444; white-space: nowrap; }
.pick-row.nope { color: #9a9a9a; }
.pick-row.nope .pts { color: #9a9a9a; }

button.linkish {
  border: none;
  background: none;
  padding: 0;
  color: #1a56db;
  text-decoration: underline;
  cursor: pointer;
}
button.linkish.general { font-weight: bold; }
button.tiny { padding: 0 5px; font-size: 11px; margin-left: 6px; }
label.inline { display: inline; font-weight: normal; margin-left: 8px; }
.roster-head label.inline { margin-left: 0; font-weight: bold; }
.roster-sub { margin-top: 3px; font-size: 12px; }
.roster-sub select { font-size: 12px; max-width: 230px; margin: 2px 6px 2px 0; }
.roster .warscroll { margin: 8px 0 4px; }
.warn-list { color: #b00000; margin: 4px 0 10px; padding-left: 20px; }
.cards label.inline { display: block; margin-left: 0; }
.cards input { width: auto; }

.bottom-bar { display: none; }
@media (max-width: 700px) {
  .bottom-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    color: #ffffff;
    padding: 8px 14px;
    border-top: 2px solid #888888;
  }
  .wrap { padding-bottom: 80px; }
  .roster-row { grid-template-columns: 1fr 44px 64px; }
}

.sheet table.army { width: auto; max-width: 560px; }
.sheet table.army th { width: 120px; }
.sheet .ability-name { font-weight: bold; }
.sheet .ability-phase { color: #555555; font-size: 12px; }
.sheet p { margin: 3px 0; }

.phase-group { margin: 0 0 14px; }
.phase-group h3 {
  background: #f4f4f2;
  border: 1px solid #bbbbbb;
  padding: 3px 7px;
  margin: 0 0 6px;
}
.phase-group.dim { opacity: 0.32; }

.entry {
  padding: 4px 0 5px 8px;
  border-bottom: 1px solid #eeeeee;
  border-left: 3px solid #ffffff;
}
.entry .src { font-weight: bold; }
.entry.enemy { border-left-color: #c9a0a0; }
.entry .tag {
  font-size: 11px;
  color: #7a2a2a;
  border: 1px solid #c9a0a0;
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 6px;
  white-space: nowrap;
}

.print-only { display: none; }
.list-controls .field select { max-width: 220px; }

button.big {
  min-width: 38px;
  min-height: 38px;
  padding: 3px 8px;
  font-size: 17px;
  line-height: 1;
}
.counter, .counter-cell { white-space: nowrap; }
.counter b, .counter-cell b {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  font-size: 16px;
}
.turn-pick { margin-left: 10px; }

.vp-input { width: 54px; }
.vp-table th, .vp-table td { vertical-align: top; }
.vp-table tr.now th, .vp-table tr.now td { background: #fffbe6; }
label.tick {
  display: block;
  font-weight: normal;
  font-size: 12px;
  margin-top: 2px;
}
label.tick input { width: auto; }
.unit-table tr.gone td { color: #8a8a8a; background: #f6f6f6; }
.unit-table td { vertical-align: middle; }

@media (max-width: 700px) {
  .entry { padding-left: 6px; }
  button.big { min-width: 44px; min-height: 44px; }
  .unit-table td, .unit-table th { padding: 6px 5px; }
  .bottom-bar select { max-width: 150px; }
}

@media print {
  .topbar, .no-print, .bottom-bar, footer { display: none !important; }
  html, body { background: #ffffff; color: #000000; font-size: 9.5pt; }
  a { color: #000000; text-decoration: none; }
  .wrap, .wrap.wide { max-width: none; padding: 0; }
  h1 { font-size: 15pt; }
  .muted { color: #000000; }
  .phase-group.dim { opacity: 1; }
  .phase-group h3 { background: #ffffff; border: none; border-bottom: 1.5pt solid #000000; }
  .entry { break-inside: avoid; page-break-inside: avoid; border-bottom: none; border-left: none; padding-left: 0; }
  .entry .tag { border: none; color: #000000; }
  .sheet .ability-phase { color: #000000; }
  .sheet p { margin: 1px 0; }
  .print-only { display: block; }
  .warscroll { break-inside: avoid; page-break-inside: avoid; border-color: #000000; }
  .stat-square { border-color: #000000; }
  th, td { border-color: #000000; }
}
