:root {
  color-scheme: dark;
  --background: #090909;
  --foreground: #ffffff;
  --muted: #1c1c1e;
  --muted-foreground: rgba(255, 255, 255, 0.58);
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.16);
  --primary: #ffffff;
  --primary-foreground: #090909;
  --secondary: rgba(255, 255, 255, 0.08);
  --secondary-foreground: #ffffff;
  --card: rgba(28, 28, 30, 0.82);
  --destructive: #ff6961;
  --ok: #32d74b;
  --heading: #f5f5f7;
  --warn: #ffd60a;
  --radius: 8px;
  --radius-md: 12px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Rendered in Chrome's side panel: fill whatever width and height it gives us. */
html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  background: #090909;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.32) #090909;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: clip;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: #090909;
}

html::-webkit-scrollbar-thumb {
  border: 2px solid #090909;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.shell {
  min-height: 100vh;
  padding: 16px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.is-signed-out .shell,
body.is-unavailable .shell,
body.is-checking .shell {
  justify-content: center;
  padding: 28px 22px;
}

body.is-checking .auth,
body.is-checking .requires-auth,
body.is-unavailable .auth,
body.is-unavailable .requires-auth {
  display: none !important;
}

.health-banner {
  display: grid;
  gap: 4px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 2px solid #aae73d;
  background: rgba(28, 28, 30, 0.92);
}

.health-banner.is-down {
  border-left-color: var(--warn);
}

.health-banner.is-degraded {
  border-left-color: var(--warn);
}

.health-banner.is-checking {
  border-left-color: rgba(255, 255, 255, 0.28);
}

.health-step {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aae73d;
}

.health-banner.is-down .health-step,
.health-banner.is-degraded .health-step {
  color: var(--warn);
}

.health-banner.is-checking .health-step {
  color: var(--muted-foreground);
}

.health-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.health-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.health-retry {
  justify-self: start;
  margin-top: 6px;
}

.auth,
.panel {
  display: grid;
  gap: 10px;
}

.auth-locked {
  display: none !important;
}

.field-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.language {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
}

.level-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--foreground);
}

.language-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.lang-btn {
  min-height: 52px;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-foreground);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.lang-flag {
  font-size: 30px;
  line-height: 1;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
}

.lang-btn.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--foreground);
}

.lang-btn:active {
  transform: scale(0.98);
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--destructive);
  background: rgba(220, 38, 38, 0.06);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.account-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 10px 0 12px;
  background: linear-gradient(to bottom, transparent, var(--background) 40%);
}

.account-menu {
  position: relative;
  width: max-content;
}

.account-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 150ms var(--ease-out);
}

.account-avatar:hover,
.account-avatar[aria-expanded="true"] {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-identity {
  padding: 6px 9px 8px;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
}

.user-email {
  font-size: 11px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 220px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(28, 28, 30, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  transform-origin: bottom left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px) scale(0.97);
  transition:
    opacity 140ms var(--ease-out),
    transform 180ms var(--ease-out),
    visibility 0s linear 180ms;
}

.account-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

.account-menu-item {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--destructive);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
}

.account-menu-item:active {
  transform: scale(0.98);
}

.account-menu-item svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
}

.slider-field {
  display: grid;
  gap: 9px;
  padding: 10px 0;
}

.slider-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--foreground);
}

.slider-label strong {
  font-size: 11px;
  font-weight: 600;
  color: #0a84ff;
  font-variant-numeric: tabular-nums;
}

.slider-field input[type="range"] {
  --range-progress: 50%;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
}

.slider-field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #0a84ff 0,
    #0a84ff var(--range-progress),
    rgba(118, 118, 128, 0.36) var(--range-progress),
    rgba(118, 118, 128, 0.36) 100%
  );
}

.slider-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 120ms var(--ease-out);
}

.slider-field input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.08);
}

.slider-field input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 3px rgba(10, 132, 255, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.28);
}

.placement-field {
  display: grid;
  gap: 6px;
}

.placement-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  padding: 2px;
  border: 0;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.24);
}

