/*
Theme Name: Spades Tourneys
Theme URI: https://spadestourneys.com/
Author: Spades Tourneys
Description: A lightweight tournament-first theme for Spades Tourneys.
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: spadestourneys
*/

@font-face {
  font-family: "Tour Sans";
  src: url("assets/ubuntu-sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tour Narrow";
  src: url("assets/nimbus-sans-narrow.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #050b0a;
  --felt: #071b17;
  --felt-2: #0b2a22;
  --line: #24463d;
  --paper: #f5f1e8;
  --muted: #a7b9b2;
  --club: #4cf59a;
  --club-deep: #16a866;
  --gold: #f2c14e;
  --danger: #ff6b6b;
  --black-card: #0a100f;
  --red-card: #ba323c;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Tour Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.035) .7px, transparent .7px);
  background-size: 5px 5px;
  opacity: .7;
  z-index: -1;
}
.admin-bar .site-header { top: 32px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; top: 8px; left: 8px; z-index: 100000; width: auto; height: auto; padding: 12px 16px; clip: auto; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
img { max-width: 100%; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5,11,10,.88);
  border-bottom: 1px solid rgba(76,245,154,.16);
  backdrop-filter: blur(18px);
}
.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 820; letter-spacing: -.02em; }
.brand img { width: 36px; height: 36px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .92rem; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--paper); }
.button {
  border: 1px solid var(--club);
  background: var(--club);
  color: #03110b;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 11px;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(76,245,154,.12);
}
.button:hover { background: #75ffb2; }
.button.secondary { background: transparent; color: var(--paper); border-color: var(--line); box-shadow: none; }
.button.secondary:hover { border-color: var(--muted); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.hero { padding: 82px 0 64px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 58px; align-items: center; }
.kicker { color: var(--club); font-weight: 780; margin: 0 0 18px; }
h1, h2, .score-number {
  font-family: "Tour Narrow", "Arial Narrow", sans-serif;
  text-transform: uppercase;
  letter-spacing: -.035em;
  line-height: .93;
}
h1 { font-size: clamp(4rem, 8.2vw, 7.1rem); margin: 0; max-width: 710px; }
h1 .line { display: block; }
h1 .outline { color: transparent; -webkit-text-stroke: 1.6px var(--paper); }
.hero-copy { max-width: 600px; color: #c4d2cd; font-size: 1.12rem; margin: 28px 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.learn-section { border-top: 1px solid var(--line); }
.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.learn-card { min-height: 330px; padding: 26px; display: flex; flex-direction: column; color: var(--paper); background: #091b17; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.learn-card:hover { border-color: var(--club); }
.learn-card .card-suit { font-family: "Tour Narrow", sans-serif; color: var(--club); font-size: 3.2rem; line-height: 1; }
.learn-card .red-suit { color: var(--red-card); }
.learn-card h3 { margin: 46px 0 8px; font-size: 1.45rem; }
.learn-card p { color: var(--muted); margin: 0; }
.text-link { color: var(--club); font-weight: 800; margin-top: auto; padding-top: 22px; }

.tourney-board {
  position: relative;
  background: linear-gradient(145deg, #102c25, #06120f 72%);
  border: 1px solid #315d50;
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 35px 100px rgba(0,0,0,.55), inset 0 0 70px rgba(76,245,154,.035);
  transform: rotate(1.2deg);
}
.tourney-board::after {
  content: "♠";
  position: absolute;
  right: -28px;
  top: -58px;
  color: rgba(76,245,154,.09);
  font-size: 13rem;
  line-height: 1;
  z-index: -1;
}
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 7px 17px; }
.live { display: inline-flex; gap: 8px; align-items: center; color: var(--club); font-weight: 760; }
.live-dot { width: 8px; height: 8px; background: var(--club); border-radius: 50%; box-shadow: 0 0 0 5px rgba(76,245,154,.12); }
.credit-pill { color: var(--gold); background: rgba(242,193,78,.08); border: 1px solid rgba(242,193,78,.35); border-radius: 999px; padding: 6px 11px; font-weight: 800; }
.match-card { background: #f7f3e9; color: #07110f; border-radius: 16px; padding: 19px; margin-bottom: 10px; position: relative; overflow: hidden; }
.match-card:last-child { margin-bottom: 0; }
.match-card.featured { border-left: 6px solid var(--club); }
.match-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.match-card h3 { margin: 0 0 3px; font-size: 1.08rem; }
.match-card p { margin: 0; color: #587068; font-size: .9rem; }
.time { font-family: "Tour Narrow", "Arial Narrow", sans-serif; font-size: 1.75rem; line-height: 1; }
.format-row { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.seats { display: flex; }
.seat { width: 31px; height: 31px; margin-left: -6px; border-radius: 9px; border: 2px solid #f7f3e9; background: #0e362c; color: white; display: grid; place-items: center; font-weight: 800; font-size: .75rem; }
.seat:first-child { margin-left: 0; }
.seat.open { background: transparent; color: #71877f; border-color: #c6d1cd; }
.fee { font-weight: 840; }

.stat-strip { border-block: 1px solid var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 23px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; color: var(--paper); font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: .85rem; }

.section { padding: 106px 0; }
.section.alt { background: var(--felt); border-block: 1px solid rgba(76,245,154,.12); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: end; margin-bottom: 44px; }
h2 { font-size: clamp(3rem, 6vw, 5.3rem); margin: 0; }
.section-head p { color: var(--muted); margin: 0 0 6px; max-width: 560px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { padding: 30px; min-height: 245px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step-number { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--club); color: var(--club); font-weight: 850; }
.step h3 { font-size: 1.35rem; margin: 55px 0 8px; }
.step p { color: var(--muted); margin: 0; }

.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.format-card { background: #0a1714; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; min-height: 300px; display: flex; flex-direction: column; }
.format-card h3 { font-size: 1.55rem; margin: 0 0 8px; }
.format-card p { color: var(--muted); margin: 0; }
.players { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 11px; padding-top: 35px; }
.player { min-width: 72px; height: 60px; padding: 0 12px; border: 1px solid #437466; background: #102d26; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: .82rem; }
.player.paired { border-color: var(--gold); box-shadow: inset 0 0 0 2px rgba(242,193,78,.12); }
.player.open { border-style: dashed; color: var(--muted); }
.vs { color: #6f8c82; font-weight: 800; font-size: .75rem; }
.pair-rail { height: 3px; width: 22px; background: var(--gold); }

.partner-feature { display: grid; grid-template-columns: .82fr 1.18fr; gap: 68px; align-items: center; }
.partner-copy p { color: var(--muted); max-width: 500px; }
.partner-proof { border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: #06100e; }
.pair-card { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; padding: 17px; background: #0e2c25; border: 1px solid #285448; border-radius: 16px; margin-bottom: 10px; }
.pair-card:last-child { margin-bottom: 0; }
.avatar { width: 64px; height: 64px; border-radius: 15px; background: var(--gold); color: #181107; display: grid; place-items: center; font-family: "Tour Narrow", sans-serif; font-size: 1.8rem; }
.pair-card:nth-child(2) .avatar { background: var(--club); }
.pair-card h3 { margin: 0; }
.pair-card p { margin: 2px 0 0; color: #9bb7ad; font-size: .88rem; }
.locked { color: var(--gold); font-weight: 800; font-size: .83rem; }

.credits-box { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #3b705f; background: linear-gradient(120deg, #0a251e 0 55%, #0b1714 55%); border-radius: 28px; overflow: hidden; }
.credits-copy { padding: clamp(32px, 6vw, 72px); }
.credits-copy p { color: var(--muted); max-width: 500px; }
.credit-rule { display: flex; gap: 12px; margin-top: 20px; align-items: flex-start; }
.check { color: var(--club); font-weight: 900; }
.credit-visual { padding: 50px; display: grid; align-content: center; justify-items: center; }
.token { width: min(250px, 75vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 5px double var(--gold); background: radial-gradient(circle at 35% 30%, #f5d273, #c88817 72%); color: #2a1b04; box-shadow: 0 24px 70px rgba(0,0,0,.45), inset 0 0 0 13px rgba(66,41,0,.12); text-align: center; transform: rotate(-5deg); }
.token strong { display: block; font-family: "Tour Narrow", sans-serif; font-size: 5rem; line-height: .8; }
.token span { font-weight: 850; }

.showcase { background: #050b0a; }
.screen-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.screen-tab { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 10px 17px; cursor: pointer; font-weight: 760; }
.screen-tab.active { color: #03110b; background: var(--club); border-color: var(--club); }
.device { border: 1px solid #315f52; border-radius: 30px; background: #07120f; padding: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.device-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 11px 18px; color: var(--muted); font-size: .82rem; }
.device-title { color: var(--paper); font-weight: 830; }
.screen { min-height: 570px; border: 1px solid #24473d; border-radius: 20px; background: #0b211b; padding: clamp(18px, 4vw, 34px); overflow: hidden; }
.screen[hidden] { display: none; }
.screen-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.screen h3 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); }
.screen .sub { color: var(--muted); margin: 3px 0 0; }
.lobby-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lobby-tile { background: var(--paper); color: #08130f; border-radius: 15px; padding: 18px; min-height: 210px; display: flex; flex-direction: column; }
.lobby-tile .clock { font-family: "Tour Narrow", sans-serif; font-size: 2.3rem; }
.lobby-tile .meta { color: #60736d; font-size: .85rem; }
.lobby-tile .join { margin-top: auto; padding-top: 22px; font-weight: 850; color: #08623b; }
.quick-match { margin-top: 13px; border: 1px solid rgba(242,193,78,.55); background: rgba(242,193,78,.08); border-radius: 15px; padding: 16px; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; }
.quick-match strong, .quick-match span { display: block; }
.quick-match span { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.quick-match .button { min-height: 40px; padding: 0 14px; font-size: .82rem; white-space: nowrap; }
.table-grid { min-height: 455px; display: grid; grid-template: 80px 1fr 80px / 100px 1fr 100px; align-items: center; justify-items: center; }
.felt-table { grid-area: 2/2; width: 100%; height: 280px; background: radial-gradient(ellipse, #17674f, #0b3b2e); border: 12px solid #09100e; outline: 2px solid #735927; border-radius: 48%; box-shadow: inset 0 0 70px rgba(0,0,0,.35), 0 20px 40px rgba(0,0,0,.4); display: grid; place-items: center; }
.trick { display: flex; gap: 5px; }
.playing-card { width: 58px; height: 82px; background: #fffdf7; color: var(--black-card); border-radius: 7px; padding: 5px 7px; font-weight: 900; box-shadow: 0 6px 10px rgba(0,0,0,.24); }
.playing-card.red { color: var(--red-card); transform: translateY(-7px) rotate(3deg); }
.table-player { width: 76px; height: 58px; background: #102e27; border: 1px solid #397060; border-radius: 13px; display: grid; place-items: center; font-weight: 820; font-size: .82rem; }
.north { grid-area: 1/2; } .south { grid-area: 3/2; } .west { grid-area: 2/1; } .east { grid-area: 2/3; }
.bracket { display: grid; grid-template-columns: 1fr 80px 1fr 80px 1fr; gap: 5px; align-items: center; min-height: 400px; }
.round { display: grid; gap: 45px; }
.round:nth-child(3) { gap: 140px; }
.bracket-match { background: #112e27; border: 1px solid #326153; border-radius: 12px; padding: 13px; min-height: 72px; }
.bracket-match strong { display: block; }
.bracket-match span { color: var(--muted); font-size: .8rem; }
.connector { height: 1px; background: #437164; }
.champion { border-color: var(--gold); background: rgba(242,193,78,.08); }
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.score-card { border: 1px solid #315d51; background: #0d2a23; border-radius: 18px; padding: 25px; }
.score-card.leading { border-color: var(--club); }
.score-number { font-size: clamp(4.8rem, 10vw, 8rem); margin: 25px 0 10px; }
.score-breakdown { display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid #315d51; padding-top: 15px; }
.round-progress { grid-column: 1/-1; background: #071511; border: 1px solid var(--line); border-radius: 15px; padding: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.round-progress span { height: 8px; background: #23483d; border-radius: 9px; }
.round-progress .done { background: var(--club); }

.faq { display: grid; grid-template-columns: .65fr 1.35fr; gap: 70px; }
.faq-list details { border-top: 1px solid var(--line); padding: 20px 0; }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; font-weight: 790; list-style: none; padding-right: 35px; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 4px; color: var(--club); font-size: 1.3rem; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { color: var(--muted); max-width: 710px; }

.final-cta { padding: 95px 0; text-align: center; background: var(--club); color: #05100c; }
.final-cta h2 { max-width: 850px; margin: 0 auto 22px; }
.final-cta p { max-width: 580px; margin: 0 auto 27px; color: #15402f; }
.final-cta .button { background: #07110f; color: var(--paper); border-color: #07110f; box-shadow: none; }
.footer { padding: 35px 0 45px; color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.footer-links { display: flex; gap: 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--paper); }

.legal { padding: 78px 0 110px; }
.legal .shell { text-align: center; }
.breadcrumb { display: flex; justify-content: center; gap: 9px; color: var(--muted); font-size: .88rem; margin-bottom: 35px; }
.breadcrumb a { color: var(--club); }
.legal h1 { font-size: clamp(3.4rem, 7vw, 6rem); margin-bottom: 22px; }
.legal .lede { color: var(--muted); max-width: 760px; margin-inline: auto; font-size: 1.08rem; }
.legal article { max-width: 900px; margin: 58px auto 0; }
.legal article > *:first-child { margin-top: 0; }
.legal h2 { font-family: "Tour Sans", sans-serif; text-transform: none; letter-spacing: -.02em; line-height: 1.2; font-size: 1.55rem; margin: 42px 0 12px; }
.legal p, .legal li { color: #c2d1cc; }
.legal ul, .legal ol { max-width: 760px; margin-inline: auto; padding-left: 0; list-style-position: inside; }
.legal li { margin-bottom: 9px; }
.legal h3 { margin: 30px 0 8px; font-size: 1.18rem; }
.legal a { color: var(--club); text-underline-offset: 3px; }
.legal table { width: 100%; border-collapse: collapse; margin: 26px 0 36px; }
.legal th, .legal td { text-align: center; vertical-align: top; padding: 14px; border: 1px solid var(--line); }
.legal th { color: var(--paper); background: var(--felt-2); }
.legal td { color: #c2d1cc; }
.page-intro { color: var(--muted); max-width: 760px; margin-inline: auto; font-size: 1.12rem; }
.page-note { border-top: 3px solid var(--gold); padding: 15px 18px; background: rgba(242,193,78,.07); color: #f2d990; }
.source-list { font-size: .92rem; }
.store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 35px 0; }
.store-panel { min-height: 220px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--felt-2); display: flex; flex-direction: column; align-items: center; }
.store-panel h2 { font-family: "Tour Sans", sans-serif; text-transform: none; letter-spacing: -.02em; line-height: 1.1; font-size: 1.6rem; margin: 0; }
.store-panel p { margin-bottom: 24px; }
.store-status { margin-top: auto; display: inline-flex; align-items: center; min-height: 48px; padding: 0 17px; border: 1px solid #52655f; border-radius: 10px; color: var(--paper); font-weight: 800; background: #070b0a; }
.store-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; background: var(--gold); }
.term-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 28px 0 38px; }
.term-item { background: var(--ink); padding: 18px; }
.term-item strong { display: block; color: var(--paper); margin-bottom: 4px; }
.term-item span { color: #c2d1cc; }
.app-feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0 42px; }
.app-feature { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #091b17; }
.app-feature h3 { margin-top: 0; color: var(--paper); }
.app-feature p { margin-bottom: 0; }
.legal .draft { border-left: 3px solid var(--gold); padding: 14px 18px; background: rgba(242,193,78,.07); color: #f2d990; }

@media (max-width: 900px) {
  .hero-grid, .section-head, .partner-feature, .credits-box, .faq, .learn-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 58px; }
  .tourney-board { transform: none; }
  .formats { grid-template-columns: 1fr; }
  .format-card { min-height: 230px; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .step:last-child { border-bottom: 0; }
  .step h3 { margin-top: 35px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-tile { min-height: 160px; }
  .quick-match { grid-template-columns: 1fr; }
  .quick-match .button { width: 100%; }
  .bracket { grid-template-columns: 1fr; }
  .connector { width: 1px; height: 30px; justify-self: center; }
  .round, .round:nth-child(3) { gap: 10px; }
}

@media (max-width: 680px) {
  .admin-bar .site-header { top: 46px; }
  .shell { width: min(100% - 26px, 1180px); }
  .nav { gap: 10px; }
  .brand { gap: 7px; font-size: .88rem; white-space: nowrap; }
  .brand img { width: 31px; height: 31px; }
  .nav-links { gap: 0; }
  .nav-links a:not(.button) { display: none; }
  .nav .button { min-height: 40px; padding: 0 12px; font-size: .78rem; }
  .hero { padding-bottom: 44px; }
  h1 { font-size: clamp(3.3rem, 17vw, 5.8rem); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section { padding: 76px 0; }
  .screen { min-height: 510px; padding: 15px; }
  .screen-top { align-items: flex-start; flex-direction: column; }
  .table-grid { grid-template: 70px 1fr 70px / 70px 1fr 70px; }
  .felt-table { height: 235px; border-width: 8px; }
  .playing-card { width: 45px; height: 66px; }
  .table-player { width: 60px; font-size: .7rem; }
  .scoreboard { grid-template-columns: 1fr; }
  .round-progress { grid-column: 1; }
  .credit-visual { padding: 35px; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
  .store-grid, .term-grid, .app-feature-grid { grid-template-columns: 1fr; }
  .legal table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
