/* GoalGrid — unified layout + dashboard topbar v4.2.8.27.331 */

body.gg-layout-shell {
  --gg-layout-max: 1180px;
  --gg-layout-gutter: max(1rem, calc((100vw - var(--gg-layout-max)) / 2));
  --topbar-h: 60px;
  background: var(--gg-brand-secondary, #061019);
}

body.gg-layout-shell .app-sidebar {
  display: none !important;
}

/* ── Dashboard topbar (stejný na všech stránkách) ── */
body.gg-layout-shell.livesport-theme .site-topbar {
  position: fixed;
  top: 0;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  height: var(--topbar-h) !important;
  min-height: var(--topbar-h) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 0.75rem !important;
  padding-left: var(--gg-layout-gutter) !important;
  padding-right: var(--gg-layout-gutter) !important;
  background: rgba(6, 16, 25, 0.82) !important;
  backdrop-filter: blur(14px) saturate(1.12);
  border-bottom: 1px solid var(--gg-brand-primary-border, rgba(53, 224, 194, 0.28)) !important;
  box-shadow: none !important;
  z-index: 100;
}

body.gg-layout-shell.livesport-theme .topbar-mobile-brand b {
  color: var(--gg-brand-primary) !important;
}

/* PWA / mobile — back navigation (no browser chrome in standalone) */
body.gg-layout-shell .topbar-back-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: #f3f7fb;
  border-radius: 12px;
  min-height: 40px;
  min-width: 40px;
  padding: 0 0.55rem;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

body.gg-layout-shell .topbar-back-btn:hover {
  border-color: var(--gg-brand-primary-border, rgba(53, 224, 194, 0.28));
  background: rgba(53, 224, 194, 0.08);
  color: #fff;
}

body.gg-layout-shell.gg-has-topbar-back .topbar-back-btn:not([hidden]) {
  display: inline-flex;
}

body.gg-layout-shell .topbar-back-label {
  display: none;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

@media (min-width: 721px) {
  body.gg-layout-shell.gg-has-topbar-back .topbar-back-label {
    display: inline;
  }

  body.gg-layout-shell.gg-has-topbar-back .topbar-back-btn:not([hidden]) {
    margin-right: 0.15rem;
  }
}

body.gg-layout-shell.livesport-theme .topbar-search-shell {
  display: flex !important;
  flex: 0 1 280px !important;
  min-width: 220px !important;
  max-width: 300px !important;
}

body.gg-layout-shell.livesport-theme .topbar-search-form {
  width: 100%;
}

body.gg-layout-shell.livesport-theme .topbar-search-form input {
  min-width: 0 !important;
  width: 100%;
  font-size: 0.82rem;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f7fb;
}

body.gg-layout-shell.livesport-theme .mobile-search-trigger {
  display: none !important;
}

body.gg-layout-shell.livesport-theme .topbar-nav.unified-topbar-nav {
  flex: 1 1 auto;
  display: flex !important;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}

body.gg-layout-shell.livesport-theme .unified-topbar-nav a {
  min-height: 40px;
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
}

body.gg-layout-shell.livesport-theme .unified-topbar-nav a:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

body.gg-layout-shell.livesport-theme .unified-topbar-nav a.active {
  color: #fff !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: inset 0 -2px 0 var(--gg-brand-primary);
}

body.gg-layout-shell.livesport-theme .unified-topbar-nav a .nav-badge {
  font-size: 0.62rem;
  padding: 0.12rem 0.38rem;
  background: var(--gg-brand-primary-soft) !important;
  color: var(--gg-brand-primary) !important;
  border: 1px solid var(--gg-brand-primary-border);
  font-weight: 800;
}

body.gg-layout-shell.livesport-theme .topbar-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

body.gg-layout-shell.livesport-theme .language-switcher-button,
body.gg-layout-shell.livesport-theme .account-trigger,
body.gg-layout-shell.livesport-theme .account-logout-btn {
  min-height: 40px;
  padding: 0.42rem 0.65rem;
  border-radius: 12px;
  font-size: 0.78rem;
  white-space: nowrap;
}

body.gg-layout-shell.livesport-theme .theme-toggle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
}

body.gg-layout-shell .site-shell.football-shell {
  width: min(var(--gg-layout-max), calc(100% - 2rem)) !important;
  max-width: var(--gg-layout-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: var(--topbar-h) !important;
  padding: 1.25rem 0 calc(2.5rem + env(safe-area-inset-bottom, 0)) !important;
}

body.gg-layout-shell .site-trust-footer,
body.gg-layout-shell .site-trust-footer.site-footer-v101 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Compact footer — tool/dashboard pages (leagues, matches, predictions…) */
body.gg-layout-shell .site-trust-footer.site-footer-compact {
  display: block !important;
  margin-top: 0.75rem;
  margin-left: 0 !important;
  padding: 0.75rem max(1rem, var(--gg-layout-gutter)) calc(0.85rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(6, 16, 25, 0.96);
}

.site-footer-compact-inner {
  width: min(var(--gg-layout-max), calc(100% - 2rem));
  max-width: var(--gg-layout-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.site-footer-compact-copy {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.82);
}

.site-footer-compact-copy strong {
  color: #f1f5f9;
  font-weight: 800;
}

.site-footer-compact-age {
  color: #35e0c2;
  font-weight: 800;
}

.site-footer-compact-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.85rem;
}

.site-footer-compact-nav a {
  font-size: 0.71rem;
  font-weight: 600;
  color: #8aa0b2;
  text-decoration: none;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background: none !important;
}

.site-footer-compact-nav a:hover {
  color: #35e0c2;
}

.site-footer-compact-note {
  margin: 0;
  max-width: 36rem;
  font-size: 0.62rem;
  line-height: 1.45;
  color: rgba(100, 116, 139, 0.92);
}

body.gg-layout-shell.gg-footer-compact-page .nt-hub-shell,
body.gg-layout-shell.gg-footer-compact-page main.site-shell.football-shell {
  min-height: 0 !important;
  padding-bottom: 0.5rem !important;
}

.site-trust-footer.site-footer-hidden {
  display: none !important;
}

@media (max-width: 640px) {
  body.gg-layout-shell .site-trust-footer.site-footer-compact {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0));
  }
}

body.gg-layout-shell .site-footer-v101 .site-footer-inner {
  width: min(var(--gg-layout-max), calc(100% - 2rem)) !important;
  max-width: var(--gg-layout-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.gg-layout-shell.gg-layout-full-bleed .site-shell.football-shell {
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.gg-layout-shell.gg-layout-narrow {
  --gg-layout-max: 720px;
}

@media (min-width: 721px) and (max-width: 1040px) {
  body.gg-layout-shell.livesport-theme .topbar-search-shell {
    flex-basis: 240px !important;
    min-width: 200px !important;
    max-width: 260px !important;
  }

  body.gg-layout-shell.livesport-theme .unified-topbar-nav a {
    padding-inline: 0.5rem;
    font-size: 0.74rem;
  }
}

@media (max-width: 720px) {
  body.gg-layout-shell {
    --topbar-h: 64px;
    --gg-layout-gutter: 0.75rem;
  }

  body.gg-layout-shell.livesport-theme .site-topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px auto auto;
    align-items: center;
    height: var(--topbar-h) !important;
    min-height: var(--topbar-h) !important;
    padding-left: var(--gg-layout-gutter) !important;
    padding-right: var(--gg-layout-gutter) !important;
  }

  body.gg-layout-shell.gg-has-topbar-back.livesport-theme .site-topbar {
    grid-template-columns: auto minmax(0, 1fr) 42px auto auto;
  }

  body.gg-layout-shell.gg-has-topbar-back .topbar-mobile-brand span {
    max-width: 108px;
  }

  body.gg-layout-shell.livesport-theme .topbar-nav.unified-topbar-nav {
    display: none !important;
  }

  body.gg-layout-shell.livesport-theme .topbar-search-shell {
    display: none !important;
  }

  body.gg-layout-shell.livesport-theme .mobile-search-trigger {
    display: inline-grid !important;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    color: #fff !important;
  }

  body.gg-layout-shell .site-shell.football-shell {
    width: calc(100% - 1.24rem) !important;
    max-width: none !important;
    margin-top: calc(var(--topbar-h) + 0.1rem) !important;
    padding: 0.65rem 0 calc(4.75rem + env(safe-area-inset-bottom, 0)) !important;
  }
}

/* AI confidence explainer modal */
.gg-ai-confidence-trigger {
  cursor: pointer;
}

.gg-ai-confidence-trigger:focus-visible {
  outline: 2px solid rgba(53, 224, 194, 0.75);
  outline-offset: 2px;
}

.gg-ai-confidence-inline-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #35e0c2;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline dotted rgba(53, 224, 194, 0.45);
  text-underline-offset: 0.15em;
}

.gg-ai-confidence-inline-btn:hover {
  color: #49e5c7;
}

.gg-ai-confidence-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gg-ai-confidence-modal[hidden] {
  display: none !important;
}

.gg-ai-confidence-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.28);
  backdrop-filter: blur(10px) brightness(0.72);
  -webkit-backdrop-filter: blur(10px) brightness(0.72);
}

