/* ============================================
   E2E4 Chess Club — Stylesheet
   ============================================ */

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

:root {
  --bg:        #0d0e0f;
  --surface:   #141618;
  --surface2:  #1c1e21;
  --border:    #2a2d32;
  --gold:      #c9a84c;
  --gold-dim:  #8a6e2f;
  --cream:     #f0e6d0;
  --text:      #e8e2d9;
  --text-dim:  #8a8a8a;
  --accent:    #c9a84c;
  --red:       #e05252;

  --sq-light: #e8d5a3;
  --sq-dark:  #8b6440;

  --r: 4px;
  --r-lg: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

em { font-style: italic; color: var(--gold); }

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: #0d0e0f;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--r);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: #d4b45c; transform: translateY(-1px); }
.btn-primary.large { padding: 14px 32px; font-size: 15px; }
.btn-primary.full-width { width: 100%; text-align: center; margin-top: 8px; }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--r);
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost.large { padding: 14px 32px; font-size: 15px; }

.btn-small {
  display: inline-block;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--r);
  border: 1px solid var(--gold-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-small:hover { background: rgba(201,168,76,0.1); }

/* ---- HEADER ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13,14,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.logo.small { font-size: 18px; }
.logo-e2 { color: var(--text); }
.logo-arrow { color: var(--gold); margin: 0 2px; }
.logo-e4 { color: var(--gold); }
.logo-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 24px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--text); }

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 60px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 20px;
  color: var(--cream);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 420px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ---- CHESS BOARD ---- */
.board-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.board-labels-letters {
  display: flex;
  gap: 0;
  margin-left: 20px;
  margin-bottom: 4px;
  width: 400px;
}
.board-labels-letters span {
  width: 50px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.board-labels-numbers {
  position: absolute;
  left: 0;
  top: 30px;
  display: flex;
  flex-direction: column;
  height: 400px;
}
.board-labels-numbers span {
  height: 50px;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  padding-right: 4px;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 50px);
  grid-template-rows: repeat(8, 50px);
  border: 2px solid var(--gold-dim);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 40px rgba(0,0,0,0.6), 0 0 80px rgba(201,168,76,0.08);
}

.square {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: default;
  user-select: none;
  position: relative;
  transition: background 0.15s;
}
.square.light { background: var(--sq-light); }
.square.dark  { background: var(--sq-dark); }
.square.highlight-from { background: rgba(201,168,76,0.55) !important; }
.square.highlight-to   { background: rgba(201,168,76,0.75) !important; }
.square.last-from { background: rgba(201,168,76,0.3) !important; }
.square.last-to   { background: rgba(201,168,76,0.45) !important; }

.piece {
  display: block;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
  transition: transform 0.08s;
}
.piece-moving {
  animation: piecePop 0.25s ease-out;
}
@keyframes piecePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.move-indicator {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gold);
  font-family: 'Inter', monospace;
  letter-spacing: 0.06em;
  min-height: 24px;
}
.move-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ---- SECTIONS ---- */
.section-about,
.section-training,
.section-training,
.section-join,
.section-contacts { padding: 100px 0; }

.section-tournaments,
.section-schedule { padding: 100px 0; background: var(--surface); }

.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--cream);
  margin-top: 8px;
}
.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- ABOUT CARDS ---- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.about-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-4px);
}
.about-icon { font-size: 36px; margin-bottom: 16px; }
.about-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--cream);
}
.about-card p { font-size: 14px; color: var(--text-dim); line-height: 1.65; }

/* ---- TOURNAMENTS ---- */
.tournament-list { display: flex; flex-direction: column; gap: 16px; }
.tournament-item {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  transition: border-color 0.2s;
}
.tournament-item:hover { border-color: var(--gold-dim); }

.t-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}
.t-day { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--gold); line-height: 1; }
.t-month { font-size: 11px; color: var(--text-dim); letter-spacing: 0.08em; }

.t-info { flex: 1; }
.t-name { font-size: 16px; font-weight: 500; color: var(--cream); margin-bottom: 4px; }
.t-meta { font-size: 13px; color: var(--text-dim); }

.t-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.t-badge.open { background: rgba(80,180,100,0.15); color: #5bc478; }
.t-badge.featured { background: rgba(201,168,76,0.15); color: var(--gold); }
.t-badge.kids { background: rgba(100,140,220,0.15); color: #7aaef5; }

/* ---- PRICING ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px 28px;
  position: relative;
  transition: border-color 0.2s;
}
.price-card.featured {
  border-color: var(--gold-dim);
  background: var(--surface2);
}
.price-badge {
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gold);
  color: #0d0e0f;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}
.price-tier { font-size: 13px; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.price-amount {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 24px;
}
.price-amount span { font-size: 16px; font-weight: 400; color: var(--text-dim); }
.price-features { list-style: none; margin-bottom: 28px; }
.price-features li { font-size: 14px; color: var(--text-dim); padding: 6px 0; border-bottom: 1px solid var(--border); }
.price-features li:last-child { border: none; }

/* ---- SCHEDULE ---- */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.schedule-day {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sch-item {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid rgba(42,45,50,0.5);
}
.sch-time { font-size: 12px; color: var(--text-dim); letter-spacing: 0.04em; }
.sch-name { font-size: 14px; color: var(--cream); margin-top: 2px; }

/* ---- JOIN SECTION ---- */
.section-join { background: var(--surface); }
.join-inner {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 80px;
  align-items: center;
}
.join-board-mini {
  width: 320px;
  height: 320px;
  display: grid;
  grid-template-columns: repeat(8, 40px);
  grid-template-rows: repeat(8, 40px);
  border: 1px solid var(--gold-dim);
  opacity: 0.4;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}
.join-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 16px;
  line-height: 1.2;
}
.join-content p { font-size: 15px; color: var(--text-dim); margin-bottom: 28px; }

.join-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
}
.form-input:focus { border-color: var(--gold-dim); }
.form-input::placeholder { color: var(--text-dim); }

/* ---- CONTACTS ---- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.contact-desc { font-size: 14px; color: var(--text-dim); margin: 16px 0 24px; max-width: 320px; }
.contact-details { display: flex; flex-direction: column; gap: 12px; }
.contact-row { font-size: 14px; color: var(--text-dim); }

.map-placeholder {
  height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}
.map-pin { font-size: 32px; }
.map-link { color: var(--gold); cursor: pointer; font-size: 13px; margin-top: 4px; }

/* ---- FOOTER ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  background: var(--surface);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { font-size: 13px; color: var(--text-dim); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
  .board-wrapper { order: -1; }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr; }
  .join-inner { grid-template-columns: 1fr; }
  .join-board-mini { display: none; }
  .contacts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .tournament-item { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; gap: 12px; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .piece-moving { animation: none; }
  .move-dot { animation: none; }
}
