:root {
  --bg: #f2f4f7; --card: #fff; --ink: #0f1b2a; --muted: #5d6b7c; --line: #e2e7ee;
  --navy: #0b1f33; --navy2: #12304d; --green: #1fb865; --green-ink: #0b7a41; --yellow: #f5c400;
  --radius: 14px; --shadow: 0 1px 2px rgba(10,30,50,.06), 0 6px 18px rgba(10,30,50,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a121c; --card: #111c29; --ink: #e8eef5; --muted: #93a3b5; --line: #1e2c3c;
          --green-ink: #3fdc8a; --shadow: 0 1px 2px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, .brand { font-family: "Roboto Condensed", "Noto Sans", sans-serif; letter-spacing: -.01em; }

/* header */
.top { background: linear-gradient(180deg, var(--navy), var(--navy2)); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 600; white-space: nowrap; }
.brand b { color: var(--green); font-weight: 800; }
.links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.links a { padding: 7px 12px; border-radius: 999px; font-size: .92rem; color: #cfe0f0; white-space: nowrap; }
.links a:hover { background: rgba(255,255,255,.1); color: #fff; }
.clubs { background: rgba(0,0,0,.18); border-top: 1px solid rgba(255,255,255,.06); }
.clubs-row { display: flex; gap: 6px; padding-top: 7px; padding-bottom: 7px; overflow-x: auto; scrollbar-width: none; }
.clubs-row a { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; transition: transform .15s; }
.clubs-row a:hover { transform: translateY(-2px) scale(1.06); }
.clubs-row img { width: 28px; height: 28px; object-fit: contain; }

main { padding-top: 22px; padding-bottom: 40px; min-height: 60vh; }

/* thumbnail = club colours + logo (no photos) */
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 17%, rgba(255,255,255,.18) 17.4% 18.2%, transparent 18.6%),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255,255,255,.18) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 10%, transparent 10% 20%),
    linear-gradient(135deg, var(--c1) 0%, color-mix(in srgb, var(--c1) 55%, #000) 100%); }
.thumb::after { content: ""; position: absolute; inset: auto -10% -40% auto; width: 60%; height: 90%; border-radius: 50%;
  background: var(--c2); opacity: .22; filter: blur(2px); }
.thumb img { position: relative; z-index: 1; height: auto; width: 34%; max-width: 160px; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); background: rgba(255,255,255,.92); border-radius: 50%; padding: 5%; }

/* cards */
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(10,30,50,.12); }
.card > a { display: flex; flex-direction: column; height: 100%; }
.card-body { padding: 12px 14px 16px; }
.card h3 { margin: 6px 0 0; font-size: 1.12rem; line-height: 1.3; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.tag, .cat { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-ink); font-weight: 600; }
a.tag:hover { background: var(--green); color: #fff; }
.cat { background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted); }

.lead-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.card.lead h3 { font-size: 1.7rem; }
.card.lead .thumb img { width: 26%; }
.side { display: grid; gap: 12px; }
.card.mini > a { flex-direction: row; }
.card.mini .thumb { width: 38%; flex: 0 0 38%; aspect-ratio: auto; min-height: 100px; }
.card.mini .thumb img { width: 64px; height: 64px; max-width: none; }
.card.mini h3 { font-size: 1rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 28px 0 0; color: var(--muted); }
.pager a { background: var(--card); border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--green); }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.page-title { margin: 0 0 16px; }