.gg-ai-confidence-panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 1.2rem 1.15rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(53, 224, 194, 0.28);
  background: linear-gradient(165deg, rgba(14, 26, 40, 0.98), rgba(6, 12, 20, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
}

.gg-ai-confidence-modal[data-tone="high"] .gg-ai-confidence-value {
  color: #4ade80;
}

.gg-ai-confidence-modal[data-tone="signal"] .gg-ai-confidence-value {
  color: #35e0c2;
}

.gg-ai-confidence-modal[data-tone="low"] .gg-ai-confidence-value {
  color: #94a3b8;
}

.gg-ai-confidence-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.gg-ai-confidence-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.gg-ai-confidence-value {
  margin: 0 0 0.2rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.gg-ai-confidence-tier {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gg-ai-confidence-modal[data-tone="signal"] .gg-ai-confidence-tier {
  color: #fde68a;
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.32);
}

.gg-ai-confidence-modal[data-tone="high"] .gg-ai-confidence-tier {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.28);
}

.gg-ai-confidence-intro {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.92);
}

.gg-ai-confidence-intro p {
  margin: 0 0 0.55rem;
}

.gg-ai-confidence-intro p:last-child {
  margin-bottom: 0;
}

.gg-ai-confidence-calc-title {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(53, 224, 194, 0.85);
}

