/* ==========================================================================
   Он бы тебе сказал — стили
   Тёмная тема, акценты: жёлтый (#F4B942) и розовый (#E8598B)
   ========================================================================== */

:root {
  --bg: #121016;
  --bg-elevated: #1c1922;
  --bg-card: #221e29;
  --border: #322c3a;
  --text: #f5f2f7;
  --text-muted: #a89fb0;
  --yellow: #f4b942;
  --pink: #e8598b;
  --danger: #ff6b6b;
  --success: #6be0a4;
  --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, rgba(232, 89, 139, 0.16), transparent 55%),
    radial-gradient(circle at 90% 0%, rgba(244, 185, 66, 0.14), transparent 45%), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------- header --------------------------------- */

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 0 12px;
  text-align: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(22px, 5.5vw, 28px);
  margin: 0;
  letter-spacing: -0.01em;
}

.logo-dot {
  color: var(--pink);
}

/* ---------------------------------- lang switch --------------------------- */

.lang-switch {
  align-self: flex-end;
  display: inline-flex;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: linear-gradient(120deg, var(--yellow), #ffd27a);
  color: #1a1420;
}

/* ---------------------------------- stage ---------------------------------- */

.stage {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding-bottom: 32px;
}

.screen {
  display: none;
  flex: 1;
}

.screen.is-active {
  display: flex;
  animation: screen-in 0.35s ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 24px 4px;
}

/* ---------------------------------- text ------------------------------------ */

.tagline {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 34ch;
  margin: 0;
}

.hero-icon {
  display: flex;
  filter: drop-shadow(0 8px 24px rgba(232, 89, 139, 0.35));
}

.rules {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 40ch;
  margin: 0;
}

.rules-small {
  font-size: 13.5px;
  max-width: 34ch;
}

.eyebrow {
  color: var(--pink);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
}

.category-label {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ---------------------------------- category card --------------------------- */

.category-card {
  width: 100%;
  background: linear-gradient(155deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(244, 185, 66, 0.12), transparent 60%);
  pointer-events: none;
}

.category-card-small {
  padding: 20px 16px;
}

.category-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(24px, 7vw, 32px);
  color: var(--yellow);
  position: relative;
}

.category-card-small .category-text {
  font-size: clamp(18px, 5.5vw, 22px);
}

/* ---------------------------------- buttons ---------------------------------- */

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 16px 28px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  color: #1a1420;
}

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

.btn-lg {
  width: 100%;
  padding: 18px 24px;
  font-size: 17px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--yellow), #ffd27a);
  box-shadow: 0 10px 26px rgba(244, 185, 66, 0.32);
}

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

.btn-accent {
  background: linear-gradient(120deg, var(--pink), #ff85b3);
  color: #2a0f1a;
  box-shadow: 0 10px 26px rgba(232, 89, 139, 0.32);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 12px 22px;
  font-size: 14px;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--pink);
}

.mic-error {
  color: var(--danger);
  font-size: 13.5px;
  max-width: 34ch;
  margin: 0;
}

/* ---------------------------------- recorder ---------------------------------- */

.recorder {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.recorder-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(232, 89, 139, 0.12);
  color: var(--pink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-heading);
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

.waveform {
  width: 100%;
  height: 120px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.timer-track {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  transform-origin: left;
  transition: transform 0.2s linear;
}

.timer-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  color: var(--text);
}

/* ---------------------------------- hint (paid feature UI) ---------------------------------- */

.btn-hint {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
    linear-gradient(120deg, var(--yellow), var(--pink));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

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

.pro-badge {
  background: linear-gradient(120deg, var(--yellow), var(--pink));
  color: #1a1420;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
}

.hint-box {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--pink);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
}

.hint-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* ---------------------------------- player ---------------------------------- */

.player {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.play-btn {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(120deg, var(--yellow), #ffd27a);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(244, 185, 66, 0.32);
}

.play-btn:active {
  transform: scale(0.95);
}

.icon {
  width: 26px;
  height: 26px;
  fill: #1a1420;
}

.player-track {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.player-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
}

.filter-row {
  width: 100%;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.is-active {
  background: linear-gradient(120deg, var(--pink), #ff85b3);
  border-color: transparent;
  color: #2a0f1a;
}

.action-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

@media (min-width: 420px) {
  .action-row {
    flex-direction: row;
  }

  .action-row .btn {
    flex: 1;
  }
}

/* ---------------------------------- toast ---------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  max-width: calc(100% - 40px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------- misc ---------------------------------- */

@media (min-width: 640px) {
  .app {
    padding: 0 24px;
  }
}
