/* Academy Hub launcher. Same pixel-RPG look as the academies (fonts are the academies' own OFL fonts). */
@font-face { font-family: "Press Start 2P"; src: url("/it/fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("/it/fonts/VT323-Regular.ttf") format("truetype"); font-display: swap; }
:root { --px: "Press Start 2P", ui-monospace, monospace; --vt: "VT323", ui-monospace, monospace; --gold: #ffd166; --ink: #080a1e; }
[data-theme="dark"] { --bg: #0d0b1a; --card: #141a52; --card2: #1d2366; --text: #f4f1ff; --muted: #b9bde8; --line: #f4f1ff; --accent: #8fb3ff; color-scheme: dark; }
[data-theme="light"] { --bg: #eef0fb; --card: #ffffff; --card2: #f1f3ff; --text: #141a52; --muted: #4b5280; --line: #141a52; --accent: #2848c9; color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[data-theme="dark"] body { background: #0d0b1a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='1' height='1' x='3' y='5' fill='%23ffffff' fill-opacity='.05'/%3E%3C/svg%3E"); }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #141a52; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hub-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: calc(60px + var(--sa-t)); padding: var(--sa-t) max(12px, var(--sa-r)) 0 max(12px, var(--sa-l));
  background: linear-gradient(180deg, #232c7a, #141a52); border-bottom: 3px solid var(--ink); color: #fff; }
@media (min-width: 760px) { .hub-top { padding-left: 20px; } }
.hub-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--px); font-size: .78rem; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.hub-brand img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.hub-brand b { color: #fff; font-weight: 400; }
.hub-top-right { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.hub-chip, .hub-icon { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; color: #fff; text-decoration: none;
  background: #0f1440; border: 2px solid #8090ff; border-radius: 6px; font: 600 .9rem system-ui, sans-serif; cursor: pointer; max-width: 46vw; }
.hub-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-icon { padding: 0; font-size: 1.1rem; }
.hub-main { padding: 16px max(14px, var(--sa-r)) 28px max(14px, var(--sa-l)); max-width: 1200px; margin: 0 auto; outline: none; }
@media (min-width: 760px) { .hub-main { padding: 22px 24px 32px; } }
.hub-hello { margin: 4px 0 16px; color: var(--muted); font-family: var(--vt); font-size: 1.35rem; line-height: 1.2; }
.hub-apps { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hub-apps { grid-template-columns: 1fr 1fr; } }
.app-card { position: relative; padding: 16px; border-radius: 10px; background: var(--card); color: var(--text); border: 3px solid var(--line); box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 3px #0006; min-width: 0; }
.app-card.it { background: linear-gradient(160deg, #1e3a8a, #141a52 70%); color: #fff; }
.app-card.ai { background: linear-gradient(160deg, #5b21b6, #2a1060 70%); color: #fff; }
.app-card.last::before { content: "LAST PLAYED"; position: absolute; right: 12px; top: -12px; font-family: var(--px); font-size: .5rem; padding: 5px 7px; background: var(--gold); color: #141a52; border: 2px solid var(--ink); }
.ac-head { display: flex; gap: 12px; align-items: flex-start; }
.ac-ic { font-size: 2.3rem; line-height: 1; flex: none; }
.app-card h2 { margin: 2px 0 6px; font-family: var(--px); font-size: .95rem; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); line-height: 1.4; }
.ac-sub { margin: 0; font-size: .9rem; color: #dfe2ff; }
.ac-stats { margin: 12px 0; }
.ac-lv { display: flex; align-items: center; gap: 10px; font-family: var(--vt); font-size: 1.35rem; }
.ac-lv .bar { flex: 1; height: 12px; background: #0008; border: 2px solid #f4f1ff; }
.ac-lv .bar i { display: block; height: 100%; background: var(--gold); }
.ac-facts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; color: #e8eaff; }
.ac-actions, .row { display: flex; flex-wrap: wrap; gap: 8px; }
.hbtn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border-radius: 6px; cursor: pointer; text-decoration: none;
  font: 700 .95rem system-ui, sans-serif; color: #fff; background: #2b3a9e; border: 2px solid #f4f1ff; box-shadow: 0 0 0 2px var(--ink); }
.hbtn.primary { background: var(--gold); color: #141a52; }
.hbtn:disabled { opacity: .7; cursor: default; }
.hbtn:active { transform: translateY(1px); }
.hub-panels { display: grid; gap: 14px; margin-top: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .hub-panels { grid-template-columns: 1fr 1fr; } }
.panel { padding: 14px 16px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 0 0 2px var(--ink); border-radius: 8px; min-width: 0; }
.panel h3 { margin: 0 0 8px; font-family: var(--px); font-size: .72rem; color: var(--gold); line-height: 1.6; }
[data-theme="light"] .panel h3 { color: #7a4b00; }
.panel p { margin: 8px 0; }
.howto summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--accent); }
.howto ol { margin: 4px 0 8px; padding-left: 1.3em; }
.howto li { margin: 4px 0; }
.hub-foot { margin-top: 22px; }
/* unfolded and roomy: bigger cards */
@media (min-width: 760px) and (min-height: 600px) { .app-card { padding: 22px; } .app-card h2 { font-size: 1.1rem; } .ac-ic { font-size: 3rem; } }
/* two reported viewport segments (fold hinge): one academy per side */
@media (horizontal-viewport-segments: 2) {
  .hub-apps, .hub-panels { grid-template-columns: 1fr 1fr; column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px) + 28px); }
}
@media (max-width: 380px) { .hub-brand span { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }
.ac-lv .small { font-size: 1.15rem; white-space: nowrap; }
