:root { --dict-correct: #51cf66; }

.question-text {
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  margin: 10px 0 8px;
  line-height: 1.3;
  color: var(--accent1);
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 14px;
  padding: 12px 16px;
}

.dict-steps-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.dict-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.dict-steps {
  display: inline-flex;
  padding: 8px 12px;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 14px;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}

.dict-step {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: #555;
  transition: all .2s;
  flex-shrink: 0;
}

.dict-step.passed {
  background: var(--dict-correct);
  color: #fff;
}

.dict-step.current {
  background: var(--accent1);
  color: #fff;
  transform: scale(1.08);
}

.dict-step.error {
  background: #ff6b6b;
  color: #fff;
  animation: dictShake .4s ease;
}

.dict-step.future {
  color: #999;
}

.dict-steps.name-mode {
  background: none;
  border: none;
  padding: 0;
  min-height: auto;
  display: flex;
  justify-content: center;
  width: 100%;
}

.level-selector {
  margin-bottom: 0;
}

.dict-fig-name {
  font-family: inherit;
  font-size: 2.2rem;
  font-weight: 800;
}
@media (max-width: 480px) {
  .dict-fig-name { font-size: 1.7rem; }
}
.dict-fig-name.win { color: var(--dict-correct); }
.dict-fig-name.giveup { color: var(--accent1); }

.dict-canvas-wrap {
  position: relative;
  margin: 8px auto;
  max-width: 100%;
  touch-action: none;
}

#dictCanvas {
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  touch-action: none;
  width: 100%;
  height: auto;
}

.dict-check-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px auto;
}

.dict-check-btn {
  margin: 0;
}

.hint-btn,
.giveup-btn {
  display: none;
  margin: 0;
  padding: 8px 18px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  background: #e8e8e8;
  color: #999;
  opacity: 0.7;
}

.hint-btn:hover,
.giveup-btn:hover {
  opacity: 0.9;
  background: #ddd;
}

.hint-overlay {
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: rgba(var(--white-shadow),.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s;
  z-index: 10;
}

.hint-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.hint-dialog {
  background: var(--glass-bg);
  border: 2px solid var(--help-border);
  border-radius: 20px;
  padding: 24px 28px;
  max-width: 320px;
  text-align: center;
}

.hint-dialog p {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent1);
  margin: 0 0 16px;
  line-height: 1.5;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 1.7rem;
  color: #888;
  font-weight: 700;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--stats-bg1), var(--stats-bg2));
  border-radius: 16px;
  border: 2px solid var(--stats-border);
  transition: all .3s;
}

.stats:hover {
  transform: scale(1.03);
  border-color: var(--stats-hover-border);
}

.stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats b {
  color: #333;
  font-size: 1.1rem;
  transition: all .3s;
}

.stats.bump b {
  animation: statBump .4s ease-out;
}

@keyframes statBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); color: var(--stats-bump-color); }
  100% { transform: scale(1); }
}

@keyframes dictShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.help-text {
  margin: 8px 0;
  padding: 12px 16px;
  line-height: 1.6;
  font-size: .95rem;
  color: #555;
  background: var(--help-bg);
  border: 2px solid var(--help-border);
  border-radius: 14px;
  display: none;
}

.help-text.show {
  display: block;
}

.glass-header {
  justify-content: center;
}

#d3Canvas {
  background: var(--glass-bg);
}

@media (max-width: 480px) {
  .dict-step { font-size: .75rem; padding: 3px 5px; }
  .stats { font-size: 1rem; gap: 12px; }
  .hint-text { display: none; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .dict-step { font-size: .8rem; }
}

@media (min-width: 769px) {
  .dict-step { font-size: .9rem; }
}
