/* Tournament Hub v4.6 — reversible visual design-system overrides */
:root{
  --th-bg:#f5f7f8;
  --th-surface:#ffffff;
  --th-surface-soft:#f8fafb;
  --th-text:#172229;
  --th-muted:#687680;
  --th-heading:#13232b;
  --th-line:#dfe5e8;
  --th-line-strong:#cbd5da;
  --th-brand:#213a46;
  --th-brand-hover:#182f3a;
  --th-brand-soft:#e8f0f3;
  --th-success-bg:#e8f4eb;
  --th-success-text:#285f39;
  --th-warning-bg:#fff4d6;
  --th-warning-text:#7c5a00;
  --th-danger-bg:#ffe5e2;
  --th-danger-text:#8b3026;
  --th-info-bg:#e8f3ff;
  --th-radius-xs:7px;
  --th-radius-sm:9px;
  --th-radius-md:12px;
  --th-radius-lg:16px;
  --th-radius-xl:22px;
  --th-shadow-sm:0 1px 2px rgba(20,34,42,.04);
  --th-shadow-md:0 8px 24px rgba(20,34,42,.08);
  --th-space-1:4px;
  --th-space-2:8px;
  --th-space-3:12px;
  --th-space-4:16px;
  --th-space-5:24px;
  --th-space-6:32px;
  --th-space-7:48px;
  --th-control-h:42px;
  --th-control-h-sm:34px;
  --th-font-xs:.75rem;
  --th-font-sm:.875rem;
  --th-font-md:1rem;
  --th-font-lg:1.2rem;
  --th-font-xl:1.6rem;
  --th-font-2xl:2.1rem;
}

body:not(.display-body){background:var(--th-bg);color:var(--th-text);font-size:15.5px;line-height:1.55}
body:not(.display-body) h1,body:not(.display-body) h2,body:not(.display-body) h3{color:var(--th-heading);letter-spacing:-.018em}
body:not(.display-body) h1{line-height:1.08}
body:not(.display-body) h2{line-height:1.15}
body:not(.display-body) h3{line-height:1.25}
body:not(.display-body) p{line-height:1.58}
.muted,.hint,.help{color:var(--th-muted)}

/* Consistent global header and content gutters */
.top{min-height:68px;height:auto;padding:10px 24px;gap:16px}
.landing,.public-shell{padding:var(--th-space-6) 24px}
.workspace{padding:var(--th-space-6)}
.heading{gap:var(--th-space-5);margin-bottom:var(--th-space-5)}
.heading h1{font-size:clamp(1.8rem,3vw,2.45rem);margin:2px 0 5px}
.eyebrow{font-size:var(--th-font-xs);letter-spacing:.075em}

