* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --amber: #f5a623;
  --amber-lt: #ffc966;
  --red: #e63946;
  --bg: #0f0c0a;
  --card: #1a1512;
  --line: #2e2620;
  --ink: #f5f0e8;
  --mut: #a89880;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 166, 35, .1), transparent);
}

/* Header styled by federalgaming.org HeaderTile CSS */
/* Site header - matches test-rewrite structure */
.site-header {
  --header-height: 90;
  --background-header-color: rgba(0, 0, 0, 0.33);
  position: relative;
  z-index: 100;
  background: transparent;
}

.header-row {
  align-items: center;
  width: 100%;
  display: flex;
  min-height: calc(var(--header-height) * 1px);
  padding: 0 16px;
  box-sizing: border-box;
  position: relative;
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  z-index: 2;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.header-center a {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}

.header-logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  position: relative;
  z-index: 11;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.header-logo img {
  max-height: 60px;
  max-width: min(400px, 55vw);
  width: auto;
  height: auto;
  aspect-ratio: 1434/370;
  display: block;
  opacity: 0;
  transition: opacity .8s ease;
}

.header-logo img.logo-loaded {
  opacity: 1;
}

#back-to-top {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card) 75%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .2s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
  user-select: none;
  -webkit-user-select: none;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-2px);
}

.burger-link {
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  padding: 8px;
  text-decoration: none;
}

.burger-link:hover {
  color: #f5a623;
}

.burger-link svg {
  display: block;
}

[data-theme='dark'] #fgi-theme-toggle::before {
  content: '☀';
}

[data-theme='light'] #fgi-theme-toggle::before {
  content: '☾';
}

[data-theme='dark'] #fgi-theme-toggle {
  color: #ffd700 !important;
}

#fgi-theme-toggle {
  width: 28px !important;
  color: #fff !important;
  height: 28px !important;
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme='dark'] #fgi-theme-toggle:hover {
  transform: scale(1.07);
}

/* Sidebar - dropdown from header like test page */
.sidebar {
  display: none;
}

.site-header.menu-open .sidebar {
  display: flex;
  animation: sidebar-drop 0.3s ease-out;
  flex: 1;
  min-height: calc(100vh - 90px);
  min-height: calc(100dvh - 90px);
  flex-direction: column;
  background: #1f1f1f;
  padding: 16px 16px 24px;
}

.site-header.menu-open {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #1f1f1f;
}

.site-header.menu-open .header-row {
  flex-shrink: 0;
}

@keyframes sidebar-drop {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar nav a {
  color: #fff;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 400;
  padding: 8px 0;
  line-height: 1.4em;
  letter-spacing: 0;
  display: block;
  -webkit-font-smoothing: antialiased;
}

.sidebar nav a:hover {
  background: rgba(245, 166, 35, .08);
  color: #f5a623;
}

.terms-pill {
  display: block;
  text-align: center;
  margin-top: 24px;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  color: #1a1512;
  background: linear-gradient(135deg, #f5a623, #e8941a);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.terms-pill:hover {
  filter: brightness(1.05);
}

.hdr-left {
  flex: 1;
  display: flex;
  align-items: center;
}

.hdr-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdr-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.logo {
  max-height: 70px;
  max-width: 400px;
  width: auto;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, .6));
}

/* Burger menu button (matches home) */
.burger {
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  padding: 8px;
}

.burger:hover {
  color: var(--amber-lt);
}

.burger svg {
  width: 24px;
  height: 24px;
}

/* Theme toggle (matches home #fgi-theme-toggle) */
#fgi-theme-toggle {
  width: 28px;
  height: 28px;
  border: none !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

html[data-theme='dark'] #fgi-theme-toggle:hover {
  transform: scale(1.07);
}

#fgi-theme-toggle:active {
  transform: scale(.93);
}

#fgi-theme-toggle:focus-visible {
  outline: 2px solid #4d9fff !important;
  outline-offset: 2px;
}

