:root {
  /* Tournament-hall dark theme built around real chessboard colors */
  --bg: #0e120e;
  --bg-soft: #151b15;
  --card: #18201a;
  --card-2: #1d271e;
  --card-hover: #233024;
  --border: #2c3a2e;
  --border-soft: #233026;
  --text: #edeae1;
  --muted: #9aa492;
  --accent: #e8b84b;        /* gold */
  --accent-soft: #f4d589;
  --green: #84a85b;         /* board light-green */
  --green-deep: #5c7a3a;
  --sq-light: #c8d3a8;      /* board square colors (for checker motifs) */
  --sq-dark: #5c7a3a;
  --good: #6fce8f;
  --bad: #e2685f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.55);
  --display: "Cinzel", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(1100px 560px at 82% -8%, rgba(132, 168, 91, 0.12), transparent),
    radial-gradient(900px 520px at -8% 6%, rgba(232, 184, 75, 0.10), transparent),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Reusable checkerboard pattern */
.checker {
  background-image:
    linear-gradient(45deg, var(--sq-dark) 25%, transparent 25%, transparent 75%, var(--sq-dark) 75%),
    linear-gradient(45deg, var(--sq-dark) 25%, transparent 25%, transparent 75%, var(--sq-dark) 75%);
  background-color: var(--sq-light);
  background-size: 56px 56px;
  background-position: 0 0, 28px 28px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.5rem;
  background: rgba(14, 18, 14, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}
.knight {
  font-size: 1.9rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(232, 184, 75, 0.4));
}

.topnav { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.topnav a {
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topnav a:hover {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 4.5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}
.hero-board {
  position: absolute;
  inset: -10%;
  z-index: -3;
  background-image:
    linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%),
    linear-gradient(45deg, #ffffff 25%, transparent 25%, transparent 75%, #ffffff 75%);
  background-size: 92px 92px;
  background-position: 0 0, 46px 46px;
  opacity: 0.045;
  transform: rotate(-4deg) scale(1.2);
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 70% at 50% 0%, rgba(132, 168, 91, 0.20), transparent 70%),
    radial-gradient(40% 60% at 80% 100%, rgba(232, 184, 75, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(14, 18, 14, 0.2), var(--bg) 92%);
}
.hero-pieces {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 4.5rem;
  color: rgba(237, 234, 225, 0.05);
  pointer-events: none;
  user-select: none;
}
.hero-pieces span { animation: bob 7s ease-in-out infinite; }
.hero-pieces span:nth-child(2n) { animation-duration: 9s; animation-delay: -2s; }
.hero-pieces span:nth-child(3n) { animation-duration: 8s; animation-delay: -4s; }

.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero-knight {
  display: inline-block;
  font-size: 4.5rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 55%, var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(232, 184, 75, 0.35));
  animation: bob 5s ease-in-out infinite;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  margin: 0.6rem 0 0.4rem;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #fff7e6, var(--accent-soft) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.hero-cta { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #2a2208;
  box-shadow: 0 8px 22px rgba(232, 184, 75, 0.3);
}
.btn-gold:hover { box-shadow: 0 12px 28px rgba(232, 184, 75, 0.45); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--green); color: #fff; background: rgba(132, 168, 91, 0.12); }

/* Checkered rank at the bottom edge of the hero */
.rank-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background-image: linear-gradient(90deg, var(--sq-dark) 50%, var(--sq-light) 50%);
  background-size: 20px 100%;
  opacity: 0.55;
}

/* ---------- Announcement ---------- */
.announcement {
  position: relative;
  max-width: 1280px;
  margin: 1.4rem auto 0;
  padding: 0.95rem 1.1rem 0.95rem 1.4rem;
  background: linear-gradient(135deg, rgba(232, 184, 75, 0.14), rgba(232, 184, 75, 0.04));
  border: 1px solid rgba(232, 184, 75, 0.34);
  border-radius: var(--radius);
  color: #f6e3b6;
  font-size: 0.96rem;
  overflow: hidden;
}
.announcement::before {
  content: "♚";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.6rem;
  max-width: 1280px;
  margin: 1.6rem auto;
  padding: 0 1.5rem;
}

.card-section { margin-bottom: 2.4rem; scroll-margin-top: 80px; }
.card-section h2,
.sidebar h2 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 0 0 1.1rem;
  position: relative;
}
/* Checkered underline under section titles */
.card-section h2::after {
  content: "";
  flex: 1;
  height: 7px;
  margin-left: 0.4rem;
  border-radius: 2px;
  background-image: linear-gradient(90deg, var(--sq-dark) 50%, transparent 50%);
  background-size: 14px 100%;
  opacity: 0.5;
}

