/**
 * Phase B — UI v2 hub shell (gestiscisquadra.html)
 * Estratto da mockup-gestisci-ui-v2-temp.html — tab shell, eventi, giochi, profilo, bottom nav
 */

:root {
  --gestisci-shell-border: rgba(255, 255, 255, 0.08);
  --gestisci-shell-muted: #94a3b8;
  --gestisci-shell-cyan: #22d3ee;
  --gestisci-shell-yellow: #f9a825;
  --gestisci-shell-emerald: #4caf50;
  --gestisci-bottom-nav-h: 4.35rem;
}

body.gestisci-v2-shell {
  overflow: hidden;
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
}

.gestisci-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 32rem;
  margin: 0 auto;
  width: 100%;
}

.gestisci-app .app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem 0.65rem;
  border-bottom: 1px solid var(--gestisci-shell-border);
  background: rgba(2, 6, 23, 0.92);
}

.gestisci-app .app-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.gestisci-app .app-header-actions {
  display: flex;
  gap: 0.45rem;
}

.gestisci-app .hdr-btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.65rem;
  border: 1px solid var(--gestisci-shell-border);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.gestisci-app .hdr-btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.gestisci-app .screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.85rem calc(var(--gestisci-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(var(--gestisci-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.gestisci-app .screen-scroll.giochi-mode {
  padding: 0.65rem 0.8rem calc(var(--gestisci-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

.gestisci-app .tab-panel {
  display: none;
  animation: gestisciTabFade 0.22s ease;
}

.gestisci-app .tab-panel.active {
  display: block;
}

@keyframes gestisciTabFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.gestisci-app .tab-heading {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 0.1rem;
}

.gestisci-app .tab-sub {
  font-size: 0.74rem;
  color: var(--gestisci-shell-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.gestisci-app .section-title {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gestisci-shell-muted);
  margin: 0 0 0.45rem;
}

.gestisci-app .glass {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gestisci-shell-border);
  border-radius: 1rem;
}

.gestisci-app .team-context-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.08);
  border-radius: 0.85rem;
  font-size: 0.72rem;
  line-height: 1.35;
}

.gestisci-app .team-context-bar i {
  color: #67e8f9;
  flex-shrink: 0;
}

.gestisci-app .team-context-bar strong {
  color: #e2e8f0;
  font-weight: 800;
}

.gestisci-app .team-context-bar button {
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #67e8f9;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

.gestisci-app .hero-cta {
  padding: 1rem;
  margin-bottom: 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(15, 23, 42, 0.8));
}

.gestisci-app .hero-cta .kicker {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #67e8f9;
  margin-bottom: 0.2rem;
}

.gestisci-app .hero-cta .title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
}

.gestisci-app .hero-cta .sub {
  font-size: 0.74rem;
  color: var(--gestisci-shell-muted);
  margin-bottom: 0.55rem;
}

.gestisci-app .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  border: none;
  background: var(--gestisci-shell-cyan);
  color: #0f172a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.gestisci-app .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gestisci-app .event-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

.gestisci-app .event-row:active {
  opacity: 0.92;
}

.gestisci-app .event-row i {
  color: #4ade80;
  font-size: 1.05rem;
}

.gestisci-app .event-row-title {
  font-weight: 700;
  font-size: 0.84rem;
}

.gestisci-app .event-row-sub {
  font-size: 0.72rem;
  color: var(--gestisci-shell-muted);
}

.gestisci-app .giochi-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.gestisci-app .game-hero {
  position: relative;
  border-radius: 1.1rem;
  overflow: hidden;
  min-height: 10.75rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.gestisci-app .game-hero:active {
  transform: scale(0.985);
}

.gestisci-app .game-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gestisci-app .game-hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gestisci-app .game-hero-bg-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.62) 100%);
}

.gestisci-app .game-hero.summer .game-hero-bg-img {
  object-position: 72% center;
}

.gestisci-app .game-hero.bet .game-hero-bg-img {
  object-position: center;
}

.gestisci-app .game-hero.enigma .game-hero-bg-img {
  object-position: 85% center;
}

.gestisci-app .game-hero-content {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 10.75rem;
  padding: 0.95rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gestisci-app .game-hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.gestisci-app .hero-apri {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.gestisci-app .hero-apri:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gestisci-app .summer-logo {
  width: auto;
  height: 3.35rem;
  max-width: 10.5rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.55));
}

.gestisci-app .game-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gestisci-app .stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.gestisci-app .stat-value {
  font-size: 0.84rem;
  font-weight: 800;
  color: #fff8e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.gestisci-app .stat-label {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 248, 225, 0.62);
}

.gestisci-app .hero-apri.summer-apri {
  background: var(--gestisci-shell-yellow);
  color: #3e2723;
}

.gestisci-app .bet-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
}

.gestisci-app .bet-logo {
  width: 4.75rem;
  height: 5.25rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  border-radius: 0.65rem;
}

.gestisci-app .bet-copy {
  flex: 1;
  min-width: 0;
  margin: 0.1rem 0 0;
  font-size: 0.71rem;
  line-height: 1.48;
  color: rgba(200, 230, 201, 0.92);
  text-align: left;
}

.gestisci-app .hero-apri.bet-apri {
  background: var(--gestisci-shell-emerald);
  color: #1b5e20;
}

.gestisci-app .game-hero.enigma .enigma-logo {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  z-index: 2;
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(171, 71, 188, 0.55));
}