.placement-btn {
  appearance: none;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 8px;
  cursor: pointer;
  transition:
    background 120ms var(--ease-out),
    color 120ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.placement-btn:hover {
  color: var(--foreground);
}

.placement-btn.is-active {
  background: rgba(99, 99, 102, 0.78);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 1px 3px rgba(0, 0, 0, 0.28);
}

.placement-btn:active {
  transform: scale(0.98);
}

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

.label-actions {
  display: flex;
  gap: 4px;
}

.activity-preview {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 4px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.activity-preview .activity-empty {
  padding: 10px 4px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 12px;
}

.activity-preview .activity-item {
  padding: 6px 8px;
  border-radius: var(--radius);
  display: grid;
  gap: 2px;
}

.activity-preview .activity-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 10px;
  color: var(--muted-foreground);
}

.activity-preview .activity-step {
  font-weight: 600;
  color: var(--foreground);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.activity-preview .activity-msg {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.activity-preview .activity-data {
  display: none;
}

.activity-preview .activity-item.level-err {
  border-color: rgba(220, 38, 38, 0.35);
}

.activity-preview .activity-item.level-ok .activity-step {
  color: var(--ok);
}

.activity-preview .activity-item.level-warn .activity-step {
  color: var(--warn);
}

.activity-preview .activity-item.level-err .activity-step {
  color: var(--destructive);
}

.value {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.progress {
  font-size: 12px;
  color: var(--warn);
}

.progress.ok {
  color: var(--ok);
}

.progress.err {
  color: var(--destructive);
}

.history-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.history-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out);
}

.history-item:hover {
  background: var(--muted);
  border-color: rgba(255, 255, 255, 0.18);
}

.history-item .title {
  font-size: 12px;
  font-weight: 600;
}

.history-item .sub {
  font-size: 11px;
  color: var(--muted-foreground);
}

.saved-words-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.saved-words-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.saved-words-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.saved-words-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.saved-word-item {
  user-select: none;
}

.upload {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
  cursor: pointer;
  transition:
    border-color 150ms var(--ease-out),
    background-color 150ms var(--ease-out);
}

.upload:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.upload input {
  display: none;
}

.upload-title {
  font-size: 13px;
  font-weight: 600;
}

.upload-hint {
  color: var(--muted-foreground);
  font-size: 11px;
}

.status {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  border: 1px solid transparent;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--muted-foreground);
}

.status.ok {
  border-color: rgba(22, 163, 74, 0.25);
  color: var(--ok);
  background: rgba(22, 163, 74, 0.06);
}

.status.err {
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--destructive);
  background: rgba(220, 38, 38, 0.06);
}

.meta {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 12px;
}

/* Production builds hide developer sections (Activity, Advanced). */
.is-production .dev-only {
  display: none !important;
}

.hidden {
  display: none !important;
}

.debug {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--foreground);
  max-height: 180px;
  overflow: auto;
}

.debug.err {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--destructive);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px;
  height: 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    transform 150ms var(--ease-out),
    opacity 150ms var(--ease-out);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(23, 23, 23, 0.25);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-icon {
  width: 28px;
  padding: 0;
  border-radius: 8px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-google {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  border-color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.26) inset;
}

.btn-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.86);
}

.btn-ghost {
  background: transparent;
  color: #0a84ff;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #409cff;
}

.google-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--foreground);
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  flex: 1;
  min-width: 0;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 30px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 180ms var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  transition:
    transform 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.toggle input:checked + .switch {
  background: rgba(255, 255, 255, 0.85);
}

.toggle input:checked + .switch::after {
  background: var(--background);
  transform: translateX(12px);
}

.toggle input:focus-visible + .switch {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.settings-group {
  border-radius: 10px;
}

.settings-summary {
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  color: var(--foreground);
  list-style: none;
  user-select: none;
  transition:
    background-color 150ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.settings-summary::-webkit-details-marker {
  display: none;
}

.settings-summary:hover {
  background: rgba(255, 255, 255, 0.045);
}

.settings-summary:active {
  transform: scale(0.985);
}

.settings-summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.32) inset;
}

