/* ========================================================================== */
:root {
  --bg: #0f1115;
  --bg-glow: radial-gradient(circle at 50% -10%, rgba(139, 124, 246, .16), transparent 55%);
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;

  --text: #e8eaed;
  --text-muted: #9aa0ab;

  --accent: #8b7cf6;
  --accent-strong: #a598ff;
  --accent-contrast: #0f1115;

  --weak: #ef4444;
  --medium: #f59e0b;
  --strong: #22c55e;
  --very-strong: #3ddc97;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  color-scheme: dark;
}
/* ========================================================================== */


/* ========================================================================== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background-color: var(--bg);
  background-image: var(--bg-glow);
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 100%;
  padding: 24px env(safe-area-inset-right, 24px) 40px env(safe-area-inset-left, 24px);
  padding-top: max(24px, env(safe-area-inset-top, 0px));
}

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


/* ========================================================================== */
.app {
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}

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

.brand__titles {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.brand__titles h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__author {
  font-size: .6875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s ease;
}

.brand__author:hover {
  color: var(--accent-strong);
}
/* ========================================================================== */


/* ========================================================================== */
.lang-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font: 600 .75rem var(--font-ui);
  transition: .15s;
}

.lang-btn:hover {
  color: var(--accent-strong);
  border-color: rgba(139, 124, 246, .4);
}

.lang-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
/* ========================================================================== */


/* ========================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  white-space: nowrap;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: 600 .8rem var(--font-ui);
  border-radius: 9px;
  cursor: pointer;
  transition: .15s;
}

.tab-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
}
/* ========================================================================== */


/* ========================================================================== */
.panel[hidden] {
  display: none;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* ========================================================================== */


/* ========================================================================== */
p.lead {
  margin: 0;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tool-list {
  display: grid;
  gap: 10px;
}

.tool-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.tool-item b {
  display: block;
  font-size: .9rem;
  margin-bottom: 2px;
}

.tool-item span {
  font-size: .8125rem;
  color: var(--text-muted);
}

.note {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(139, 124, 246, .1);
  border: 1px solid rgba(139, 124, 246, .3);
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}
/* ========================================================================== */


/* ========================================================================== */
.output__field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px 14px 18px;
}

.output__text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: .02em;
  word-break: break-all;
  color: var(--accent-strong);
  user-select: all;
}

.icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: .15s;
}

.icon-btn:hover {
  background: rgba(139, 124, 246, .12);
  color: var(--accent-strong);
  border-color: rgba(139, 124, 246, .4);
}

.icon-btn.is-copied {
  color: var(--very-strong);
  border-color: rgba(61, 220, 151, .4);
  background: rgba(61, 220, 151, .1);
}

.icon-btn:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
/* ========================================================================== */


/* ========================================================================== */
.strength {
  display: flex;
  align-items: center;
  gap: 12px;
}

.strength__bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.strength__bar {
  height: 6px;
  flex: 1;
  border-radius: 3px;
  background: var(--border);
  transition: background-color .25s;
}

.strength__label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 78px;
  text-align: right;
}

.strength--weak .strength__bar:nth-child(-n+1) {
  background: var(--weak);
}

.strength--weak .strength__label {
  color: var(--weak);
}

.strength--medium .strength__bar:nth-child(-n+2) {
  background: var(--medium);
}

.strength--medium .strength__label {
  color: var(--medium);
}

.strength--strong .strength__bar:nth-child(-n+3) {
  background: var(--strong);
}

.strength--strong .strength__label {
  color: var(--strong);
}

.strength--very-strong .strength__bar {
  background: var(--very-strong);
}

.strength--very-strong .strength__label {
  color: var(--very-strong);
}
/* ========================================================================== */


/* ========================================================================== */
.warning {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
  color: #fca5a5;
  font-size: .8125rem;
  line-height: 1.4;
}
/* ========================================================================== */


/* ========================================================================== */
.control-row__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.control-row__value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .8125rem;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent-strong);
  cursor: pointer;
}

input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent-strong);
  cursor: pointer;
}
/* ========================================================================== */


/* ========================================================================== */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border: none;
  margin: 0;
  padding: 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: .15s;
}

.option:hover {
  border-color: rgba(139, 124, 246, .4);
}

.option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  position: relative;
  transition: .15s;
}

.option__box::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5px;
  height: 9px;
  border: solid var(--accent-contrast);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: .15s;
}

.option input:checked ~ .option__box {
  background: var(--accent);
  border-color: var(--accent);
}

.option input:checked ~ .option__box::after {
  transform: rotate(45deg) scale(1);
}

.option__text {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text);
}

.option__text em {
  font-style: normal;
  font-size: .75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
/* ========================================================================== */


/* ========================================================================== */
.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font: 600 .8125rem var(--font-ui);
  cursor: pointer;
  transition: .15s;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
/* ========================================================================== */


/* ========================================================================== */
.generate-btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font: 600 .9375rem var(--font-ui);
  color: var(--accent-contrast);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  cursor: pointer;
  transition: .15s;
}

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

.generate-btn:active {
  transform: scale(.98);
}
/* ========================================================================== */


/* ========================================================================== */
.seed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.seed-word {
  display: flex;
  gap: 7px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: .85rem;
}

.seed-word i {
  color: var(--text-muted);
  font-style: normal;
  font-size: .7rem;
  min-width: 15px;
}
/* ========================================================================== */


/* ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}

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


/* ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 17, 21, .72);
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity .2s ease;
}

.modal-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}

.modal-card h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-card p {
  margin: 0;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.55;
}
/* ========================================================================== */


/* ========================================================================== */
@media (max-width: 520px) {
  .app {
    padding: 22px 18px;
  }

  .options {
    grid-template-columns: 1fr;
  }

  .strength__label {
    min-width: unset;
  }

  .tabs {
    gap: 2px;
  }

  .modal-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: .001ms !important;
  }
}
/* ========================================================================== */