/* Standard buttons */
.btn{
  min-height:var(--th-control-h);
  padding:9px 15px;
  border-radius:var(--th-radius-sm);
  border-color:var(--th-line-strong);
  font-size:var(--th-font-sm);
  font-weight:700;
  line-height:1.15;
  box-shadow:var(--th-shadow-sm);
  transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .05s ease;
}
.btn:hover{border-color:#aebcc3;box-shadow:0 3px 10px rgba(20,34,42,.08)}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--th-brand);border-color:var(--th-brand);color:#fff}
.btn.primary:hover{background:var(--th-brand-hover);border-color:var(--th-brand-hover)}
.btn.secondary{background:var(--th-brand-soft)}
.btn.ghost{box-shadow:none}
.btn.small{min-height:var(--th-control-h-sm);padding:6px 10px;font-size:.8rem}

/* Forms and controls */
label{gap:var(--th-space-2);font-size:.875rem;font-weight:700}
input,select,textarea{
  min-height:var(--th-control-h);
  border:1px solid var(--th-line-strong);
  border-radius:var(--th-radius-sm);
  padding:9px 11px;
  color:var(--th-text);
  background:var(--th-surface);
  line-height:1.3;
}
textarea{min-height:92px;resize:vertical}
input:hover,select:hover,textarea:hover{border-color:#adbac0}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{
  outline:3px solid rgba(35,111,160,.28);
  outline-offset:2px;
}
.form-grid{gap:var(--th-space-4)}
.form-grid.compact{gap:var(--th-space-3)}
.inline-form{gap:var(--th-space-3);margin-bottom:var(--th-space-4)}
.check{gap:var(--th-space-2);min-height:32px}
.check input{min-height:auto}

/* Standard cards/panels */
.cards{gap:var(--th-space-4);margin-top:var(--th-space-5)}
.cards article,.card,.tcard,.pool-card,.result-card,.score-card,.bracket-card,.standings-card,.auth-card,.gate,.stat-card,.pathway{
  border-color:var(--th-line);
  border-radius:var(--th-radius-lg);
  background:var(--th-surface);
  box-shadow:var(--th-shadow-sm);
}
.cards article,.card{padding:var(--th-space-5)}
.tcard,.pool-card{padding:var(--th-space-4)}
.result-card,.score-card,.bracket-card{padding:var(--th-space-4);margin-bottom:var(--th-space-3)}
.card>h2:first-child,.card>h3:first-child,.pool-card>h3:first-child,.tcard>h3:first-child{margin-top:0}
.security-note,.auto-note,.notice-banner{border-radius:var(--th-radius-md);padding:12px 14px}

/* Standard badges/chips/statuses */
.status,.prelim,.final,.result-context41,.round-badge,.chip{
  border-radius:999px;
  font-size:.78rem;
  font-weight:700;
  line-height:1.2;
}
.status{padding:6px 10px;background:var(--th-success-bg);color:var(--th-success-text)}
.status.warn{background:var(--th-warning-bg);color:var(--th-warning-text)}
.prelim{background:var(--th-warning-bg);color:var(--th-warning-text)}
.final{background:var(--th-success-bg);color:var(--th-success-text)}
.chip{padding:7px 10px;border-color:var(--th-line-strong)}

/* Sidebar/navigation */
.side{padding:16px 10px 96px}
.nav{min-height:42px;padding:10px 12px;border-radius:var(--th-radius-sm);font-size:.9rem;font-weight:650}
.nav+.nav{margin-top:2px}
.side-footer{font-size:.78rem;line-height:1.35}
.side-brand{margin-bottom:12px}

/* Tables */
table{font-size:.9rem}
th,td{padding:9px 10px}
th{font-size:.72rem;letter-spacing:.045em;font-weight:800}
tbody tr:hover{background:rgba(33,58,70,.025)}
.table-wrap{border-radius:var(--th-radius-lg)}
.standings-card th:not(:first-child),.standings-card td:not(:first-child){width:62px}

/* Tabs */
.public-tabs{gap:var(--th-space-2);margin:var(--th-space-4) 0 var(--th-space-5)}
.pubtab{min-height:38px;padding:8px 12px;border-radius:var(--th-radius-sm);font-size:.86rem;font-weight:700}
.pubtab.active{background:var(--th-brand)}

/* Home/marketing system */
.landing-v4{padding:40px 24px 64px}
.hero-v4{gap:24px}
.hero-copy,.hero-proof{border-radius:var(--th-radius-xl)}
.hero-copy{padding:40px}
.hero-proof{padding:26px}
.hero-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  width:min(100%,820px);
  gap:10px;
  align-items:stretch;
}
.hero-actions .btn{width:100%;min-height:46px;text-align:center;white-space:normal}
.landing-section{padding:52px 0}
.feature-grid{gap:var(--th-space-4)}
.feature-card{padding:22px;border-radius:var(--th-radius-lg);box-shadow:var(--th-shadow-sm)}
.feature-card h3{font-size:1.05rem;margin:11px 0 6px}
.feature-card p{font-size:.94rem}
.feature-icon{width:40px;height:40px;border-radius:var(--th-radius-sm)}
.access-cards article{min-height:170px}
.landing-band{border-radius:var(--th-radius-xl)}
.landing-cta .actions{width:min(100%,820px)}
.landing-cta .actions .btn{min-height:46px}
.landing-footer{padding:22px 24px}

/* Auth/public/scoring consistency */
.auth-shell{margin:34px auto;padding:0 24px}
.auth-grid{gap:var(--th-space-5)}
.auth-card{padding:var(--th-space-5)}
.gate{padding:var(--th-space-5)}
.countdown-card{border-radius:var(--th-radius-lg)}

