/* Looking for a Fight — comic-book staging design.
   Committed palette: paper #f7f2e4, ink #141414, red #d92323, yellow #ffc907, blue #2b50c8.
   Display: Bangers. Body: Archivo. Halftone dots, hard ink shadows, panel borders. */

:root {
  --paper: #f7f2e4;
  --ink: #141414;
  --red: #d92323;
  --yellow: #ffc907;
  --blue: #2b50c8;
  --panel: #fffdf4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#14141414 1.2px, transparent 1.3px);
  background-size: 14px 14px;
}
a { color: var(--blue); }

/* Masthead */
.masthead {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.4rem; background: var(--ink); border-bottom: 6px solid var(--yellow);
}
.logo {
  font-family: "Bangers", cursive; font-size: 2rem; letter-spacing: 0.04em;
  color: var(--paper); text-decoration: none;
}
.logo span { color: var(--yellow); }
.masthead nav a {
  color: var(--paper); text-decoration: none; font-weight: 800; margin-left: 1.4rem;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem;
}
.masthead nav a:hover { color: var(--yellow); }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }

/* Hero */
.hero { text-align: center; margin: 1rem 0 2rem; }
.hero.small { margin-bottom: 1rem; }
.hero h1 {
  font-family: "Bangers", cursive; font-size: clamp(2.6rem, 7vw, 4.6rem);
  margin: 0; letter-spacing: 0.03em; line-height: 1;
}
.burst-word { color: var(--red); text-shadow: 3px 3px 0 var(--yellow); }
.tagline { font-size: 1.08rem; margin-top: 0.8rem; }
.tagline .red { color: var(--red); } .tagline .blue { color: var(--blue); }

/* Corners */
.corners { display: flex; align-items: stretch; gap: 1rem; margin: 1.5rem 0 1rem; }
.corner {
  flex: 1; background: var(--panel); border: 4px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink); min-height: 240px; display: flex; flex-direction: column;
}
.corner-red { border-color: var(--red); box-shadow: 7px 7px 0 var(--red); }
.corner-blue { border-color: var(--blue); box-shadow: 7px 7px 0 var(--blue); }
.corner-label {
  font-family: "Bangers", cursive; letter-spacing: 0.08em; font-size: 1.25rem;
  padding: 0.4rem 0.8rem; color: #fff;
}
.corner-red .corner-label { background: var(--red); }
.corner-blue .corner-label { background: var(--blue); }
.corner-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.8rem; gap: 0.5rem; }
.corner-body img { width: 100%; max-width: 240px; height: 210px; object-fit: cover; border: 3px solid var(--ink); }
.corner-name { font-family: "Bangers", cursive; font-size: 1.7rem; letter-spacing: 0.03em; }
.corner-empty { color: #6b675a; font-weight: 600; }
.vs-badge {
  align-self: center; font-family: "Bangers", cursive; font-size: 2rem;
  background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%;
  width: 84px; height: 84px; display: flex; align-items: center; justify-content: center;
  box-shadow: 4px 4px 0 var(--ink); flex: none; transform: rotate(-6deg);
}
.vs-badge.big { width: 104px; height: 104px; font-size: 2.6rem; }

/* Fight bar */
.fight-bar { text-align: center; margin: 1.2rem 0 2.4rem; }
#fight-btn {
  font-family: "Bangers", cursive; font-size: 2.2rem; letter-spacing: 0.06em;
  background: var(--red); color: #fff; border: 4px solid var(--ink);
  padding: 0.35em 1.6em; cursor: pointer; box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.08s ease;
}
#fight-btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
#fight-btn:disabled { background: #9a958a; cursor: not-allowed; box-shadow: 6px 6px 0 #6b675a; }
.fight-msg { color: var(--red); font-weight: 700; min-height: 1.4em; margin-top: 0.7rem; }

