/* Home Page Styles */
body.home-page { padding: 0; }
body.home-page .main-menu-container { padding-top: 120px; }
body.home-page .main-title { font-size: 3.2rem; margin-bottom: 20px; }
body.home-page .main-desc { font-size: 1.35rem; margin-bottom: 44px; }
body.home-page .main-search { width: 460px; padding: 10px 26px; }
body.home-page .search-input { font-size: 1.2rem; }
body.home-page .search-btn svg { width: 30px; height: 30px; }

.main-menu-container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: calc(100vh - 150px); padding-top: 60px; margin-bottom: 0; }
.main-title { font-family: 'ClashBold', Arial, sans-serif; font-size: 3rem; font-weight: bold; color: #ffffff; margin-bottom: 16px; text-align: center; }
.main-desc { font-family: 'ClashRegular', Arial, sans-serif; font-size: 1.25rem; color: #ffffff; margin-bottom: 40px; text-align: center; }
.home-page .seo-summary { text-align: center; }
.home-page .seo-summary h2 { font-size: 1rem; }
.main-search { display: flex; align-items: center; background: transparent; border-radius: 32px; box-shadow: none; padding: 8px 24px; width: 400px; max-width: 90vw; margin-bottom: 40px; position: relative; z-index: 2; }

/* Render the rounded white search box above the typeahead panel */
.main-search::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  z-index: 40;
  pointer-events: none;
}
.search-input { border: none; outline: none; font-size: 1.1rem; font-family: 'ClashRegular', Arial, sans-serif; flex: 1; background: transparent; padding: 10px 0; position: relative; z-index: 41; }
.search-input { min-width: 0; }
.search-btn { background: none; border: none; cursor: pointer; margin-left: 8px; padding: 0; display: flex; align-items: center; justify-content: center; position: relative; z-index: 41; flex-shrink: 0; }
.search-btn svg { width: 28px; height: 28px; stroke: #333; }
.search-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.main-error { color: #d32f2f; background: #fff3f3; border-radius: 8px; padding: 10px 18px; margin-top: 10px; font-size: 1rem; text-align: center; font-family: 'ClashRegular', Arial, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,0.05); display: none; position: relative; z-index: 3; }

/* Home typeahead (index.html creates #typeaheadList) */
#typeaheadList {
  background: #fff;
  border: 1px solid #ddd;
  border-top: 0;
  border-radius: 0 0 32px 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 20;
  overflow: hidden;

  /* Pull panel upward so the "gap" stays behind the search bar */
  margin-top: -28px;
  padding-top: 44px;
}

#typeaheadList .typeahead-item {
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
}

#typeaheadList .typeahead-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#typeaheadList .typeahead-name {
  font-family: 'ClashBold', Arial, sans-serif;
  color: #1f2937;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#typeaheadList .typeahead-clan {
  color: #4b5563;
  opacity: 0.9;
  font-size: 0.85rem;
  min-width: 0;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#typeaheadList .typeahead-tag {
  color: #6b7280;
  opacity: 0.9;
  font-family: 'ClashBold', Arial, sans-serif;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#typeaheadList .typeahead-item:hover {
  background: #f6f6f6;
}

/* Search Suggestions */
.cc-suggest-box { position:absolute; left:0; right:0; top:calc(100% + 4px); background:#fff; border:1px solid #cbd4de; border-radius:32px; box-shadow:0 10px 30px -12px rgba(0,0,0,.25); z-index:20; max-height:260px; overflow:auto; }
.cc-suggest-empty { padding:10px 12px; color:#556; font-size:.9rem; opacity:.8; }
.cc-suggest-list { list-style:none; margin:6px 0; padding:0; }
.cc-suggest-item { margin:0; padding:0; }
.cc-suggest-item button { width:100%; text-align:left; background:#fff; border:none; padding:10px 12px; font-family:'ClashRegular', Arial, sans-serif; font-size:.95rem; color:#233; display:flex; align-items:center; gap:10px; cursor:pointer; }
.cc-suggest-item button:hover { background:#f4f7fb; }
.cc-suggest-item.is-active button { background:#eaf2ff; }
.cc-sg-tag { font-family:'ClashBold', Arial, sans-serif; color:#0a5ec9; }
.cc-sg-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cc-sg-clan { max-width:40%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#556; opacity:.9; }

@media (max-width: 900px) {
  body.home-page .main-title { font-size: 2.4rem; }
  body.home-page .main-search { width: 90%; }
}
@media (max-width: 600px) {
  /* Homepage-only: keep everything in-view (no vertical scroll) */
  body.home-page {
    padding-top: 52px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    inset: 0;
    width: 100%;
  }

  body.home-page .main-menu-container {
    padding-top: 36px;
    min-height: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  body.home-page .main-title { font-size: 1.6rem; margin-bottom: 8px; }
  body.home-page .main-desc { font-size: 0.85rem; padding: 0 16px; margin-bottom: 14px; line-height: 1.35; }
  body.home-page .main-search {
    width: min(380px, calc(100% - 32px));
    max-width: 100%;
    padding: 8px 16px;
    margin: 0 auto 12px;
    border-radius: 28px;
    overflow: visible;
  }
  body.home-page .main-search::before { border-radius: 28px; }
  body.home-page .search-input { font-size: 1rem; padding: 10px 0; }
  body.home-page .search-btn svg { width: 24px; height: 24px; }

  /* Mobile: smaller, tighter dropdown that aligns with the bar */
  #typeaheadList {
    border-radius: 0 0 28px 28px;
    margin-top: -26px;
    padding-top: 42px;
    max-height: 220px;
    box-sizing: border-box;
  }

  #typeaheadList .typeahead-item {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  #typeaheadList .typeahead-clan {
    max-width: 42vw;
  }
  body.home-page .main-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 12px 14px;
    font-size: 0.72rem;
    line-height: 1.25;
  }
}
