/* ============================================================
   FC-OS Deck — Champions-League dark (Gemini creative)
   20 slides · persistent tilted pitch · ballistic-arc ball ·
   fade-on-land · goal finale. Vanilla, offline, no heavy libs.
   ============================================================ */

:root {
  --bg: #070b09; --panel: rgba(8,12,10,.85);
  --line-c: #223029; --chalk: #EDF2EE; --muted: #96a89d; --muted-2: #7a8a80;
  --green: #16E06A; --amber: #F4B740; --cyan: #35D0E0; --coral: #FF6B5C;
  --display: "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pass: .72s; --pass-ease: cubic-bezier(.45,.05,.3,1); --arclift: 13vh;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; width: 100%; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); color: var(--chalk); background: var(--bg); -webkit-font-smoothing: antialiased; }
ul { margin: 0; padding: 0; list-style: none; }

/* ============================================================ PITCH ============================================================ */
.stage { position: fixed; inset: 0; z-index: 0; perspective: 1300px; overflow: hidden; background: #050806; }
.pitch {
  position: absolute; inset: -14% -6% -4%;
  transform: rotateX(15deg) scale(1.06); transform-origin: 50% 42%;
  background: radial-gradient(ellipse 75% 60% at 50% 62%, #123c24 0%, #0b2417 45%, #06110c 78%, #05080660 100%);
  transition: transform .8s cubic-bezier(.5,0,.2,1);
}
.pitch::before { content: ""; position: absolute; inset: 0; opacity: .6;
  background: radial-gradient(ellipse 40% 30% at 50% 20%, rgba(220,255,235,.10), transparent 70%),
              repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 46px, transparent 46px 92px); }
.pitch__svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 4px rgba(120,255,180,.35)); }
.pitch__lines { opacity: .5; }
.pitch__lines .spot { opacity: .7; }
.goalmouth { fill: var(--green); opacity: .55; filter: drop-shadow(0 0 8px var(--green)); }
.pitch__vignette { position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(ellipse 62% 58% at 50% 48%, transparent 40%, rgba(0,0,0,.55) 78%, rgba(0,0,0,.92) 100%); }
/* goal zoom */
.stage.is-goal .pitch { transform: rotateX(15deg) scale(1.28) translateY(-6%); }
.net.shake { animation: net .5s ease-in-out; transform-origin: 300px 972px; }
@keyframes net { 0%,100% { transform: scaleY(1); } 30% { transform: scaleY(1.7) translateY(2px); } 60% { transform: scaleY(.9); } }

