/* =====================================================
   Boardify — Global Stylesheet
   Dark atmospheric board-game theme
   ===================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0d0905;
  --bg-card:      #1c1208;
  --bg-card-hover:#261a0c;
  --accent:       #c8922a;
  --accent-dim:   #8a6118;
  --text:         #e8d5b0;
  --text-muted:   #9e8a6a;
  --border:       #3a2810;
  --success:      #5a9a4a;
  --error:        #c04a3a;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,0.7);
}

html, body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
}

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

/* --- Page Wrapper --- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================================================
   HEADER — Search Page
   ===================================================== */
.site-header {
  text-align: center;
  padding: 4rem 1rem 2.5rem;
}

.logo {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 16px rgba(200,146,42,0.6));
}

.site-title {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(200,146,42,0.35);
  margin-bottom: 0.5rem;
}

.site-tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-style: italic;
}

/* =====================================================
   SITE NAVIGATION
   ===================================================== */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0 2rem;
}

.nav-link {
  display: inline-block;
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav-link:hover {
  color: var(--text);
  border-color: var(--accent-dim);
  background: var(--bg-card);
  text-decoration: none;
}
.nav-link.active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(200,146,42,0.1);
  font-weight: 700;
}

.coming-soon-banner {
  text-align: center;
  padding: 0.5rem 1rem;
  background: rgba(200, 146, 42, 0.08);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

/* =====================================================
   SEARCH BOX
   ===================================================== */
.search-section {
  flex: 1;
  padding: 0 0 2rem;
}

.search-box {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

/* =====================================================
   AUTOCOMPLETE DROPDOWN
   ===================================================== */
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  z-index: 200;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.suggestions-dropdown.hidden { display: none; }

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg-card-hover); }

.suggestion-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.suggestion-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-item:hover .suggestion-name { color: var(--accent); }

.suggestion-badge {
  font-size: 0.7rem;
  color: var(--success);
  background: rgba(90,154,74,0.12);
  border: 1px solid rgba(90,154,74,0.3);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn {
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: #0d0905;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.search-btn:hover  { background: #daa940; }
.search-btn:active { transform: scale(0.97); }

/* =====================================================
   STATUS MESSAGES
   ===================================================== */
.loading {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin: 2rem 0;
  font-size: 1rem;
}

.error-msg {
  text-align: center;
  color: var(--error);
  margin: 1rem 0;
  font-size: 0.95rem;
  min-height: 1.2rem;
}

/* =====================================================
   RESULTS GRID
   ===================================================== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: var(--shadow);
}
.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.85), 0 0 12px rgba(200,146,42,0.15);
}

.game-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.game-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.game-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.year {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.has-music {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--success);
  background: rgba(90,154,74,0.12);
  border: 1px solid rgba(90,154,74,0.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-style: normal;
}

/* =====================================================
   PLAYER PAGE HEADER
   ===================================================== */
.player-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  color: var(--accent);
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.back-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent-dim);
  text-decoration: none;
}

.player-game-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.game-thumbnail {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.player-title {
  font-size: 1.6rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(200,146,42,0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   YOUTUBE PLAYER
   ===================================================== */
.player-section {
  flex: 1;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.player-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8), 0 0 40px rgba(200,146,42,0.08);
  border: 1px solid var(--border);
}

.player-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Now Playing badge --- */
.now-playing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.now-playing-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* --- No music fallback --- */
.no-music-msg {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.no-music-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-music-msg h2 {
  color: var(--text);
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

.no-music-msg p {
  margin-bottom: 1.5rem;
  font-style: italic;
  font-size: 0.95rem;
}

.back-link-btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: #0d0905;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: inherit;
  transition: background 0.2s;
}
.back-link-btn:hover {
  background: #daa940;
  text-decoration: none;
}

/* =====================================================
   SOLO BOTS — Coming Soon
   ===================================================== */
.coming-soon-card {
  text-align: center;
  padding: 4rem 2rem;
  border: 1px dashed var(--accent-dim);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  max-width: 540px;
  margin: 2rem auto;
}

.coming-soon-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 12px rgba(200,146,42,0.4));
}

.coming-soon-title {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.coming-soon-desc {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.7;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  text-align: center;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
  .site-title { font-size: 1.9rem; }
  .search-box { flex-direction: column; }
  .search-btn { justify-content: center; }
  .player-title { font-size: 1.2rem; }
  .results-grid { grid-template-columns: 1fr; }
}
