:root {
  --bg: #f5f5f5;
  --text: #111;
  --card: #ffffff;
  --line: #e6e6e6;
  --muted: #777;
  --accent: #000;
}

/* Dark mode */
body.dark {
  --bg: #000;
  --text: #f5f5f5;
  --card: #0a0a0a;
  --line: #1f1f1f;
  --muted: #8a8a8a;
  --accent: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.25s ease;

  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;

  /* Nothing OS dot grid */
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}

.container {
  width: 420px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
}

/* Header */
h1 {
  font-size: 20px;
  letter-spacing: 2px;
  font-weight: 600;
  margin: 0 0 6px;
}

p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

/* Toggle */
.toggle {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider {
  background: var(--accent);
}

input:checked + .slider::before {
  transform: translateX(20px);
  background: var(--bg);
}

/* Input */
input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  outline: none;
  margin-bottom: 10px;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

button {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  letter-spacing: 1px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

button:hover {
  opacity: 0.85;
}

/* Results */
.results {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.card {
  background: transparent;
}

.card h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--muted);
}

#unscrambled {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
