/* Q-Sports demo page (/demo.html): phone, LED board, network switch and club
   website on one dark stage. Builds on site.css for tokens, nav and footer. */

/* TrueType fonts for the LED board (same files as design/mockups/fonts/). */
@font-face { font-family: "QS Montserrat"; src: url("../fonts/montserrat-extrabold.ttf") format("truetype"); font-display: block; }
@font-face { font-family: "QS DejaVu Condensed"; src: url("../fonts/dejavu-sans-condensed-bold.ttf") format("truetype"); font-display: block; }

.demo-page {
  /* clip, not hidden: hidden would make this the scroll container and break the sticky board on phones */
  position: relative; overflow: clip; background: var(--night); color: #c9d5e2;
  padding: 120px 0 72px;
}
.demo-page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.5px);
  background-size: 9px 9px;
}
.demo-page .wrap { z-index: 1; }

.demo-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-bottom: 40px; }
.demo-title { font: 900 clamp(2.1rem, 4.6vw, 3.4rem)/1.05 var(--f-display); color: #fff; letter-spacing: -.02em; margin-bottom: 16px; }
.demo-lead { margin: 0; max-width: 36em; color: #d3dde8; font-size: 1.05rem; }
.demo-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.demo-steps li {
  counter-increment: step; display: flex; align-items: center; gap: 12px; font-size: .95rem;
  padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius); background: rgba(255, 255, 255, .03);
  transition: border-color .2s, background-color .2s;
}
.demo-steps li::before {
  content: counter(step); flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font: 800 .78rem var(--f-display); color: var(--night); background: #7f8fa3;
}
.demo-steps li.done { border-color: rgba(0, 179, 196, .5); background: rgba(0, 179, 196, .08); color: #fff; }
.demo-steps li.done::before { content: "✓"; background: var(--teal); }
.demo-steps b { color: #fff; }
.demo-noscript { background: #1a2333; padding: 16px 20px; border-radius: var(--radius); }
.demo-noscript a { color: var(--teal); }

/* phone | board + network + website */
.demo-grid {
  display: grid; gap: 28px 32px; align-items: start;
  grid-template-columns: 340px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "phone board board" "phone net web";
}
.demo-grid[hidden] { display: none; }
.demo-phone { grid-area: phone; }
.demo-board { grid-area: board; }
.demo-net { grid-area: net; }
.demo-web { grid-area: web; }
.demo-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font: 800 .82rem/1.3 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: #fff; margin-bottom: 12px; }
.demo-label span { color: var(--teal); }
.demo-label small { font-weight: 600; letter-spacing: .04em; text-transform: none; color: #8597ad; font-size: .82rem; }
.demo-label .demo-later { border: 1px solid #5d6b80; border-radius: 99px; padding: 1px 8px; font-size: .72rem; }
.demo-actions { margin: 36px 0 0; text-align: center; }
.demo-actions .btn { background: none; }

/* ---------- phone ---------- */
.phone-frame { width: 340px; max-width: 100%; margin: 0 auto; padding: 12px; border-radius: 48px; background: #1b1f27; box-shadow: 0 0 0 2px #2f3542, 0 40px 80px -20px rgba(0, 0, 0, .7); }
.phone-screen {
  position: relative; overflow: hidden; height: 680px; border-radius: 38px; background: #0b1324; color: #e8eef6;
  font: 500 14px/1.35 var(--f-body); display: flex; flex-direction: column;
}
.phone-screen button { font: inherit; cursor: pointer; }
.phone-screen button:disabled { cursor: default; opacity: .4; }
.app-bar { display: flex; justify-content: space-between; padding: 14px 26px 6px; font: 700 12px var(--f-body); color: #c8d2e0; }
.app-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px 10px; }
.app-conn { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; background: rgba(47, 210, 122, .14); color: #7ee8ac; font-size: 12px; font-weight: 700; }
.app-conn i { width: 7px; height: 7px; border-radius: 50%; background: #2fd27a; }
.app-conn.is-off { background: rgba(232, 92, 92, .16); color: #f2a0a0; }
.app-conn.is-off i { background: #e85c5c; }
.app-per { font-size: 12px; font-weight: 700; color: #ffb000; text-transform: uppercase; letter-spacing: .06em; }
.app-score { display: grid; gap: 6px; padding: 0 16px; }
.app-team { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #142039; }
.app-team img { display: block; }
.app-team span { font-weight: 700; }
.app-team b { font: 800 30px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.app-clock { display: flex; align-items: center; justify-content: space-between; margin: 10px 16px; padding: 8px 8px 8px 16px; border-radius: 12px; background: #000; }
.app-clk { font: 500 34px/1 var(--f-mono); color: #ffb000; font-variant-numeric: tabular-nums; }
.app-go { border: 0; border-radius: 9px; padding: 10px 18px; background: #334055; color: #fff; font-weight: 800 !important; }
.app-go.is-go { background: #2fd27a; color: #062512; }
.app-go.is-hint { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 210, 122, .6); } 50% { box-shadow: 0 0 0 8px rgba(47, 210, 122, 0); } }
.app-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px; }
.app-acts button {
  display: flex; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid #22304b; border-radius: 12px;
  background: #142039; color: #fff; font-weight: 800 !important; text-align: left;
}
.app-acts .k-goal { --k: #2fd27a; }
.app-acts .k-card { --k: #ffd200; }
.app-acts .k-sub { --k: #4c8dff; }
.app-acts .k-period { --k: #c084fc; }
.app-acts button:not(:disabled):hover { border-color: var(--k); }
.app-acts i { width: 10px; height: 10px; border-radius: 3px; background: var(--k); }
.app-seg { padding: 12px 16px 0; }
.app-seg small { display: block; color: #8494ab; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.app-seg div { display: flex; flex-wrap: wrap; gap: 5px; }
.app-seg button { border: 1px solid #22304b; background: none; color: #c8d2e0; border-radius: 99px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.app-seg button.on { background: #e8eef6; color: #0b1324; border-color: #e8eef6; }
.app-tl { flex: 1; overflow: auto; margin-top: 12px; padding: 8px 16px 20px; border-top: 1px solid #1b2843; }
.app-ev { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #16223a; font-size: 12.5px; }
.app-ev .m { color: #ffb000; font-weight: 800; }
.app-ev button { border: 0; background: #1d2a45; color: #c8d2e0; border-radius: 7px; padding: 5px 8px; font-size: 11.5px; font-weight: 700; }
.app-empty { margin: 8px 0; color: #8494ab; font-size: 12.5px; }
.app-pend { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 10px 12px; border-radius: 10px; background: #1d2a45; font-size: 12.5px; font-weight: 700; text-align: center; }

.sheet {
  position: absolute; inset: auto 0 0; max-height: 82%; overflow: auto; padding: 14px 16px 20px;
  border-radius: 22px 22px 0 0; background: #f5f7fb; color: #0d1726; box-shadow: 0 -20px 40px rgba(0, 0, 0, .45);
}
.sh-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sh-head b { font: 800 18px var(--f-display); }
.sh-head button { border: 0; background: #e3e8f0; border-radius: 50%; width: 30px; height: 30px; font-size: 18px !important; line-height: 1 !important; }
.sh-tog { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.sh-tog button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid #d3dae6; border-radius: 9px; background: #fff; font-size: 12.5px; font-weight: 700; }
.sh-tog button.on { border-color: #0d1726; box-shadow: inset 0 0 0 1px #0d1726; }
.sh-col .cY.on { background: #ffd200; border-color: #b39300; }
.sh-col .cR.on { background: #ff2a2a; border-color: #a00; color: #fff; }
.sh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sh-grid button { padding: 8px 4px; border: 1px solid #d3dae6; border-radius: 9px; background: #fff; text-align: center; }
.sh-grid button:hover { border-color: #0d1726; }
.sh-grid b { display: block; font: 800 18px/1.1 var(--f-display); }
.sh-grid span { display: block; font-size: 11px; color: #4b5a70; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-wide { width: 100%; margin-top: 6px; padding: 9px; border: 1px dashed #aab4c4; border-radius: 9px; background: none; font-size: 12.5px; font-weight: 700; }
.sh-q { margin: 4px 0 8px; font-size: 13px; font-weight: 700; }

/* ---------- board ---------- */
.board-frame { padding: 14px; border-radius: 6px; background: #15181e; box-shadow: 0 0 0 1px #2a2f39, 0 30px 70px -20px rgba(0, 0, 0, .8); }
.board-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #030304; image-rendering: pixelated; }
.board-status { margin: 10px 0 0; font-size: .92rem; color: #8fa1b8; }
.board-fonts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; font-size: .88rem; }
.board-fonts > span { color: #8fa1b8; margin-right: 4px; }
.board-fonts button { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); color: #d3dde8; border-radius: 99px; padding: 5px 12px; font: 700 .82rem var(--f-body); cursor: pointer; }
.board-fonts button[aria-pressed="true"] { background: #e8eef6; border-color: #e8eef6; color: var(--night); }

/* ---------- network ---------- */
.net-switch {
  display: inline-flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 99px; background: rgba(255, 255, 255, .04); color: #fff; font: 800 1rem var(--f-body);
}
.net-knob { position: relative; width: 48px; height: 28px; border-radius: 99px; background: #4a5568; transition: background-color .2s; }
.net-knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.net-switch[aria-pressed="true"] .net-knob { background: var(--teal); }
.net-switch[aria-pressed="true"] .net-knob::after { transform: translateX(20px); }
.net-note { margin: 12px 0 18px; font-size: .92rem; min-height: 4.2em; }
.net-note b { color: #fff; }
.flow-h { font: 700 .75rem var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: #8597ad; margin: 0 0 8px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flow li { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); font-size: .85rem; }
.flow li:first-child { border-color: rgba(0, 179, 196, .35); }
.flow .fl-empty { color: #8597ad; }
.fl-head { display: flex; justify-content: space-between; gap: 8px; color: #8597ad; font: 500 .75rem var(--f-mono); }
.fl-head code { font: inherit; color: #9fd6dc; }
.flow b { color: #fff; font-weight: 700; }
.hop { color: #8fa1b8; }
.hop::before { content: "●"; margin-right: 6px; font-size: .7em; vertical-align: 1px; color: #6b7a90; }
.hop.ok::before { color: #2fd27a; }

/* ---------- website ---------- */
.browser { border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #e8ecf2; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #c3cad5; }
.browser-bar span { flex: 1; margin-left: 8px; padding: 4px 10px; border-radius: 6px; background: #fff; color: #4b5a70; font: 500 12px var(--f-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-page { color: #141821; font: 500 14px/1.4 var(--f-body); }
.w-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #a3001a; color: #fff; }
.w-club { display: inline-flex; align-items: center; gap: 8px; font: 800 15px var(--f-display); }
.w-links { display: flex; gap: 12px; font-size: 12.5px; font-weight: 700; opacity: .85; }
.w-links .on { text-decoration: underline; text-underline-offset: 4px; }
.w-body { padding: 18px 16px 20px; background: #f3f4f7; }
.widget { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 18px rgba(0, 0, 0, .06); }
.w-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 700 11px var(--f-body); text-transform: uppercase; letter-spacing: .06em; color: #7a8291; }
.w-state { color: #4b5466; }
.w-state.live { color: #d0021b; }
.w-state.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #d0021b; animation: blink 1.2s infinite; }
.w-state.off { color: #9a6200; }
@keyframes blink { 50% { opacity: .2; } }
.w-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 14px 0 6px; text-align: center; }
.w-score img { display: block; margin: 0 auto 6px; }
.w-score span { font-size: 12.5px; font-weight: 700; }
.w-score strong { font: 800 40px/1 var(--f-display); font-variant-numeric: tabular-nums; color: #141821; }
.w-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 1.4em; font-size: 12px; color: #5e6675; }
.w-scorers span:last-child { text-align: right; }
.w-events { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid #e8ebf0; display: grid; gap: 6px; font-size: 12.5px; }
.w-events li { display: grid; grid-template-columns: 28px 16px 1fr; gap: 6px; align-items: baseline; }
.w-events .m { font-weight: 800; color: #141821; }
.w-events i { font-style: normal; text-align: center; color: #5e6675; }
.w-events .k-goal i { color: #1a9a50; }
.w-events .cY i { color: #e0b400; }
.w-events .cR i { color: #e01e1e; }
.w-events .w-none { display: block; color: #7a8291; }
.w-foot { margin: 12px 0 0; font-size: 11.5px; color: #7a8291; }

@media (max-width: 1100px) {
  .demo-grid { grid-template-columns: 340px minmax(0, 1fr); grid-template-areas: "phone board" "phone net" "web web"; }
  .demo-web { max-width: 520px; }
}
@media (max-width: 860px) {
  .demo-head { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "board" "phone" "net" "web"; }
  /* Keep the board in view while tapping on the phone below it. */
  .demo-board { position: sticky; top: 68px; z-index: 5; padding: 8px 0; background: var(--night); }
  .demo-board .board-status, .demo-board .board-fonts { display: none; }
  .demo-web { max-width: none; }
}
@media (max-width: 400px) {
  .phone-screen { height: 620px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-go.is-hint, .w-state.live::before { animation: none; }
}