.gestisci-app .game-hero-content.enigma-layout {
  padding-left: 4.85rem;
  padding-right: 0.5rem;
}

.gestisci-app .enigma-title {
  margin: 0 0 0.3rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f3e5f5;
  font-style: italic;
}

.gestisci-app .enigma-copy {
  margin: 0 0 0.5rem;
  font-size: 0.71rem;
  line-height: 1.48;
  color: rgba(225, 190, 231, 0.88);
  max-width: 13.5rem;
}

.gestisci-app .enigma-progress-wrap {
  font-size: 0.67rem;
  font-weight: 700;
  color: #ce93d8;
  margin-bottom: 0.1rem;
}

.gestisci-app .enigma-progress {
  margin-top: 0.28rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  max-width: 8.5rem;
}

.gestisci-app .enigma-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ab47bc, #ce93d8);
  width: 0%;
}

.gestisci-app .hero-apri.enigma-apri {
  background: #ab47bc;
  color: #fff;
}

.gestisci-app .profilo-card {
  padding: 1rem;
  text-align: center;
  margin-bottom: 0.65rem;
}

.gestisci-app .profilo-card .avatar-lg {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  margin: 0 auto 0.5rem;
  background: rgba(34, 211, 238, 0.12);
  border: 2px solid rgba(34, 211, 238, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #67e8f9;
}

.gestisci-app .profilo-name {
  font-weight: 800;
}

.gestisci-app .profilo-email {
  font-size: 0.75rem;
  color: var(--gestisci-shell-muted);
  margin-top: 0.2rem;
}

.gestisci-app .profilo-fallback-link {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.72rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.1);
  color: #67e8f9;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.gestisci-app .team-list-empty {
  padding: 1rem 0.85rem;
  font-size: 0.75rem;
  color: var(--gestisci-shell-muted);
  text-align: center;
}

/* Phase C — multi-squadra switcher */
.gestisci-app .team-switcher {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 0.55rem;
  padding: 0.45rem 0 0.15rem;
  scrollbar-width: none;
}

.gestisci-app .team-switcher::-webkit-scrollbar {
  display: none;
}

.gestisci-app .team-switcher.hidden {
  display: none;
}

.gestisci-app .team-pill {
  flex-shrink: 0;
  position: relative;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--gestisci-shell-border);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gestisci-shell-muted);
  cursor: pointer;
  max-width: 9.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gestisci-app .team-pill.active {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

.gestisci-app .team-pill .pill-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.25rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #f472b6;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(15, 23, 42, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.gestisci-app .team-list-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gestisci-app .team-list-row:last-child {
  border-bottom: none;
}

.gestisci-app .team-list-row.active {
  background: rgba(34, 211, 238, 0.08);
}

.gestisci-app .team-list-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 0;
}

.gestisci-app .team-list-chevron {
  color: var(--gestisci-shell-muted);
}

.gestisci-app .role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--gestisci-shell-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--gestisci-shell-muted);
}

.gestisci-app .role-pill.captain {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.1);
}

.gestisci-app .role-pill.vice {
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.1);
}

