/* Daily Football — styles for index.php (body.home) and match.php (body.match). Light and dark theme. */

:root {
  --bg: #f3f4f8; --card: #ffffff; --card2: #f8f9fc; --text: #0f172a; --muted: #64748b; --line: #e6e8f0;
  --accent: #4f46e5; --accent2: #7c3aed; --accent-soft: #eef0ff; --on-accent: #ffffff;
  --hot1: #facc15; --hot2: #f97316; --hot3: #dc2626;
  --w: #16a34a; --d: #94a3b8; --l: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12; --card: #141821; --card2: #1a1f2b; --text: #e7e9ef; --muted: #94a3b8; --line: #252c3a;
    --accent: #818cf8; --accent2: #a78bfa; --accent-soft: #1f2340; --on-accent: #0b0d12;
    --hot1: #eab308; --hot2: #ea580c; --hot3: #dc2626;
    --w: #22c55e; --d: #64748b; --l: #ef4444;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 10px; height: 58px; }
.logo { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; min-width: 0; }
.logo img { width: 34px; height: 34px; flex: 0 0 auto; }
.logo span { font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.logo span b { font-weight: 800; }
.logo span i { font-style: normal; font-weight: 400; color: var(--muted); }

.select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--card2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 30px 7px 12px; cursor: pointer;
  min-width: 0; text-overflow: ellipsis;
}
.select:focus-visible, .chip:focus-visible, .choices button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#lang { max-width: 42vw; }

.back {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; font-weight: 600;
  color: var(--accent); padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); white-space: nowrap;
}