/* team page */
.team-head { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: var(--radius); margin-bottom: 18px; color: #fff;
  background: linear-gradient(135deg, var(--c1), color-mix(in srgb, var(--c1) 50%, #000)); }
.team-head img { background: #fff; border-radius: 50%; padding: 8px; width: 84px; height: 84px; object-fit: contain; }
.team-head h1 { margin: 0; font-size: 2rem; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.team-head p { margin: 0; opacity: .9; }

/* article */
.story { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); max-width: 860px; margin: 0 auto; }
.thumb.hero { aspect-ratio: 21/8; }
.thumb.hero img { width: 20%; }
.story-title { padding: 22px 28px 0; }
.story-title h1 { font-size: 2.1rem; line-height: 1.15; margin: 10px 0 10px; }
.dek { font-size: 1.1rem; color: var(--muted); margin: 0 0 8px; }
.story-title time { color: var(--muted); font-size: .88rem; }
.story-body { padding: 8px 28px 26px; font-size: 1.08rem; }
.story-body p { margin: 0 0 1em; }
.source { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px !important; font-size: .9rem; color: var(--muted); }
.source a { color: var(--green-ink); font-weight: 600; }
.related { max-width: 860px; margin: 28px auto 0; }
.related .grid { grid-template-columns: repeat(2, 1fr); }
.prose { background: var(--card); border-radius: var(--radius); padding: 24px 28px; max-width: 800px; margin: 0 auto; border: 1px solid var(--line); }
.prose a { color: var(--green-ink); text-decoration: underline; }

.foot { background: var(--navy); color: #a9bccf; padding: 24px 0; font-size: .9rem; }
.foot a { color: #fff; }
.foot p { margin: 4px 0; }

@media (max-width: 900px) {
  .lead-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid, .related .grid { grid-template-columns: 1fr; gap: 14px; }
  .brand { font-size: 1.25rem; }
  .links a:not(:first-child):not(:nth-child(2)) { display: none; }
  .card.lead h3 { font-size: 1.35rem; }
  .story-title, .story-body { padding-left: 16px; padding-right: 16px; }
  .story-title h1 { font-size: 1.55rem; }
  .thumb.hero { aspect-ratio: 16/8; }
  .thumb.hero img { width: 28%; }
  .team-head h1 { font-size: 1.5rem; }
}

/* club colours (generated from app/config.php CLUBS) */
.club-apoel { --c1: #f5c400; --c2: #1d4fa0; }
.club-omonoia { --c1: #0f8a3c; --c2: #ffffff; }
.club-ael { --c1: #f5c400; --c2: #1d4fa0; }
.club-apollon { --c1: #1d4fa0; --c2: #ffffff; }
.club-aris { --c1: #101820; --c2: #20a050; }
.club-anorthosis { --c1: #1d4fa0; --c2: #ffffff; }
.club-aek { --c1: #f5c400; --c2: #0f8a3c; }
.club-pafos { --c1: #1d3f7a; --c2: #ffffff; }
.club-krasava { --c1: #101820; --c2: #e2231a; }
.club-olympiakos { --c1: #101820; --c2: #20a050; }
.club-omonia29m { --c1: #0f8a3c; --c2: #ffffff; }
.club-omonia-aradippou { --c1: #0f8a3c; --c2: #ffffff; }
.club-karmiotissa { --c1: #e2231a; --c2: #101820; }
.club-nea-salamis { --c1: #e2231a; --c2: #ffffff; }
.club-ethnikos { --c1: #e2231a; --c2: #ffffff; }
.club-enp { --c1: #1d4fa0; --c2: #ffffff; }
.club-akritas { --c1: #e2231a; --c2: #ffffff; }
.club-doxa { --c1: #e2231a; --c2: #101820; }
.club-ethniki { --c1: #d35400; --c2: #ffffff; }
.club-kop { --c1: #1d4fa0; --c2: #ffffff; }

/* match centre */
.mc { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; margin-bottom: 26px; }
.mc-main { display: grid; gap: 18px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 10px; }
.box h2 { margin: 0 0 8px; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.box h2 small { font: 600 .78rem "Noto Sans", sans-serif; color: var(--muted); }
.mday { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 0 4px; border-bottom: 1px solid var(--line); }
.m { display: grid; grid-template-columns: 52px 1fr auto 1fr; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.m:last-child { border-bottom: 0; }
.m .home, .m .away { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m .home { justify-content: flex-end; text-align: right; }
.m .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.m a:hover .tn { color: var(--green-ink); }
.m img, .nologo { width: 26px; height: 26px; object-fit: contain; flex: 0 0 26px; }
.m .sc { min-width: 58px; text-align: center; font: 800 1.05rem "Roboto Condensed", sans-serif; background: color-mix(in srgb, var(--muted) 10%, transparent); border-radius: 8px; padding: 3px 8px; }
.m .sc.vs { color: var(--muted); font-weight: 600; }
.m .ko, .m .fin, .m .off, .m .min { font-size: .82rem; color: var(--muted); font-weight: 600; }
.m .comp { grid-column: 2 / -1; font-size: .72rem; color: var(--muted); text-align: center; margin-top: -4px; }
.m.live .sc { background: #e53935; color: #fff; }
.m.live .min { color: #e53935; }
.m.off .off { color: #c77700; }
.live-box { border-color: color-mix(in srgb, #e53935 45%, var(--line)); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; box-shadow: 0 0 0 0 rgba(229,57,53,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(229,57,53,0); } 100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); } }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { text-align: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl .l { text-align: left; }
.tbl td.l a { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tbl td.l img { width: 20px; height: 20px; object-fit: contain; }
.tbl tbody tr:nth-child(-n+2) td:first-child { box-shadow: inset 3px 0 var(--green); }
.tbl tr:last-child td { border-bottom: 0; }
.note { font-size: .75rem; color: var(--muted); margin: 8px 0 2px; }
.sub-title { margin: 0 0 14px; font-size: 1.3rem; }
@media (max-width: 900px) { .mc { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .m { grid-template-columns: 42px 1fr auto 1fr; gap: 6px; font-size: .88rem; }
  .m img, .nologo { width: 22px; height: 22px; flex-basis: 22px; }
  .m .sc { min-width: 48px; padding: 3px 5px; }
  .tbl .wide { display: none; }
}

/* compact layout: small pitch tile beside the text (v5) */
.card > a { flex-direction: row; align-items: flex-start; gap: 14px; padding: 12px; }
.card .thumb { flex: 0 0 112px; width: 112px; aspect-ratio: 4/3; border-radius: 10px; }
.card .thumb::after { display: none; }
.card .thumb img { width: 52%; padding: 6%; filter: drop-shadow(0 2px 5px rgba(0,0,0,.3)); }
.card-body { padding: 0; min-width: 0; flex: 1; }
.card h3 { margin-top: 4px; font-size: 1.05rem; }
.card.lead > a { padding: 16px; gap: 18px; }
.card.lead .thumb { flex-basis: 190px; width: 190px; }
.card.lead .thumb img { width: 46%; }
.card.lead h3 { font-size: 1.55rem; }
.card.mini .thumb { flex: 0 0 84px; width: 84px; aspect-ratio: 4/3; min-height: 0; }
.card.mini .thumb img { width: 52%; height: auto; }
.lead-row { align-items: start; }
.grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
.story-head { display: flex; gap: 20px; align-items: flex-start; padding: 24px 28px 0; }
.thumb.hero { flex: 0 0 150px; width: 150px; aspect-ratio: 4/3; border-radius: 12px; }
.thumb.hero img { width: 50%; }
.story-title { padding: 0; flex: 1; min-width: 0; }
.story-title h1 { margin-top: 6px; }
@media (max-width: 600px) {
  .card .thumb { flex-basis: 88px; width: 88px; }
  .card.lead > a { padding: 12px; gap: 12px; }
  .card.lead .thumb { flex-basis: 104px; width: 104px; }
  .card.lead h3 { font-size: 1.2rem; }
  .card.lead p { font-size: .9rem; }
  .card.lead .thumb img { width: 52%; }
  .story-head { padding: 16px 16px 0; gap: 12px; }
  .thumb.hero { flex-basis: 86px; width: 86px; }
  .thumb.hero img { width: 56%; }
}

/* ---- mobile polish (v8) ---- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .top { position: relative; }                 /* header scrolls away; tab bar is the nav */
  .bar { height: 52px; }
  .links { display: none; }
  .brand { font-size: 1.3rem; }
  .brand img { width: 30px; height: 30px; }
  .clubs-row { gap: 8px; padding-top: 8px; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .clubs-row a { width: 40px; height: 40px; scroll-snap-align: start; }
  main { padding-top: 14px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--navy) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; min-height: 48px; justify-content: center;
    color: #9fb4c9; font-size: .7rem; font-weight: 600; border-radius: 10px; -webkit-tap-highlight-color: transparent; }
  .tabbar a.on { color: var(--green); }
  .tabbar a:active { background: rgba(255,255,255,.08); }

  .page-title { font-size: 1.6rem; }
  .card:hover { transform: none; }
  .card h3 { font-size: 1rem; line-height: 1.28; }
  .card .meta { font-size: .72rem; }
  .card.lead p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lead-row { gap: 12px; margin-bottom: 12px; }
  .side { gap: 12px; }

  /* fixtures: let names wrap instead of truncating */
  .box { padding: 12px 12px 6px; }
  .m { grid-template-columns: 34px 1fr auto 1fr; gap: 6px; padding: 10px 0; }
  .m .tn { white-space: normal; overflow: visible; line-height: 1.15; font-size: .82rem; }
  .m img, .nologo { width: 20px; height: 20px; flex-basis: 20px; }
  .m .home, .m .away { gap: 6px; }
  .m .ko, .m .fin, .m .off, .m .min { font-size: .78rem; }
  .m .sc { min-width: 40px; font-size: .98rem; padding: 3px 4px; }
  .grid, .related .grid { grid-template-columns: 1fr; gap: 12px; }
  .tbl { font-size: .86rem; }
  .tbl td, .tbl th { padding: 7px 3px; }

  .story { border-radius: 12px; }
  .story-title h1 { font-size: 1.45rem; }
  .dek { font-size: 1rem; }
  .story-body { font-size: 1.04rem; line-height: 1.7; }
  .team-head { padding: 14px; gap: 12px; }
  .team-head img { width: 60px; height: 60px; }
  .pager { gap: 8px; font-size: .85rem; }
  .pager a { padding: 10px 14px; }
}
