/* Plakat: shared look for the Boccia sketches.
   Paper ground, navy ink, gouache red and blue balls, Rammetto One for display, Lato for text. */
@import url('https://fonts.googleapis.com/css2?family=Rammetto+One&family=Lato:wght@400;700;900&display=swap');

:root {
  --paper: #f7f7f5;
  --ink: #14204f;
  --muted: #5a6282;
  --line: rgba(20, 32, 79, .14);
  --red: #e01b22;
  --red-text: #c4141b;
  --blue: #1f63c4;
  --blue-text: #1f63c4;
  --on-ink: #fff;
  --card: #fff;
  --hover: #eceef4;
  --wash: #14204f;
  --ball-ink: #14204f;
  --ball-ink-text: #fff;
  --grain: .07;
  --white: #fff;
  color-scheme: light;
  --d: 'Rammetto One', 'Arial Black', sans-serif;
  --b: 'Lato', system-ui, sans-serif;
}
/* dark: night-navy ground, paper-white ink; the balls keep their red and blue */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0d1331;
  --ink: #eef0f7;
  --muted: #a2aacb;
  --line: rgba(238, 240, 247, .14);
  --red: #e8262d;
  --red-text: #ff6a70;
  --blue: #2b6fd8;
  --blue-text: #7aaeff;
  --on-ink: #0d1331;
  --card: #172052;
  --hover: #212c66;
  --wash: #1d2a6e;
  --ball-ink: #eef0f7;
  --ball-ink-text: #0d1331;
  --grain: .12;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #0d1331;
  --ink: #eef0f7;
  --muted: #a2aacb;
  --line: rgba(238, 240, 247, .14);
  --red: #e8262d;
  --red-text: #ff6a70;
  --blue: #2b6fd8;
  --blue-text: #7aaeff;
  --on-ink: #0d1331;
  --card: #172052;
  --hover: #212c66;
  --wash: #1d2a6e;
  --ball-ink: #eef0f7;
  --ball-ink-text: #0d1331;
  --grain: .12;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--b); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  transition: background-color .35s, color .35s;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue-text); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--d); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
@media (min-width: 900px) { .wrap { padding-inline: 64px; } }

/* masthead: the real logo (red, blue on hover like the app) and a few words of navigation */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 12px; }
.logo { display: block; position: relative; flex: none; }
.logo img { display: block; height: 52px; width: auto; }
.logo .lb { position: absolute; inset: 0; opacity: 0; }
.logo:hover .lb { opacity: 1; } .logo:hover .lr { opacity: 0; }
@media (min-width: 900px) { .logo img { height: 80px; } .mast { padding-block: 20px; } }
.mast nav { display: flex; align-items: center; gap: 14px; font-weight: 900; font-size: 14px; white-space: nowrap; }
@media (max-width: 899px) { .mast .logo img { height: 46px; } }
@media (min-width: 900px) { .mast nav { gap: 36px; font-size: 17px; } }
.mast nav a { text-decoration: none; }
.mast nav a[aria-current] { position: relative; z-index: 0; }
.mast nav a[aria-current]::after, .brush::after {
  content: ""; position: absolute; left: -4px; right: -5px; bottom: -4px; height: 8px;
  background: var(--red); border-radius: 2px 7px 3px 6px; transform: rotate(-1.5deg); z-index: -1;
}
.brush { position: relative; z-index: 0; }