/* Slide-in menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(420px, 88vw);
  background: #1a1512;
  border-right: 1px solid var(--line);
  z-index: 201;
  transform: translateX(-102%);
  transition: transform .3s cubic-bezier(.32, .72, .35, 1);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.side-menu.open {
  transform: none;
}

.side-menu .menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--mut);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
}

.side-menu .menu-close:hover {
  color: var(--amber);
}

.side-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.side-menu nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 10px;
  transition: background .15s;
}

.side-menu nav a:hover {
  background: rgba(245, 166, 35, .08);
  color: var(--amber-lt);
}

.side-menu .menu-logo {
  max-height: 50px;
  width: auto;
  margin: 8px auto 0;
  display: block;
}

/* Light theme */
html[data-theme='light'] {
  --bg: #f7f3ec;
  --card: #fbf7f5;
  --line: #e2d9c8;
  --ink: #2a2118;
  --mut: #8a7a63;
  /* Matt 2026-11-03: one light-theme gold at the variable level — the
     bright dark-theme golds (#f5a623 / #ffc966) wash out on cream, so
     both amber steps take the podium gradient's deep end, #b87409.
     Every var(--amber) / var(--amber-lt) consumer (Recent link, hovers,
     the active location pill, focus ring) inherits the light shade. */
  --amber: #b87409;
  --amber-lt: #b87409;
}

html[data-theme='light'] body::before {
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245, 166, 35, .12), transparent);
}

html[data-theme='light'] .logo {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .15));
}

html[data-theme='light'] h1 {
  color: #1a1512;
}

html[data-theme='light'] .side-menu {
  background: #ffffff;
}

html[data-theme='light'] #fgi-theme-toggle {
  color: #2a2118 !important;
}

html[data-theme='light'] .burger-link,
html[data-theme='light'] #burgerBtn {
  color: #2a2118 !important;
}

.pagetitle {
  text-align: center;
  padding: 28px 24px 0;
  position: relative;
}

h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -.5px;
  color: #fff;
}

