/* ===== Emoji Cipher (ec-) ===== */

/* --- Map Area --- */
.ec-map-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow-x: auto;
}

.ec-map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 320px;
}

.ec-map-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  background: rgba(139,92,246,0.08);
  font-size: 0.85rem;
  min-height: 44px;
}

.ec-map-emoji {
  font-size: 1.2rem;
  line-height: 1.2;
}

.ec-map-char {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.8rem;
}

/* For empty spots in the a-i-u-e-o table (like yi, ye, wu) */
.ec-map-empty {
  visibility: hidden;
}

/* --- Cipher Text --- */
.ec-cipher-wrap {
  text-align: center;
  margin: 16px 0 8px;
}

.ec-cipher-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

#ec-cipher-text {
  font-size: 1.8rem;
  letter-spacing: 4px;
  padding: 12px 16px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: var(--radius);
  display: inline-block;
  min-width: 200px;
  min-height: 48px;
  line-height: 1.6;
  word-break: break-all;
}

/* --- Input Display --- */
.ec-input-wrap {
  text-align: center;
  margin: 10px 0;
}

.ec-input-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 4px;
  font-weight: 600;
  display: block;
}

.ec-input-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  max-width: 320px;
}

.ec-native-input {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 2px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  letter-spacing: 2px;
  transition: all 0.2s;
  min-width: 0;
  text-align: center;
}

.ec-native-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(139,92,246,0.1);
}

.ec-native-input.ec-correct {
  border-color: #22c55e;
  background: rgba(34,197,94,0.12);
}

.ec-native-input.ec-wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
}

.ec-submit-btn {
  padding: 0 16px;
  min-height: 44px;
  margin: 0;
  white-space: nowrap;
}

/* --- Animations --- */
@keyframes ecFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ec-map-area,
.ec-cipher-wrap,
.ec-input-wrap {
  animation: ecFadeIn 0.35s ease-out;
}

/* --- Responsive --- */
@media (max-width: 380px) {
  .ec-map-grid {
    gap: 3px;
  }
  .ec-map-item {
    font-size: 0.75rem;
    min-height: 38px;
  }
  #ec-cipher-text {
    font-size: 1.4rem;
    letter-spacing: 3px;
    padding: 8px 12px;
  }
  .ec-native-input {
    font-size: 1rem;
  }
  .ec-submit-btn {
    padding: 0 12px;
  }
}
