:root {
  --bg: #050505;
  --text: #f4f4f4;
  --muted: #8a8a8a;
  --red: #e82127;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
}

audio {
  display: none;
}

.en-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 16px;
  gap: 10px;
}

.en-app > header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.en-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.back-link,
.en-top h1 {
  font-size: 26px;
  font-weight: 600;
}

.back-link {
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  white-space: nowrap;
}

.back-link:active {
  background: #fff;
  color: #000;
}

.progress,
.status {
  color: var(--muted);
  font-size: 20px;
}

.meaning {
  font-size: 36px;
  font-weight: 600;
}

.sentence {
  font-size: 28px;
  line-height: 1.4;
  min-height: 40px;
}

.zh-sentence {
  font-size: 24px;
  color: var(--muted);
  min-height: 32px;
}

.slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 72px;
}

.slot {
  width: 56px;
  height: 64px;
  border-bottom: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  text-transform: uppercase;
}

.slot.ok {
  color: #9fe7b0;
  border-color: #9fe7b0;
}

.slot.bad {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.slot.missing {
  color: var(--red);
  border-color: var(--red);
}

.keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 8px;
  max-width: 920px;
}

.key {
  height: 110px;
  border: 0;
  border-radius: 20px;
  background: #1c1c1c;
  color: #fff;
  font-size: 48px;
  font-weight: 700;
}

.key.wrong {
  background: #5a1a1a;
  opacity: 0.55;
}

.en-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 920px;
  margin-top: auto;
}

.en-actions button {
  height: 72px;
  border: 0;
  border-radius: 18px;
  background: #1c1c1c;
  color: #fff;
  font-size: 26px;
  font-weight: 600;
}

.en-actions button:disabled {
  opacity: 0.35;
}

.en-actions button:active:not(:disabled) {
  background: var(--red);
}

.status.ok { color: #9fe7b0; }
.status.bad { color: #ff6b6b; }

@media (max-height: 700px) {
  .meaning { font-size: 28px; }
  .sentence { font-size: 22px; }
  .slot { width: 44px; height: 52px; font-size: 28px; }
  .key { height: 80px; font-size: 36px; }
  .en-actions button { height: 56px; font-size: 22px; }
}
