/* word_battle styles — studio palette */

.wb-body {
  background: linear-gradient(180deg, #fef3c7 0%, #ffffff 60%);
  min-height: 100vh;
}

/* ---------- intro cards ---------- */

.wb-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.08);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.wb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.14);
}
.wb-card.active { cursor: default; }
.wb-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.wb-card-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e1b4b;
}

.wb-form {
  padding: 0 18px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wb-form.hidden { display: none; }
.wb-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #4b5563;
}
.wb-field input,
.wb-field select {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  background: #fff;
}
.wb-field input:focus,
.wb-field select:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
.wb-form-note {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.wb-btn-primary {
  background: linear-gradient(135deg, #ff6b6b 0%, #a855f7 50%, #4f46e5 100%);
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
  font-size: 15px;
}
.wb-btn-primary:hover { opacity: 0.92; }
.wb-btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 1;
}

/* ---------- lobby ---------- */

.wb-roomcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #1e1b4b;
  margin-top: 4px;
  background: linear-gradient(135deg, #ff6b6b, #a855f7, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wb-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
.wb-lobby-status {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-lobby-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

/* ---------- play ---------- */

.wb-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.wb-score-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid transparent;
}
.wb-score-side.host { border-color: #ef4444; }
.wb-score-side.guest { border-color: #3b82f6; }
.wb-score-name {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 2px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-score-value {
  font-size: 32px;
  font-weight: 800;
  color: #1e1b4b;
  font-variant-numeric: tabular-nums;
}
.wb-round-pill {
  background: #1e1b4b;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.wb-progress {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.wb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #a855f7, #4f46e5);
  transition: width .3s ease;
}

.wb-card-word {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 18px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wb-korean {
  font-size: 80px;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.wb-word-meta {
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
}

.wb-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-input {
  width: 100%;
  height: 64px;
  padding: 0 18px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-size: 28px;
  font-weight: 600;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
}
.wb-input:focus { border-color: #a855f7; }
.wb-input.wrong { border-color: #ef4444; animation: wb-shake 0.25s; }
.wb-input.correct { border-color: #10b981; }
@keyframes wb-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.wb-feedback {
  font-size: 14px;
  color: #6b7280;
  min-height: 20px;
  text-align: center;
}
.wb-feedback.win { color: #10b981; font-weight: 700; }
.wb-feedback.lose { color: #ef4444; font-weight: 700; }

.wb-opponent-status {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  margin-top: 6px;
  min-height: 18px;
}

/* result modal */
.wb-modal-bg {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.wb-modal-bg.hidden { display: none; }
.wb-modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.wb-modal h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}
.wb-modal-score {
  font-size: 48px;
  font-weight: 800;
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.wb-modal-note {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 18px;
}

/* toast */
.wb-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #1e1b4b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.wb-toast.hidden { display: none; }

/* connection indicator */
.wb-conn {
  position: fixed; top: 56px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: #6b7280;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid #e5e7eb;
  z-index: 30;
}
.wb-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.wb-conn.up .wb-conn-dot { background: #10b981; }
.wb-conn.down .wb-conn-dot { background: #ef4444; }

@media (max-width: 480px) {
  .wb-korean { font-size: 56px; }
  .wb-card-word { padding: 24px 18px; min-height: 120px; }
  .wb-input { height: 56px; font-size: 24px; }
  .wb-roomcode { font-size: 40px; }
}
