/* ════════════════════════════════════════════════════════════════
   GUESS IT! — game.css v1.0
   Detective/mystery theme — indigo & violet
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

#gi-wrap, #gi-wrap * { box-sizing: border-box; }

#gi-wrap {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  max-width: 600px;
  margin: 40px auto;
  color: #1e1b4b;
  -webkit-font-smoothing: antialiased;
}

.inside-article, .entry-content, .page-content { padding: 0 !important; margin: 0 !important; }
.site-main, .site-main > .inside-article, #primary, .content-area > .site-main { padding-top: 0 !important; margin-top: 0 !important; }

.gi-screen { display: none; }
.gi-screen.active { display: block; }

/* ══ WELCOME ══ */
#gi-screen-welcome {
  background: linear-gradient(160deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 28px;
  padding: 44px 36px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(79,70,229,.12);
}

.gi-intro-emoji {
  font-size: 60px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  animation: gi-float 3s ease-in-out infinite;
}
@keyframes gi-float {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-10px) rotate(4deg); }
}

#gi-screen-welcome h1 {
  font-size: 26px;
  font-weight: 900;
  color: #312e81;
  margin-bottom: 10px;
}

#gi-screen-welcome > p.gi-intro-sub {
  font-size: 15px;
  color: #4f46e5;
  line-height: 1.65;
  margin-bottom: 26px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  opacity: .85;
}

/* Category selector */
#gi-category-select { margin-bottom: 22px; }
#gi-category-select h3 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #4f46e5;
  margin-bottom: 10px;
  text-align: left;
}

.gi-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.gi-cat-btn {
  background: rgba(255,255,255,.75);
  border: 2px solid #c7d2fe;
  border-radius: 14px;
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all .2s;
}
.gi-cat-btn:hover { border-color: #4f46e5; background: #eef2ff; transform: translateY(-2px); }
.gi-cat-btn.gi-cat-selected { border-color: #4f46e5; background: #eef2ff; box-shadow: 0 4px 12px rgba(79,70,229,.2); }
.gi-cat-emoji { font-size: 24px; display: block; margin-bottom: 4px; }
.gi-cat-label { font-size: 11px; font-weight: 800; color: #312e81; }

/* Setup */
#gi-setup {
  background: rgba(255,255,255,.7);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 22px;
}
.gi-setup-row { display: flex; gap: 10px; }
.gi-setup-row > div { flex: 1; }
#gi-setup label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #4f46e5;
  margin-bottom: 6px;
}
#gi-setup input, #gi-setup select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 2px solid #c7d2fe;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1e1b4b;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s;
}
#gi-setup input:focus, #gi-setup select:focus { border-color: #4f46e5; }

#gi-start-btn {
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 6px 20px rgba(79,70,229,.35);
}
#gi-start-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(79,70,229,.45); }

/* ══ GAME SCREEN ══ */
#gi-screen-game {
  background: linear-gradient(160deg, #eef2ff 0%, #fff 60%);
  border-radius: 28px;
  padding: 28px 24px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.gi-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.gi-q-counter {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  padding: 6px 14px;
  border-radius: 20px;
}

#gi-lb-btn {
  background: rgba(255,255,255,.8);
  border: 2px solid #c7d2fe;
  color: #4f46e5;
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
#gi-lb-btn:hover { background: #eef2ff; }

/* Bot bubble */
.gi-bot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 2px solid #e0e7ff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(79,70,229,.06);
}
.gi-bot-avatar {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  animation: gi-pulse 2s ease-in-out infinite;
}
@keyframes gi-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(79,70,229,0); }
}
#gi-bot-msg {
  font-size: 15px;
  font-weight: 700;
  color: #312e81;
}

/* Question options */
#gi-question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.gi-q-option {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #1e1b4b;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .15s;
}
.gi-q-option:hover:not(:disabled) {
  border-color: #4f46e5;
  background: #eef2ff;
  transform: translateX(4px);
}
.gi-q-option:disabled { cursor: default; opacity: .5; }
.gi-q-emoji { font-size: 18px; flex-shrink: 0; }

