/* custom.css — Colordle Answers V5 Final — Dark Slate Gray Theme */

:root {
  --accent-color:  #ef4444;
  --accent-dark:   #dc2626;
  --card-radius:   16px;
  --shadow-sm:     0 2px 12px rgba(0,0,0,.2);
  --shadow-md:     0 8px 40px rgba(0,0,0,.35);
  --transition:    .25s ease;
  --bg:            #2F4F4F;
  --bg-dark:       #243d3d;
  --bg-card:       #3a5c5c;
  --border-col:    rgba(255,255,255,.12);
}

/* ── Badge pill ── */
.hero-badge .badge-pill {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.9);
  font-family: 'Poppins', sans-serif; font-size: .78rem; font-weight: 600;
  padding: .4rem 1.1rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.2); letter-spacing: .03em;
}

/* ── Hero title ── */
.hero-title {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.8rem);
  font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 1rem;
}
.hero-intro { font-size: 1rem; color: rgba(255,255,255,.75); line-height: 1.75; }

/* ── Hero color swatch ── */
.hero-color-swatch {
  width: 100%; max-width: 320px; height: 240px;
  border-radius: var(--card-radius); margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  overflow: hidden;
}
.hero-color-swatch .swatch-name {
  font-family: 'Raleway', sans-serif; font-size: 1.5rem; font-weight: 800;
  letter-spacing: -.02em; text-align: center; padding: 0 18px;
}
.hero-color-swatch .swatch-hex { font-family: 'Courier New', monospace; font-size: .9rem; opacity: .7; }
.hero-color-swatch .swatch-badge {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px; padding: 4px 12px; font-size: .75rem; font-weight: 600;
}

/* ── Hero image (default featured image) ── */
.hero-featured-img {
  width: 100%; max-width: 460px; border-radius: var(--card-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); display: block; margin: 0 auto;
  height: auto; object-fit: cover;
}

