* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05060a;
  color: #f7f7f7;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 720px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.app-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #a3a3b5;
}

.card {
  background: radial-gradient(circle at top, #141623 0, #05060a 60%);
  border-radius: 18px;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  color: #c5c5d8;
}

.word-main {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 650;
  letter-spacing: 0.03em;
  margin-top: 8px;
}

.word-meta {
  font-size: 0.9rem;
  color: #9fa0b8;
}

.reveal-btn {
  margin-top: 8px;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #f7f7f7;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.reveal-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.reveal-btn:active {
  transform: scale(0.97);
}

.translation {
  font-size: 1.4rem;
  margin-top: 4px;
  min-height: 1.6em;
}

.details {
  font-size: 0.85rem;
  color: #a3a3b8;
  margin-top: 6px;
  line-height: 1.4;
}

.controls {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.ctrl-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 13, 25, 0.9);
  color: #f7f7f7;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ctrl-btn.primary {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  border: none;
}

.ctrl-btn:hover {
  background: rgba(34, 197, 94, 0.12);
}

.ctrl-btn.primary:hover {
  filter: brightness(1.08);
}

.ctrl-btn:active {
  transform: scale(0.97);
}

.secondary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  color: #a3a3b5;
}

.field-group select {
  background: #060814;
  color: #f7f7f7;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 5px 10px;
  font-size: 0.85rem;
}

.hint {
  font-size: 0.78rem;
  color: #7f8097;
}

@media (max-width: 480px) {
  .app {
    padding: 12px;
  }
  .card {
    padding: 16px 14px 20px;
  }
}


/* Phone-first optimierungen */
@media (max-width: 768px) {
  .app {
    padding: 10px;
    gap: 12px;
  }

  .app-header h1 {
    font-size: 1.4rem;
  }

  .card {
    padding: 14px 14px 18px;
  }

  .word-main {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }

  .controls {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(5,6,10,0.96), rgba(5,6,10,0.7));
    padding-top: 6px;
    padding-bottom: 4px;
  }

  .ctrl-btn {
    padding: 12px 10px;
    font-size: 1rem;
  }

  .secondary-controls {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .secondary-controls {
    position: sticky;
    bottom: 56px;
    background: radial-gradient(circle at bottom, #080816 0, #05060a 60%);
    padding: 6px 4px 8px;
    border-radius: 999px;
    backdrop-filter: blur(16px);
  }

  .field-group label {
    display: none;
  }

  .field-group select {
    font-size: 0.78rem;
    padding: 4px 8px;
  }

  .hint {
    font-size: 0.7rem;
  }
}


/* Premium card state when revealed */
.card.card-revealed {
  background: radial-gradient(circle at top, #1d2034 0, #05060a 65%);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.75);
  transform: translateY(-1px);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.translation {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.card.card-revealed .translation {
  opacity: 1;
  transform: translateY(0);
}


.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.lang-box {
  border-radius: 14px;
  padding: 10px 10px 12px;
  background: rgba(8, 10, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lang-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fa0b8;
}

.lang-word {
  font-size: 1.05rem;
  font-weight: 560;
}

@media (max-width: 480px) {
  .lang-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.lang-word[contenteditable="true"] {
  outline: 1px dashed rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 2px 4px;
}

.edit-panel {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.edit-panel h2 {
  font-size: 0.9rem;
  margin: 0 0 6px;
  color: #c5c5de;
}

.edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
}

.edit-row input {
  background: #060814;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: #f7f7f7;
  padding: 4px 8px;
}

.edit-row select {
  background: #060814;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  color: #f7f7f7;
  padding: 4px 8px;
}

.ctrl-btn.small {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.edit-hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: #8c8da3;
}
