/* ============================================================
   United Dueling Amity (UDA) website styles
   Light theme: white and pale mint, lime to teal accents,
   stone gray headings.
   ============================================================ */
:root {
  --bg: #f6faf7;
  --surface: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(46, 140, 96, 0.16);
  --line-strong: rgba(34, 168, 116, 0.42);
  --text: #1f2a26;
  --muted: #56655e;
  --stone: #3d4642;
  --lime: #8ccf3f;
  --emerald: #28b46e;
  --teal: #22c4aa;
  --deep: #1a8c5c;
  --grad: linear-gradient(110deg, #8ccf3f 0%, #3dbd72 50%, #22c4aa 100%);
  --grad-text: linear-gradient(110deg, #5ea82a 0%, #1fa866 50%, #129c88 100%);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Full-site background: white center with lime and teal wisps at the sides */
.site-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: var(--bg) url("background.jpg") center top / cover no-repeat;
}
/* Sections below the hero sit on a light veil so the wisps stay subtle */
section { background: rgba(250, 253, 251, 0.78); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
footer { background: rgba(255, 255, 255, 0.9); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Nav */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Cinzel', serif; font-weight: 800; font-size: 1.35rem; letter-spacing: 3px; }
.logo img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line-strong); }
.links { display: flex; gap: 26px; font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.links a { position: relative; padding: 4px 0; transition: color .25s; }
.links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.links a:hover { color: var(--text); }
.links a:hover::after { transform: scaleX(1); }
.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero {
  padding: 64px 0 90px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--line);
}
/* Logo shown as a dark round medallion so its black background fits the light page */
.hero-logo {
  width: min(340px, 72vw); aspect-ratio: 1; margin: 0 auto 26px; display: block;
  object-fit: cover; border-radius: 50%;
  background: #000;
  box-shadow:
    0 0 0 5px #ffffff,
    0 0 0 7px rgba(40, 180, 110, 0.55),
    0 22px 60px -12px rgba(26, 140, 92, 0.45),
    0 0 90px 10px rgba(140, 207, 63, 0.18);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.eyebrow { color: var(--deep); font-weight: 700; letter-spacing: 4px; font-size: 0.78rem; text-transform: uppercase; }
.hero h1 {
  font-family: 'Cinzel', serif; font-weight: 800; color: var(--stone);
  font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.1;
  margin: 18px 0;
}
.hero p { color: var(--muted); max-width: 600px; margin: 14px auto 34px; font-size: 1.06rem; }
.btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px; border-radius: 10px; font-weight: 600; letter-spacing: .3px;
  transition: transform .25s ease, box-shadow .3s ease, background .3s ease, border-color .3s;
}
/* Hollow button with an animated lime to teal outline */
.btn-primary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
}
.btn-primary::before,
.tab.active::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: linear-gradient(90deg, #8ccf3f, #3dbd72, #22c4aa, #3dbd72, #8ccf3f);
  background-size: 300% 100%;
  animation: flow 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none; z-index: -1;
}
@keyframes flow {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: rgba(140, 207, 63, 0.10);
  box-shadow: 0 10px 28px -12px rgba(26, 140, 92, 0.5);
}
.btn-primary:hover::before { animation-duration: 1.6s; }

/* Click effect: ripple from the click point plus a soft pulse */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: radial-gradient(circle, rgba(140, 207, 63, 0.55), rgba(34, 196, 170, 0.25) 45%, transparent 70%);
  transform: scale(0);
  animation: ripple .55s ease-out forwards;
}
@keyframes ripple {
  to { transform: scale(22); opacity: 0; }
}
.btn.clicked, .tab.clicked { animation: press .4s ease; }
.btn.clicked { box-shadow: 0 0 0 1px rgba(40, 180, 110, 0.25), 0 0 26px -2px rgba(40, 180, 110, 0.55); }
.btn-primary.clicked::before { animation-duration: .6s; filter: brightness(1.15); }
@keyframes press {
  0% { transform: scale(1); }
  35% { transform: scale(.95); }
  100% { transform: scale(1); }
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--emerald);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 26px -14px rgba(26, 140, 92, 0.5);
}