/* Roster cards */
.roster h2, .board h2, .feats h2, .history h2 {
  font-family: "Bangers", cursive; font-size: 2.1rem; letter-spacing: 0.04em;
  border-bottom: 4px solid var(--ink); padding-bottom: 0.2rem;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.fighter-card {
  background: var(--panel); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 0; cursor: pointer; text-align: center; font-family: inherit;
  display: flex; flex-direction: column; transition: transform 0.08s ease;
}
.fighter-card:hover { transform: translate(-2px, -2px); }
.fighter-card .card-img { display: block; height: 190px; overflow: hidden; border-bottom: 3px solid var(--ink); }
.fighter-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-name { font-family: "Bangers", cursive; font-size: 1.4rem; padding: 0.35rem 0.2rem 0; letter-spacing: 0.03em; }
.card-universe { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #6b675a; padding-bottom: 0.55rem; }
.fighter-card.picked-red { outline: 5px solid var(--red); outline-offset: 2px; }
.fighter-card.picked-blue { outline: 5px solid var(--blue); outline-offset: 2px; }
.roster-note { margin-top: 1rem; color: #55524a; }

/* Panels + breakdown */
.panel {
  background: var(--panel); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
  padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.panel h3 { font-family: "Bangers", cursive; font-size: 1.5rem; margin: 0 0 0.4rem; letter-spacing: 0.03em; }
.panel p { margin: 0; line-height: 1.55; }
.panel.turning { background: #fff6cf; }
.verdict-panel { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--red); }
.verdict-panel h3 { color: var(--yellow); }
.verdict-winner { margin-top: 0.8rem !important; font-weight: 800; font-size: 1.1rem; }

/* Versus page */
.verdict-head { text-align: center; }
.verdict-head h1 { font-family: "Bangers", cursive; font-size: clamp(2.4rem, 6vw, 4rem); margin: 0.4rem 0; }
.decided-line { color: #55524a; font-weight: 600; }
.vault-note {
  display: inline-block; background: var(--yellow); border: 3px solid var(--ink);
  padding: 0.35rem 0.9rem; font-weight: 800; box-shadow: 4px 4px 0 var(--ink);
}
.versus { display: flex; align-items: center; gap: 1.2rem; margin: 1.6rem 0 2.2rem; }
.versus-side { flex: 1; text-align: center; position: relative; }
.versus-img { border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); background: var(--panel); }
.versus-img img { width: 100%; height: 380px; object-fit: cover; display: block; }
.versus-side.is-loser .versus-img img { filter: grayscale(1) contrast(0.92); }
.versus-side.is-loser .versus-img { box-shadow: 7px 7px 0 #8a8578; }
.versus-name {
  display: inline-block; margin-top: 0.8rem; font-family: "Bangers", cursive;
  font-size: 2.2rem; color: var(--ink); text-decoration: none; letter-spacing: 0.03em;
}
.versus-universe { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: #6b675a; }
.winner-burst {
  position: absolute; top: -22px; right: -10px; z-index: 2;
  font-family: "Bangers", cursive; font-size: 1.5rem; color: var(--ink);
  background: var(--yellow); padding: 1.1rem 0.9rem;
  clip-path: polygon(50% 0%, 61% 12%, 78% 6%, 82% 22%, 98% 26%, 92% 42%, 100% 55%, 88% 64%, 90% 82%, 74% 84%, 66% 98%, 52% 88%, 36% 97%, 30% 82%, 12% 86%, 12% 68%, 0% 56%, 10% 43%, 4% 26%, 22% 22%, 28% 6%, 42% 13%);
  transform: rotate(8deg);
}
.back-links { text-align: center; font-weight: 700; }

/* Profile */
.profile { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.profile-img { border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); background: var(--panel); flex: none; }
.profile-img img { width: 280px; height: 360px; object-fit: cover; display: block; }
.profile-main { flex: 1; min-width: 280px; }
.profile-main h1 { font-family: "Bangers", cursive; font-size: 3.2rem; margin: 0; letter-spacing: 0.03em; }
.profile-universe { font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--red); margin: 0.1rem 0 1rem; }
.record-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.record-strip span {
  background: var(--panel); border: 3px solid var(--ink); padding: 0.3rem 0.7rem;
  font-weight: 700; box-shadow: 3px 3px 0 var(--ink); font-size: 0.92rem;
}
.record-strip strong { font-family: "Bangers", cursive; font-size: 1.25rem; margin-right: 0.25rem; }
.background { line-height: 1.6; font-size: 1.03rem; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feat-grid .panel { margin-bottom: 0; }

/* Tables */
.record-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.record-table th, .record-table td { padding: 0.55rem 0.8rem; text-align: left; border-bottom: 2px solid #e4ddc8; }
.record-table th { font-family: "Bangers", cursive; font-size: 1.15rem; letter-spacing: 0.05em; background: var(--yellow); border-bottom: 3px solid var(--ink); }
.record-table .rank { font-family: "Bangers", cursive; font-size: 1.3rem; }
.record-table .points { font-weight: 800; }
.record-table .uni { color: #6b675a; font-size: 0.85rem; font-weight: 600; }
.result-w { background: #1d7a1d; color: #fff; font-weight: 800; padding: 0.1rem 0.55rem; border: 2px solid var(--ink); }
.result-l { background: var(--red); color: #fff; font-weight: 800; padding: 0.1rem 0.55rem; border: 2px solid var(--ink); }
.board { margin-bottom: 2.4rem; }
.no-fights { font-weight: 600; }

/* Overlay */
.overlay {
  position: fixed; inset: 0; background: rgba(20, 20, 20, 0.82);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem;
}
.overlay[hidden] { display: none; }
.overlay-box {
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--red);
  padding: 2rem 2.4rem; text-align: center; max-width: 520px;
}
.overlay-title { font-family: "Bangers", cursive; font-size: 2.2rem; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.045); } }

/* Setup (one-time) */
.setup-panel { max-width: 640px; margin: 0 auto; }
.setup-panel p { margin-bottom: 0.9rem; line-height: 1.55; }
.setup-steps { margin: 0 0 0.9rem; padding-left: 1.4rem; line-height: 1.6; }
.setup-error {
  background: #fde3e3; border: 3px solid var(--red); color: var(--ink);
  padding: 0.7rem 0.9rem; font-weight: 700; box-shadow: 4px 4px 0 var(--red);
}
.setup-form { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }
.setup-form label {
  font-family: "Bangers", cursive; font-size: 1.3rem; letter-spacing: 0.04em;
}
.setup-form input {
  font-family: inherit; font-size: 1rem; padding: 0.75rem 0.9rem;
  border: 3px solid var(--ink); background: #fff; box-shadow: inset 3px 3px 0 #e4ddc8;
}
.setup-form input:focus { outline: 3px solid var(--yellow); outline-offset: 1px; }
.setup-btn {
  font-family: "Bangers", cursive; font-size: 1.8rem; letter-spacing: 0.06em;
  background: var(--red); color: #fff; border: 4px solid var(--ink);
  padding: 0.3em 1.4em; cursor: pointer; box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.08s ease; align-self: flex-start;
}
.setup-btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.setup-arena-link { color: var(--yellow); text-decoration: none; }
.setup-arena-link:hover { text-decoration: underline; }

.colophon { border-top: 4px solid var(--ink); padding: 1.2rem; text-align: center; background: var(--panel); }
.colophon p { margin: 0.2rem 0; font-weight: 600; }
.colophon .fine { color: #6b675a; font-size: 0.85rem; }

@media (max-width: 720px) {
  .corners, .versus { flex-direction: column; }
  .versus-img img { height: 300px; }
  .vs-badge { margin: -0.4rem 0; }
  .profile-img img { width: 100%; height: 320px; }
  .profile-img { width: 100%; }
}
