/* 끝말잇기 — 60초 단어 사슬 */

.board-wrap {
  position: relative;
  width: min(92vw, 480px);
  margin: 0 auto;
}

.wc-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 22px 18px 20px;
  background: linear-gradient(135deg, #ffb3a0, #e76f51);
  border-radius: 24px;
  color: #fff;
  user-select: none;
  text-align: center;
  transition: transform 0.1s;
  box-shadow: 0 10px 30px rgba(231, 111, 81, 0.25);
  min-height: 480px;
}

.wc-card.correct { animation: pop 0.32s ease; }
.wc-card.wrong   { animation: shake 0.32s ease; }
@keyframes pop {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

.wc-prompt {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 600;
  margin-bottom: -4px;
}

.wc-prev-block {
  background: rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 12px 16px;
}
.wc-prev-label {
  font-size: 0.72rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.wc-prev {
  font-size: clamp(1.3rem, 5.6vw, 1.7rem);
  font-weight: 800;
}

.wc-arrow {
  font-size: 1.4rem;
  opacity: 0.7;
  line-height: 1;
}

.wc-next-block {
  background: rgba(255,255,255,0.95);
  color: #6a1e0d;
  border-radius: 14px;
  padding: 10px 14px;
}
.wc-next-label {
  font-size: 0.72rem;
  color: #8c3d2a;
  margin-bottom: 4px;
}
.wc-next-char {
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.05em;
}

.wc-history {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px 10px;
  height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  text-align: left;
}
.wc-history::-webkit-scrollbar { width: 4px; }
.wc-history::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

.wc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 0.92rem;
  font-weight: 600;
}
.wc-row-me  { color: #fffdf5; justify-content: flex-end; }
.wc-row-cpu { color: rgba(255,253,245,0.78); }
.wc-row-me  .wc-word  { background: rgba(255,255,255,0.95); color: #6a1e0d; padding: 3px 10px; border-radius: 999px; }
.wc-row-cpu .wc-word  { background: rgba(255,255,255,0.16); padding: 3px 10px; border-radius: 999px; }

.wc-input-row {
  display: flex;
  gap: 8px;
}
#wc-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.95);
  color: #2b0e07;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
#wc-input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.32); }

#wc-submit {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #2ed573;
  color: #0e3a1f;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#wc-submit:active { transform: scale(0.96); }

.wc-feedback {
  min-height: 1.2em;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  opacity: 0.95;
}
.wc-feedback.is-error { color: #ffd6cf; }
.wc-feedback.is-ok    { color: #b6f0c6; }

/* ===== 시작 오버레이 ===== */

.wc-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 41, 0.78);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  z-index: 5;
  transition: opacity 0.2s;
}
.wc-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-content { text-align: center; padding: 24px; }
.overlay-icon { font-size: 3.5rem; margin-bottom: 12px; }
.overlay-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.overlay-content p { color: var(--text-dim); margin-bottom: 18px; line-height: 1.5; }

.hint {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 0 16px;
}

/* ===== 결과 모달 ===== */

.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn 0.25s ease;
}
.result-modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-emoji { font-size: 4rem; margin-bottom: 8px; }
.result-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.result-msg { color: var(--text-dim); margin-bottom: 24px; }

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.result-stats > div {
  background: rgba(255,255,255,0.05);
  padding: 14px;
  border-radius: 12px;
}
.result-stats span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.result-stats strong {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result-rank {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 4px;
  color: var(--accent);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.result-actions .btn {
  padding: 12px 16px;
  text-align: center;
  font-size: 0.95rem;
}
