/* home.php animations: ha-drill (hero), ha-week (microcycle), ha-stats (reports). Driven by js/home-anim.js. */

/* ---- Panels: each animation fills its feature gallery's main frame (16:10) ---- */
.ha-panel { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0b1220; display: flex; flex-direction: column; justify-content: center; }
.ha-panel[hidden] { display: none; }
.ha-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: linear-gradient(150deg, #1e3a8a, #4c1d95); color: #e0e7ff; font: 600 .78rem/1 inherit; }
.ha-thumb span { display: inline-flex; align-items: center; gap: .3rem; }
.ha-thumb svg { width: 14px; height: 14px; }

/* ---- Train: the drill draws itself ---- */
.ha-panel-drill { background: rgb(58,120,28); }
.ha-board { position: relative; }
.ha-board svg { display: block; width: 100%; height: auto; }
.ha-chips { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.ha-chip { font-size: .72rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(15,23,42,.55); color: #cbd5e1; border: 1px solid rgba(255,255,255,.08); transition: background .25s, color .25s; }
.ha-chip.on { background: #8b5cf6; color: #fff; }
@media (max-width: 640px) { .ha-board .ha-chips { display: none; } }

.ha-nt * { transition: none !important; }
.ha-line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s ease; }
.ha-play .ha-line { stroke-dashoffset: 0; }
.ha-pop { opacity: 0; transform: translateY(-26px) scale(.4); transform-box: fill-box; transform-origin: center; transition: opacity .35s, transform .55s cubic-bezier(.16,1,.3,1); }
.ha-play .ha-pop { opacity: 1; transform: none; transition-delay: var(--d); }
.ha-draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--t,1s) ease-in-out; }
.ha-play .ha-draw { stroke-dashoffset: 0; transition-delay: var(--d); }
.ha-layer { transition: opacity .6s; }
.ha-out .ha-layer { opacity: 0; }
.ha-save { opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: center; }
.ha-saved1 .ha-save1, .ha-saved2 .ha-save2 { opacity: 1; transform: none; transition: opacity .2s, transform .5s cubic-bezier(.16,1,.3,1); }
.ha-ring { opacity: 0; }
.ha-saved1 .ha-save1 .ha-ring, .ha-saved2 .ha-save2 .ha-ring { animation: ha-ring .9s ease-out; }
@keyframes ha-ring { 0% { opacity: .9; r: 6; } 100% { opacity: 0; r: 60; } }

/* ---- Plan: week to matchday ---- */
.ha-wk { position: relative; padding: 0 4% 0; }
.ha-wk-head { position: relative; text-align: center; font-size: 1.25rem; font-weight: 700; color: #f8fafc; margin-bottom: 1rem; }
.ha-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ha-lines path { fill: none; stroke: rgba(96,165,250,.13); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ha-go .ha-lines path { animation: ha-trace 2.6s cubic-bezier(.65,0,.35,1) forwards; }
@keyframes ha-trace { to { stroke-dashoffset: 0; } }
.ha-rot { display: inline-grid; vertical-align: bottom; overflow: hidden; color: #60a5fa; text-align: left; }
.ha-rot span { grid-area: 1/1; transform: translateY(105%); opacity: 0; transition: transform .6s cubic-bezier(.16,1,.3,1), opacity .4s; }
.ha-rot span.on { transform: none; opacity: 1; }
.ha-rot span.off { transform: translateY(-105%); opacity: 0; }
.ha-week { position: relative; margin: 0 auto; }
.ha-track { position: absolute; left: 7%; right: 7%; top: calc(100% + 18px); height: 2px; background: #1e293b; }
.ha-track i { position: absolute; inset: 0; background: linear-gradient(90deg,#3b82f6,#a78bfa); transform-origin: left; transform: scaleX(0); }
.ha-ball { position: absolute; top: calc(100% + 19px); left: 7%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 0 18px rgba(167,139,250,.8); }
.ha-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.ha-day { perspective: 700px; height: 118px; }
.ha-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.16,1,.3,1); }
.ha-day.on .ha-flip { transform: rotateY(180deg); }
.ha-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; border: 1px solid #1e293b; background: #111c33; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px 4px; gap: 3px; text-align: center; }
.ha-face.front { color: #475569; font-weight: 700; font-size: 1rem; }
.ha-face.back { transform: rotateY(180deg); background: #16213b; border-color: #334155; }
.ha-md { font-size: .62rem; font-weight: 700; color: #94a3b8; letter-spacing: .04em; }
.ha-ses { font-size: .74rem; font-weight: 700; color: #f8fafc; line-height: 1.2; }
/* Day tiles are narrow: a word too long for its tile is cut with an ellipsis (Αποκαταστ…), never spills or wraps mid-word. */
.ha-ses { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-face > div { max-width: 100%; }
.ha-foc { font-size: .6rem; color: #94a3b8; line-height: 1.2; }
.ha-int { display: flex; gap: 3px; margin-top: 4px; }
.ha-int b { width: 7px; height: 5px; border-radius: 2px; background: #334155; }
.ha-int b.f { background: var(--c); }
.ha-day.match .back { background: linear-gradient(160deg,#1d4ed8,#6d28d9); border-color: #818cf8; }
.ha-score { font-size: 1.2rem; font-weight: 800; color: #fff; line-height: 1; }
.ha-rating { font-size: .6rem; color: #e0e7ff; }
.ha-cap { position: relative; margin-top: 2.2rem; color: #64748b; font-size: .85rem; min-height: 1.4em; text-align: center; }
@media (max-width: 760px) {
    .ha-panel-week { aspect-ratio: auto; padding: 1.2rem 0; }
    .ha-days { grid-template-columns: repeat(4,1fr); }
    .ha-day { height: 104px; }
    .ha-day.match { grid-column: span 2; }
    .ha-track, .ha-ball { display: none; }
    .ha-cap { margin-top: 1.2rem; }
}

/* ---- Report: the numbers come alive ---- */
.ha-st { position: relative; padding: 0 3.5%; }
.ha-st::before { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, rgba(59,130,246,.16), transparent); pointer-events: none; }
.ha-stage { perspective: 1400px; position: relative; }
.ha-deck { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transform-style: preserve-3d; transition: transform .4s cubic-bezier(.16,1,.3,1); }
.ha-card { background: #111c33; border: 1px solid #1e293b; border-radius: 12px; padding: 10px 12px; text-align: left; box-shadow: 0 24px 60px -24px rgba(0,0,0,.7); opacity: 0; transform: translateY(40px); }
.ha-go .ha-card { animation: ha-rise .9s cubic-bezier(.16,1,.3,1) forwards, ha-float 6s ease-in-out infinite; animation-delay: var(--d), calc(var(--d) + 1s); }
@keyframes ha-rise { to { opacity: 1; transform: none; } }
@keyframes ha-float { 0%,100% { transform: none; } 50% { transform: translateY(-8px); } }
.ha-card h5 { margin: 0 0 .2rem; font-size: .78rem; font-weight: 600; color: #94a3b8; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: center; }
.ha-card h5 b { color: #c4b5fd; font-weight: 600; }
.ha-big { font-size: 1.5rem; font-weight: 800; color: #f8fafc; line-height: 1.1; }
.ha-big small { font-size: .9rem; color: #64748b; font-weight: 600; margin-left: .2rem; }
.ha-up { font-size: .75rem; color: #4ade80; font-weight: 600; }
.ha-card svg { display: block; width: 100%; height: auto; overflow: visible; }
.ha-trend path.ln { fill: none; stroke: #60a5fa; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ha-trend path.area { fill: url(#haFade); opacity: 0; transition: opacity .8s .9s; }
.ha-trend.draw path.ln { transition: stroke-dashoffset 1.4s cubic-bezier(.65,0,.35,1); stroke-dashoffset: 0; }
.ha-trend.draw path.area { opacity: 1; }
.ha-trend circle { fill: #0f172a; stroke: #60a5fa; stroke-width: 2.5; opacity: 0; transition: opacity .2s; }
.ha-trend.draw circle { opacity: 1; transition-delay: calc(var(--i) * .2s + .2s); }
.ha-radar polygon.shape { fill: rgba(139,92,246,.28); stroke: #a78bfa; stroke-width: 2; transition: all .9s cubic-bezier(.16,1,.3,1); }
.ha-radar text { font-size: 9px; fill: #94a3b8; }
.ha-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-bottom: 6px; }
.ha-kpis > div { font-size: .72rem; color: #94a3b8; }
.ha-kpis .ha-big { font-size: 1.15rem; }
.ha-bars { display: flex; align-items: flex-end; gap: 4px; height: 44px; }
.ha-bars i { flex: 1; background: linear-gradient(#3b82f6,#1d4ed8); border-radius: 4px 4px 0 0; transform: scaleY(.04); transform-origin: bottom; transition: transform 1s cubic-bezier(.16,1,.3,1); }
.ha-bars i.hl { background: linear-gradient(#a78bfa,#7c3aed); }
.ha-bars i.grow { transform: none; }
.ha-bdays { display: flex; gap: 6px; font-size: .62rem; color: #64748b; margin-top: 4px; }
.ha-bdays span { flex: 1; text-align: center; }
.ha-deck .ha-card:first-child { grid-column: 1/-1; }
.ha-deck .ha-card:first-child svg { height: 52px; }
.ha-radar { height: 118px; }
/* Taller than 16:10 on purpose: three cards do not fit the screenshot frame. */
.ha-panel-stats { aspect-ratio: auto; min-height: 0; padding: .8rem 0; }
.ha-panel-stats .ha-big { font-size: 1.25rem; }
.ha-panel-stats .ha-card h5 { margin-bottom: .1rem; }
@media (max-width: 560px) { .ha-panel-stats { aspect-ratio: auto; padding: 1rem 0; } .ha-deck { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    .ha-go .ha-lines path { animation: none; stroke-dashoffset: 0; }
    .ha-go .ha-card { animation: none; opacity: 1; transform: none; }
    .ha-rot span, .ha-flip { transition: none; }
}
