/* ============================================================
 * ACPU14 - style.css
 * Fogli di stile condivisi per Athletics Challenge Province U14
 * ============================================================ */

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(ellipse at bottom, #0d47a1 0%, #061428 100%);
    min-height: 100vh;
    color: #fff;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ===== SFONDO: STELLE ===== */
.stars {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}
@keyframes twinkle {
    0%   { opacity: .2; transform: scale(1); }
    100% { opacity: 1;  transform: scale(1.3); }
}

/* ===== SFONDO: NEBBIA ===== */
.fog {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(3,169,244,.18) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(21,101,192,.15) 0%, transparent 45%);
    z-index: 1;
    pointer-events: none;
}

/* ===== CONTENITORI ===== */
.main-container {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}
.main-container.scrollable {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ===== SFERA (provinces fluttuanti) ===== */
.sfere-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none;
}
.sfera {
    position: absolute;
    width: min(70px, 12vw);
    height: min(70px, 12vw);
    border-radius: 50%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.3);
    pointer-events: auto;
    cursor: pointer;
    transition: all .2s ease;
    animation: float 15s infinite alternate;
    will-change: transform;
    border: 2px solid rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: min(16px, 4vw);
    text-shadow: 1px 1px 2px rgba(0,0,0,.5);
}
.sfera::after {
    content: '';
    position: absolute;
    top: 5%; left: 10%;
    width: 30%; height: 30%;
    background: radial-gradient(circle, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}
.sfera:hover {
    transform: scale(1.3) !important;
    z-index: 1000;
    box-shadow: 0 15px 30px rgba(0,0,0,.7), 0 0 0 3px gold;
    animation-play-state: paused;
}
@keyframes float {
    0%   { transform: translate(0,0) rotate(0deg); }
    25%  { transform: translate(20px,-15px) rotate(3deg); }
    50%  { transform: translate(-15px,20px) rotate(-3deg); }
    75%  { transform: translate(20px,10px) rotate(2deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}

/* ===== LOGO CENTRALE ===== */
.central-logo {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(280px, 50vw);
    height: min(280px, 50vw);
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 40px rgba(3,169,244,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: pulseGlow 2s infinite alternate;
    border: 3px solid rgba(255,215,0,.6);
    overflow: hidden;
    cursor: pointer;
}
.central-logo img {
    width: 90%; height: 90%;
    object-fit: contain;
}
.central-logo .fallback {
    font-size: min(60px, 14vw);
    font-weight: 900;
    color: #1565c0;
    letter-spacing: 2px;
}
@keyframes pulseGlow {
    0%   { box-shadow: 0 0 30px rgba(3,169,244,.6); transform: translate(-50%,-50%) scale(1); }
    100% { box-shadow: 0 0 60px rgba(255,215,0,.7); transform: translate(-50%,-50%) scale(1.03); }
}

/* ===== COUNTER ===== */
.societa-counter {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 10px 16px;
    border: 1px solid rgba(255,215,0,.3);
    z-index: 200;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
    font-size: .8rem;
}
.counter-number {
    font-size: 1.3rem;
    color: gold;
    margin-right: 3px;
}
.societa-counter i { font-size: 1rem; color: gold; }

/* ===== COUNTDOWN (home) ===== */
.countdown-box {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 12px 15px;
    border: 1px solid rgba(255,215,0,.3);
    z-index: 200;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
    max-width: 85%;
    text-decoration: none;
}
.countdown-label {
    font-size: .7rem;
    color: gold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-align: center;
}
.countdown-numbers {
    display: flex;
    gap: 8px;
}
.countdown-item {
    text-align: center;
    min-width: 40px;
}
.countdown-number {
    font-size: 1.2rem;
    font-weight: 900;
    background: rgba(255,255,255,.1);
    color: #f59e0b;
    padding: 4px 0;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.2);
}
.countdown-item span:last-child {
    font-size: .55rem;
    opacity: .7;
    display: block;
    margin-top: 2px;
}

/* Countdown "compatto" (App) */
.countdown-compact {
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 15px 20px;
    margin-bottom: 30px;
    border: 2px solid rgba(255,215,0,.3);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.countdown-compact .countdown-label {
    font-size: .8rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}
.countdown-compact .countdown-numbers {
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.countdown-compact .countdown-item { min-width: 50px; }
.countdown-compact .countdown-number {
    font-size: 1.8rem;
    padding: 5px;
}
.countdown-compact .countdown-item span:last-child {
    font-size: .6rem;
    margin-top: 3px;
}

/* ===== BOTTONI ===== */
.buttons-panel {
    position: absolute;
    bottom: 15px; left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
    flex-wrap: wrap;
    padding: 0 10px;
}
.btn {
    pointer-events: auto;
    padding: 10px 14px;
    border-radius: 40px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s ease;
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(10px);
    background: rgba(0,0,0,.5);
    font-size: .75rem;
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
    min-height: 40px;
}
.btn:hover {
    transform: translateY(-3px);
    border-color: gold;
    background: rgba(0,0,0,.8);
}

/* Bottone "Torna alla home" grande */
.back-home { text-align: center; margin: 20px 0; }
.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    border-radius: 60px;
    border: 2px solid gold;
    font-weight: 700;
    transition: all .3s;
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.btn-home:hover {
    background: rgba(0,0,0,.9);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(3,169,244,.5);
}

/* ===== HEADER APP ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 10px 20px;
    border: 2px solid rgba(255,215,0,.3);
    box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.small-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid gold;
    flex-shrink: 0;
}
.small-logo img { width: 90%; height: 90%; object-fit: contain; }
.small-logo .fallback {
    font-size: 1rem;
    font-weight: 900;
    color: #1565c0;
}
.app-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(3,169,244,.8);
    text-align: center;
    padding: 0 10px;
    line-height: 1.2;
}
.home-link {
    color: white;
    font-size: 1.8rem;
    opacity: .8;
    transition: all .3s;
    flex-shrink: 0;
}
.home-link:hover { opacity: 1; transform: scale(1.1); color: gold; }

/* ===== GRIGLIA CARD APP ===== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    flex: 1;
}
.app-card {
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255,215,0,.2);
    border-radius: 30px;
    padding: 25px 20px;
    text-decoration: none;
    color: white;
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,.5);
    position: relative;
    overflow: hidden;
}
.app-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(3,169,244,.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity .5s;
    pointer-events: none;
}
.app-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: gold;
    background: rgba(0,0,0,.8);
    box-shadow: 0 25px 50px rgba(3,169,244,.5);
}
.app-card:hover::before { opacity: 1; }

.card-icon {
    font-size: 3.5rem;
    color: gold;
    filter: drop-shadow(0 0 15px rgba(255,215,0,.5));
}
.card-apex {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255,215,0,.5));
}
.card-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(3,169,244,.8);
}
.card-subtitle {
    font-size: .95rem;
    opacity: .8;
    color: #ddd;
}
.card-badge {
    background: gold;
    color: #061428;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,.3);
}

/* ===== CARD SQUADRA (dettaglio provincia) ===== */
.card-squadra {
    max-width: 620px;
    width: 100%;
    margin: 40px auto;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(12px);
    border: 2px solid gold;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    animation: fadeIn .4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.logo-box {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid gold;
    box-shadow: 0 0 30px rgba(255,215,0,.5);
    overflow: hidden;
}
.logo-box img { width: 90%; height: 90%; object-fit: contain; }
.logo-box .fallback {
    font-size: 3rem;
    font-weight: 900;
    color: #1565c0;
    letter-spacing: 4px;
}
.card-squadra h1 {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-shadow: 0 0 15px rgba(3,169,244,.6);
}
.regione {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,215,0,.15);
    color: gold;
    border: 1px solid rgba(255,215,0,.5);
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.info-list {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.05);
    padding: 12px 18px;
    border-radius: 12px;
    border-left: 3px solid #03a9f4;
}
.info-item i {
    color: #03a9f4;
    width: 20px;
    font-size: 1.1rem;
}
.info-item .label {
    flex: 1;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .7;
}
.info-item .value { font-weight: 700; color: #fff; }

/* Badge stato */
.badge-stato {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}
.badge-stato.confermata { background: #1b5e20; color: #a5d6a7; border: 1px solid #4caf50; }
.badge-stato.attesa     { background: #e65100; color: #ffcc80; border: 1px solid #ff9800; }
.badge-stato.ritirata   { background: #b71c1c; color: #ef9a9a; border: 1px solid #f44336; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 30px;
    background: rgba(255,255,255,.08);
    border: 2px solid gold;
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: all .2s ease;
}
.btn-back:hover {
    background: rgba(255,215,0,.15);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,.4);
}

/* ===== NO SQUADRE / MESSAGGI ===== */
.no-squadre {
    position: absolute;
    top: 80%; left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    color: gold;
    font-weight: 600;
    background: rgba(0,0,0,.5);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,215,0,.4);
    font-size: .9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .btn { padding: 8px 10px; font-size: .65rem; }
    .countdown-number { font-size: 1rem; }
    .countdown-item { min-width: 30px; }
    .societa-counter { padding: 8px 12px; font-size: .7rem; }
    .counter-number { font-size: 1.1rem; }
    .app-header { padding: 5px 15px; }
    .small-logo { width: 50px; height: 50px; }
    .app-title { font-size: 1rem; }
    .card-title { font-size: 1.2rem; }
    .card-icon { font-size: 2.8rem; }
    .card-apex { width: 90px; height: 90px; }
    .card-squadra { padding: 30px 20px; }
    .logo-box { width: 140px; height: 140px; }
    .card-squadra h1 { font-size: 1.5rem; }
    .countdown-compact .countdown-number { font-size: 1.4rem; }
    .countdown-compact .countdown-item { min-width: 40px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .central-logo { width: 120px; height: 120px; }
    .btn { padding: 6px 10px; font-size: .65rem; }
    .countdown-box { padding: 8px 12px; }
    .countdown-number { font-size: 1rem; }
}

/* ===== Esigenze alimentari (checkbox grid) ===== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    cursor: pointer;
    transition: .2s;
    background: rgba(255,255,255,.03);
    font-size: .9rem;
}
.checkbox-item:hover {
    border-color: gold;
    background: rgba(255,215,0,.06);
}
.checkbox-item input[type="checkbox"] {
    accent-color: gold;
    cursor: pointer;
}

/* ===== Badge "Alim." in tabella ===== */
.badge-alim {
    display: inline-block;
    padding: 3px 8px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255,152,0,.15);
    color: #ff9800;
    border: 1px solid rgba(255,152,0,.4);
    cursor: help;
}