/* TourneyRatings -- plain CSS, no framework. Ice-blue + navy, system fonts. */

:root {
  --navy: #0b2a4a;
  --navy-2: #123c66;
  --ice: #e8f2fa;
  --ice-2: #d3e6f5;
  --accent: #c8102e;
  --teal: #0e7c7b;
  --ink: #1c2733;
  --muted: #5b6b7a;
  --line: #d7e1ea;
  --card: #ffffff;
  --warn-bg: #fdf0e6;
  --warn-ink: #8a4b12;
  --ok-bg: #e7f5ec;
  --ok-ink: #1d6b3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #f4f8fb;
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

a { color: var(--navy-2); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0.6em 0 0.3em; }
h2 { font-size: 1.35rem; margin: 1.4em 0 0.5em; color: var(--navy); }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 46em; }
.meta { color: var(--muted); margin: 0.15em 0; font-size: 0.95rem; }
.fineprint { color: var(--muted); font-size: 0.85rem; }

/* Header */
.site-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
.brand { color: #fff; text-decoration: none; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.brand span { color: #7fc4f0; }
.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: #cfe3f2; text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.main-nav a:hover { color: #fff; }
.main-nav a.active { color: #fff; border-bottom: 2px solid var(--accent); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--ice), #f4f8fb); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; margin: 22px 0; }
.hero h1 { margin-top: 0; }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin: 16px 0 8px; }
.hero-search input { flex: 1; padding: 11px 12px; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; }
button, .button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 11px 18px; font-size: 1rem; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: #a50d26; }
.button.ghost { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.hero-stats { color: var(--muted); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin: 16px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0; font-size: 1.12rem; }
.card h3 a { text-decoration: none; color: var(--navy); }
.card .fee { font-weight: 700; margin: 0.5em 0 0.3em; }
.card-actions { margin-bottom: 0; font-size: 0.95rem; }

.score-badge {
  background: var(--navy); color: #fff; border-radius: 8px; padding: 4px 10px;
  font-weight: 800; font-size: 1.05rem; white-space: nowrap; text-align: center;
}
.score-badge small { font-weight: 600; font-size: 0.75rem; opacity: 0.85; }
.score-badge.none { background: #eef3f7; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.badge-row, .tag-row { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.badge { background: #eef3f7; color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 0.82rem; font-weight: 600; }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag { background: #e2f2f2; color: var(--teal); border: 1px solid #bfe3e2; border-radius: 999px; padding: 2px 10px; font-size: 0.82rem; font-weight: 700; }

/* Spotlight / founder */
.spotlight { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
@media (max-width: 800px) { .spotlight { grid-template-columns: 1fr; } }
.spotlight-story, .spotlight-review { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.spotlight h2 { margin-top: 0; }
.founder-flag { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Leaderboard */
.leaderboard { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.leaderboard li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.leaderboard li:last-child { border-bottom: 0; }
.rank { font-size: 1.3rem; font-weight: 800; color: var(--muted); width: 1.6em; text-align: center; }
.lb-main { flex: 1; display: flex; flex-direction: column; }
.lb-main a { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.lb-main small { color: var(--muted); }
.lb-criteria { font-size: 0.85rem; }

/* Filters */
.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.chip:hover { border-color: var(--navy-2); }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.filters label, .rate-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.95rem; }
.filters input, .filters select, .rate-form input, .rate-form select, .rate-form textarea {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-weight: 400; background: #fff;
}
.myplayer { border: 1px solid var(--ice-2); background: var(--ice); border-radius: 10px; margin-top: 16px; padding: 12px 16px; }
.myplayer legend { font-weight: 800; color: var(--navy); padding: 0 6px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.check-label { font-weight: 700; min-width: 3.2em; }
.chip-check { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 600; cursor: pointer; flex-direction: row !important; align-items: center; gap: 6px !important; }
.myplayer-count { font-weight: 700; color: var(--navy); margin: 8px 0 0; }
.filter-actions { margin: 14px 0 0; }
.result-count { color: var(--muted); font-weight: 600; }
.empty { grid-column: 1 / -1; color: var(--muted); }

/* Detail */
.crumbs { margin-top: 18px; }
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.detail-facts div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.detail-facts span { color: var(--muted); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.return-stat { font-size: 1.02rem; }
.criteria { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-width: 640px; }
.criterion { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.criterion-label { width: 9.5em; font-weight: 600; }
.bar { flex: 1; background: #eef3f7; border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--teal); }
.criterion-score { font-weight: 800; width: 2em; text-align: right; }

/* Reviews */
.review { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.review.founder { border-color: var(--accent); border-width: 2px; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-top .score-badge { margin-left: auto; }
.review-scores { color: var(--muted); font-size: 0.92rem; }

/* Forms */
.rate-form { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; max-width: 760px; }
.score-field { margin: 14px 0; max-width: 560px; }
.score-field .hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.flash { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 12px 16px; font-weight: 600; }
.flash.error { background: #fdeaea; color: #8a1212; }

/* Tags legend */
.tag-defs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 22px; }
.tag-defs div { display: flex; gap: 10px; align-items: baseline; }
.tag-defs dt { flex-shrink: 0; }
.tag-defs dd { margin: 0; color: var(--muted); }
.tag-legend { margin: 20px 0; }

/* Ads */
.ad-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
@media (max-width: 800px) { .ad-row { grid-template-columns: 1fr; } }
.house-ad { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; background: #fff; text-align: center; color: var(--muted); }
.house-ad .ad-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }

/* Footer */
.site-footer { margin-top: 44px; background: var(--navy); color: #cfe3f2; padding: 26px 0 34px; }
.site-footer a { color: #fff; }
.footer-links { margin: 6px 0; }