/* Help controls should look consistently interactive */
.help-icon,.help-dot,.setup-help{
  width:18px;height:18px;min-width:18px;border-radius:50%;
  display:inline-grid;place-items:center;
  font-size:.72rem;font-weight:800;line-height:1;
}

/* Modals */
.modal41{border-radius:var(--th-radius-lg);padding:var(--th-space-5)}
.modal41 h2{font-size:1.4rem}

/* Logo size tokens */
.brand-logo{height:48px;max-width:176px;width:auto;object-fit:contain}
.landing-top .brand-logo{height:50px;max-width:190px}
.side-brand img{width:38px;height:38px;object-fit:contain}
.gate-logo{max-width:180px;height:auto}

/* Deliberately keep Live Display's specialised large-screen typography separate. */
.display-controls .btn{min-height:32px;padding:5px 9px;font-size:.72rem}

@media(max-width:900px){
  .workspace{padding:22px 18px}
  .landing,.public-shell{padding:24px 18px}
  .side{padding-bottom:10px}
  .hero-actions{grid-template-columns:1fr}
  .hero-actions .btn{width:100%}
  .cards article,.card{padding:18px}
}
@media(max-width:600px){
  body:not(.display-body){font-size:15px}
  .top{padding:8px 12px}
  .workspace{padding:18px 14px}
  .landing,.public-shell{padding:20px 14px}
  .hero-copy{padding:24px}
  .landing-section{padding:36px 0}
  .heading{gap:12px;margin-bottom:16px}
  .btn{min-height:42px}
  th,td{padding:8px 7px}
  .brand-logo{height:40px;max-width:142px}
  .landing-top .brand-logo{height:42px;max-width:150px}
}


/* Tournament Hub v4.6.1 — trial-band contrast and CTA polish */
body:not(.display-body) .trial-band461 h2{color:#fff}
body:not(.display-body) .trial-band461 .eyebrow{color:#d9e6eb}
body:not(.display-body) .trial-band461 p{color:#e3ebee}
.trial-band461 .trial-cta461{
  flex:0 0 auto;
  min-width:190px;
  min-height:48px;
  padding:12px 20px;
  background:#fff;
  color:var(--th-brand);
  border:2px solid #fff;
  border-radius:var(--th-radius-md);
  box-shadow:0 8px 20px rgba(0,0,0,.16);
  font-weight:800;
}
.trial-band461 .trial-cta461:hover{
  background:#f2f7f9;
  color:var(--th-brand-hover);
  border-color:#f2f7f9;
  box-shadow:0 10px 24px rgba(0,0,0,.2);
}
.trial-band461 .trial-cta461:focus-visible{outline:3px solid rgba(255,255,255,.72);outline-offset:3px}
@media(max-width:900px){.trial-band461 .trial-cta461{width:100%;min-width:0}}

/* Tournament Hub v4.6.2 — Public View mobile header controls */
@media(max-width:600px){
  body[data-page="public"] .top{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    row-gap:0;
    padding:8px 12px 0;
  }
  body[data-page="public"] .top .brand{
    width:100%;
    min-width:0;
    padding-bottom:8px;
  }
  body[data-page="public"] .top .top-actions{
    order:2;
    width:calc(100% + 24px);
    margin:0 -12px;
    padding:7px 12px 8px;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:7px;
    border-top:1px solid var(--th-line);
    background:#f7fafb;
  }
  body[data-page="public"] .top .top-actions .btn{
    width:100%;
    min-width:0;
    min-height:36px;
    padding:6px 8px;
    font-size:11.5px;
    line-height:1.15;
    white-space:normal;
    text-align:center;
  }
  body[data-page="public"] .top .top-actions .status{display:none}
}
@media(max-width:370px){
  body[data-page="public"] .top .top-actions{
    grid-template-columns:1fr;
  }
}

/* Tournament Hub v4.6.3 — restore internal padding for the public-trial band.
   This element is both .landing-section and .landing-band, so this more specific
   rule prevents the generic section spacing rule from zeroing horizontal inset. */
.landing-section.landing-band.trial-band461{
  padding:34px 38px;
}
@media(max-width:600px){
  .landing-section.landing-band.trial-band461{
    padding:26px;
  }
}
