/* Austrian Open 2026 — Branding nach Turnierheader:
   Sparkassen-Rot, Grau, weiße Flächen, diagonale Streifen */
:root {
  --red: #c8102e;
  --red-dark: #a00d25;
  --grey: #6d6e70;
  --bg: #f2f3f4;
  --card: #ffffff;
  --ink: #3a3b3d;
  --muted: #85878a;
  --line: #e2e4e6;
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
}
#app { max-width: 1280px; margin: 0 auto; padding: 0 18px 40px; }

#banner-img { margin: 14px 0 4px; }
#banner-img img {
  display: block; width: 100%; height: auto; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
}

header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 14px 0 6px; }
h1 { font-size: 26px; margin: 0; color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--grey);
  margin: 28px 0 12px; padding-left: 12px; border-left: 4px solid var(--red);
}
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
select, .btn {
  font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover, select:hover { border-color: var(--red); color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.match-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
/* diagonaler Streifen wie am Banner */
.match-card::after {
  content: ""; position: absolute; top: 0; right: -30px; width: 90px; height: 200%;
  background: linear-gradient(105deg, transparent 40%, rgba(109,110,112,.08) 40%, rgba(109,110,112,.08) 55%, rgba(200,16,46,.10) 55%);
  transform: rotate(0deg); pointer-events: none;
}
.match-card:hover { border-color: var(--red); }
.match-card .head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.badge { padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge.live { background: var(--red); color: #fff; animation: pulse 1.5s infinite; }
.badge.suspended { background: #b58900; color: #fff; }
.badge.finished, .badge.walkover, .badge.retired { background: #ececec; color: var(--grey); }
.badge.scheduled { background: #f0f1f2; color: var(--muted); }
@keyframes pulse { 50% { opacity: .7; } }

.scoreline { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 4px 10px; font-size: 17px; align-items: baseline; }
.scoreline .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #232425; }
.scoreline .nm.winner { color: var(--red); font-weight: 800; }
.scoreline .sets { font-variant-numeric: tabular-nums; letter-spacing: .18em; color: var(--grey); }
.scoreline .pts { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 1.8em; text-align: right; color: var(--red); font-size: 1.1em; }
.serve { color: var(--red); font-size: 10px; visibility: hidden; }
.serve.on { visibility: visible; }

table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
td, th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--grey); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #faf5f6; }
.summary { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.winner-name { color: var(--red); font-weight: 700; }

footer { margin-top: 34px; font-size: 13px; text-align: center; color: var(--muted); }
#connState.ok::before { content: "● "; color: #2e9e6b; }
#connState.bad::before { content: "● "; color: var(--red); }

dialog {
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; width: min(560px, 94vw); box-shadow: 0 14px 44px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(30,30,32,.55); }
dialog h3 { margin: 0 0 4px; color: var(--red); }
dialog table { box-shadow: none; }
dialog table td { font-variant-numeric: tabular-nums; }
.close-x { float: right; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.close-x:hover { color: var(--red); }

/* Monitor-Modus (Anlagen-Bildschirm) */
body.monitor { background: #fff; }
body.monitor #app { max-width: none; padding: 8px 14px; }
body.monitor #banner-img { margin: 4px 0 8px; }
body.monitor #banner-img img { border-radius: 8px; max-height: 16vh; width: auto; max-width: 100%; margin: 0 auto; }
body.monitor header .row, body.monitor header, body.monitor section:nth-of-type(n+2), body.monitor footer { display: none; }
body.monitor #banner-img + header { display: none; }
body.monitor .grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; height: calc(100vh - 18vh - 60px); }
body.monitor .match-card { display: flex; flex-direction: column; justify-content: center; }
body.monitor .scoreline { font-size: clamp(18px, 2.3vw, 34px); }
body.monitor h2 { margin: 6px 0; }
@media (max-width: 900px) { body.monitor .grid { grid-template-columns: repeat(2, 1fr); } }
