@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;600;700;800&display=swap');

:root{
  --bg:#f4f7fb;
  --bg2:#e8eef8;
  --card:#fff;
  --line:#d9e2ef;
  --text:#1e293b;
  --muted:#5b6b82;
  --brand:#0f6cbd;
  --brand2:#0a5ca2;
  --accent:#0ea5e9;
  --good:#138a36;
  --warn:#b45309;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%}

body{
  font-family:Inter,Arial,sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,var(--bg),var(--bg2));
}

a{text-decoration:none;color:var(--brand)}
a:hover{color:var(--brand2)}

.wrap{
  width:min(96vw,1180px);
  margin:0 auto;
}

.topbar{
  background:#ffffffd9;
  backdrop-filter:blur(6px);
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:10;
}

.topbar-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 0;
  gap:20px;
}

.logo{
  font-family:"Archivo Black",sans-serif;
  font-size:1.4rem;
  color:#0f172a;
}

.logo span{color:var(--brand)}

.nav{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  font-weight:800;
  font-size:.95rem;
}

.nav a{color:#37506d}
.nav a:hover{color:var(--brand)}

.nav-right{justify-content:flex-end}

.hero{
  padding:22px 0 16px;
}

.hero-card,
.content-card,
.tool-card,
.result,
.content,
.callout,
.search-box,
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 6px 20px rgba(15,23,42,.04);
}

.hero-card{
  padding:2px 24px;
}

.hero-card h1{
  margin:0 0 .65rem;
  font-size:clamp(1.9rem,2.7vw,2.85rem);
  line-height:1.04;
  max-width:1100px;
}

.hero-card p{
  color:var(--muted);
  font-size:1.05rem;
  line-height:1.55;
  max-width:860px;
}

.kicker{
  font-size:.82rem;
  font-weight:800;
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.hero-actions,
.contact-links,
.game-actions,
.badge-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-start;
}

.hero-actions{
  align-items:center;
  margin-top:16px;
}

.hero-actions .btn{
  flex:0 0 auto;
  align-self:center;
  white-space:nowrap;
}

.btn,
.button-link{
  display:inline-block;
  padding:.82rem 1rem;
  border-radius:12px;
  font-weight:800;
  border:1px solid var(--line);
  background:#fff;
  color:#1f3a56;
  cursor:pointer;
}

.btn.primary,
.button-link{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}

.btn.primary:hover,
.button-link:hover{
  background:var(--brand2);
  color:#fff;
}

.badge{
  padding:.5rem .7rem;
  border-radius:999px;
  background:#f3f8fe;
  border:1px solid #d5e8f8;
  color:#32597c;
  font-size:.88rem;
  font-weight:700;
}

.section{
  padding:20px 0;
}

.tools-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}

.tool-card{
  padding:18px;
  color:inherit;
  display:block;
}

.tool-card:hover{
  transform:translateY(-2px);
}

.tool-card h3{
  margin:.15rem 0 .55rem;
  font-size:1.1rem;
  color:#13233a;
}