/* ---------- Day strip ---------- */
.days { display: flex; align-items: stretch; gap: 8px; padding: 2px 16px 12px; max-width: 760px; margin: 0 auto; }
.strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0;
         -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.strip::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  padding: 6px 10px; border-radius: 14px; text-decoration: none; background: var(--card2); border: 1px solid var(--line);
  line-height: 1.15; transition: background .15s, border-color .15s;
}
.chip small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chip strong { font-size: 15px; font-weight: 700; }
.chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chip.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.chip.active small { color: rgba(255, 255, 255, .8); }
.calendar { position: relative; min-width: 46px; }
.calendar svg { width: 20px; height: 20px; color: var(--muted); }
.calendar input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* ---------- Home: list ---------- */
main.wrap { padding-top: 22px; padding-bottom: 32px; }
.dayline { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.dayline h1 { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
#tz { flex: 0 1 auto; max-width: 48%; font-size: 12px; padding: 5px 26px 5px 10px; color: var(--muted); background-color: transparent; }

.comp { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
        border: 1px solid var(--line); }
.comp h2 { margin: 0; padding: 12px 16px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px;
           background: var(--card2); border-bottom: 1px solid var(--line); min-width: 0; }
.comp h2 .country { color: var(--muted); font-weight: 500; white-space: nowrap; }
.comp h2 .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }

.game { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px;
        text-decoration: none; border-top: 1px solid var(--line); transition: background .15s; }
.comp h2 + .game { border-top: 0; }
.game:hover { background: var(--card2); }
.time { font-weight: 700; font-size: 14px; text-align: center; padding: 5px 0; border-radius: 10px; background: var(--card2);
        font-variant-numeric: tabular-nums; border: 1px solid var(--line); }
.vbox { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.vcount { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted);
          font-variant-numeric: tabular-nums; white-space: nowrap; }
.vcount svg { width: 11px; height: 11px; flex: 0 0 auto; }
.teams { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-weight: 500; }
.teams > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.teams span em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.ph { display: inline-grid; place-items: center; border-radius: 50%; background: var(--line); color: var(--muted);
      font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.tiles { display: flex; gap: 5px; }
.tile { width: 44px; padding: 5px 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center;
        font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile b { font-size: 10px; font-weight: 700; opacity: .75; }

.empty, .error { text-align: center; color: var(--muted); padding: 48px 16px; background: var(--card); border-radius: var(--radius);
                 border: 1px dashed var(--line); }

/* ---------- Match page ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        margin-bottom: 14px; padding: 16px; }
.card > h2 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
             display: flex; align-items: center; gap: 8px; }
.card > h2::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent2)); }

.head { text-align: center; padding: 18px 16px 16px; position: relative; overflow: hidden;
        background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 14%, var(--card)) 0%, var(--card) 70%); }
.head .comp-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500;
                   padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent);
                   border: 1px solid var(--line); max-width: 100%; }
.head .comp-line b { color: var(--text); font-weight: 600; }
.head .teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; margin: 18px 0 6px;
               font-size: 15px; font-weight: 400; }
.head .team { min-width: 0; overflow-wrap: anywhere; font-size: 17px; font-weight: 700; line-height: 1.25;
              display: flex; flex-direction: column; align-items: center; gap: 10px; letter-spacing: -.01em; }
.tl { width: 64px; height: 64px; object-fit: contain; padding: 8px; border-radius: 22px; background: var(--card);
      box-shadow: var(--shadow); border: 1px solid var(--line); }
.tl.ph { font-size: 24px; padding: 0; }
.head .when { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; }
.head .when strong { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.head .date { color: var(--muted); font-size: 13px; margin-top: 6px; }

.chart { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.chart h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.rtiles { display: grid; gap: 8px; }
.rtiles + .rtiles { margin-top: 8px; }
.rtiles.c3 { grid-template-columns: repeat(3, 1fr); }
.rtiles.c2 { grid-template-columns: repeat(2, 1fr); }
.rtile { border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
         font-variant-numeric: tabular-nums; transition: background .4s; }
.rtile span { font-size: 12px; font-weight: 600; opacity: .85; overflow-wrap: break-word; hyphens: auto; text-align: center; line-height: 1.2; }
.rtile b { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
.chart .meta { text-align: center; }

ul.news { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
ul.news li { position: relative; padding-left: 18px; }
ul.news li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 7px; height: 7px; border-radius: 50%;
                     background: var(--accent); opacity: .7; }

table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
td { padding: 9px 4px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
tr:first-child td { border-top: 0; }
td.date { color: var(--muted); white-space: nowrap; width: 64px; font-size: 12px; }
td.score { text-align: center; white-space: nowrap; width: 58px; }
td.score b { display: inline-block; padding: 3px 8px; border-radius: 8px; background: var(--card2); border: 1px solid var(--line);
             font-variant-numeric: tabular-nums; }
td.right { text-align: right; }

.form { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-weight: 500; }
.form + .form { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.badges { display: flex; gap: 5px; }
.badge { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.none { color: var(--muted); font-size: 14px; }

.vg + .vg { margin-top: 18px; }
.vg h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.choices { display: grid; gap: 8px; }
.choices.c3 { grid-template-columns: repeat(3, 1fr); }
.choices.c2 { grid-template-columns: repeat(2, 1fr); }
.choices button {
  font: inherit; font-size: 14px; font-weight: 700; color: var(--text); overflow-wrap: break-word; hyphens: auto; line-height: 1.2;
  background: var(--card2); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 8px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.choices button:hover { border-color: var(--accent); background: var(--accent-soft); }
.choices button:active { transform: scale(.97); }
.choices button:disabled { cursor: default; opacity: .55; transform: none; }

/* ---------- Footer ---------- */
footer.wrap { padding-top: 8px; padding-bottom: 36px; }
.about { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.langs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.langs a, .langs b { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.langs a:hover { color: var(--text); border-color: var(--muted); }
.langs b { color: var(--text); background: var(--card); font-weight: 600; }

@media (max-width: 400px) {
  .logo { gap: 8px; }
  .logo img { width: 30px; height: 30px; }
  .logo span { font-size: 16px; }
  .dayline h1 { font-size: 16px; }
  .game { grid-template-columns: 46px 1fr auto; gap: 10px; padding: 12px 12px; }
  .tile { width: 38px; }
  .head .team { font-size: 15px; }
  .tl { width: 56px; height: 56px; border-radius: 18px; }
  .head .when strong { font-size: 26px; }
}