.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Sections */
section { padding: 84px 0; border-bottom: 1px solid var(--line); }
h2 { font-family: 'Cinzel', serif; font-weight: 700; color: var(--stone); font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 10px; letter-spacing: 1px; }
.divider { width: 56px; height: 3px; background: var(--grad); border-radius: 2px; margin: 4px 0 18px; }
.sub { color: var(--muted); margin-bottom: 36px; max-width: 640px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px -16px rgba(20, 80, 50, 0.35);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 34px -18px rgba(26, 140, 92, 0.45);
}
.card h3 { font-size: 1.08rem; margin-bottom: 8px; color: var(--stone); font-weight: 700; }
.card h3::before {
  content: "\2726"; margin-right: 8px; font-size: .85em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card p { color: var(--muted); font-size: 0.95rem; }

/* Leaderboard */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem;
  transition: color .25s, border-color .25s, transform .2s, box-shadow .3s;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.tab.active {
  color: var(--text); border-color: transparent;
  background: rgba(140, 207, 63, 0.10);
  box-shadow: 0 6px 20px -12px rgba(26, 140, 92, 0.5);
}
.board { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 22px -16px rgba(20, 80, 50, 0.35); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; }
th { background: rgba(40, 180, 110, 0.08); color: var(--muted); font-size: 0.76rem; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(140, 207, 63, 0.08); }
tr + tr td { border-top: 1px solid var(--line); }
td.rank { font-weight: 700; width: 70px; color: var(--muted); }
td.score { text-align: right; font-weight: 700; color: var(--stone); font-variant-numeric: tabular-nums; }
th.score { text-align: right; }
.r1 { color: #c18a1c !important; } .r2 { color: #7f8a85 !important; } .r3 { color: #a8693a !important; }
.note { color: var(--muted); font-size: 0.82rem; margin-top: 12px; }

/* Tournaments */
.event { display: flex; gap: 18px; align-items: flex-start; }
.date {
  min-width: 64px; text-align: center; border-radius: 10px; padding: 8px 6px;
  border: 1px solid var(--line-strong);
  background: rgba(140, 207, 63, 0.10);
}
.date .m { font-size: 0.7rem; color: var(--deep); font-weight: 700; letter-spacing: 1.5px; }
.date .d { font-size: 1.5rem; font-weight: 700; font-family: 'Cinzel', serif; color: var(--stone); }
.tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 3px 10px; letter-spacing: .5px;
  border-radius: 999px; background: rgba(40, 180, 110, 0.12); color: var(--deep); margin-bottom: 6px;
}
.event h3::before { content: none; }

.empty {
  text-align: center; padding: 44px 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
}
.empty-icon {
  font-size: 1.6rem; margin-bottom: 6px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.empty h3 { font-size: 1.1rem; color: var(--stone); margin-bottom: 6px; font-weight: 700; }
.empty p { color: var(--muted); font-size: .95rem; max-width: 440px; margin: 0 auto; }
#tournament-list:empty { display: none; }
.grid:empty { display: none; }

/* Rules */
ol.rules { counter-reset: r; list-style: none; display: grid; gap: 12px; }
ol.rules li {
  counter-increment: r; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px 16px 60px; position: relative; color: var(--muted);
  box-shadow: 0 4px 16px -14px rgba(20, 80, 50, 0.35);
  transition: border-color .3s;
}
ol.rules li:hover { border-color: var(--line-strong); }
ol.rules li strong { color: var(--text); }
ol.rules li::before {
  content: counter(r); position: absolute; left: 20px; top: 13px;
  font-family: 'Cinzel', serif; font-weight: 800; font-size: 1.25rem;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* CTA + footer */
.cta { text-align: center; position: relative; }
.cta .divider { margin: 4px auto 18px; }
footer { padding: 34px 0; color: var(--muted); font-size: 0.85rem; text-align: center; border-top: 1px solid var(--line); }

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Active page in the nav */
.links a.active { color: var(--text); }
.links a.active::after { transform: scaleX(1); }

/* Header used on inner pages */
.page-hero {
  padding: 70px 0 56px; text-align: center;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-family: 'Cinzel', serif; font-weight: 800; letter-spacing: 1px; color: var(--stone);
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.1; margin: 14px 0 12px;
  text-shadow: 0 1px 0 #fff;
}
.page-hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 1.04rem; }
.page-hero .divider { margin: 18px auto 0; }

/* Smaller sub-headings inside a page */
h2.small { font-size: clamp(1.3rem, 3vw, 1.7rem); }
.stack > * + * { margin-top: 64px; }

/* Home page previews */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.preview { display: flex; flex-direction: column; }
.preview .preview-body { flex: 1; margin: 6px 0 18px; }
.mini-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: .95rem;
}
.mini-row:first-child { border-top: 0; }
.mini-row .pos { font-weight: 700; width: 28px; }
.mini-row .who { flex: 1; color: var(--text); }
.mini-row .pts { font-weight: 700; color: var(--stone); font-variant-numeric: tabular-nums; }
.preview .muted { color: var(--muted); font-size: .95rem; }
.text-link {
  align-self: flex-start; font-weight: 700; font-size: .92rem; color: var(--deep);
  display: inline-flex; gap: 6px; align-items: center;
}
.text-link span { transition: transform .25s ease; }
.text-link:hover span { transform: translateX(3px); }

.empty.compact { padding: 30px 20px; }
.callout { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.callout p { margin: 0; }

@media (max-width: 760px) {
  .links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
  }
  .links.open { display: flex; }
  .links a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .links a::after { display: none; }
  .menu-btn { display: block; }
  th, td { padding: 12px 12px; }
  section { padding: 60px 0; }
  .hero { padding: 40px 0 70px; }
  .page-hero { padding: 48px 0 40px; }
  .callout { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
