@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&family=Arvo:wght@400;700&display=swap');

:root {
  /* Colors */
  --bg-dark-start: #0e1113;
  --bg-dark-end: #171c1f;
  --card-bg: #f5eedc;
  --card-text: #202326;
  --card-text-muted: #5e646a;
  --card-border: #e8dfcd;

  --gold-primary: #bfa054;
  --gold-semi: #ccbc92;
  --gold-hover: #d5b565;
  --gold-dark: #8c6e30;
  --gold-light: #f5eedc;

  --text-light: #e2e8f0;
  --text-muted: #8e959d;
  --border-dark: rgba(255, 255, 255, 0.08);

  /* Fonts */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Outfit', sans-serif;
  --font-slab: 'Arvo', serif;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--bg-dark-start) 0%, var(--bg-dark-end) 100%);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  padding: 0 1.5rem;
  margin: 0 auto;
}

/* Header Styles */
.header {
  width: 100%;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-hover);
  letter-spacing: -0.02em;
}

.logo svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: var(--gold-primary);
}

.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  color: var(--text-light);
}

.logo-text span {
  color: var(--gold-primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
  transition: color 0.2s ease;
  opacity: 0.85;
}

.nav-link:hover {
  color: var(--gold-hover);
  opacity: 1;
}

.btn-signin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-signin:hover {
  background: rgba(191, 160, 84, 0.08);
  border-color: var(--gold-hover);
  color: var(--gold-hover);
  transform: translateY(-1px);
}

.btn-signin svg,
.btn-signin-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-top: 13rem; /* Space for the peeking mascot to match the desired overlap */
  margin-bottom: 3.5rem;
  width: 100%;
}

.hero-cartoon-wrapper {
  position: absolute;
  top: -2.5rem; /* Sits higher, overlapping header slightly */
  left: 50%;
  transform: translateX(-50%);
  width: 380px; /* Size for correct desktop proportions */
  z-index: 1; /* Behind title (z-index: 2) but in front of background */
  transition: transform 0.3s ease;
  pointer-events: none;
}

.hero-cartoon {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.hero-cartoon:hover {
  transform: scale(1.05) translateY(-5px);
}

.hero-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-serif);
  font-size: 5.5rem;
  font-weight: 700;
  color: var(--card-bg);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
  user-select: none;
}

.hero-title span {
  color: var(--gold-primary);
}

.hero-subtitle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 750px;
}

.hero-subtitle-line {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-primary), transparent);
  opacity: 0.5;
}

.hero-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold-primary);
  white-space: nowrap;
}

/* Split Main Container */
.search-section {
  display: flex;
  position: relative;
  align-items: stretch;
  gap: 0;
  width: 100%;
  margin-bottom: 4rem;
}