.tool-card p{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

.meta{
  font-size:.78rem;
  color:var(--brand);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}

.card,
.content,
.content-card{
  padding:22px;
}

.card h3,
.content h2,
.content-card h2{
  margin-top:0;
}

.card p,
.content p,
.content li,
.content-card p,
.content-card li{
  color:var(--muted);
  line-height:1.6;
}

.two-col{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);
  gap:18px;
  align-items:stretch;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.field label{
  display:block;
  font-weight:700;
  color:#334155;
  margin-bottom:6px;
}

.field input,
.field select{
  width:100%;
  padding:.82rem .85rem;
  border-radius:12px;
  border:1px solid #cbd5e1;
  background:#fff;
  font:inherit;
  color:var(--text);
}

.field small{
  display:block;
  color:var(--muted);
  margin-top:5px;
  font-size:.85rem;
}

.content{
  display:flex;
  flex-direction:column;
  height:100%;
}

.content .callout{
  margin-bottom:16px;
  background:#fff2dd;
  border:1px solid #f2c48a;
  color:#9a4f00;
  font-weight:700;
}

.result{
  padding:18px;
  position:static;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

.result h3{
  margin:.1rem 0 .35rem;
  font-size:2.15rem;
}

.big-number{
  font-size:clamp(2rem,4vw,3.4rem);
  font-weight:800;
  color:var(--brand);
  margin:.2rem 0 .15rem;
  line-height:1;
}

.primary-label{
  font-size:.98rem;
  color:var(--muted);
  margin-bottom:.9rem;
}

.result-list{
  display:grid;
  gap:12px;
}

.result-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #edf2f7;
}

.result-row span{
  color:var(--muted);
}

.callout{
  padding:14px 16px;
  color:#13456f;
  background:#f5fbff;
  border-color:#d9edf8;
}

.footer{
  padding:10px 0 14px;
}

.footer-grid{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  flex-wrap:wrap;
  color:var(--muted);
}

.footer-center{
  text-align:center;
  color:var(--muted);
  font-weight:700;
}

.search-box{
  padding:16px;
  margin:16px 0 18px;
}

.search-input{
  width:100%;
  padding:1rem;
  border:1px solid #cbd5e1;
  border-radius:14px;
  font:inherit;
}

.count{
  margin-top:10px;
  color:var(--muted);
  font-size:.92rem;
}

.hidden{
  display:none !important;
}

.table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}

.table th,
.table td{
  border-bottom:1px solid #e7eef7;
  padding:10px;
  text-align:left;
}

.table th{
  color:#334155;
}

.small-note{
  font-size:.92rem;
  color:var(--muted);
}

.intro{
  color:var(--muted);
  line-height:1.55;
  max-width:900px;
  margin:0 0 16px;
  text-align:left;
}

.action-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:16px;
}

.seo-card{
  margin-top:18px;
}

.game-page-panel{
  padding:0;
}

.rules-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 6px 20px rgba(15,23,42,.04);
  padding:22px;
}

.rules-card h2,
.rules-card h3{
  margin-top:0;
}

.rules-card p,
.rules-card li{
  color:var(--muted);
  line-height:1.6;
}

.hero-stats{
  display:none !important;
}

.live-inline{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:0;
  margin-left:6px;
}

.live-inline-label{
  font-size:.95rem;
  font-weight:800;
  color:#5b6b82;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.live-inline-value{
  font-size:clamp(1.35rem,2.1vw,2rem);
  font-weight:800;
  color:var(--brand);
  line-height:1;
}

/* EXACT FIX FOR CALCULATOR PAGE TITLE + SUBTITLE */
.calculator-hero{
  display:block !important;
  text-align:left !important;
  margin-bottom:18px;
}

.calculator-hero h1,
.calculator-hero .tool-name,
.calculator-hero .page-title{
  display:block;
  width:100%;
  margin:0 0 10px 0 !important;
  text-align:left !important;
  max-width:none !important;
}

