* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1f2328;
}

.counter {
  position: fixed;
  top: 16px;
  right: 20px;
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 110px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.back {
  flex: none;
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}
.back:hover { background: #eaeef2; }
.filename {
  color: #57606a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-title {
  font-size: 1.8rem;
  margin: 0 0 24px;
}
.files {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.file {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 18px 22px;
  font-size: 1.15rem;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}
.file:hover:not(:disabled) { background: #eaeef2; }
.file:disabled { opacity: .6; cursor: default; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-meta { color: #57606a; font-variant-numeric: tabular-nums; flex: none; }
.files-empty { color: #57606a; }
.folder { background: #eef4ff; }
.folder:hover:not(:disabled) { background: #dde8fd; }

.login {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 360px;
  margin: 0 auto;
}
.login-input {
  font: inherit;
  font-size: 1.2rem;
  padding: 14px 16px;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
}
.login-input:focus { outline: 2px solid #2f6feb; outline-offset: 1px; }

.card {
  width: 100%;
  max-width: 760px;
  text-align: center;
}

.position {
  font-size: 1rem;
  font-weight: 600;
  color: #57606a;
  margin: 0 0 12px;
}

.sentence {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  line-height: 1.45;
  margin: 0 0 40px;
}

.sentence-text { transition: filter .2s ease; }
.sentence-text.blurred {
  filter: blur(8px);
  cursor: pointer;
  user-select: none;
}

.speak {
  border: none;
  background: none;
  cursor: pointer;
  font-size: .9em;
  padding: 0 4px;
  vertical-align: baseline;
  border-radius: 8px;
}
.speak:hover { background: #e4e8ec; }
.speak:disabled { cursor: progress; }
.speak.loading { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.choices {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: default; }

.btn-know, .btn-learn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  padding: 24px 32px;
}
.btn-know { background: #1f9d55; }
.btn-learn { background: #d93025; }
.icon { font-size: 2.6rem; line-height: 1; }

.answer {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.term {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.translation {
  font-size: 1.3rem;
  color: #57606a;
  margin: 0 0 24px;
}
.btn-next {
  background: #2f6feb;
  padding: 16px 40px;
}

.done {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f9d55;
}
.error { color: #d93025; }

[hidden] { display: none !important; }
