:root {
  --bg-dark: #051b13;
  --bg-mid: #0c2b1e;
  --bg-light: #13452c;
  --accent: #7dd56f;
  --accent-soft: #c5f8c3;
  --text-main: #f7fff6;
  --text-muted: #b6d1bf;
  --danger: #ff9f9f;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.55);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --gap: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #16472b 0, #051b13 55%, #020b07 100%);
  color: var(--text-main);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* Soft forest background overlay */
.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(125,213,111,0.10), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(48,209,88,0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(10, 43, 26, 0.96), rgba(5, 19, 12, 0.98));
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Header */
header {
  text-align: center;
}

h1 {
  font-size: 1.7rem;
  letter-spacing: 0.03em;
}

.subtitle {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Card */
.card {
  background: radial-gradient(circle at top, var(--bg-light), var(--bg-mid));
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
}

.label.small {
  font-size: 0.7rem;
}

.word {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.definition {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(3, 14, 9, 0.55);
  border: 1px dashed rgba(197, 248, 195, 0.25);
}

.definition.hidden {
  filter: blur(4px);
  color: var(--text-muted);
}

.category-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.pill {
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 213, 111, 0.6);
  font-size: 0.75rem;
  color: var(--accent-soft);
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

button {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #49a45b);
  color: #03200f;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.6);
  filter: brightness(1.03);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* Special button colors */
#unknown-btn {
  background: linear-gradient(135deg, #ffb3b3, #ff7b7b);
  color: #3c0505;
}

#next-btn {
  background: linear-gradient(135deg, #b4f1c2, #7dd56f);
}

/* Stats & difficult list */
.stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.difficult-list {
  margin-top: 0.3rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border-radius: 16px;
  background: rgba(3, 17, 10, 0.85);
  border: 1px solid rgba(197, 248, 195, 0.35);
}

.difficult-list h2 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.difficult-list ul {
  list-style: none;
  max-height: 140px;
  overflow-y: auto;
}

.difficult-list li {
  font-size: 0.85rem;
  padding: 0.15rem 0;
  border-bottom: 1px dashed rgba(182, 209, 191, 0.25);
}

.difficult-list li:last-child {
  border-bottom: none;
}

/* Footer */
footer {
  margin-top: 0.3rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Small screens tweaks */
@media (max-width: 520px) {
  .app {
    margin: 0.75rem;
    padding: 1.1rem;
  }

  .card {
    padding: 0.9rem 1rem;
  }

  h1 {
    font-size: 1.45rem;
  }

  .word {
    font-size: 1.4rem;
  }
}