/* ============================================================ BALL ============================================================ */
.ballwrap { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.ball-pos { position: absolute; top: 0; left: 0; width: clamp(58px, 6.4vmin, 112px); aspect-ratio: 1;
  transform: translate(calc(var(--x,50) * 1vw - 50%), calc(var(--y,50) * 1vh - 50%));
  transition: transform var(--pass) var(--pass-ease); will-change: transform; }
.ball-lift { width: 100%; height: 100%; will-change: transform; }
.ball { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.ball model-viewer { width: 100%; height: 100%; background: transparent; --poster-color: transparent; }
.ball-lift.is-passing { animation: arc var(--pass) var(--pass-ease); }
@keyframes arc { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(calc(var(--arclift) * -1)) scale(1.16); } 100% { transform: translateY(0) scale(1); } }
.ball-2d { width: 88%; aspect-ratio: 1; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 36% 28%, #fff 0%, #dfe5de 52%, #a8b1a9 100%);
  box-shadow: inset -7px -9px 16px rgba(0,0,0,.4), 0 6px 14px rgba(0,0,0,.5); }
.ball-2d::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #12140e 0 9%, transparent 10%),
              radial-gradient(circle at 24% 66%, #12140e 0 7%, transparent 8%),
              radial-gradient(circle at 76% 66%, #12140e 0 7%, transparent 8%); }
.ball.has-3d .ball-2d { display: none; }
.ball-shadow { position: absolute; left: 50%; bottom: -14%; width: 74%; height: 15%; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,.6), transparent 72%); filter: blur(3px); }
.ball-shadow.is-passing { animation: shadowpass var(--pass) var(--pass-ease); }
@keyframes shadowpass { 0% { transform: translateX(-50%) scale(1); opacity: 1; } 45% { transform: translateX(-50%) scale(.45); opacity: .35; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ============================================================ SLIDES + ANCHORS ============================================================ */
.deck { position: fixed; inset: 0; z-index: 2; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

.panel { position: absolute; max-width: min(460px, 90vw);
  background: linear-gradient(180deg, var(--panel), rgba(6,10,8,.66));
  border: 1px solid var(--line-c); border-radius: 20px; padding: clamp(22px, 2.4vw, 40px);
  backdrop-filter: blur(7px); box-shadow: 0 30px 80px -30px rgba(0,0,0,.85); }
.panel--wide { max-width: min(760px, 92vw); }
.panel--hero { max-width: min(780px, 92vw); text-align: center; }
.panel--center-t { max-width: min(620px, 92vw); text-align: center; }

/* anchor offsets (panel placed OPPOSITE the ball) */
[data-anchor="tl"] .panel { top: 7vh; left: 5vw; }
[data-anchor="tr"] .panel { top: 7vh; right: 5vw; }
[data-anchor="tc"] .panel { top: 6vh; left: 50%; transform: translateX(-50%); }
[data-anchor="bl"] .panel { bottom: 12vh; left: 5vw; }
[data-anchor="br"] .panel { bottom: 12vh; right: 5vw; }
[data-anchor="bc"] .panel { bottom: 12vh; left: 50%; transform: translateX(-50%); }
[data-anchor="ml"] .panel { top: 50%; left: 5vw; transform: translateY(-50%); }
[data-anchor="mr"] .panel { top: 50%; right: 5vw; transform: translateY(-50%); }
[data-anchor="mc"] .panel, [data-anchor="c"] .panel { top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* content fades in exactly when the ball lands (delay ≈ pass) — opacity only, keeps anchor transform */
.slide.is-active .panel { animation: land .5s ease var(--pass) both; }
@keyframes land { from { opacity: 0; } to { opacity: 1; } }

/* ---------- typography / shared ---------- */
.eyebrow { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--green); margin: 0 0 1rem; line-height: 1.4; }
.s-title { font-family: var(--display); font-weight: 800; line-height: 1.0; letter-spacing: -.03em; margin: 0 0 1.1rem; font-size: clamp(2.2rem, 5vw, 4.4rem); }
.s-title--md { font-size: clamp(1.8rem, 3.6vw, 3rem); }
.s-title--sm { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
.accent { color: var(--green); }
.s-lead { color: var(--muted); font-size: clamp(.98rem, 1.4vw, 1.18rem); margin: 0; line-height: 1.5; }
.panel--hero .s-lead, .panel--center-t .s-lead { margin: 0 auto; max-width: 46ch; }
.warn { color: var(--coral); }
.note { font-family: var(--mono); font-size: .68rem; color: var(--muted-2); margin: .9rem 0 0; }

/* problem chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1.2rem; }
.chips span { font-family: var(--mono); font-size: .82rem; padding: .5em 1em; border: 1px solid var(--line-c); border-radius: 9px; background: rgba(0,0,0,.3); color: var(--muted); }

/* dashboard */
.dash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 1.4rem 0 .3rem; }
.tile { position: relative; overflow: hidden; background: rgba(0,0,0,.32); border: 1px solid var(--line-c); border-radius: 13px; padding: 16px 16px 18px; display: flex; flex-direction: column; gap: .3rem; min-height: 108px; }
.tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--a); box-shadow: 0 0 14px var(--a); }
.tl { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tv { font-family: var(--mono); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2.1rem); color: var(--chalk); margin-top: auto; letter-spacing: -.02em; }
.tf { font-size: .68rem; color: var(--muted-2); }
@media (max-width: 720px) { .dash { grid-template-columns: repeat(2, 1fr); } }

/* module content */
.m-problem { font-size: 1.02rem; line-height: 1.5; margin: 0 0 1.1rem; }
.tag { display: inline-block; font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line-c)); border-radius: 6px; padding: .22em .55em; margin-right: .5em; vertical-align: middle; }
.tag--role { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line-c)); }
.m-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 1.1rem; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.m-flow span { padding: .38em .65em; border: 1px solid var(--line-c); border-radius: 7px; background: rgba(0,0,0,.32); }
.m-flow span.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line-c)); }
.m-flow em { color: var(--green); font-style: normal; }
.m-caps { display: grid; gap: .5rem; margin: 0 0 1.2rem; }
.m-caps li { position: relative; padding-left: 1.45rem; font-size: .98rem; line-height: 1.4; }
.m-caps li strong { color: var(--green); }
.m-caps li::before { content: ""; position: absolute; left: 0; top: .48em; width: 8px; height: 8px; background: var(--green); border-radius: 2px; box-shadow: 0 0 9px var(--green); }
.m-role { color: var(--muted); font-size: .94rem; margin: 0; }