/* the painted ball: a gouache disc with the number on it */
.ball {
  --s: 44px; --c: var(--red);
  position: relative; isolation: isolate; flex: none;
  display: inline-grid; place-items: center; width: var(--s); height: var(--s);
  font-family: var(--d); font-size: calc(var(--s) * .5); line-height: 1; color: var(--white);
}
.ball::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50%;
  background: var(--c); filter: var(--f, url(#g));
  box-shadow: inset 0 0 calc(var(--s) * .06) rgb(0 0 0 / .14);
  animation: fill .6s cubic-bezier(.2, .7, .2, 1) both;
}
/* splash drops thrown off the ball, placed per ball by _plakat.js */
.ball::after {
  content: ""; position: absolute; inset: -40%; z-index: -1; pointer-events: none;
  background: var(--drops, none); filter: var(--f, url(#g));
  animation: drops .35s .45s cubic-bezier(.2, .7, .2, 1) both;
}
.ball.ring::after { display: none; }
@keyframes drops { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.ball.b { --c: var(--blue); }
.ball.navy { --c: var(--ball-ink); color: var(--ball-ink-text); }
.ball.ring { color: var(--c); }
.ball.ring::before { background: none; box-shadow: inset 0 0 0 calc(var(--s) * .085) var(--c); animation: none; }
@keyframes fill { from { clip-path: inset(100% -20% -20% -20%); } to { clip-path: inset(-20%); } }

/* balls left in the end: six pips, spent ones drained to an outline */
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; transition: background .4s; }
.pips i.x { background: none; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .45; }

/* navy wash: a painted band with a torn edge */
.wash { position: relative; isolation: isolate; color: #fff; }
.wash::before { content: ""; position: absolute; inset: 0 -40px; z-index: -1; background: var(--wash); filter: url(#gb); }
.wash.v::before { inset: -40px 0; filter: url(#gv); }

.r-t { color: var(--red-text); } .b-t { color: var(--blue-text); }
.muted { color: var(--muted); }
.meta { font-size: 13px; font-weight: 700; color: var(--muted); }
.go { font-family: var(--d); font-size: 17px; color: var(--red-text); text-decoration: none; }
.go:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* light/dark switch: a round button with a painted moon; in the dark it turns into a sun */
.mode { flex: none; position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 2px solid currentColor; border-radius: 50%; background: none; color: inherit; cursor: pointer; transition: background-color .2s, color .2s; }
.mode::before { content: ""; width: 20px; height: 20px; background: currentColor; filter: url(#g); transition: transform .45s cubic-bezier(.3, .8, .25, 1);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20.5 14.6A8.6 8.6 0 0 1 9.4 3.5a8.6 8.6 0 1 0 11.1 11.1z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M20.5 14.6A8.6 8.6 0 0 1 9.4 3.5a8.6 8.6 0 1 0 11.1 11.1z'/></svg>") center / contain no-repeat; }
.mode[aria-checked="true"]::before { transform: rotate(180deg);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='5'/><g stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M12 1.5v3M12 19.5v3M1.5 12h3M19.5 12h3M4.6 4.6l2.1 2.1M17.3 17.3l2.1 2.1M4.6 19.4l2.1-2.1M17.3 6.7l2.1-2.1'/></g></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='5'/><g stroke='black' stroke-width='2.4' stroke-linecap='round'><path d='M12 1.5v3M12 19.5v3M1.5 12h3M19.5 12h3M4.6 4.6l2.1 2.1M17.3 17.3l2.1 2.1M4.6 19.4l2.1-2.1M17.3 6.7l2.1-2.1'/></g></svg>"); }
.mode:hover { background: currentColor; }
.mode:hover::before { background: var(--paper); }
.mode .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Zaloguj: a small painted button, not a bare link */
.login { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px 9px; color: var(--ball-ink-text); font-weight: 900; text-decoration: none; white-space: nowrap; }
.login::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ball-ink); border-radius: 14px 9px 13px 10px; filter: url(#g); transition: transform .2s; }
.login:hover::before { transform: scale(1.05) rotate(-1deg); }

/* alerts: a paper slip at the top, a painted mark says what kind; the title says it in words too */
.toast { position: fixed; left: 50%; top: 24px; z-index: 90; transform: translateX(-50%); width: min(540px, calc(100% - 32px));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 16px 16px 18px;
  background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px 16px 10px 14px;
  box-shadow: 0 18px 50px rgba(13, 19, 49, .28); animation: toast .4s cubic-bezier(.2, .8, .2, 1) both; }
.toast.static { position: relative; left: auto; top: auto; transform: none; animation: none; }
.toast b { display: block; font-family: var(--d); font-weight: 400; font-size: 18px; line-height: 1.1; }
.toast p { margin: 4px 0 0; font-size: 16px; line-height: 1.35; }
.toast .x { font: inherit; font-size: 22px; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; align-self: start; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* team matches: a painted tag that says it in words, and the club's crest leading the name */
.teamtag { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 4px; font-family: var(--b); font-weight: 900; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ball-ink-text); white-space: nowrap; }
.teamtag::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ball-ink); border-radius: 9px 5px 8px 6px; filter: url(#g); }
.teamtag svg { width: 16px; height: 16px; }
.crest { display: inline-block; flex: none; object-fit: contain; vertical-align: middle; color: var(--ink); }

/* control left alone: after a few minutes the screen blurs. One look says which court and which match;
   the first click or key only wakes it, it never changes the score */
.idle { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgb(247 247 245 / .4); -webkit-backdrop-filter: blur(18px) saturate(.7); backdrop-filter: blur(18px) saturate(.7); animation: idleIn .9s ease both; }
:root[data-theme="dark"] .idle { background: rgb(13 19 49 / .5); }
.idle[hidden] { display: none; }
.idle .box { display: grid; justify-items: center; gap: 16px; max-width: 620px; text-align: center; padding: 34px 44px 30px; background: color-mix(in srgb, var(--paper) 90%, transparent); border-radius: 14px 26px 16px 22px; box-shadow: 0 24px 60px rgba(13, 19, 49, .18); }
.idle .ctag { position: relative; isolation: isolate; display: grid; justify-items: center; padding: 14px 40px 20px; color: #fff; line-height: .9; }
.idle .ctag::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #14204f; border-radius: 12px 26px 14px 22px; filter: url(#g); }
.idle .ctag small { font-weight: 900; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-bottom: 12px; }
.idle .ctag b { font-family: var(--d); font-weight: 400; font-size: 120px; }
.idle h2 { font-size: 40px; margin-top: 6px; }
.idle .why { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.45; }
.idle .match { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-weight: 900; font-size: 19px; }
.idle .match .end { font-weight: 700; color: var(--muted); }
.idle .safe { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--muted); max-width: 44ch; }
@keyframes idleIn { from { opacity: 0; } }

/* paper grain: a faint printed texture over the page */
.grain::after { content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .55  0 0 0 1.1 -.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

@media (prefers-reduced-motion: reduce) {
  .ball::before, .ball::after { animation: none; }
  * { transition: none !important; }
}
