:root {
  --green: #2d5e3e;
  --green-light: #e8f3ec;
  --accent: #d4a017;
  --bg: #f7f7f5;
  --text: #1a1a1a;
  --muted: #666;
  --border: #d8d8d4;
  --danger: #b8312f;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; background: var(--bg); color: var(--text); }
header { background: var(--green); color: white; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
header h1 { margin: 0; font-size: 1.4rem; }
header nav a { color: white; margin-left: 16px; text-decoration: none; opacity: 0.85; }
header nav a:hover { opacity: 1; text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
.card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
h2 { color: var(--green); margin-top: 0; }
button, .btn { background: var(--green); color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 0.95rem; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #234a31; }
button.secondary { background: #777; }
button.danger { background: var(--danger); }
button.small { padding: 4px 10px; font-size: 0.85rem; }
.tournament-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-top: 10px; }
.tournament-actions .action-btn { width: 110px; min-height: 36px; line-height: 20px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
input, select, textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; font-family: inherit; }
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 0.9rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--green-light); color: var(--green); font-size: 0.85rem; text-transform: uppercase; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 12px; background: var(--accent); color: white; font-size: 0.75rem; font-weight: 600; }
.tag.mens { background: #2c5282; }
.tag.womens { background: #b83280; }
.tag.doubles { background: #6b46c1; }
.tag.singles { background: #2c5282; }
.tag.signup { background: #888; }
.tag.active { background: #38a169; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { background: #fee; color: var(--danger); padding: 10px; border-radius: 4px; margin: 10px 0; }
.success { background: #efe; color: #2a6; padding: 10px; border-radius: 4px; margin: 10px 0; }

/* Bracket */
.bracket { display: flex; gap: 30px; overflow-x: auto; padding: 20px 0; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; min-width: 200px; }
.round-title { text-align: center; font-weight: 600; color: var(--green); margin-bottom: 8px; }
.round-deadline { text-align: center; font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.match { background: white; border: 1px solid var(--border); border-radius: 4px; padding: 8px; margin: 8px 0; min-width: 180px; }
.player-row { display: flex; justify-content: space-between; padding: 4px 6px; border-radius: 3px; }
.player-row.winner { background: var(--green-light); font-weight: 600; }
.player-row.bye { color: var(--muted); font-style: italic; }
.match-meta { font-size: 0.75rem; color: var(--muted); margin-top: 4px; text-align: center; }
.seed-badge { display: inline-block; background: var(--accent); color: white; font-size: 0.7rem; padding: 1px 5px; border-radius: 8px; margin-right: 4px; }
.handicap-badge { display: inline-block; background: #6b46c1; color: white; font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; margin-right: 4px; }

@media print {
  header, nav, button, .no-print { display: none !important; }
  body { background: white; }
  .card { border: none; box-shadow: none; padding: 0; }
  .bracket { page-break-inside: avoid; }
  @page { size: A4 landscape; margin: 1cm; }
}
