/* =========================================================
   Brunel 8-Ball Pool Society: one-page site
   Palette: deep navy + gold (matches the society poster)
   ========================================================= */
 
:root {
  --navy-950: #05072f;
  --navy-900: #080b4a;
  --navy-800: #0d1170;
  --royal: #1722a8;
  --gold: #ffc20e;
  --gold-soft: #ffd75e;
  --red: #ff4d4d;
  --text: #eef0ff;
  --muted: #aab0e6;
  --line: rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.06);
  --radius: 22px;
  --font-display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
 
*, *::before, *::after { box-sizing: border-box; }
 
[hidden] { display: none !important; }
 
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
 
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(255, 194, 14, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 100% 10%, rgba(23, 34, 168, 0.55), transparent 60%),
    var(--navy-950);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
 
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: 0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--gold); }
 
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
 
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)); border-block: 1px solid var(--line); }
 
.eyebrow {
  display: inline-block;
  margin-bottom: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
h2 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 1rem; }
.section-lead { max-width: 60ch; color: var(--muted); font-size: 1.08rem; margin-bottom: 2.2rem; }
 
/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 0.98rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; }
.btn-primary { background: var(--gold); color: var(--navy-950); box-shadow: 0 8px 24px rgba(255, 194, 14, 0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(255, 194, 14, 0.4); background: var(--gold-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.btn-small { padding: 0.5rem 1.1rem; font-size: 0.88rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.cta-row.center { justify-content: center; }
 
/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }
 
.live-bar {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.55rem clamp(0.8rem, 3vw, 1.5rem);
  background: var(--gold);
  color: var(--navy-950);
  font-size: 0.9rem; font-weight: 600;
  animation: slideDown 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.live-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.22rem 0.75rem 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--navy-950); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  white-space: nowrap;
}
.live-dot {
  width: 0.62rem; height: 0.62rem; border-radius: 50%;
  background: var(--red);
  animation: ping 1.6s infinite;
}
.live-text { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-status { margin-left: 0.4rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: rgba(5, 7, 47, 0.12); font-weight: 700; }
.live-link { color: var(--navy-950); font-weight: 700; text-underline-offset: 3px; white-space: nowrap; }
.live-close {
  background: none; border: 0; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--navy-950); padding: 0 0.3rem; opacity: 0.7;
}
.live-close:hover { opacity: 1; }
 
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(5, 7, 47, 0.74);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--text); }
.brand-badge { width: 42px; height: 42px; flex: none; transition: transform 0.6s cubic-bezier(.3,1.4,.5,1); }
.brand:hover .brand-badge { transform: rotate(360deg); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand-name em { font-style: normal; color: var(--gold); }
 
.nav-links { display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.7rem); }
.nav-links a:not(.btn) {
  color: var(--text); text-decoration: none; font-size: 0.93rem; font-weight: 500; position: relative; padding: 0.2rem 0;
}
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav-links a:not(.btn):hover::after { transform: scaleX(1); }
 
/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100svh - 104px);
  display: flex; align-items: center;
  padding: clamp(3rem, 8vw, 6rem) 0 6rem;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(520px 420px at 78% 40%, rgba(255, 194, 14, 0.14), transparent 70%),
    radial-gradient(700px 500px at 20% 80%, rgba(23, 34, 168, 0.5), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; }
 
.pill {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 1rem; margin-bottom: 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 194, 14, 0.5);
  background: rgba(255, 194, 14, 0.1);
  color: var(--gold-soft);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  animation: fadeUp 0.8s 0.1s both;
}
.pulse { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--gold); animation: ping-gold 1.8s infinite; }
 
.hero h1 { font-size: clamp(3.2rem, 10vw, 7.4rem); font-weight: 700; }
.hero h1 .line { display: block; animation: rise 0.9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(0.2s + var(--i) * 0.14s); }
.hero h1 .accent {
  color: var(--gold);
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 194, 14, 0.35);
}
.lead { max-width: 52ch; margin-top: 1.6rem; font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); animation: fadeUp 0.9s 0.7s both; }
.hero .cta-row { animation: fadeUp 0.9s 0.85s both; }
 
.hero-balls { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float-ball {
  position: absolute;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: var(--c);
  display: grid; place-items: center;
  box-shadow: inset -8px -10px 18px rgba(0, 0, 0, 0.35), 0 26px 34px rgba(0, 0, 0, 0.4);
  animation: drift var(--d) ease-in-out infinite alternate;
}
.float-ball.stripe { background: linear-gradient(#fff 0 24%, var(--c) 24% 76%, #fff 76%); }
.float-ball::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.6), transparent 36%);
}
.float-ball i {
  position: relative; display: grid; place-items: center;
  width: 44%; height: 44%; border-radius: 50%;
  background: #fff; color: #111;
  font-style: normal; font-family: var(--font-display); font-weight: 700;
  font-size: calc(var(--s) * 0.2);
}
 
.scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.4); border-radius: 20px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--gold); animation: wheel 1.7s infinite;
}
 