.calculator-hero p,
.calculator-hero .tool-subtext,
.calculator-hero .page-subtitle,
.calculator-hero .subtitle{
  display:block;
  width:100%;
  margin:0 !important;
  text-align:left !important;
  max-width:none !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* extra protection in case parent wrappers center text */
.calculator-hero,
.calculator-hero *{
  text-align:left !important;
}


.footer-row{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:24px;
  color:var(--muted);
  font-size:.9rem;
}
.footer-row a{
  color:var(--brand);
  font-weight:700;
}
.footer-disclaimer,.footer-copy{
  color:var(--muted);
}

.result-row.primary-row{
  display:none;
}

/* ══════════════════════════════════════════════
   HERO LAYOUT (desktop)
══════════════════════════════════════════════ */
.hero-card-split{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);
  gap:24px;
  align-items:center;
}
.hero-copy{min-width:0}
.hero-graphic{
  position:relative;
  min-height:380px;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
}
.hero-graphic-svg{
  display:block;
  width:min(100%,600px);
  height:auto;
}

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET
══════════════════════════════════════════════ */
@media (max-width:900px){
  .topbar-inner{
    flex-direction:row;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    padding:10px 0;
  }
  .nav-right{
    justify-content:flex-start;
    flex-wrap:wrap;
    gap:8px 12px;
    font-size:.85rem;
  }
  .hero-card-split{
    grid-template-columns:1fr;
  }
  .hero-graphic{
    display:none;
  }
  .hero-card{
    padding:2px 20px;
  }
  .hero-actions{
    align-items:flex-start;
  }
  .live-inline{
    margin-left:0;
    width:100%;
  }
  .two-col{
    grid-template-columns:1fr;
  }
  .form-grid{
    grid-template-columns:1fr 1fr;
  }
  .result{
    position:static;
  }
  .tools-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════ */
@media (max-width:600px){
  .topbar-inner{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    padding:10px 0;
    gap:8px;
  }
  /* Hide nav categories on mobile - too cramped */
  .nav-right{
    display:none;
  }
  .wrap{
    width:94vw;
  }
  /* Hero cell - tight */
  .hero{
    padding:10px 0 8px;
  }
  .hero-card{
    padding:12px 16px 10px;
  }
  .hero-card h1{
    font-size:1.7rem;
    margin:0 0 .5rem;
  }
  .hero-card p{
    font-size:.93rem;
    margin-bottom:.75rem;
  }
  .kicker{
    font-size:.72rem;
    margin-bottom:.2rem;
  }
  .hero-graphic{
    display:none;
  }
  .hero-actions{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .hero-actions .btn{
    text-align:center;
    width:100%;
    box-sizing:border-box;
  }
  .live-inline{
    margin-left:0;
    width:100%;
    margin-top:6px;
  }

  /* Reduce spacing between hero and search */
  .section{
    padding:10px 0;
  }

  /* Search bar */
  .search-box{
    padding:10px 12px;
    margin:0 0 10px;
  }

  /* Calculator grid - single column */
  .tools-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  .tool-card{
    padding:14px 16px;
  }

  /* ── Calculator pages: stack form + results side by side on mobile ── */
  /* On mobile, show form inputs + results BOTH on screen without scrolling.
     Use a compact single-column layout with the result panel BELOW the form
     but with minimal padding so both fit in viewport. */
  .two-col{
    grid-template-columns:1fr;
    gap:10px;
  }
  .form-grid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .field input,
  .field select{
    padding:.55rem .7rem;
    font-size:.9rem;
  }
  .field label{
    font-size:.82rem;
    margin-bottom:3px;
  }
  .callout{
    font-size:.82rem;
    padding:.6rem .9rem;
    margin-bottom:10px;
  }
  .action-row{
    margin-top:8px;
  }
  .action-row .btn{
    padding:.55rem 1.1rem;
    font-size:.9rem;
  }
  .result{
    padding:12px;
  }
  .result h3{
    font-size:1.1rem;
    margin-bottom:.4rem;
  }
  .big-number{
    font-size:clamp(1.6rem,8vw,2.4rem);
    margin:.1rem 0 .1rem;
  }
  .primary-label{
    font-size:.85rem;
    margin-bottom:.5rem;
  }
  .result-list{
    gap:0;
  }
  .result-row{
    padding:.35rem 0;
    font-size:.88rem;
  }
  .game-page-title{
    font-size:1.35rem;
    margin-bottom:8px;
  }
  .intro{
    font-size:.9rem;
    margin-bottom:10px;
  }
  .footer-row{
    gap:10px;
    font-size:.82rem;
    justify-content:center;
  }
  .rules-card{
    padding:14px;
  }
}

/* Mobile disclaimer */
@media (max-width: 600px) {
  .disclaimer-full { display: none !important; }
  .disclaimer-mobile { display: block !important; }
}

/* Parameter label alignment - ensure label+input pairs align in grid */
.form-grid .field {
  display: flex;
  flex-direction: column;
}
.form-grid .field label {
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}

@media(max-width:600px){
  p.disclaimer{font-size:0.72rem;color:#888;line-height:1.3;}
  p.disclaimer:not(:first-child){display:none;}
}

/* Formula display in about section */
.formula-line {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.83rem;
  background: #f7f8fa;
  color: #1a1a1a;
  border: 1px solid #e2e5ea;
  padding: 7px 12px;
  border-radius: 4px;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.formula-line.formula-wrap {
  white-space: normal;
  overflow: visible;
  line-height: 1.5;
}