.icon-3d,
.settings-icon {
  width: 30px;
  height: 30px;
  position: relative;
  display: inline-block;
  flex: 0 0 30px;
}

.icon-3d {
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform 180ms var(--ease-out);
}

.settings-summary:hover .icon-3d {
  transform: perspective(90px) rotateX(7deg) rotateY(-10deg) translateY(-1px);
}

.icon-practice-back,
.icon-practice-card,
.icon-subtitle-back,
.icon-subtitle-screen,
.icon-activity-back,
.icon-activity-panel {
  position: absolute;
  display: flex;
  box-sizing: border-box;
}

.icon-practice-back {
  width: 22px;
  height: 27px;
  top: 3px;
  left: 6px;
  border-radius: 6px;
  background: #3b34b5;
  transform: rotateZ(-6deg) translateZ(-2px);
}

.icon-practice-card {
  width: 22px;
  height: 27px;
  top: 1px;
  left: 1px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 6px;
  background: linear-gradient(155deg, #9d96f7, #5b52e0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transform: translateZ(2px);
}

.icon-practice-card i {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.42);
}

.icon-practice-card i:first-child {
  background: rgba(255, 255, 255, 0.74);
}

.icon-practice-card i:nth-child(2) {
  width: 9px;
}

.icon-subtitle-back {
  width: 28px;
  height: 20px;
  top: 7px;
  left: 1px;
  border-radius: 5px;
  background: #067a6a;
  transform: rotateZ(2deg) translateZ(-2px);
}

.icon-subtitle-screen {
  width: 28px;
  height: 20px;
  top: 4px;
  left: 0;
  align-items: flex-end;
  padding: 0 3px 3px;
  border-radius: 5px;
  background: linear-gradient(155deg, #2dd4bf, #0d8880);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transform: translateZ(2px);
}

.icon-subtitle-bar {
  width: 100%;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
}

.icon-subtitle-bar i {
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.75);
}

.icon-subtitle-bar i:last-child {
  width: 70%;
  background: rgba(255, 255, 255, 0.45);
}

.icon-activity-back {
  width: 26px;
  height: 26px;
  top: 4px;
  left: 2px;
  border-radius: 7px;
  background: #c2410c;
  transform: translateZ(-2px);
}

.icon-activity-panel {
  width: 26px;
  height: 26px;
  top: 1px;
  left: 1px;
  align-items: flex-end;
  gap: 2px;
  padding: 4px;
  border-radius: 7px;
  background: linear-gradient(155deg, #fb923c, #ea6a00);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transform: translateZ(2px);
}

.icon-activity-panel i {
  height: var(--bar);
  flex: 1;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.36);
}

.icon-activity-panel i:nth-last-child(-n + 2) {
  background: rgba(255, 255, 255, 0.9);
}

.icon-activity-pulse {
  position: absolute;
  width: 15px;
  height: 6px;
  top: 10px;
  left: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-right: 1px solid rgba(255, 255, 255, 0.8);
  transform: rotate(-12deg) skewX(-25deg) translateZ(4px);
}

.settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.settings-icon-advanced {
  background: #636366;
  letter-spacing: 0.04em;
}

.settings-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.settings-title strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.settings-title small {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.42);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.42);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 180ms var(--ease-out);
}

.settings-group[open] .settings-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.settings-group-content > .panel {
  padding: 4px 8px 12px 51px;
}

.advanced-content {
  padding: 4px 8px 12px 51px;
  display: grid;
  gap: 10px;
}

@media (prefers-reduced-transparency: reduce) {
  body {
    background: #090909;
  }

  .history-item {
    background: #1c1c1e;
  }
}

@media (prefers-reduced-motion: reduce) {
  .icon-3d {
    transition: none;
  }

  .settings-summary:hover .icon-3d {
    transform: none;
  }
}

#tracking-section {
  border: 0;
}

#tracking-section > .label-row {
  min-height: 36px;
}


#settings-section {
  gap: 0;
}

