/* WrestleFlow Brackets — orange/blue brand per Teams style */
:root {
  --orange: #e84a0c;
  --orange-dk: #c23d08;
  --blue: #1b3a6b;
  --blue-lt: #2d5499;
  --ink: #1d2330;
  --paper: #f5f6f8;
  --card: #ffffff;
  --line: #c9cfd9;
  --win: #1d8a3e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; color: #fff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dk) 60%, var(--blue) 140%);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  background: #fff; color: var(--orange); font-weight: 800; font-size: 18px;
  border-radius: 8px; padding: 6px 9px; letter-spacing: -1px;
}
.site-header h1 { margin: 0; font-size: 22px; font-weight: 800; }
.site-header h1 span { font-weight: 300; opacity: .9; }
.site-header nav a { color: #fff; opacity: .85; text-decoration: none; font-size: 14px; }
.site-header nav a:hover { opacity: 1; }

main { max-width: 1280px; margin: 0 auto; padding: 22px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; box-shadow: 0 1px 4px rgba(20,30,50,.06);
}
.panel h2 { margin: 0 0 16px; color: var(--blue); }
.setup-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.setup-grid .span2 { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; color: var(--blue); }
.field label small { font-weight: 400; color: #67708a; }
.field input[type=text], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
}
.field textarea { resize: vertical; }
.count { font-size: 12.5px; color: #67708a; margin-top: 4px; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--blue-lt); color: var(--blue); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dk); color: #fff; }
.btn.ghost { background: transparent; }

.hidden { display: none !important; }

.bracket-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 22px 0 4px; }
.bracket-toolbar h2 { margin: 0; color: var(--blue); }
.toolbar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { color: #67708a; margin: 4px 0 12px; font-size: 13.5px; }
.share-box { display: flex; gap: 8px; margin: 0 0 12px; }
.share-box input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }

.champ {
  background: linear-gradient(135deg, var(--orange), var(--blue));
  color: #fff; font-size: 19px; font-weight: 800; text-align: center;
  border-radius: 10px; padding: 12px; margin-bottom: 14px;
}

/* Bracket grid */
.bracket-wrap { position: relative; overflow-x: auto; padding-bottom: 8px; }
#bracket { display: flex; gap: 46px; min-width: max-content; position: relative; z-index: 2; }
#lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#lines path { stroke: var(--line); stroke-width: 2; fill: none; }

.round { display: flex; flex-direction: column; min-width: 190px; }
.round-label {
  text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #67708a; margin-bottom: 10px;
}
.round-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.match {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(20,30,50,.07);
}
.slot {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  border-bottom: 1px solid #edf0f4; min-height: 36px; cursor: pointer; user-select: none;
}
.slot:last-child { border-bottom: 0; }
.slot.empty { cursor: default; color: #b6bcc8; font-style: italic; }
.slot.bye { cursor: default; color: #b6bcc8; font-style: italic; }
.slot:not(.empty):not(.bye):hover { background: #fff3ec; }
.slot .seed {
  font-size: 11px; font-weight: 700; color: #8a93a8; background: #eef1f6;
  border-radius: 5px; padding: 1px 6px; min-width: 22px; text-align: center;
}
.slot .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.winner { background: #e9f7ee; }
.slot.winner .nm { font-weight: 700; color: var(--win); }
.slot.winner .seed { background: var(--win); color: #fff; }
.slot.loser .nm { color: #aab1c0; text-decoration: line-through; }

/* Round robin */
#rrWrap { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
#standings, #schedule { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
#standings h3, #schedule h3 { margin: 0 0 10px; color: var(--blue); }
#standings table { width: 100%; border-collapse: collapse; font-size: 14px; }
#standings th, #standings td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #edf0f4; }
#standings th { color: #67708a; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.rr-round { margin-bottom: 14px; }
.rr-round h4 { margin: 0 0 6px; color: var(--orange-dk); }
.rr-match {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid #edf0f4; border-radius: 8px; margin-bottom: 6px; background: #fff;
}
.rr-side { flex: 1; padding: 5px 9px; border-radius: 6px; cursor: pointer; user-select: none; }
.rr-side:hover { background: #fff3ec; }
.rr-side.winner { background: #e9f7ee; font-weight: 700; color: var(--win); }
.rr-side.bye { cursor: default; color: #b6bcc8; font-style: italic; }
.rr-vs { color: #8a93a8; font-size: 12px; font-weight: 700; }

.seo-blurb { margin-top: 34px; color: #555e72; max-width: 820px; }
.seo-blurb h3 { color: var(--blue); }
.site-footer { text-align: center; color: #8a93a8; font-size: 13px; padding: 26px 12px; }
.site-footer a { color: var(--blue-lt); }

@media (max-width: 760px) {
  .setup-grid { grid-template-columns: 1fr; }
  #rrWrap { grid-template-columns: 1fr; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .bracket-wrap { overflow: visible; }
  .match, #standings, #schedule { box-shadow: none; }
  .champ { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
