* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: #04223d;
  background-image: url("assets/backgrounds/roy_cabin.png");
  background-position: center;
  background-size: 75%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #eaf4ff;
}

#admin-root {
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  background: rgba(4, 34, 61, 0.93);
  border: 1px solid #3a6ea5;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(2px);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem;
  background: rgba(4, 34, 61, 0.93);
  border: 1px solid #3a6ea5;
  border-radius: 10px;
  backdrop-filter: blur(2px);
}
.tab-btn {
  background: transparent;
  color: #9fd3ff;
  border: 1px solid #3a6ea5;
  border-radius: 6px 6px 0 0;
  font-weight: normal;
}
.tab-btn.active {
  background: #ffb703;
  color: #04223d;
  font-weight: bold;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sub-tabs — same idea as the top-level .tabs/.tab-btn, smaller, nested inside a
   tab-panel (e.g. Grant shots / Prizes / Full board inside Active Campaign). */
.subtabs {
  display: flex;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #3a6ea5;
}
.subtab-btn {
  background: transparent;
  color: #9fd3ff;
  border: 1px solid #3a6ea5;
  border-radius: 6px;
  font-weight: normal;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
}
.subtab-btn.active {
  background: #ffb703;
  color: #04223d;
  font-weight: bold;
}
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

#campaign-history-list {
  list-style: none;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}
#campaign-history-list li {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #123a5c;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
#campaign-history-list li:hover { background: #0a2e4d; }
#campaign-history-list li.selected { background: #123a5c; }
#campaign-history-list .meta { color: #9fd3ff; font-size: 0.8rem; }
#campaign-history-list .badge {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #3a6ea5;
  color: #eaf4ff;
  align-self: flex-start;
}
#campaign-history-list .badge.active { background: #ffb703; color: #04223d; }

#back-to-board-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: #ffb703;
  color: #04223d;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
}
#back-to-board-link:hover { background: #ffc93c; }

h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; border-bottom: 1px solid #3a6ea5; padding-bottom: 0.3rem; }

section { max-width: none; margin-bottom: 2rem; }

/* Backer chips for plain list rows (reps, grants, prizes) — a subtle fill so each row
   reads as its own item against the panel behind it, not just bare text. */
#rep-list, #grant-list, #prize-list { list-style: none; padding: 0; }
#rep-list li, #grant-list li, #prize-list li {
  background: rgba(10, 46, 77, 0.6);
  border: 1px solid #123a5c;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
}

.row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }

input, select, button {
  padding: 0.5rem;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid #3a6ea5;
  background: #0a2e4d;
  color: #eaf4ff;
}

button {
  background: #ffb703;
  color: #04223d;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid #123a5c; font-size: 0.9rem; }

.error { color: #ff6b6b; }

#login-screen { max-width: 320px; margin: 4rem auto; text-align: center; }
#login-screen form { display: flex; flex-direction: column; gap: 0.5rem; }

#fleet-list { list-style: none; padding: 0; }
#fleet-list li {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0;
  border-bottom: 1px solid #123a5c;
}
#fleet-list .swatch {
  width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
}
#fleet-list .status { color: #9fd3ff; font-size: 0.85rem; }
#fleet-list .status.placed { color: #7be08a; }

.fleet-builder-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.fleet-builder-columns > .fleet-col { flex: 1 1 340px; min-width: 300px; }
.fleet-builder-columns > .placement-col { flex: 1 1 380px; min-width: 320px; }

#placement-grid {
  display: inline-grid;
  gap: 2px;
  margin: 0.5rem 0;
}
.placement-cell {
  width: 36px; height: 36px;
  background: #0a2e4d;
  border: 1px solid #123a5c;
  cursor: pointer;
}
.placement-cell.hover-preview { background: #2f7fb8; }
.placement-cell.invalid-preview { background: #7a1f1f; }

#placement-hint { font-size: 0.85rem; color: #ffd166; font-weight: normal; }

.hint { font-size: 0.8rem; color: #9fd3ff; font-weight: normal; }

#prize-chest {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  min-height: 2rem;
  padding: 0.4rem;
  background: #08223b;
  border: 1px dashed #3a6ea5;
  border-radius: 6px;
}
.prize-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: #ffb703;
  color: #04223d;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: grab;
  user-select: none;
}
.prize-chip:active { cursor: grabbing; }
.prize-chip .remove-chip { cursor: pointer; opacity: 0.6; }
.prize-chip .remove-chip:hover { opacity: 1; }

#fleet-list li.drop-target { outline: 2px dashed #ffb703; outline-offset: 2px; }