.gg-ai-confidence-list {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.gg-ai-confidence-list li + li {
  margin-top: 0.35rem;
}

.gg-ai-confidence-range-note {
  margin: 0.75rem 0 0.85rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(234, 179, 8, 0.22);
  background: rgba(234, 179, 8, 0.08);
  font-size: 0.86rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.gg-ai-confidence-modal[data-tone="high"] .gg-ai-confidence-range-note {
  border-color: rgba(53, 224, 194, 0.22);
  background: rgba(53, 224, 194, 0.08);
}

.gg-ai-confidence-note {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.gg-ai-confidence-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 2px solid #35e0c2;
  border-radius: 999px;
  background: #35e0c2;
  color: #061019;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

/* CLV help explainer modal */
.gg-clv-help-trigger {
  cursor: pointer;
}

.gg-clv-help-trigger:focus-visible {
  outline: 2px solid rgba(53, 224, 194, 0.75);
  outline-offset: 2px;
}

.gg-clv-help-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gg-clv-help-modal[hidden] {
  display: none !important;
}

.gg-clv-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.28);
  backdrop-filter: blur(10px) brightness(0.72);
  -webkit-backdrop-filter: blur(10px) brightness(0.72);
}

.gg-clv-help-panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 1.2rem 1.15rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(53, 224, 194, 0.28);
  background: linear-gradient(165deg, rgba(14, 26, 40, 0.98), rgba(6, 12, 20, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
}

.gg-clv-help-modal[data-tone="positive"] .gg-clv-help-value {
  color: #4ade80;
}

.gg-clv-help-modal[data-tone="negative"] .gg-clv-help-value {
  color: #f87171;
}

.gg-clv-help-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.gg-clv-help-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
}

.gg-clv-help-value {
  margin: 0 0 0.2rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.gg-clv-help-tier {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gg-clv-help-intro {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.92);
}

.gg-clv-help-intro p {
  margin: 0 0 0.55rem;
}

.gg-clv-help-intro p:last-child {
  margin-bottom: 0;
}

.gg-clv-help-calc-title {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(53, 224, 194, 0.85);
}

.gg-clv-help-list {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.gg-clv-help-list li + li {
  margin-top: 0.35rem;
}

.gg-clv-help-range-note {
  margin: 0.75rem 0 0.85rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(53, 224, 194, 0.22);
  background: rgba(53, 224, 194, 0.08);
  font-size: 0.86rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.gg-clv-help-filter-note {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #94a3b8;
}

.gg-clv-help-note {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.gg-clv-help-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 2px solid #35e0c2;
  border-radius: 999px;
  background: #35e0c2;
  color: #061019;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}