/* compliance badges + disclaimer */
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 1.3rem 0; }
.badges span { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line-c); border-left: 3px solid var(--green); border-radius: 11px; background: rgba(0,0,0,.3); font-size: .74rem; color: var(--muted); }
.badges b { font-family: var(--display); font-weight: 800; font-size: .95rem; color: var(--chalk); }
.disclaimer { font-family: var(--mono); font-size: .66rem; color: var(--muted-2); line-height: 1.5; margin: .4rem 0 0; }
@media (max-width: 720px) { .badges { grid-template-columns: repeat(2, 1fr); } }

/* comparison table */
.cmp { border: 1px solid var(--line-c); border-radius: 14px; overflow: hidden; margin-top: 1.2rem; }
.cmp__row { display: grid; grid-template-columns: 1.1fr 1.7fr 1.1fr; }
.cmp__row > span { padding: 13px 15px; border-bottom: 1px solid var(--line-c); font-size: .86rem; color: var(--muted); min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.cmp__row:last-child > span { border-bottom: 0; }
.cmp__head > span { background: rgba(0,0,0,.35); color: var(--muted-2); font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; }
.cmp .k { color: var(--chalk) !important; font-weight: 600; }
.cmp .fcos { background: rgba(22,224,106,.06); color: var(--chalk) !important; }
.cmp__head .fcos { color: var(--green) !important; }
.cmp .yes { color: var(--green) !important; }
.cmp .no { color: var(--coral); }

/* ============================================================ GOAL SLIDE + FX ============================================================ */
.panel--goal { text-align: center; border-color: color-mix(in srgb, var(--green) 45%, var(--line-c)); box-shadow: 0 0 60px -10px rgba(22,224,106,.5), 0 30px 80px -30px rgba(0,0,0,.85); }
.goaltag { font-family: var(--mono); letter-spacing: .5em; font-size: .7rem; color: var(--green); margin: 0 0 .4rem; }
.goal-title { font-family: var(--display); font-weight: 800; font-size: clamp(3.4rem, 9vw, 7rem); line-height: .9; letter-spacing: -.04em; margin: 0 0 1rem; color: #fff; text-shadow: 0 0 50px rgba(22,224,106,.7); }
.slide--goal.is-active .goal-title { animation: goalpop .6s cubic-bezier(.2,1.4,.4,1) var(--pass) both; }
@keyframes goalpop { 0% { opacity: 0; transform: scale(.5); } 100% { opacity: 1; transform: scale(1); } }
.cta-badge { display: inline-flex; align-items: center; gap: 10px; margin-top: 1.6rem; font-family: var(--display); font-weight: 900; letter-spacing: .06em; color: var(--muted); padding: 11px 20px; border: 1px solid var(--line-c); border-radius: 999px; background: rgba(255,255,255,.02); }
.cta-badge .dot { width: 11px; height: 11px; border-radius: 3px; background: var(--green); box-shadow: 0 0 14px var(--green); }

.goalfx { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.goalfx.show { opacity: 1; }
.goalfx .flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 92%, rgba(255,255,255,.9), transparent 45%); opacity: 0; }
.goalfx.show .flash { animation: flash .6s ease-out var(--pass); }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }
.confetti { position: absolute; inset: 0; overflow: hidden; }
.confetti i { position: absolute; top: -8%; width: 9px; height: 14px; border-radius: 2px; opacity: .9; animation-name: fall; animation-timing-function: cubic-bezier(.3,.2,.5,1); animation-iteration-count: 1; animation-fill-mode: both; }
@keyframes fall { 0% { top: -8%; opacity: 0; } 10% { opacity: .95; } 100% { top: 108%; opacity: .9; } }