/* Chess piece in a board-square tile */
.piece-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 9px;
  color: #1a210f;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(232, 184, 75, 0.25);
}

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

/* ---------- Cards ---------- */
.card {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
}
/* faint chess-piece watermark */
.card::before {
  content: "♞";
  position: absolute;
  right: -0.4rem;
  bottom: -1.1rem;
  font-size: 5rem;
  line-height: 1;
  color: rgba(237, 234, 225, 0.035);
  pointer-events: none;
  transition: color 0.18s, transform 0.18s;
}
/* gold rank accent that grows on hover */
.card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--green));
  opacity: 0;
  transition: opacity 0.18s;
}
.card:hover::after { opacity: 1; }
a.card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}
a.card:hover::before { color: rgba(132, 168, 91, 0.1); transform: rotate(-8deg); }
.card h3 { margin: 0 0 0.35rem; font-size: 1.08rem; color: var(--text); font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; position: relative; }

.meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.55rem 0; font-size: 0.88rem; position: relative; }
.meta-row span { color: var(--muted); }
.meta-row b { color: var(--text); font-weight: 600; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; position: relative; }
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(132, 168, 91, 0.16);
  color: #c4dca0;
  border: 1px solid rgba(132, 168, 91, 0.34);
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
}
.level-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2a2208;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  position: relative;
}

/* ---------- Videos ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}
.video-card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.video-card:hover { transform: translateY(-4px); border-color: var(--green); box-shadow: var(--shadow-lift); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card .v-meta { padding: 0.85rem 1.05rem; }
.video-card h3 { margin: 0 0 0.25rem; font-size: 1.02rem; font-weight: 700; }
.video-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* ---------- Sidebar / News ---------- */
.sidebar {
  align-self: start;
  position: sticky;
  top: 80px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sidebar-head h2 { margin: 0; font-size: 1.2rem; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  flex: none;
  cursor: pointer;
  font-size: 1.15rem;
  transition: color 0.15s, border-color 0.15s, transform 0.4s;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); }
.ghost-btn.spin { transform: rotate(360deg); }

.news { margin-top: 0.9rem; overflow-y: auto; padding-right: 4px; }
.news-item { padding: 0.65rem 0; border-bottom: 1px solid var(--border-soft); }
.news-item:last-child { border-bottom: 0; }
.news-item a { color: var(--text); font-weight: 600; font-size: 0.92rem; display: block; }
.news-item a:hover { color: var(--accent); }
.news-meta { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.25rem; color: var(--muted); font-size: 0.74rem; }
.news-src { color: var(--green); font-weight: 600; }

.news-sources { margin-top: 0.7rem; font-size: 0.72rem; color: var(--muted); border-top: 1px solid var(--border-soft); padding-top: 0.6rem; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot.ok { background: var(--good); }
.dot.bad { background: var(--bad); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 0 1rem 2rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.footer-strip {
  height: 8px;
  margin-bottom: 1.6rem;
  background-image: linear-gradient(90deg, var(--sq-dark) 50%, var(--sq-light) 50%);
  background-size: 20px 100%;
  opacity: 0.5;
}
.site-footer a { color: var(--accent); }

.muted { color: var(--muted); }
.skeleton { color: var(--muted); font-style: italic; }

/* ---------- Motion ---------- */
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-knight, .hero-pieces span { animation: none; }
  .btn:hover, a.card:hover, .video-card:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .news { max-height: 420px; }
}
@media (max-width: 520px) {
  .site-header { padding: 0.6rem 1rem; }
  .hero { padding: 3rem 1.1rem 3rem; }
  .layout { padding: 0 1rem; }
  .topnav a { padding: 0.35rem 0.6rem; font-size: 0.82rem; }
}
