
:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --line: #374151;
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --success: #34d399;
  --danger: #fb7185;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled, input:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.app-shell {
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1.05;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat,
.progress-card,
.game-card {
  border: 1px solid var(--line);
  background: rgba(17, 24, 39, .94);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.stat {
  border-radius: 14px;
  padding: 12px;
}

.stat span,
.progress-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  font-size: 20px;
}

.game-card {
  border-radius: 22px;
  padding: 20px;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge,
.difficulty {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
}

.badge {
  background: var(--panel-2);
}

.difficulty {
  color: var(--muted);
  text-transform: capitalize;
}

.emoji {
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 28px 12px;
  text-align: center;
  font-size: clamp(64px, 18vw, 110px);
  line-height: 1.2;
  letter-spacing: .04em;
}

.hint-area {
  margin-bottom: 14px;
  border: 1px dashed #4b5563;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(31,41,55,.65);
}

.hint-label {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hint-area p {
  margin: 0;
}

form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid #4b5563;
  border-radius: 14px;
  outline: none;
  background: #0b1220;
  color: var(--text);
  padding: 14px 15px;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,191,36,.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border-radius: 14px;
  font-weight: 800;
}

.primary-btn {
  border: 0;
  background: var(--accent);
  color: #111827;
  padding: 0 18px;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-strong);
}

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

.secondary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.secondary-btn {
  flex: 1;
  padding: 11px 14px;
}

.ghost-btn {
  padding: 8px 12px;
}

.secondary-btn:hover:not(:disabled),
.ghost-btn:hover:not(:disabled) {
  background: var(--panel-2);
}

.feedback {
  min-height: 28px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 700;
}

.feedback.success { color: var(--success); }
.feedback.error { color: var(--danger); }
.feedback.info { color: var(--accent); }

.progress-card {
  margin-top: 12px;
  border-radius: 16px;
  padding: 14px;
}

.progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.progress-card strong {
  font-size: 13px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #263244;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}

.footer-note {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    padding-top: 18px;
  }

  .game-card {
    padding: 16px;
  }

  .emoji {
    min-height: 170px;
  }

  form {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    padding: 13px 16px;
  }
}
