:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color-scheme: light;
  --bg-1: #fff7e8;
  --bg-2: #ffe2a8;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(0, 0, 0, 0.08);
  --text: #1a1a1a;
  --muted: #5f6472;
  --accent: #ffb100;
  --accent-strong: #ff7a00;
  --accent-dark: #1f1f1f;
  --success: #1f9d55;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.9), transparent 35%),
    radial-gradient(circle at top right, rgba(255, 166, 77, 0.55), transparent 28%),
    linear-gradient(180deg, var(--bg-1) 0%, #fff4d8 45%, #ffe8b9 100%);
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.header h1 {
  margin: 0;
  letter-spacing: 0.06em;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

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

.iconBtn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  color: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.iconBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
  max-width: 60ch;
}

.card {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px 0 8px;
  flex-wrap: wrap;
}

.box {
  text-align: center;
}

.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.big {
  font-size: clamp(2rem, 5vw, 2.7rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: center;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff6d9 0%, #ffe7a8 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  min-width: 170px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.arrow {
  font-size: 28px;
  color: var(--muted);
  padding: 18px 0 0;
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 4px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
  font-weight: 600;
}

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

input {
  flex: 1;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

input:focus {
  border-color: rgba(255, 122, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 177, 0, 0.16);
}

button {
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #1f1f1f 0%, #101010 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.22);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.msg {
  margin-top: 12px;
  min-height: 24px;
  font-size: 14px;
  color: var(--accent-dark);
  font-weight: 700;
}

.path {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.path li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.07);
  letter-spacing: 0.08em;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
  animation: popIn 0.22s ease;
}

.changed {
  color: #ff7a00;
  font-weight: 900;
  background: rgba(255, 122, 0, 0.15);
  padding: 2px 4px;
  border-radius: 6px;
}

.path-meta {
  color: #5f6472;
  font-weight: 700;
  letter-spacing: normal;
  margin-left: 8px;
}

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

.btn {
  flex: 1;
}

.secondary {
  background: linear-gradient(180deg, #ffb100 0%, #ff8f1f 100%);
  color: #171717;
}

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.dialog {
  border: 0;
  border-radius: 18px;
  padding: 20px;
  max-width: 560px;
  width: calc(100% - 24px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.wordsie-stats {
  margin-top: 14px !important;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 22px 14px 36px;
  }

  .card {
    padding: 18px;
    border-radius: 18px;
  }

  .form,
  .btnRow {
    flex-direction: column;
  }

  button,
  input {
    width: 100%;
  }

  .big {
    min-width: 132px;
    letter-spacing: 0.12em;
  }

  .arrow {
    width: 100%;
    text-align: center;
    padding-top: 0;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .titleRow {
    align-items: flex-start;
  }

  .path-meta {
    display: block;
    margin-left: 0;
    margin-top: 6px;
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}