#settings-section > .label-row {
  min-height: 34px;
}

#settings-section > .placement-field {
  padding: 8px 0 10px;
}

#active-section,
#history-section {
  gap: 6px;
}

.local-server {
  padding: 4px 2px 0;
}

.local-server .field-hint {
  display: block;
}


.lang-btn:not(.is-active) .lang-flag {
  opacity: 0.55;
  transition: opacity 150ms var(--ease-out);
}

.lang-btn:hover .lang-flag {
  opacity: 1;
}

/* Signed-out welcome and first-run language pick. */
.welcome {
  display: grid;
  gap: 18px;
  margin-bottom: 10px;
}

body:not(.is-signed-out) .welcome {
  display: none;
}

.welcome-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.welcome-flags {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.welcome-flags span {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 30px;
  line-height: 1;
}

.welcome-hint {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

body.needs-language .settings-group {
  display: none !important;
}

body.needs-language .language {
  margin: auto 0;
  gap: 14px;
}

/* "Select a language" reads as the page header, not a field label. */
#language-label {
  color: var(--heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

body.needs-language .label-row {
  justify-content: center;
}

body.needs-language #language-label {
  font-size: 26px;
  text-align: center;
}

body.needs-language .mascot-slot.mascot-lg {
  justify-self: center;
}

body.needs-language .lang-btn {
  min-height: 72px;
}

body.needs-language .lang-btn .lang-flag {
  font-size: 38px;
  opacity: 1;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.now-playing-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.now-playing-go {
  margin-left: auto;
  flex-shrink: 0;
}

.now-playing:not(.is-idle) .now-playing-go {
  display: none;
}

.now-playing:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.32);
}

.now-playing-text {
  display: grid;
  min-width: 0;
}

.now-playing.is-idle {
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}

.now-playing.is-idle:hover {
  background: rgba(255, 255, 255, 0.07);
}


.now-playing.is-idle .now-playing-text strong {
  color: var(--foreground);
  font-weight: 600;
}

.now-playing-text small {
  color: var(--muted-foreground);
  font-size: 11px;
}

.now-playing-text strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Setup guide: after the first pick, until Netflix shows the language on. */
.setup-guide {
  display: none;
  margin: auto 0;
  gap: 16px;
  justify-items: center;
  text-align: center;
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}

body.needs-setup .setup-guide {
  display: grid;
}

body.needs-setup .language,
body.needs-setup .settings-group {
  display: none !important;
}

.setup-guide.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.setup-flag {
  font-size: 48px;
  line-height: 1;
}

.setup-title {
  margin: 0;
  color: var(--heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.setup-steps {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  text-align: left;
}

.setup-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--heading);
  font-size: 14px;
  font-weight: 500;
}

.setup-step-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  flex-shrink: 0;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.setup-step-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.setup-step-icon svg path:first-child {
  fill: currentColor;
}

.setup-waiting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.setup-waiting-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
  animation: setup-pulse 1.4s ease-in-out infinite;
}

.setup-waiting.is-error {
  align-items: flex-start;
  color: var(--destructive);
  text-align: left;
}

.setup-waiting.is-error .setup-waiting-dot {
  flex: none;
  margin-top: 5px;
  background: var(--destructive);
  animation: none;
}

@keyframes setup-pulse {
  50% {
    opacity: 0.25;
  }
}

.setup-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.setup-actions .btn {
  width: 100%;
  height: 40px;
  text-decoration: none;
}

/* Once detected, the regular view fades in where the guide was. */
body.setup-revealed .language,
body.setup-revealed .settings-group {
  animation: setup-reveal 480ms var(--ease-out) both;
}

@keyframes setup-reveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .setup-guide,
  body.setup-revealed .language,
  body.setup-revealed .settings-group {
    transition: none;
    animation: none;
  }

  .setup-waiting-dot {
    animation: none;
  }
}

/* Before the first auth check lands, signed-out must not flash settings. */
body.is-signed-out .requires-auth {
  display: none !important;
}