/* ============================================================ CONTROLS ============================================================ */
.controls { position: fixed; z-index: 6; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; background: rgba(6,10,8,.75); border: 1px solid var(--line-c); border-radius: 999px; padding: 7px 13px; backdrop-filter: blur(8px); }
.ctrl { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-c); background: rgba(255,255,255,.03); color: var(--chalk); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: border-color .2s, transform .15s; }
.ctrl:hover:not(:disabled) { border-color: var(--green); transform: translateY(-1px); }
.ctrl:disabled { opacity: .35; cursor: default; }
.ctrl:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.counter { font-family: var(--mono); font-size: .9rem; color: var(--muted); min-width: 54px; text-align: center; letter-spacing: .06em; }
.kbdhint { position: fixed; z-index: 6; right: 18px; bottom: 26px; margin: 0; font-family: var(--mono); font-size: .7rem; color: color-mix(in srgb, var(--muted) 60%, transparent); }

/* ============================================================ REDUCED MOTION ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ball-pos, .pitch { transition: none; }
  .ball-lift.is-passing, .ball-shadow.is-passing, .slide.is-active .panel, .slide--goal.is-active .goal-title { animation: none; }
  .goalfx { display: none; }
}
@media (max-width: 760px) { .kbdhint { display: none; } }

/* ============================================================
   MOBILE / PORTRAIT (≤480) — 3 stacked zones. Desktop untouched.
   TOP: pitch + ball (tight lane) · MIDDLE: solid readable card
   (same for hero/modules/goal) · BOTTOM: fixed full-width nav footer.
   ============================================================ */
@media (max-width: 480px) {
  /* Ball keeps its DESKTOP trajectory (may pass BEHIND the card — intended). */

  /* MIDDLE ZONE — one solid, high-contrast card ABOVE the ball (higher z-index).
     Generous height so content-heavy slides fit; scrolls if still taller. */
  .slide:not(.slide--goal) .panel {
    position: fixed !important;
    top: 14vh !important; bottom: auto !important;
    left: 12px !important; right: 12px !important;
    width: auto !important; max-width: none !important;
    max-height: calc(86vh - 82px) !important;   /* never reaches the 64px footer */
    transform: none !important;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    text-align: left !important;
    background: #0e1512 !important;              /* clearly a card, not a ghost */
    border: 1px solid #3a4d42 !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 55px rgba(0,0,0,.75) !important;
    z-index: 4;                                  /* above the ball (z-index 1) */
  }

  /* titles small enough to break cleanly */
  .s-title { font-size: 1.9rem; line-height: 1.05; }
  .s-title--md { font-size: 1.5rem; }
  .s-title--sm { font-size: 1.4rem; }
  .s-lead { font-size: .93rem; }
  .eyebrow { font-size: .58rem; letter-spacing: .1em; }
  .m-problem, .m-role { font-size: .9rem; }
  .m-caps li { font-size: .9rem; padding-left: 1.3rem; }
  .chips span, .m-flow { font-size: .7rem; }

  /* BOTTOM ZONE — nav as a fixed, full-width footer bar */
  .controls {
    left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
    transform: none !important; width: 100% !important; height: 64px;
    border: 0 !important; border-top: 1px solid var(--line-c) !important; border-radius: 0 !important;
    justify-content: center; background: rgba(6,10,8,.95) !important; backdrop-filter: blur(10px);
  }

  /* tighten so content-heavy slides (17 Ροές, 19 Σύγκριση) fit fully */
  .slide:not(.slide--goal) .panel { padding: 18px 16px; }
  .s-title, .s-title--md, .s-title--sm { margin-bottom: .7rem; }
  .m-problem { margin-bottom: .8rem; }
  .m-caps { gap: .4rem; margin-bottom: .8rem; }
  .m-flow { margin-bottom: .8rem; }
  .eyebrow { margin-bottom: .6rem; }

  /* comparison → compact stacked cells */
  .cmp { margin-top: .8rem; }
  .cmp__row { grid-template-columns: 1fr; }
  .cmp__head { display: none; }
  .cmp__row > span { padding: 9px 12px; font-size: .8rem; }
  .cmp .k { background: rgba(0,0,0,.4); font-size: .74rem; }
  .cmp .fcos { border-top: 1px dashed var(--line-c); }

  .dash { gap: 8px; }
  .tile { min-height: 80px; padding: 10px; }
  .tv { font-size: 1.5rem; }

  /* GOAL — keep centered & readable, just above the footer */
  .slide--goal .panel { max-width: calc(100vw - 28px); bottom: auto; }
}