.gi-ans-yes  { border-color: #16a34a !important; background: rgba(22,163,74,.08) !important; opacity: 1 !important; }
.gi-ans-no   { border-color: #dc2626 !important; background: rgba(220,38,38,.08) !important; opacity: 1 !important; }
.gi-ans-maybe{ border-color: #d97706 !important; background: rgba(217,119,6,.08) !important; opacity: 1 !important; }

/* Guess grid */
#gi-guess-section h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #4f46e5;
  margin-bottom: 10px;
}
.gi-guess-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.gi-guess-item {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gi-guess-item:hover:not(:disabled) { border-color: #4f46e5; background: #eef2ff; transform: scale(1.05); }
.gi-guess-item:disabled { cursor: default; }
.gi-guess-emoji { font-size: 22px; }
.gi-guess-name { font-size: 10px; font-weight: 700; color: #1e1b4b; line-height: 1.2; }
.gi-guess-eliminated { opacity: .25; filter: grayscale(80%); }
.gi-guess-wrong { animation: gi-shake .5s ease; border-color: #dc2626 !important; }
@keyframes gi-shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-6px); }
  75%     { transform: translateX(6px); }
}

/* History */
#gi-history-section h3 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #94a3b8;
  margin-bottom: 8px;
}
#gi-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.gi-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}
.gi-history-row strong { font-size: 12px; }

/* ══ RESULT ══ */
#gi-screen-result {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  background: #fff;
}
.gi-result-emoji-box {
  font-size: 80px;
  text-align: center;
  padding: 36px 20px 12px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  line-height: 1;
}
#gi-result-title {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: #312e81;
  padding: 16px 32px 4px;
}
#gi-result-item {
  text-align: center;
  font-size: 16px;
  color: #4f46e5;
  font-weight: 700;
  padding: 0 32px 16px;
}
#gi-result-item strong { color: #312e81; }
#gi-result-xp {
  display: block;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  color: #4f46e5;
  margin: 0 auto 16px;
  width: fit-content;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
  border-radius: 999px;
  padding: 6px 24px;
}
#gi-result-summary {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  padding: 0 32px 16px;
}
#gi-result-rank {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #312e81;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 0 32px 20px;
  padding: 10px;
}

.gi-result-btns { display: flex; gap: 10px; padding: 0 32px 28px; }
.gi-result-btns button {
  flex: 1;
  padding: 13px;
  border-radius: 50px;
  border: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
#gi-play-again-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
}
#gi-play-again-btn:hover { transform: translateY(-2px); }
#gi-change-category-btn {
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0 !important;
}
#gi-change-category-btn:hover { background: #e2e8f0; }

/* ══ LEADERBOARD ══ */
#gi-lb-panel { display: none; margin-top: 16px; }
#gi-lb-panel.gi-lb-open { display: block; }
.gi-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 6px;
}
.gi-lb-rank { font-size: 1.1rem; min-width: 28px; }
.gi-lb-name { flex: 1; font-size: 13px; font-weight: 700; color: #1e1b4b; }
.gi-lb-name small { color: #94a3b8; font-weight: 600; margin-left: 4px; }
.gi-lb-xp { font-weight: 900; color: #4f46e5; font-size: 13px; }
.gi-lb-loading { color: #94a3b8; text-align: center; padding: 16px; font-size: 13px; }

/* Responsive */
@media (max-width: 540px) {
  #gi-screen-welcome { padding: 32px 20px; }
  #gi-screen-game { padding: 22px 16px 26px; }
  .gi-cat-grid { grid-template-columns: repeat(2, 1fr); }
  .gi-guess-grid { grid-template-columns: repeat(3, 1fr); }
  .gi-setup-row { flex-direction: column; }
  .gi-result-btns { flex-direction: column; }
}
