/* ==========================================================
   Emojidle — Design tokens
   Concept: bright, playful puzzle-game card. Light paper background,
   punchy accent colors, big friendly type.
   ========================================================== */

:root {
  --bg: #fdf6e9;
  --bg-2: #fbeccb;
  --card: #ffffff;
  --ink: #23272f;
  --ink-soft: #5b5f6b;
  --ink-faint: #9a9ea8;
  --accent: #ff8a5b;
  --accent-2: #3ddc97;
  --accent-3: #5b8cff;
  --line: #ecdfc2;
  --wrong: #e5e5e5;

  --font-display: 'Space Grotesk', 'Nunito', sans-serif;
  --font-body: 'Nunito', -apple-system, sans-serif;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  padding: 32px 16px 60px;
}

.stage {
  width: 100%;
  max-width: 520px;
}

.tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
  text-align: center;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  margin: 0 0 28px;
  color: var(--ink);
}

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 6px 6px 0 var(--ink);
}

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

.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--accent-3);
  padding: 5px 12px;
  border-radius: 999px;
}

.mode-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.puzzle-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 18px;
}

.emoji-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
}

.emoji-display {
  font-size: 5rem;
  line-height: 1;
  transition: filter 0.3s ease;
  user-select: none;
}

.tries {
  flex: none;
  width: 116px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
}

.try-box {
  min-width: 0;
  min-height: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-soft);
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  cursor: default;
  text-overflow: ellipsis;
}

.try-correct {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #08331f;
}

.try-wrong {
  background: var(--wrong);
  border-color: var(--wrong);
  color: var(--ink-soft);
}

.try-box.try-pending {
  opacity: 0;
  transform: scale(0.3);
}

.try-box.stamp-hit {
  animation: stamp-hit 0.4s cubic-bezier(.36, 1.7, .5, 1) forwards;
}

@keyframes stamp-hit {
  0%   { opacity: 0; transform: scale(2.1); }
  55%  { opacity: 1; transform: scale(0.85); }
  75%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.guess-flyer {
  position: fixed;
  z-index: 60;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(.4, 0, .2, 1), opacity 0.2s ease 0.2s;
}

.guess-flyer.correct {
  background: var(--accent-2);
  color: #08331f;
}

.guess-flyer.wrong {
  background: var(--wrong);
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .try-box.stamp-hit { animation: none; opacity: 1; transform: scale(1); }
  .guess-flyer { display: none; }
}

.guess-form {
  display: flex;
  gap: 10px;
}

.guess-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
}

.guess-input:focus {
  outline: none;
  border-color: var(--accent-3);
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 20px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(2px); }

.btn-primary {
  background: var(--accent);
  color: #2a1200;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn:hover { opacity: 0.88; }

.result-box { display: none; }

.result-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.result-sub {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.streak-line {
  font-size: 0.92rem;
  margin: 0 0 14px;
}

.result-grid {
  font-family: var(--font-body);
  font-size: 1.1rem;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  white-space: pre-wrap;
  margin: 0 0 18px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions .btn { flex: 1; }

.practice-section {
  display: none;
  margin-top: 14px;
}

.practice-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-faint);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}

.practice-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}

.btn-icon:hover { background: var(--bg-2); }

.house-ad {
  margin-top: 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.house-ad-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  text-decoration: none;
  background: rgba(255,255,255,0.5);
}

.house-ad-kicker {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent);
}

.house-ad-copy {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.site-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.site-footer a {
  color: var(--accent-3);
  text-decoration: none;
  font-weight: 600;
}

.site-footer .legal {
  margin-top: 6px;
  font-size: 0.72rem;
}

@media (max-width: 480px) {
  body { padding: 18px 16px 40px; }
  .tag { margin-bottom: 4px; }
  .page-title { font-size: 1.2rem; margin-bottom: 16px; }
  .card { padding: 20px; }
  .puzzle-row { margin-bottom: 14px; }
  .emoji-stage { padding: 8px; }
  .emoji-display { font-size: 3.25rem; }
  .tries { width: 96px; gap: 5px; }
  .try-box { font-size: 1rem; }
  .guess-form { flex-direction: column; }
  .actions { flex-direction: column; }
}