.health-step:empty,
.health-body:empty {
  display: none;
}

/* Practice group shows the language being learned in place of an icon. */
.settings-flag {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 24px;
  line-height: 1;
}

/* Mascot: a small dancing banana. Click it for a spin. */
.mascot {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.mascot svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mascot-lg .mascot {
  width: 72px;
  height: 86px;
}

.mascot-sm .mascot {
  width: 36px;
  height: 43px;
}

.mascot-peel {
  fill: #aae73d;
}

.mascot-stem {
  fill: #1a1a1a;
}

.mascot-eye {
  fill: #1a1a1a;
}

.mascot-smile,
.mascot-arm,
.mascot-leg {
  fill: none;
  stroke: #aae73d;
  stroke-width: 3;
  stroke-linecap: round;
}

.mascot-smile {
  stroke: #1a1a1a;
  stroke-width: 2.4;
}

.mascot-shadow {
  fill: rgba(255, 255, 255, 0.08);
  transform-box: fill-box;
  transform-origin: center;
  animation: mascot-shadow 0.9s ease-in-out infinite alternate;
}

.mascot-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: mascot-dance 0.9s ease-in-out infinite alternate;
}

.mascot-arm {
  transform-box: fill-box;
  animation: mascot-wave 0.45s ease-in-out infinite alternate;
}

.mascot-arm-left {
  transform-origin: 100% 100%;
}

.mascot-arm-right {
  transform-origin: 0% 100%;
  animation-delay: -0.225s;
}

.mascot.is-party .mascot-body {
  animation: mascot-spin 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes mascot-dance {
  from {
    transform: translateY(0) rotate(-7deg);
  }
  to {
    transform: translateY(-5px) rotate(7deg);
  }
}

@keyframes mascot-wave {
  from {
    transform: rotate(-18deg);
  }
  to {
    transform: rotate(22deg);
  }
}

@keyframes mascot-shadow {
  to {
    transform: scaleX(0.75);
    opacity: 0.6;
  }
}

@keyframes mascot-spin {
  0% {
    transform: translateY(0) rotate(0);
  }
  40% {
    transform: translateY(-14px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

.account-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

/* Onboarding shows the big banana, so the footer one waits. */
.mascot-onboarding,
body.needs-language .account-footer .mascot-slot {
  display: none;
}

body.needs-language .mascot-onboarding {
  display: block;
}

.mascot-slot.mascot-lg {
  justify-self: start;
}

@media (prefers-reduced-motion: reduce) {
  .mascot-body,
  .mascot-arm,
  .mascot-shadow {
    animation: none;
  }
}

/* Talking: mouth opens and closes, and a bubble shows the greeting. */
.mascot-slot {
  position: relative;
}

.mascot-mouth {
  display: none;
  fill: #1a1a1a;
  transform-box: fill-box;
  transform-origin: center;
}

.is-talking .mascot-smile {
  display: none;
}

.is-talking .mascot-mouth {
  display: block;
  animation: mascot-talk 0.18s ease-in-out infinite alternate;
}

.mascot-bubble {
  position: absolute;
  z-index: 5;
  padding: 5px 10px;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-out),
    transform 200ms var(--ease-out);
}

.mascot-lg .mascot-bubble {
  top: 6px;
  left: 78px;
  transform-origin: left bottom;
}

.mascot-sm .mascot-bubble {
  bottom: calc(100% + 4px);
  right: 0;
  transform-origin: right bottom;
}

.is-greeting .mascot-bubble {
  opacity: 1;
  transform: none;
}

.is-greeting .mascot-bubble.is-swapping {
  opacity: 0;
  transform: translateY(2px) scale(0.96);
  transition-duration: 140ms;
}

@keyframes mascot-talk {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-bubble,
  .account-dropdown {
    transform: none !important;
    transition-property: opacity, visibility;
  }
}

/* Italian: visible but not pickable yet. */
.lang-btn:disabled {
  cursor: default;
  flex-direction: column;
  gap: 2px;
}

.lang-btn:disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-foreground);
}

.lang-btn:disabled .lang-flag,
body.needs-language .lang-btn:disabled .lang-flag {
  opacity: 0.35;
}

.lang-btn:disabled:active {
  transform: none;
}

.lang-soon {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.welcome-flags .is-soon {
  opacity: 0.35;
}

/* ---------- Tabs: Home · Words · Review ---------- */

.view-tabs {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  gap: 2px;
  padding: 2px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.24);
}

.view-tab {
  appearance: none;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 120ms var(--ease-out),
    color 120ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.view-tab svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.view-tab:hover {
  color: var(--foreground);
}

.view-tab.is-active {
  background: rgba(99, 99, 102, 0.78);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 1px 3px rgba(0, 0, 0, 0.28);
}

.view-tab:active {
  transform: scale(0.97);
}

.view-tab:focus-visible,
.back-btn:focus-visible,
.word-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.32);
}

