/* Match details page (/{match_id}/{home}-vs-{away}). Plain CSS: beta's Tailwind build only ships classes already in use. */
[x-cloak] { display: none !important; }

.md-page { width: 100%; max-width: 1400px; margin: 0 auto; display: grid; gap: 1rem; padding: 0 0 1.5rem; font-size: .875rem; color: #1E1E1E; }
.md-page * { box-sizing: border-box; }
.md-card { width: 0; min-width: 100%; background: #fff; border: 1px solid #ececec; border-radius: 1.25rem; padding: 1.25rem; }
.md-h2 { font-size: 1.125rem; font-weight: 800; color: #1E1E1E; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.md-h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 4px; background: linear-gradient(#f5c451, #B27900); }
.md-h3 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 .75rem; }
.md-sub { color: #6b7280; margin: -.5rem 0 1rem; font-size: .8125rem; }
.md-note { color: #6b7280; font-size: .75rem; margin: .75rem 0 0; }
.md-empty { color: #6b7280; text-align: center; padding: 1.25rem .5rem; margin: 0; font-size: .8125rem; }
.md-muted { color: #9ca3af; font-size: .75rem; }
.md-stack { display: grid; gap: 1rem; width: 0; min-width: 100%; }
.md-grid-2 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.md-grid-top { width: 0; min-width: 100%; align-items: start; }
@media (min-width: 900px) { .md-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.md-grid-3 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 768px) { .md-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .md-grid-3 > :first-child { grid-column: 1 / -1; } }
@media (min-width: 1200px) { .md-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .md-grid-3 > :first-child { grid-column: auto; } }
.md-box-title small { font-weight: 500; margin-left: .25rem; }
.md-box { background: #FAFAF7; border: 1px solid #f0ebe0; border-radius: 1rem; padding: .875rem; min-width: 0; }
.md-box-title { font-weight: 700; color: #3E2A00; margin: 0 0 .625rem; display: flex; align-items: center; gap: .375rem; }
.md-box-title:not(:first-child) { margin-top: 1.25rem; }

/* Title card */
.md-title { width: 0; min-width: 100%; border-radius: 0 0 1.25rem 1.25rem; padding: 1.5rem 1.25rem; color: #fff; background: radial-gradient(circle at 85% 20%, rgba(245, 196, 81, .35), transparent 45%), linear-gradient(135deg, #2a1c00, #3E2A00 55%, #6b4a00); }
.md-title h1 { font-size: 1.75rem; font-weight: 800; margin: .375rem 0 .25rem; line-height: 1.2; }
.md-title p { margin: 0; color: #f5dfa8; }
.md-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; font-size: .75rem; color: #e5cf98; }
.md-crumbs a { color: #f5c451; text-decoration: none; }

/* Hero */
.md-hero { display: grid; gap: 1rem; }
.md-league { display: flex; justify-content: center; align-items: center; gap: .5rem; font-weight: 700; color: #3E2A00; text-align: center; }
.md-league img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.md-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .75rem; }
.md-team { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; font-weight: 700; font-size: 1rem; min-width: 0; }
.md-team img { width: 4rem; height: 4rem; object-fit: contain; }
.md-team span { overflow-wrap: anywhere; }
.md-kick { display: flex; flex-direction: column; align-items: center; background: #F7F2E6; border-radius: 1rem; padding: .625rem 1rem; }
.md-kick strong { font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.md-kick small { color: #8a5e00; font-weight: 600; }
.md-score { font-size: 1.75rem !important; }
.md-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #F3F3F3; border-radius: 1rem; padding: .75rem; text-align: center; gap: .5rem; }
.md-pick small { display: block; color: #6b7280; font-size: .75rem; margin-bottom: .25rem; }
.md-pick strong { font-weight: 800; font-size: .9375rem; }
.md-conf { display: inline-block; padding: .125rem .625rem; border-radius: 9999px; background: #14AE5C; color: #fff; }
.md-conf.is-lost { background: #9CA3AF; }
.md-conf.is-void { background: #6b7280; }

/* Overview (inside hero) */
.md-overview { display: grid; gap: 1rem; }
.md-form-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .md-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.md-form-team { background: #FAFAF7; border: 1px solid #f0ebe0; border-radius: 1rem; padding: .875rem; }
.md-form-title { margin: 0 0 .5rem; font-size: .8125rem; }
.md-form-dots { display: flex; gap: .25rem; margin-bottom: .75rem; }
.md-wdl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.md-wdl div { display: flex; flex-direction: column; align-items: center; gap: .125rem; border-radius: .75rem; padding: .5rem .25rem; background: #fff; border: 1px solid #eee; text-align: center; }
.md-wdl span { width: 1.5rem; height: 1.5rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .75rem; }
.md-wdl strong { font-size: .8125rem; }
.md-wdl small { color: #9ca3af; font-size: .6875rem; }
.md-wdl .is-w span { background: #14AE5C; }
.md-wdl .is-l span { background: #ef4444; }
.md-wdl .is-d span { background: #E5A000; }
.md-1x2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.md-1x2 div { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; background: #F7F2E6; border-radius: .875rem; padding: .625rem .25rem .875rem; }
.md-1x2 small { color: #8a5e00; font-weight: 700; font-size: .75rem; }
.md-1x2 strong { font-size: 1.125rem; font-weight: 800; }
.md-1x2 span { font-size: .75rem; background: #3E2A00; color: #f5c451; border-radius: 9999px; padding: .0625rem .5rem; font-weight: 700; }
.md-1x2 i { position: absolute; left: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #f5c451, #B27900); }

/* Result badges */
.md-res { width: 1.375rem; height: 1.375rem; border-radius: .375rem; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .6875rem; flex-shrink: 0; }
.md-res-W { background: #14AE5C; }
.md-res-L { background: #ef4444; }
.md-res-D { background: #E5A000; }
.md-mini-form { display: inline-flex; gap: 2px; }
.md-mini-form .md-res { width: 1.125rem; height: 1.125rem; font-size: .5625rem; border-radius: .25rem; }

/* All tips */
.md-tips { display: grid; gap: .625rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.md-tipcard { display: flex; flex-direction: column; gap: .25rem; border-radius: 1rem; padding: .75rem; background: #FAFAF7; border: 1px solid #f0ebe0; border-left: 4px solid #B27900; }
.md-tipcard small { color: #6b7280; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.md-tipcard strong { font-size: .9375rem; font-weight: 800; }
.md-tipcard span { display: flex; gap: .375rem; }
.md-tipcard em { font-style: normal; font-size: .6875rem; font-weight: 700; background: #3E2A00; color: #f5c451; border-radius: 9999px; padding: .0625rem .5rem; }
.md-tipcard.is-won { border-left-color: #14AE5C; }
.md-tipcard.is-lost { border-left-color: #9CA3AF; opacity: .8; }

/* Match lines (H2H / last matches) */
.md-line { padding: .5rem 0; border-bottom: 1px dashed #e8e2d4; }
.md-line:last-child { border-bottom: 0; }
.md-line-meta { margin: 0 0 .25rem; color: #8a7a5a; font-size: .6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-line-row { display: flex; align-items: center; gap: .5rem; }
.md-line-teams { flex: 1; min-width: 0; display: grid; gap: .125rem; }
.md-line-team { display: flex; align-items: center; gap: .375rem; font-size: .8125rem; color: #4b5563; }
.md-line-team.is-win { color: #1E1E1E; font-weight: 700; }
.md-line-team img { width: 1rem; height: 1rem; object-fit: contain; }
.md-line-team span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-line-team strong { min-width: 1.25rem; text-align: center; }

/* Tables */
.md-table-wrap { overflow-x: auto; }
.md-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.md-table th { background: #3E2A00; color: #f5c451; font-weight: 700; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem; text-align: center; white-space: nowrap; }
.md-table th:first-child { border-radius: .5rem 0 0 .5rem; }
.md-table th:last-child { border-radius: 0 .5rem .5rem 0; }
.md-table td { padding: .5rem; text-align: center; border-bottom: 1px solid #f1f1f1; white-space: nowrap; }
.md-table .tl { text-align: left; }
.md-table tr.is-focus td { background: #FBF3DF; font-weight: 700; }
.md-table-vs td:not(.tl) { width: 35%; }
.md-tteam { display: inline-flex; align-items: center; gap: .5rem; }
.md-tteam img { width: 1.25rem; height: 1.25rem; object-fit: contain; }
.md-tteam img.is-round { width: 1.75rem; height: 1.75rem; border-radius: 9999px; object-fit: cover; }
.md-tteam small { display: block; color: #9ca3af; font-size: .6875rem; font-weight: 400; }
.md-more { display: block; margin: .875rem auto 0; border: 1px solid #B27900; color: #8a5e00; background: #fff; border-radius: 9999px; padding: .375rem 1.25rem; font-weight: 700; font-size: .75rem; cursor: pointer; }
.md-more:hover { background: #B27900; color: #fff; }

/* Tabs and probability chips */
.md-tabs { display: flex; gap: .375rem; overflow-x: auto; padding-bottom: .375rem; margin-bottom: 1rem; scrollbar-width: thin; }
.md-tabs button { flex-shrink: 0; border: 1px solid #e5dccb; background: #fff; color: #3E2A00; border-radius: 9999px; padding: .375rem .875rem; font-weight: 700; font-size: .75rem; cursor: pointer; white-space: nowrap; }
.md-tabs button.is-active { background: linear-gradient(135deg, #f5c451, #B27900); border-color: transparent; color: #2a1c00; }
.md-tabs-sm { margin-bottom: .75rem; }
.md-chips { display: grid; gap: .625rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.md-chip { display: flex; flex-direction: column; gap: .25rem; background: #FAFAF7; border: 1px solid #f0ebe0; border-radius: .875rem; padding: .75rem; }
.md-chip small { color: #6b7280; font-weight: 700; font-size: .75rem; }
.md-chip strong { font-size: 1.125rem; font-weight: 800; }
.md-chip span { color: #8a5e00; font-size: .6875rem; font-weight: 700; }
.md-pbar { display: block; height: .375rem; background: #ececec; border-radius: 9999px; overflow: hidden; }
.md-pbar b { display: block; height: 100%; max-width: 100%; border-radius: 9999px; background: linear-gradient(90deg, #f5c451, #B27900); }
.md-pbar.is-away b { background: #3E2A00; }

/* Model comparison */
.md-model-head { display: grid; gap: .25rem; margin-bottom: .875rem; }
.md-model-head p { margin: 0; color: #4b5563; }
.md-legend { display: flex; gap: 1rem; font-size: .75rem; font-weight: 700; margin-bottom: .75rem; }
.md-legend span::before { content: ""; display: inline-block; width: .625rem; height: .625rem; border-radius: 2px; margin-right: .375rem; vertical-align: middle; }
.md-legend .is-home::before { background: #B27900; }
.md-legend .is-away::before { background: #3E2A00; }
.md-compare { display: grid; gap: .625rem; }
.md-compare-label { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 600; margin-bottom: .25rem; }
.md-split { display: flex; height: .5rem; border-radius: 9999px; overflow: hidden; background: #ececec; }
.md-split .is-home { background: linear-gradient(90deg, #f5c451, #B27900); }
.md-split .is-away { background: #3E2A00; }

/* Goal lines */
.md-lines { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.md-lines-item p { margin: 0 0 .375rem; font-weight: 700; }
.md-lines-row { display: grid; grid-template-columns: minmax(0, 7rem) 1fr auto; align-items: center; gap: .5rem; font-size: .75rem; margin-bottom: .25rem; }
.md-lines-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Goals by period */
.md-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .375rem; align-items: end; }
.md-bar-col { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.md-bar-col small { font-size: .625rem; color: #6b7280; white-space: nowrap; }
.md-bar-track { position: relative; width: 100%; height: 7rem; background: #fff; border-radius: .5rem; display: flex; align-items: flex-end; overflow: hidden; border: 1px solid #f0ebe0; }
.md-bar { width: 100%; min-height: 2px; display: flex; justify-content: center; border-radius: .375rem .375rem 0 0; }
.md-bar span { font-size: .6875rem; font-weight: 800; color: #fff; padding-top: .125rem; }
.md-bar.is-for { background: linear-gradient(#14AE5C, #0e8a48); }
.md-bar.is-against { background: linear-gradient(#ef4444, #c62828); }
.md-events { background: #FAFAF7; border: 1px solid #f0ebe0; border-radius: 1rem; padding: .875rem; display: grid; gap: .375rem; }
.md-events div { display: flex; justify-content: space-between; gap: .5rem; font-size: .8125rem; }
.md-events i { color: #B27900; width: 1rem; }
.md-card-ico { color: #E5A000 !important; }

/* Shots */
.md-shots { display: grid; gap: .5rem; }
.md-kv { display: flex; justify-content: space-between; font-size: .8125rem; }
.md-ratio { display: flex; border-radius: .5rem; overflow: hidden; font-size: .625rem; font-weight: 700; }
.md-ratio b { background: #e8e2d4; color: #3E2A00; padding: .25rem .375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.md-ratio b.is-alt { background: #B27900; color: #fff; }

/* Fixture difficulty */
.md-fdr { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.md-fdr-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; border-radius: .75rem; padding: .5rem .375rem; text-align: center; font-size: .75rem; font-weight: 700; min-width: 0; }
.md-fdr-item small { font-size: .625rem; opacity: .85; }
.md-fdr-item img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.md-fdr-item span { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-fdr-1 { background: #0e8a48; color: #fff; }
.md-fdr-2 { background: #6fd39c; color: #063; }
.md-fdr-3 { background: #e5e7eb; color: #374151; }
.md-fdr-4 { background: #f59e8b; color: #7f1d1d; }
.md-fdr-5 { background: #c62828; color: #fff; }
.md-fdr-key { display: flex; justify-content: flex-end; align-items: center; gap: .25rem; margin-top: .75rem; font-size: .6875rem; color: #6b7280; }
.md-fdr-key i { width: 1.25rem; height: .5rem; border-radius: 2px; }

/* Write-up, FAQ, preview */
.md-prose p { line-height: 1.7; color: #374151; margin: 0 0 .75rem; }
.md-author { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #f1f1f1; }
.md-author-avatar { width: 2.75rem; height: 2.75rem; border-radius: 9999px; background: linear-gradient(135deg, #f5c451, #B27900); color: #2a1c00; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; }
.md-author div { display: flex; flex-direction: column; }
.md-author small { color: #9ca3af; font-size: .6875rem; }
.md-author span { color: #6b7280; font-size: .75rem; }
.md-faq { display: grid; gap: .5rem; }
.md-faq-item { border: 1px solid #ececec; border-radius: .875rem; overflow: hidden; }
.md-faq-item.is-open { border-color: #e0c88f; }
.md-faq-item button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: #fff; border: 0; padding: .875rem 1rem; font-weight: 700; text-align: left; cursor: pointer; color: #1E1E1E; }
.md-faq-item button i { color: #B27900; }
.md-faq-body { padding: 0 1rem .875rem; color: #4b5563; line-height: 1.6; }
.md-preview h3 { font-size: 1rem; font-weight: 800; margin: 0 0 .75rem; }
.md-preview dl { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0; }
.md-preview dl div { background: #FAFAF7; border-radius: .75rem; padding: .625rem .875rem; }
.md-preview dt { color: #8a5e00; font-size: .6875rem; font-weight: 700; text-transform: uppercase; }
.md-preview dd { margin: 0; font-weight: 600; }

/* Preloaders */
.md-skel { position: relative; display: grid; gap: .625rem; }
.md-skel-inline { padding: .25rem 0; }
.md-skel-row { height: .875rem; border-radius: .5rem; background: linear-gradient(90deg, #f1ece1 0%, #faf7f0 40%, #f1ece1 80%); background-size: 200% 100%; animation: md-shimmer 1.3s linear infinite; }
.md-skel-row:nth-child(3n+1) { height: 2.25rem; border-radius: .75rem; }
.md-skel-label { display: flex; align-items: center; gap: .375rem; justify-content: center; color: #8a5e00; font-size: .75rem; font-weight: 600; margin-top: .25rem; }
@keyframes md-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 640px) {
    .md-card { padding: 1rem .75rem; border-radius: 1rem; }
    .md-title h1 { font-size: 1.375rem; }
    .md-team { font-size: .875rem; }
    .md-team img { width: 3rem; height: 3rem; }
    .md-kick { padding: .5rem .625rem; }
    .md-kick strong { font-size: 1rem; }
    .md-wdl strong { font-size: .75rem; }
}