/* ── Hints ── */
.hints-box {
  background: rgba(255,255,255,.07); border: 1px solid var(--border-col);
  border-radius: var(--card-radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.hints-heading { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: .75rem; }
.hints-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.hints-list li { display: flex; align-items: flex-start; gap: .6rem; font-size: .93rem; color: rgba(255,255,255,.8); }
.hint-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-color); color: #fff;
  font-size: .72rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* ── Reveal / answer box ── */
.reveal-box { margin-bottom: 0; }
.answer-details {
  border-radius: var(--card-radius); overflow: hidden;
  border: 2px solid rgba(255,255,255,.2);
}
.answer-details summary.btn-get-started {
  list-style: none; cursor: pointer; user-select: none;
  border-radius: calc(var(--card-radius) - 2px);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
}
.answer-details summary::-webkit-details-marker { display: none; }
.answer-details[open] summary { border-radius: calc(var(--card-radius) - 2px) calc(var(--card-radius) - 2px) 0 0; }
.answer-details[open] .chevron-icon { transform: rotate(180deg); }
.chevron-icon { transition: transform .3s ease; flex-shrink: 0; }
.answer-reveal-content {
  background: var(--bg-card); padding: 1.5rem;
  border-top: 1px solid var(--border-col);
}

/* ── Color answer display ── */
.answer-color-display { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.answer-color-swatch {
  width: 110px; height: 110px; border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  animation: swatch-pop .45s ease forwards;
}
@keyframes swatch-pop { 0%{transform:scale(.6) rotate(-5deg);opacity:0} 70%{transform:scale(1.08)} 100%{transform:scale(1);opacity:1} }
.answer-color-name {
  font-family: 'Raleway', sans-serif; font-size: 1.7rem; font-weight: 800;
  color: #fff; letter-spacing: -.02em;
  animation: fade-in-up .4s .2s ease both;
}
.answer-color-hex {
  font-family: 'Courier New', monospace; font-size: .9rem; color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.1); padding: 4px 14px; border-radius: 6px;
  animation: fade-in-up .4s .3s ease both;
}
@keyframes fade-in-up { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.answer-explanation {
  font-size: .93rem; color: rgba(255,255,255,.75); line-height: 1.7;
  background: rgba(255,255,255,.07); border-radius: 10px; padding: 1rem 1.25rem;
}

/* ── Color codes row ── */
.color-codes-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.color-code-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; transition: var(--transition);
}
.color-code-chip:hover { background: rgba(255,255,255,.18); }
.color-code-chip .lbl { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: rgba(255,255,255,.5); }
.color-code-chip .val { font-family: 'Courier New', monospace; font-size: .85rem; font-weight: 600; color: #fff; }

/* ── Hero button row ── */
.hero-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── Recent answers section header ── */
.recent-section { background: var(--bg-dark); }

/* ── About section ── */
.about-section { background: var(--bg); }
.about-feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-col);
  border-radius: 14px; padding: 16px 18px;
  display: flex; gap: 12px; align-items: flex-start;
  height: 100%;
}
.about-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-color); display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}
.about-feature-box h5 { color: #fff; font-size: .88rem; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.about-feature-box p  { color: rgba(255,255,255,.65); font-size: .8rem; margin: 0; line-height: 1.5; }

/* ── Color Guesser ── */
.mystery-color-box {
  width: clamp(120px, 38vw, 160px);
  height: clamp(120px, 38vw, 160px);
  border-radius: 20px; margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.guesser-input-row {
  display: flex; gap: 10px; margin-bottom: 8px;
  position: relative; width: 100%;
}
.guesser-input {
  flex: 1; min-width: 0; /* min-width:0 prevents flex child from overflowing */
  height: 50px; padding: 0 14px;
  border: 2px solid rgba(255,255,255,.2); border-radius: 12px;
  font-family: 'Poppins', sans-serif; font-size: .92rem;
  background: var(--bg-card); color: #fff; transition: border-color var(--transition);
}
.guesser-input::placeholder { color: rgba(255,255,255,.4); }
.guesser-input:focus { outline: none; border-color: #fff; }
.guesser-btn {
  height: 50px; padding: 0 18px; border-radius: 12px; flex-shrink: 0;
  background: #fff; color: #111 !important;
  border: none; font-family: 'Poppins', sans-serif;
  font-size: .88rem; font-weight: 700; cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.guesser-btn:hover { background: #f0f0f0; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1.5px solid rgba(255,255,255,.15);
  border-top: none; border-radius: 0 0 12px 12px; z-index: 50;
  max-height: 220px; overflow-y: auto; box-shadow: 0 8px 20px rgba(0,0,0,.3); display: none;
  max-width: 100%;
}
.autocomplete-list.show { display: block; }
.ac-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; font-size: .88rem; font-weight: 500;
  color: #fff; transition: background .15s;
}
.ac-item:hover { background: rgba(255,255,255,.1); }
.ac-dot { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.1); }
.guesses-list { display: flex; flex-direction: column; gap: 9px; margin: 20px 0; }
.guess-row {
  display: grid; grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-col);
  border-radius: 12px; padding: 12px 16px;
  animation: fade-in-up .25s ease;
}
.guess-swatch { width: 44px; height: 44px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); }
.guess-name { font-weight: 700; font-size: .92rem; color: #fff; }
.guess-hex  { font-family: 'Courier New', monospace; font-size: .75rem; color: rgba(255,255,255,.5); }
.guess-score-col { text-align: right; }
.score-pct  { font-family: 'Raleway', sans-serif; font-size: 1.3rem; font-weight: 800; line-height: 1; }
.score-bar  { height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; margin-top: 4px; overflow: hidden; width: 60px; }
.score-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }
.score-exact { color: #4ade80; } .score-hot { color: #fb923c; } .score-warm { color: #fbbf24; } .score-cold { color: rgba(255,255,255,.4); }
.guesser-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 20px; }
.g-stat {
  background: var(--bg-card); border: 1px solid var(--border-col);
  border-radius: 12px; padding: 14px 12px; text-align: center;
}
.g-stat-n { font-family: 'Raleway', sans-serif; font-size: 1.7rem; font-weight: 800; line-height: 1; color: #fff; }
.g-stat-l { font-size: .7rem; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.win-banner {
  background: linear-gradient(135deg, #052e16, #065f46);
  color: #fff; border-radius: 12px; padding: 18px 24px;
  text-align: center; margin-bottom: 18px; display: none;
  border: 1px solid rgba(74,222,128,.3);
}
.win-banner.show { display: block; animation: fade-in-up .3s ease; }
.win-banner h4 { font-size: 1.2rem; margin-bottom: 4px; }
.win-banner p  { font-size: .88rem; opacity: .8; margin: 0; }
.how-to-card {
  background: var(--bg-card); border: 1px solid var(--border-col);
  border-radius: 12px; padding: 16px 20px; margin-top: 16px;
}
.how-to-card h5 { font-size: .88rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.how-to-card ul { padding-left: 1.2rem; margin: 0; }
.how-to-card li { font-size: .84rem; color: rgba(255,255,255,.65); margin-bottom: 5px; }
.score-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: .78rem; color: rgba(255,255,255,.5); margin-top: 10px; }
.score-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* ── Toast ── */
.toast-msg {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--bg-dark); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: .85rem; font-weight: 500;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: fade-in-up .25s ease; pointer-events: none;
}
.toast-msg.ok { background: #065f46; }

/* ── Answer / Archive page article ── */
.article-body h2 { color: #fff; font-size: 1.3rem; margin: 2rem 0 .8rem; padding-top: 2rem; border-top: 1px solid var(--border-col); }
.article-body h2:first-child { border-top: none; padding-top: 0; }
.article-body h3 { color: #fff; font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.article-body p,
.article-body li { color: rgba(255,255,255,.75); }
.article-body ul,
.article-body ol { padding-left: 1.5rem; margin-bottom: .9rem; }
.article-body a  { color: #7dd3fc; }

/* ── Prev/next nav ── */
.pn-link {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-col);
  border-radius: 12px; padding: 14px 18px; transition: var(--transition);
  color: #fff; text-decoration: none;
}
.pn-link:hover { background: var(--bg-card-hover); color: #fff; border-color: rgba(255,255,255,.25); }

/* ════════════════════════════
   CUSTOM — Mobile fixes
   ════════════════════════════ */

/* Guesser app: max-width stays inside viewport */
#colorGuesserApp {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* Autocomplete: constrained to parent width */
.autocomplete-list {
  max-width: calc(100vw - 28px);
}

/* Guess row: prevent overflow on very small screens */
.guess-row {
  min-width: 0;
  overflow: hidden;
}
.guess-name, .guess-hex {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score bar: fixed width on small screens */
@media (max-width: 380px) {
  .score-bar { width: 44px; }
  .score-pct { font-size: 1.1rem; }
  .g-stat-n  { font-size: 1.4rem; }
  .guesser-btn { padding: 0 12px; font-size: .82rem; }
  .guesser-input { font-size: .85rem; padding: 0 10px; }
}

/* Hero colour swatch on mobile */
@media (max-width: 767px) {
  .hero-color-swatch { max-width: 240px; height: 200px; }
  .hero-color-swatch .swatch-name { font-size: 1.2rem; }
  .hero-featured-img { max-width: 100%; border-radius: 12px; }
  .answer-color-name { font-size: 1.4rem; }
  .color-codes-row { gap: 6px; }
  .color-code-chip { padding: 5px 10px; }
  .how-to-card { padding: 14px 16px; }
  .score-legend { font-size: .73rem; gap: 8px; }
}