/* ---------- Event ---------- */
.event-card {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 0;
  border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--royal) 0%, var(--navy-800) 55%, var(--navy-900) 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  position: relative;
}
.event-card::before {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.04); left: -120px; top: -140px;
}
.event-main { position: relative; padding: clamp(1.5rem, 4vw, 3rem); }
.chip {
  display: inline-block; padding: 0.3rem 0.85rem; margin-bottom: 1.2rem;
  border-radius: 999px; background: var(--gold); color: var(--navy-950);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
body[data-phase="live"] .chip { background: var(--red); color: #fff; animation: ping 1.6s infinite; }
.event-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.4rem; }
.event-meta dt { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.event-meta dd { margin: 0.15rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 1.7rem); color: var(--gold); }
 
.event-count {
  position: relative; padding: clamp(1.5rem, 4vw, 3rem);
  display: flex; flex-direction: column; justify-content: center;
  background: rgba(5, 7, 47, 0.45);
  border-left: 1px solid var(--line);
}
.count-title { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.count-box {
  text-align: center; padding: 0.9rem 0.2rem;
  border-radius: 16px; border: 1px solid rgba(255, 194, 14, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.count-box span { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.count-box small { display: block; margin-top: 0.4rem; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.count-msg { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); margin: 0; }
 
/* ---------- Game ---------- */
.game-wrap {
  max-width: 940px; margin-inline: auto;
  padding: clamp(0.8rem, 2.5vw, 1.6rem);
  border-radius: 30px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.game-hud { display: flex; align-items: center; gap: clamp(1rem, 4vw, 2.2rem); flex-wrap: wrap; padding: 0.2rem 0.4rem 1rem; }
.hud-item { display: flex; flex-direction: column; }
.hud-label { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hud-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--gold); line-height: 1.1; transition: transform 0.25s; }
.hud-value.bump { transform: scale(1.35); }
.power { margin-left: auto; display: flex; flex-direction: column; gap: 0.35rem; }
.power-track { width: min(240px, 42vw); height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.power-fill { width: 0%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3ddc84, var(--gold) 60%, var(--red)); }
 
.table-stage { position: relative; }
#table {
  display: block; width: 100%; height: auto;
  border-radius: 22px;
  cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
 
.result {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 22px; background: rgba(5, 7, 47, 0.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.4s both;
}
.result-card {
  width: min(380px, 88%); text-align: center;
  padding: clamp(1.1rem, 4vw, 2rem);
  border-radius: 24px; border: 1px solid rgba(255, 194, 14, 0.5);
  background: linear-gradient(160deg, var(--royal), var(--navy-900));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: pop 0.55s cubic-bezier(.2,1.4,.4,1) both;
}
.result-kicker { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.result-card h3 { font-size: clamp(1.6rem, 5vw, 2.1rem); color: var(--gold); }
.result-count { margin: 0.6rem 0; display: flex; align-items: baseline; justify-content: center; gap: 0.6rem; }
.result-count span { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.8rem, 9vw, 4.4rem); line-height: 1; }
.result-count small { color: var(--muted); font-size: 0.9rem; }
.result-card p#resultText { color: var(--muted); font-size: 0.95rem; }
.result-card .btn { margin-top: 0.3rem; }
 
.game-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; margin-top: 1.2rem; }
.game-hint { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0.9rem 0 0; min-height: 1.5em; }
 
/* ---------- About ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.feature {
  position: relative; padding: 1.8rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.feature:hover { transform: translateY(-6px); border-color: rgba(255, 194, 14, 0.5); background: rgba(255, 255, 255, 0.09); }
.feature-num { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; color: var(--gold); opacity: 0.9; line-height: 1; display: block; margin-bottom: 0.8rem; }
.feature h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.feature p { color: var(--muted); margin: 0; }
 
/* ---------- Coming soon ---------- */
.soon { text-align: center; }
.soon .section-lead { margin-inline: auto; }
.progress { max-width: 560px; height: 16px; margin: 0.6rem auto 1.6rem; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; border: 1px solid var(--line); }
.progress-bar {
  width: 0; height: 100%; border-radius: 99px;
  background: repeating-linear-gradient(115deg, var(--gold) 0 14px, var(--gold-soft) 14px 28px);
  background-size: 40px 100%;
  transition: width 2.2s cubic-bezier(.2,.8,.2,1) 0.3s;
  animation: stripes 1.2s linear infinite;
}
.progress.in .progress-bar { width: 68%; }
.chips { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; max-width: 700px; }
.chips li { padding: 0.45rem 1rem; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.3); color: var(--muted); font-size: 0.9rem; }
 
/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 1.8rem 0; color: var(--muted); font-size: 0.9rem; background: rgba(0, 0, 0, 0.2); }
.footer p { margin: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; justify-content: space-between; align-items: center; }
 
/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
 
/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(60px) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes drift { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(-14px, -28px, 0) rotate(12deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.75); } 70% { box-shadow: 0 0 0 11px rgba(255, 77, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); } }
@keyframes ping-gold { 0% { box-shadow: 0 0 0 0 rgba(255, 194, 14, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 194, 14, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 194, 14, 0); } }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.7) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes stripes { to { background-position: 40px 0; } }
 
/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .event-card { grid-template-columns: 1fr; }
  .event-count { border-left: 0; border-top: 1px solid var(--line); }
  .nav-links a:not(.btn) { display: none; }
  .float-ball { opacity: 0.35; }
  .power { margin-left: 0; width: 100%; }
  .power-track { width: 100%; }
}
@media (max-width: 640px) {
  .live-bar { gap: 0.6rem; font-size: 0.8rem; }
  .live-text { white-space: normal; line-height: 1.3; }
  .live-link { display: none; }
  .live-status { display: block; margin: 0.25rem 0 0; width: fit-content; }
  .brand-name { font-size: 1rem; }
  html { scroll-padding-top: 130px; }
}
 
/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}