/* Onboarding owns the screen; tabs appear once a language is set up. */
body.needs-language .view-tabs,
body.needs-setup .view-tabs,
body[data-view="leaderboard"] .view-tabs {
  display: none;
}

body[data-view]:not([data-view="home"]) .home-only {
  display: none !important;
}

/* The picker header is only for the first pick. */
body:not(.needs-language) #language-label {
  display: none;
}

.view-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  animation: view-in 220ms var(--ease-out) both;
}

.view-panel[hidden] {
  display: none;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.view-section {
  display: grid;
  gap: 8px;
}

.view-section + .view-section {
  margin-top: 8px;
}

.view-heading {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.empty-note {
  margin: 0;
  padding: 14px 4px;
  color: var(--muted-foreground);
  font-size: 12px;
  list-style: none;
}

.is-loading {
  opacity: 0.55;
  transition: opacity 150ms var(--ease-out);
}

/* ---------- Words ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stat {
  display: grid;
  gap: 1px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.stat strong {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 11px;
  color: var(--muted-foreground);
}

.words-search {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.words-search:focus {
  border-color: rgba(255, 255, 255, 0.28);
}

.words-search::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.word-list {
  display: grid;
}

.word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.word-row:last-child {
  border-bottom: 0;
}

.word-row.is-leaving {
  opacity: 0;
  transform: translateX(8px);
}

.word-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.word-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.word-line strong {
  font-size: 14px;
  font-weight: 600;
}

.word-row[data-status="learning"] .word-line strong {
  box-shadow: 0 2px 0 #f5c451;
}

.word-meaning {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-example {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-action {
  appearance: none;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 120ms var(--ease-out),
    color 120ms var(--ease-out),
    transform 120ms var(--ease-out);
}

.word-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--foreground);
}

.word-action.is-primary {
  background: rgba(50, 215, 75, 0.14);
  color: var(--ok);
}

.word-action.is-primary:hover:not(:disabled) {
  background: rgba(50, 215, 75, 0.22);
  color: var(--ok);
}

.word-action:active:not(:disabled) {
  transform: scale(0.96);
}

.word-action:disabled {
  opacity: 0.5;
  cursor: default;
}

#words-more-btn {
  justify-self: center;
}

/* ---------- Review ---------- */

.review-lines {
  display: grid;
  gap: 6px;
}

.review-line {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.review-sentence {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.review-score,
.review-rec,
.review-result {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.review-score {
  overflow: hidden;
}

.review-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.review-actions [hidden] {
  display: none;
}

/* One thing at a time in the meta row: score, then the live recorder, then the result. */
.review-rec,
.review-result,
.review-line[data-state="starting"] .review-score,
.review-line[data-state="listening"] .review-score,
.review-line[data-state="checking"] .review-score,
.review-line[data-state="listening"] [data-watch],
.review-line[data-state="checking"] [data-watch] {
  display: none;
}

.review-line[data-state="starting"] .review-rec,
.review-line[data-state="listening"] .review-rec,
.review-line[data-state="checking"] .review-rec {
  display: flex;
}

.review-line[data-result="1"]:not([data-state="listening"]):not([data-state="checking"]):not([data-state="starting"]) .review-result {
  display: flex;
}

.review-sentence .missed {
  color: #ff8a84;
  text-decoration: underline;
  text-decoration-color: rgba(255, 105, 97, 0.5);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.review-line[data-state="listening"] {
  background: rgba(255, 105, 97, 0.08);
}

/* Mirrors the Ask button on the Netflix explain card (content.css .nap-explain-ask). */
.practice-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: #e50914;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 120ms var(--ease-out);
}

.practice-btn:hover:not(:disabled) {
  background: #f6121d;
}

.practice-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.practice-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.review-line[data-state="checking"] .practice-btn:disabled {
  opacity: 0.7;
}

.practice-icon {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.practice-icon.is-stop {
  fill: currentColor;
  stroke: none;
}

/* Watch sits beside it like the Ask card's neutral buttons. */
.review-actions [data-watch] {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 500;
}

.review-actions [data-watch]:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.review-rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--destructive);
  flex: none;
}

.review-line[data-state="listening"] .review-rec-dot {
  animation: review-rec-pulse 1.2s ease-in-out infinite;
}

.review-line[data-state="checking"] .review-rec-dot {
  background: var(--muted-foreground);
}

.review-rec-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}

.review-rec-wave i {
  width: 2px;
  height: 18px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.72);
  transform: scaleY(var(--bar, 0.12));
  transition: transform 60ms linear;
}

.review-line[data-state="checking"] .review-rec-wave i {
  opacity: 0.35;
}

.review-rec-time {
  color: var(--muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.review-result {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.review-result[data-tone="ok"] {
  color: var(--ok);
}

.review-result[data-tone="warn"] {
  color: var(--warn);
}

.review-result[data-tone="err"] {
  color: #ff8a84;
  font-weight: 500;
}

.review-line.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

@keyframes review-rec-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-line[data-state="listening"] .review-rec-dot {
    animation: none;
  }
  .review-rec-wave i {
    transition: none;
  }
}

.stars {
  display: inline-flex;
  gap: 3px;
  flex: none;
}

.stars i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.stars i.is-on {
  background: var(--warn);
}



/* ---------- Leaderboard ---------- */

.leaderboard-link {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.leaderboard-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, #ffd60a, #ff9f0a);
  color: #3a2600;
}

.leaderboard-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-chevron.is-forward {
  transform: rotate(-45deg) translate(-1px, -1px);
}

.view-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-title {
  margin: 0;
  color: var(--heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.back-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: -6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.back-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leaderboard-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lb-row {
  display: grid;
  grid-template-columns: 22px 28px minmax(0, 1fr) 48px 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 10px;
}

.lb-row.is-me {
  background: rgba(10, 132, 255, 0.14);
}

.lb-rank {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lb-row:nth-child(1) .lb-rank {
  color: #ffd60a;
}

.lb-row:nth-child(2) .lb-rank {
  color: #d1d1d6;
}

.lb-row:nth-child(3) .lb-rank {
  color: #ff9f0a;
}

.lb-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  object-fit: cover;
}

.lb-name {
  min-width: 0;
  display: grid;
}

.lb-name strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-flags {
  font-size: 12px;
  line-height: 1.2;
}

.lb-score {
  display: grid;
  justify-items: end;
  line-height: 1.1;
}

.lb-score strong {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lb-score small {
  color: var(--muted-foreground);
  font-size: 10px;
}

.lb-minutes strong {
  color: var(--muted-foreground);
  font-weight: 500;
}

.lb-gap {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}

.leaderboard-note {
  padding: 0 6px;
}

@media (prefers-reduced-motion: reduce) {
  .view-panel,
  .word-row {
    animation: none;
    transition: none;
  }
}

/* Settings stay quiet until reached for: dimmed until hovered, focused or open. */
.settings-group {
  opacity: 0.42;
  transition: opacity 180ms var(--ease-out);
}

.settings-group:hover,
.settings-group:focus-within,
.settings-group[open] {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .settings-group {
    transition: none;
  }
}