.gestisci-app .role-pill.member {
  color: #94a3b8;
}

/* Phase D — profilo inline sections */
.gestisci-app .profilo-card-clickable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.gestisci-app .profilo-card-clickable:hover,
.gestisci-app .profilo-card-clickable:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.gestisci-app .profilo-edit-hint {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--gestisci-shell-cyan);
}

.gestisci-app .profilo-section {
  margin-bottom: 0.55rem;
  padding: 0;
  overflow: hidden;
}

.gestisci-app #panel-profilo .profilo-section:last-of-type {
  margin-bottom: 0.85rem;
}

.gestisci-app .profilo-section summary {
  list-style: none;
  cursor: pointer;
  padding: 0.72rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gestisci-app .profilo-section summary::-webkit-details-marker {
  display: none;
}

.gestisci-app .profilo-section-badge {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gestisci-app .profilo-section-body {
  padding: 0 0.85rem 0.75rem;
}

.gestisci-app .profilo-notif-card {
  padding: 0.72rem;
  margin-bottom: 0.45rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.gestisci-app .profilo-notif-muted {
  opacity: 0.85;
}

.gestisci-app .profilo-notif-title {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
}

.gestisci-app .profilo-notif-sub {
  margin: 0;
  font-size: 0.68rem;
  color: var(--gestisci-shell-muted);
}

.gestisci-app .profilo-notif-pending {
  color: #fde68a;
}

.gestisci-app .profilo-notif-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.gestisci-app .profilo-notif-btn {
  padding: 0.45rem 0.5rem;
  font-size: 0.68rem;
}

.gestisci-app .profilo-notif-accept {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}

.gestisci-app .profilo-notif-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gestisci-app .profilo-notif-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  cursor: pointer;
}

.gestisci-app .profilo-storico-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gestisci-app .profilo-storico-row:last-child {
  border-bottom: none;
}

.gestisci-app .profilo-storico-locale {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.gestisci-app .profilo-storico-sub {
  font-size: 0.65rem;
  color: var(--gestisci-shell-muted);
}

.gestisci-app .profilo-storico-date {
  font-size: 0.68rem;
  color: var(--gestisci-shell-cyan);
  white-space: nowrap;
}

.gestisci-app .profilo-password-banner {
  padding: 0.85rem;
  margin-bottom: 0.55rem;
  border-left: 3px solid var(--gestisci-shell-cyan);
}

.gestisci-app .profilo-password-banner p {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.gestisci-app .profilo-account-hint {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  color: var(--gestisci-shell-muted);
}

.gestisci-app .profilo-account-btn {
  width: 100%;
  margin-bottom: 0.45rem;
}

.gestisci-app .profilo-create-team {
  width: 100%;
  margin: 0.45rem 0 0.55rem;
  border-style: dashed;
}

.gestisci-app .profilo-role-legend {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  color: var(--gestisci-shell-muted);
  line-height: 1.45;
}

#gestisci-bottom-nav.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-width: 32rem;
  margin: 0 auto;
  flex-shrink: 0;
  overflow: visible;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--gestisci-shell-border);
  padding: 0.45rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
}

#gestisci-bottom-nav .bar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  overflow: visible;
}

#gestisci-bottom-nav .tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 3rem;
  border: none;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.56rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0.55rem;
  position: relative;
  overflow: visible;
}

#gestisci-bottom-nav .tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.35rem;
}

#gestisci-bottom-nav .tab-btn i {
  font-size: 1.05rem;
}

#gestisci-bottom-nav .tab-btn.active {
  color: var(--gestisci-shell-cyan);
  background: rgba(34, 211, 238, 0.08);
}

#gestisci-bottom-nav .tab-btn.squadra.active {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  box-shadow: inset 0 2px 0 rgba(251, 191, 36, 0.55), 0 0 18px rgba(251, 191, 36, 0.18);
}

#gestisci-bottom-nav .tab-btn.games.active {
  color: #e1bee7;
  background: rgba(123, 31, 162, 0.28);
  box-shadow: inset 0 2px 0 #ab47bc, 0 0 18px rgba(123, 31, 162, 0.3);
}

#gestisci-bottom-nav .nav-badge {
  position: absolute;
  top: -0.4rem;
  right: -0.55rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(15, 23, 42, 0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