/* Cards layout */
.card-wrapper {
  flex: 1;
  background-color: var(--card-bg);
  color: var(--card-text);
  border-radius: 18px;
  padding: 2.25rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

/* Card Headers */
.card-header-block {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.card-header-icon {
  width: 2.75rem;
  height: 2.75rem;
  background-color: #1c1e22;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: #fff;
}

.card-header-icon img,
.card-header-icon .card-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-header-info {
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--card-text-muted);
  margin-top: 0.15rem;
  font-weight: 400;
}

/* Left Card Elements */
.input-search-container {
  display: flex;
  background: #ffffff;
  border: 1.5px solid #d8cfba;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.25rem;
}

.input-search-container:focus-within {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(191, 160, 84, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.search-field-icon {
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: #8c9096;
}

.search-field-icon svg,
.search-field-icon .search-icon {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.search-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  padding: 0.85rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--card-text);
  outline: none;
}

.search-input::placeholder {
  color: #9aa1a9;
}

.btn-search-submit {
  background-color: var(--gold-primary);
  border: none;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-search-submit:hover {
  background-color: var(--gold-hover);
}

.btn-search-submit svg,
.btn-search-submit-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.digging-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  color: #2c2c2c;
  font-weight: 500;
}

.digging-info svg,
.digging-info .digging-icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.popular-searches {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.popular-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7b7e83;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-btn {
  background-color: var(--gold-semi);
  border: 1px solid #e5dcce;
  color: #4a4d52;
  padding: 0.5rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tag-btn:hover {
  background-color: #ffffff;
  border-color: var(--gold-primary);
  color: #1c1e22;
  box-shadow: 0 2px 8px rgba(191, 160, 84, 0.1);
  transform: translateY(-1px);
}

/* OR Separator */
.divider-col {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 52px;
  background-color: #111417;
  flex-shrink: 0;
  box-sizing: border-box;
}

.divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  border-left: 1px dashed rgba(191, 160, 84, 0.45);
}

.divider-badge {
  position: absolute;
  z-index: 10;
  width: 52px;
  height: 52px;
  background-color: #111417;
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Right Card Elements - Board & Setup */
.board-section-container {
  display: flex;
  gap: 1.5rem;
}

.chessboard-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 260px;
  background-color: #ded6c4;
  border-radius: 6px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 8x8 chess layout */
.chessboard-inner {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1;
}

.chess-square {
  width: 100%;
  height: 100%;
}

.chess-square.light {
  background-color: #f1ebd8;
}

.chess-square.dark {
  background-color: #bcae97;
}

.board-placeholder-overlay {
  position: absolute;
  top: 3rem;
  left: 3rem;
  right: 3rem;
  bottom: 3rem;
  background: rgba(245, 238, 220, 0.95);
  border: 2px dashed #bba585;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(2px);
}

.board-placeholder-overlay svg,
.board-placeholder-overlay .board-placeholder-icon {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.board-placeholder-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #635b50;
  line-height: 1.3;
}

/* Board Coordinates */
.board-coords-y {
  position: absolute;
  left: 0.125rem;
  top: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  font-size: 0.65rem;
  font-weight: 700;
  color: #6e6557;
  pointer-events: none;
}

.board-coords-x {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.125rem;
  display: flex;
  justify-content: space-around;
  font-size: 0.65rem;
  font-weight: 700;
  color: #6e6557;
  pointer-events: none;
}

.board-sidebar {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  margin-bottom: 1rem;
}

.instruction-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.instruction-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #4a4d52;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.instruction-icon svg,
.instruction-icon .instruction-img {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
}

.instruction-text {
  font-size: 0.825rem;
  line-height: 1.35;
  color: #3b3d42;
  font-weight: 500;
}

.btn-search-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background-color: var(--gold-primary);
  border: none;
  color: #1c1e22;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(191, 160, 84, 0.15);
}

.btn-search-position:hover {
  background-color: var(--gold-hover);
  box-shadow: 0 6px 15px rgba(191, 160, 84, 0.3);
  transform: translateY(-1px);
}

.btn-search-position svg,
.btn-search-position-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

/* Footer Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  width: 100%;
  margin-bottom: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-dark);
}

.feature-col {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

.feature-icon-container {
  color: var(--gold-primary);
  margin-bottom: 0.25rem;
}

.feature-icon-container svg,
.feature-icon-container .feature-icon {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
}

.feature-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-light);
  text-transform: uppercase;
}

.feature-desc {
  font-size: 0.825rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Bottom separator & badge */
.bottom-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 3rem;
}

.bottom-line-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
}

.bottom-line {
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--border-dark), transparent);
}

.bottom-badge {
  position: absolute;
  padding: 0 1rem;
  color: var(--gold);
}

.bottom-badge svg,
.bottom-badge-icon {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
}

/* Responsive Media Queries */

@media (max-width: 1024px) {
  .hero {
    padding-top: 10.5rem;
    margin-bottom: 2.5rem;
  }

  .hero-cartoon-wrapper {
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    z-index: 1;
    pointer-events: none;
  }

  .hero-cartoon {
    width: 100%;
    height: auto;
  }

  .hero-cartoon:hover {
    transform: scale(1.03) translateY(-3px);
  }

  .hero-title {
    font-size: 4rem;
  }
  
  .search-section {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .divider-col {
    width: 100%;
    height: 42px;
    border-left: none;
    border-right: none;
  }
  
  .divider-line {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 0;
    transform: translateY(-50%);
    border-left: none;
    border-top: 1px dashed rgba(191, 160, 84, 0.45);
  }
  
  .divider-badge {
    transform: none;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 1.25rem 0;
  }
  
  .nav {
    gap: 1.25rem;
  }
  
  .hero {
    margin-top: 1.5rem;
    padding-top: 8.5rem;
    margin-bottom: 2rem;
    width: 100%;
  }

  .hero-subtitle-container {
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
  }

  .hero-subtitle-line {
    display: none; /* Hide lines on mobile when text wraps */
  }
  
  .hero-cartoon-wrapper {
    top: -1.75rem;
    width: 250px;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    white-space: normal; /* Allow wrapping */
    text-align: center;
    line-height: 1.4;
  }

  .popular-tags {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .board-section-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .chessboard-wrapper {
    width: 100%;
    max-width: 280px;
  }
  
  .board-sidebar {
    width: 100%;
  }
  
  .btn-search-position {
    margin-top: 1.5rem;
  }
}

@media (max-width: 576px) {
  .search-field-icon {
    display: none; /* Hide duplicate left search icon to save space */
  }
  
  .search-input {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    min-width: 0;
  }
  
  .btn-search-submit {
    padding: 0 0.85rem;
  }
  
  .btn-search-submit-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}

@media (max-width: 480px) {
  .header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 0;
  }
  
  .logo-img {
    height: 36px;
  }
  
  .nav {
    width: 100%;
    justify-content: center;
    gap: 1.25rem;
  }
  
  .hero {
    padding-top: 6rem;
    margin-bottom: 1.5rem;
  }

  .hero-cartoon-wrapper {
    top: -1.25rem;
    width: 180px;
  }

  .hero-title {
    font-size: 2.25rem;
  }
  
  .card-wrapper {
    padding: 1.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}