/* The Imposter — Game Styles v1.0.0 */
/* Shell: game-shell.css | Theme vars: theme.css */

/* ── Mode grid ───────────────────────────────────────────────────────────── */
.mode-grid { grid-template-columns: repeat(2, 1fr); }

/* ── HUD extras ──────────────────────────────────────────────────────────── */
.best-pill {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text2);
}
.best-pill strong { color: var(--accent); font-size: 1rem; }

/* ── Timer bar ────────────────────────────────────────────────────────────── */
.timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}
.timer-bar-wrap {
  flex: 1;
  background: var(--surface2);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
#timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--red));
  border-radius: 99px;
  transition: width 1s linear;
  width: 100%;
}
.timer-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--accent);
  min-width: 34px;
  text-align: right;
  transition: color 0.2s;
}
.timer-num.urgent { color: var(--red); animation: timerPulse 0.5s ease infinite alternate; }
@keyframes timerPulse { from { transform: scale(1); } to { transform: scale(1.15); } }

/* ── Round prompt card ───────────────────────────────────────────────────── */
.prompt-card {
  text-align: center;
  padding: 18px 20px 14px;
}
/* ── Metadata row — wraps both badges, handles alignment ─────────────────── */
.meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  line-height: 1;
}

/* Shared base for both badges — identical box model so they align perfectly */
.category-tag,
.difficulty-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.category-tag {
  background: var(--accent-lt);
  color: #fff;
}

.difficulty-tag.easy   { background: rgba(0,184,148,0.15); color: var(--green); }
.difficulty-tag.medium { background: rgba(253,203,110,0.2); color: var(--orange); }
.difficulty-tag.hard   { background: rgba(225,112,85,0.15); color: var(--red); }

.prompt-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.prompt-sub {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ── 2×2 item card grid ──────────────────────────────────────────────────── */
.imposter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.item-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 18px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  word-break: break-word;
  hyphens: auto;
  position: relative;
}

.item-card:hover:not(:disabled):not(.correct):not(.wrong):not(.imposter-reveal) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface2));
  transform: translateY(-2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 20%, transparent);
}

.item-card:active:not(:disabled) { transform: scale(0.95); }
.item-card:disabled               { cursor: default; }

/* Correct: player tapped the imposter ✅ */
.item-card.imposter-correct {
  background: color-mix(in srgb, var(--green) 15%, var(--surface));
  border-color: var(--green);
  color: var(--green);
  animation: cardCorrect 0.45s ease both;
}

/* Wrong tap: player tapped a non-imposter ❌ */
.item-card.wrong-tap {
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border-color: var(--red);
  color: var(--red);
  animation: cardWrong 0.4s ease both;
}

/* Reveal: the actual imposter shown after wrong tap */
.item-card.imposter-reveal {
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border-color: var(--orange);
  color: var(--orange);
}

/* Dimmed: non-imposter after any correct answer */
.item-card.belongs {
  opacity: 0.45;
  border-color: var(--border);
}

@keyframes cardCorrect {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.07); box-shadow: 0 0 24px color-mix(in srgb, var(--green) 50%, transparent); }
  60%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@keyframes cardWrong {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-8px); }
  40%  { transform: translateX(8px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
}

/* ── Reveal panel ────────────────────────────────────────────────────────── */
.reveal-panel {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  animation: revealSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes revealSlide {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 800;
}
.reveal-result.correct { color: var(--green); }
.reveal-result.wrong   { color: var(--red); }

.reveal-explanation {
  font-size: 0.87rem;
  color: var(--text2);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.reveal-next-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  font-size: 0.97rem;
}

/* ── Streak effect ───────────────────────────────────────────────────────── */
.streak-burst {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--orange);
  animation: streakPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin: -4px 0;
}
@keyframes streakPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── How-to-play card ────────────────────────────────────────────────────── */
.how-to-play {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
  padding: 14px 16px;
  text-align: center;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .item-card { font-size: 0.82rem; padding: 14px 10px; min-height: 68px; }
  .mode-grid { grid-template-columns: 1fr; }
}

@media (min-width: 480px) {
  .item-card { font-size: 0.96rem; min-height: 86px; }
}

@media (min-width: 600px) {
  .item-card { font-size: 1rem; min-height: 92px; padding: 20px 16px; }
  .prompt-card { padding: 22px 24px 16px; }
}

@media (min-width: 900px) {
  body { padding-top: 36px; }
  #app { max-width: 640px; }
  .item-card { font-size: 1.05rem; min-height: 100px; }
  .game-title { font-size: 2rem; }
  .mode-btn { padding: 18px 10px; }
  .mode-emoji { font-size: 1.8rem; }
  .mode-name  { font-size: 0.9rem; }
  .btn-full { padding: 16px; font-size: 1.05rem; }
  .screen { padding: 16px 28px; gap: 16px; }
  .hud { padding: 12px 20px; }
}

@media (min-width: 1200px) {
  #app { max-width: 720px; }
}
