* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #1e1e1e; color: #fff; margin: 0; padding: 20px; }
a { color: #d85a2b; }
.wrap { max-width: 860px; margin: 0 auto; }
h2 { margin-top: 0; }

/* Navigation */
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; background: #1d3c45; padding: 12px 20px; margin: -20px -20px 25px -20px; }
.site-nav .brand { color: #fff; font-weight: bold; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; margin-right: auto; text-decoration: none; }
.site-nav a.link { color: #ddd; text-decoration: none; font-weight: bold; padding: 6px 10px; border-radius: 4px; }
.site-nav a.link:hover, .site-nav a.link.active { background: #d85a2b; color: #fff; }
.nav-search input { padding: 7px 10px; border: none; border-radius: 4px; font-size: 14px; width: 170px; }

/* Breadcrumbs */
.crumbs { margin: 0 0 15px 0; font-size: 14px; color: #ccc; }
.crumbs a { color: #d85a2b; text-decoration: none; font-weight: bold; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: #777; margin: 0 6px; }

/* Messages */
.error { background: #ff4444; padding: 15px; border-radius: 5px; margin-bottom: 20px; font-weight: bold; }
.muted { color: #999; }

/* Search form */
.search-form { background: #2b2b2b; padding: 20px; border-radius: 8px; margin-bottom: 25px; }
.search-row { display: flex; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.search-form input, .search-form select, .search-form button { padding: 10px; font-size: 16px; border: none; border-radius: 4px; }
.search-form select { background: #fff; color: #000; cursor: pointer; max-width: 100%; }
.search-form button { background: #d85a2b; color: #fff; cursor: pointer; font-weight: bold; }
.search-form button:hover { background: #e86a3b; }
.search-form .reset { align-self: center; color: #aaa; font-size: 14px; }
.suggest-wrap { position: relative; flex-grow: 1; }
.suggest-wrap input { width: 100%; }
.suggest-box { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #fff; border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,0.5); overflow: hidden; }
.suggest-box a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; color: #000; text-decoration: none; border-bottom: 1px solid #eee; }
.suggest-box a:hover { background: #ffe9df; }
.suggest-box small { color: #666; }

/* Result cards */
.result-card { background: #2b2b2b; padding: 15px; margin-bottom: 10px; border-radius: 5px; border-left: 4px solid #d85a2b; }
.result-card > a { color: #fff; text-decoration: none; font-size: 18px; font-weight: bold; display: block; }
.result-card > a:hover { color: #d85a2b; }
.tag { background: #1d3c45; color: #fff; padding: 3px 8px; border-radius: 3px; font-size: 12px; margin-right: 5px; display: inline-block; margin-top: 8px; }
.tag.grey { background: #444; }
.tag.orange { background: #d85a2b; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 25px; padding: 15px 20px; background: #2b2b2b; border-radius: 8px; }
.btn-page { background: #444; color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-weight: bold; }
.btn-page:hover { background: #d85a2b; }

/* Faction browse */
.group-title { margin: 30px 0 12px 0; padding-bottom: 6px; border-bottom: 2px solid #d85a2b; text-transform: uppercase; letter-spacing: 1px; font-size: 18px; }
.faction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.faction-card { background: #2b2b2b; border-radius: 6px; padding: 16px; text-decoration: none; color: #fff; border-top: 4px solid #1d3c45; }
.faction-card:hover { border-top-color: #d85a2b; transform: translateY(-2px); }
.faction-card strong { display: block; font-size: 16px; }
.faction-card span { color: #999; font-size: 13px; }
.unit-list a { display: inline-block; background: #2b2b2b; color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 4px; margin: 0 6px 8px 0; font-size: 14px; }
.unit-list a:hover { background: #d85a2b; }

/* Datacard */
.datacard { background: #f0f0f0; color: #000; border: 3px solid #333; border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.datacard a { color: #1d3c45; font-weight: bold; }
.datacard-header { background: #1d3c45; color: #fff; padding: 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.datacard-header h1 { margin: 0; font-size: 24px; text-transform: uppercase; }
.role-tag { background: #d85a2b; padding: 5px 10px; font-weight: bold; border-radius: 4px; color: #fff; }
.stat-table { width: 100%; border-collapse: collapse; text-align: center; margin-top: 10px; }
.stat-table th { background: #2b2b2b; color: #fff; padding: 10px; font-size: 14px; }
.stat-table td { background: #e5e5e5; padding: 8px; font-weight: bold; font-size: 16px; border: 1px solid #ccc; }
.model-name { text-align: left !important; background: #d1d1d1 !important; }
.section-title { background: #333; color: #fff; padding: 8px 15px; margin: 10px 0 0 0; font-size: 16px; text-transform: uppercase; }
.weapon-name { text-align: left !important; font-size: 14px !important; }
.weapon-desc { font-weight: normal; font-size: 12px; color: #555; display: block; }
.card-section { padding: 12px 15px; background: #e5e5e5; font-size: 14px; }
.card-section p { margin: 5px 0; }
.ability-item { margin-bottom: 10px; }
.ability-name { font-weight: bold; text-transform: uppercase; color: #1d3c45; }
.ability-type { font-size: 12px; font-weight: bold; color: #d85a2b; margin-left: 5px; }
.kw-row { padding: 10px 15px; background: #d9d9d9; border-top: 1px solid #ccc; font-size: 12px; }
.kw { display: inline-block; background: #555; color: #fff; padding: 2px 8px; border-radius: 3px; margin: 2px 3px 2px 0; }
.kw.faction { background: #d85a2b; }
.link-chip { display: inline-block; background: #fff; border: 1px solid #1d3c45; border-radius: 4px; padding: 4px 10px; margin: 3px 6px 3px 0; text-decoration: none; }
.link-chip:hover { background: #1d3c45; color: #fff !important; }
.pts-table { width: 100%; border-collapse: collapse; }
.pts-table td { padding: 5px 8px; border-bottom: 1px solid #ccc; }

/* Rules panels (dark) */
details.panel { background: #2b2b2b; border-radius: 8px; margin-bottom: 12px; padding: 0 16px; }
details.panel > summary { cursor: pointer; padding: 14px 0; font-weight: bold; font-size: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
details.panel[open] > summary { border-bottom: 1px solid #444; margin-bottom: 12px; }
.det-title { margin: 14px 0 8px 0; font-size: 15px; }
.det-title a { color: #d85a2b; text-decoration: none; }
.rule-card { background: #1e1e1e; border-left: 4px solid #1d3c45; border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; line-height: 1.45; }
.rule-card h4 { margin: 0 0 4px 0; font-size: 15px; text-transform: uppercase; }
.rule-card .meta { color: #aaa; font-size: 12px; margin-bottom: 6px; }
.rule-card .cp { float: right; background: #d85a2b; border-radius: 3px; padding: 2px 8px; font-weight: bold; font-size: 12px; }