h1 .cherry {
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.sub {
  color: var(--mut);
  margin-top: 10px;
  font-size: 1.05rem;
  font-style: italic;
}

.stats {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 26px auto 0;
  flex-wrap: wrap;
  max-width: 700px;
}

.stat {
  background: rgba(245, 166, 35, .06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 26px;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 1.5rem;
  color: var(--amber-lt);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: .72rem;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px 40px;
  position: relative;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  transition: transform .2s, box-shadow .2s;
  animation: rise .5s ease both;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.card .plat {
  font-size: .75rem;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 5px 0 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td {
  padding: 11px 6px;
  border-top: 1px solid var(--line);
  font-size: .95rem;
}

tr:first-child td {
  border-top: none;
}

.medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 800;
  font-size: .85rem;
  background: #362b20;
  color: #c2b4a2;
  box-shadow: inset 0 0 0 1px #54432f;
}

/* Light theme only (Matt, 2026-11-02): ranks below the podium lose the
   dark-mode near-black fill for warm sand with a deep amber-brown
   number. Placed before the tr:nth-child podium rules so gold, silver
   and bronze keep winning there; .card .medal.r1/r2/r3 outrank this
   rule on specificity everywhere. Dark theme is untouched. */
html[data-theme='light'] .medal {
  background: #e9dec6;
  color: #8a5a00;
  box-shadow: inset 0 0 0 1px #ddd0b2;
}

tr:nth-child(1) .medal {
  background: linear-gradient(135deg, #ffc966, #b87409);
  color: #3a2500;
  box-shadow: 0 0 12px rgba(245, 166, 35, .5);
}

tr:nth-child(2) .medal {
  background: linear-gradient(135deg, #e8e8e8, #9a9aa5);
  color: #333;
}

tr:nth-child(3) .medal {
  background: linear-gradient(135deg, #e0a060, #8b5a2b);
  color: #2d1a08;
}

.name {
  font-weight: 600;
  padding-left: 8px;
}

.score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--amber-lt);
}

.when {
  font-size: .75rem;
  color: #665c4e;
  text-align: right;
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: var(--mut);
  padding: 80px 20px;
  font-size: 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.empty .big {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

footer {
  text-align: center;
  margin: 44px 0 12px;
  color: var(--mut);
  font-size: .9rem;
}

footer a {
  color: var(--amber);
  font-weight: 600;
  text-decoration: none;
}

.cherries {
  font-size: 1.1rem;
  letter-spacing: 6px;
  margin-top: 14px;
  opacity: .8;
}

[data-theme='light'] .topbar {
  background: transparent !important;
  box-shadow: none !important;
}

.topbar {
  --stick: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 8px -20px;
  flex-wrap: wrap;
  border-radius: 0 0 24px 24px;
  padding: 12px 20px;
  width: calc(100% + 40px);
  max-width: calc(100% + 40px);
  box-sizing: border-box;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
}

.topbar .search-open {
  transform: scale(calc(1 + var(--stick) * .10));
  transform-origin: center;
  transition: transform .18s ease-out;
}

.topbar .submit-btn {
  display: none !important;
  transform: scale(calc(1 + var(--stick) * .10));
  transform-origin: center;
}

.topbar .searchwrap {
  margin: 0;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.searchwrap button.search-open {
  width: 100%;
  padding: 14px 20px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(15, 12, 10, .5) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--mut);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: border .15s;
}

[data-theme=light] .searchwrap button.search-open {
  background: rgba(247, 243, 236, .5) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

}

.searchwrap button.search-open:hover {
  border-color: var(--amber);
  color: var(--ink);
}

/* --- Search overlay --- */
html[data-theme=light] .search-overlay {
  background: rgba(247, 243, 236, .97);
}

#burgerBtn {
  display: none !important;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 12, 10, .97);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity .8s ease;
}

.search-overlay.open {
  display: flex;
  opacity: 1;
}

.search-overlay-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

html[data-theme=light] .search-overlay-head input {
  background: #fbf7f5;
}

.search-overlay-head input {
  flex: 1;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f0c0a;
  color: var(--ink);
  font-size: 1.1rem;
  outline: none;
}

.search-overlay-head input:focus {
  border-color: var(--amber);
}

.search-overlay-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.search-overlay-close:hover {
  border-color: var(--amber);
}

.search-overlay-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 40px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  transition: border .15s, transform .1s;
  content-visibility: auto;
}
}

.search-result.enter {
  animation: rise .22s ease both;
}

.search-result:hover {
  border-color: var(--amber);
}

.search-result:active {
  transform: scale(.98);
}

.search-result .r-game {
  font-weight: 700;
  flex: 1;
}

.search-result .r-game mark {
  background: rgba(245, 166, 35, .35);
  color: var(--amber-lt);
  border-radius: 4px;
  padding: 0 2px;
}

.search-result .r-score {
  font-variant-numeric: tabular-nums;
  color: var(--amber-lt);
  font-weight: 700;
}

.search-result .r-plat {
  font-size: .75rem;
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-overlay-empty {
  text-align: center;
  color: var(--mut);
  padding: 60px 20px;
  font-size: 1.05rem;
  display: none;
}

.submit-btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, #f5a623, #d17f0a);
  color: #241500;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .15s, transform .1s;
}

.submit-btn:hover {
  filter: brightness(1.1);
}

.submit-btn:active {
  transform: scale(.97);
}

.auto-note {
  text-align: center;
  color: var(--mut);
  font-size: .9rem;
  font-style: italic;
  margin: -8px 0 28px;
}

.no-results {
  display: none;
  text-align: center;
  color: var(--mut);
  padding: 40px;
  font-size: 1.1rem;
}

@media(min-width:1600px) {
  h1 {
    font-size: 3.6rem;
  }

  .games {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  }
}

/* === Submit form styles === */
.submit-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

form {
  text-align: left;
}

label {
  display: block;
  font-size: .8rem;
  color: var(--mut);
  margin: 18px 0 7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  transition: border .15s;
}

select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  transition: border .15s;
}

.back {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: var(--mut);
  font-size: .85rem;
  text-decoration: none;
}

.back:hover {
  color: var(--amber);
}

/* Submit button */
form button[type="submit"],
.submit-btn {
  width: 100%;
  margin-top: 28px;
  margin-bottom: 16px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f5a623, #d17f0a);
  color: #241500;
  cursor: pointer;
  transition: transform .1s;
  display: block;
}

form button[type="submit"]:hover,
.submit-btn:hover {
  transform: translateY(-1px);
}

/* Submit page heading - restore original */
.submit-wrap h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 2.8rem !important;
  font-weight: 900 !important;
  letter-spacing: -.5px !important;
  color: #fff !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}

.submit-wrap .subtitle,
.submit-wrap p.sub {
  text-align: center !important;
  color: var(--mut) !important;
}

.tagline {
  color: var(--mut);
  font-style: italic;
  font-size: .95rem;
  margin-bottom: 24px;
  text-align: center;
}