/* ===== Kelime Yarışması ===== */

.wr-page {
  padding: 1.5rem 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.wr-screen { display: none; }
.wr-screen.wr-active { display: block; }

/* Card */
.wr-card {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.wr-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.wr-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Inputs */
.wr-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  color: var(--text);
}
.wr-input:focus { border-color: var(--primary); }
.wr-input-code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
}
.wr-name-row { margin-bottom: 1.2rem; }

/* Buttons */
.wr-btn {
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.wr-btn:active { transform: scale(0.97); }
.wr-btn:hover { opacity: 0.85; }
.wr-btn-primary { background: var(--primary); color: white; }
.wr-btn-secondary { background: #059669; color: white; }
.wr-btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); }
.wr-btn-bot { background: #7c3aed; color: white; }

.wr-btn-group { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.wr-btn-group .wr-btn { flex: 1; min-width: 130px; }

.wr-join-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.wr-join-row .wr-input { flex: 1; }

/* Divider */
.wr-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 1rem 0;
  position: relative;
}
.wr-divider::before, .wr-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.wr-divider::before { left: 0; }
.wr-divider::after { right: 0; }

/* ── Waiting Screen ── */
.wr-waiting-anim {
  font-size: 3.5rem;
  animation: wr-pulse 1.4s ease-in-out infinite;
  margin-bottom: 1rem;
  display: block;
}
@keyframes wr-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}
.wr-dots { margin: 0.5rem 0 1.5rem; font-size: 1.6rem; letter-spacing: 0.3em; }
.wr-dots span { animation: wr-blink 1.2s infinite; }
.wr-dots span:nth-child(2) { animation-delay: 0.2s; }
.wr-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes wr-blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ── Room Screen ── */
.wr-room-code-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.wr-room-code {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 0.4em;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 12px;
  padding: 0.5rem 1.2rem;
  display: inline-block;
  margin-bottom: 0.4rem;
  cursor: pointer;
  user-select: all;
}
.wr-room-hint { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.2rem; }

.wr-players-list { margin: 0.8rem 0 1.2rem; text-align: left; }
.wr-player-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}
.wr-player-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.wr-host-badge { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }

.wr-hint-small { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }
.wr-mt { margin-top: 1rem; }

/* ── Countdown Screen ── */
.wr-card-center {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wr-countdown-label { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.wr-countdown-num {
  font-size: 7rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  animation: wr-zoom 0.7s ease-out;
}
@keyframes wr-zoom {
  from { transform: scale(2); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Game Screen ── */
.wr-game-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.wr-round-label {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-muted);
  min-width: 60px;
}
.wr-timer-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.wr-timer-fill {
  height: 100%;
  width: 100%;
  background: #22c55e;
  border-radius: 4px;
  transition: background 0.4s;
}

.wr-word-box {
  background: white;
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--primary-light);
}
.wr-word-tr {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.wr-word-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.4rem; }

.wr-answer-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.wr-input-answer { flex: 1; font-size: 1.05rem; font-weight: 600; }
.wr-input-answer:disabled { background: #f3f4f6; color: var(--text-muted); }

.wr-feedback {
  min-height: 2.2rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.8rem;
  transition: opacity 0.3s;
}
.wr-feedback:empty { background: transparent; }
.wr-feedback-wrong { color: #dc2626; background: #fef2f2; }
.wr-feedback-win { color: #16a34a; background: #f0fdf4; }
.wr-feedback-correct { color: #16a34a; background: #dcfce7; }
.wr-feedback-timeout { color: #d97706; background: #fffbeb; }

.wr-scores-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 0.4rem; }
.wr-scores { display: flex; flex-direction: column; gap: 0.35rem; }
.wr-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.8rem;
  background: white;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
}
.wr-score-row.wr-me {
  background: var(--primary-light);
  font-weight: 700;
  color: var(--primary);
}
.wr-score-pts { font-weight: 800; font-size: 1rem; }

/* ── Game Over Screen ── */
.wr-results { margin: 1.2rem 0; }
.wr-result-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  font-size: 0.95rem;
}
.wr-result-row.wr-rank-1 {
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  font-size: 1.05rem;
}
.wr-result-row.wr-rank-2 { background: #f1f5f9; }
.wr-result-row.wr-rank-3 { background: #fdf4ef; }
.wr-result-row.wr-mine { outline: 2px solid var(--primary); }
.wr-result-rank { font-size: 1.4rem; width: 2rem; text-align: center; flex-shrink: 0; }
.wr-result-name { flex: 1; font-weight: 600; text-align: left; }
.wr-result-score { font-weight: 800; color: var(--primary); }

/* ── Açık Masalar ── */
.wr-open-rooms-section { margin-top: 1.2rem; text-align: left; }
.wr-open-rooms-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.wr-no-rooms {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
}
.wr-open-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  animation: wr-fadein 0.25s ease;
}
@keyframes wr-fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wr-open-room-info { display: flex; flex-direction: column; gap: 0.1rem; }
.wr-open-room-host { font-weight: 600; font-size: 0.9rem; }
.wr-open-room-count { font-size: 0.75rem; color: var(--text-muted); }
.wr-btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; flex-shrink: 0; }

/* ── Sonuç Paylaşım ── */
.wr-share-result {
  margin: 1rem 0 0.5rem;
}
.wr-share-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.wr-share-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.wr-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.wr-share-btn:hover { opacity: 0.82; }
.wr-share-btn:active { transform: scale(0.96); }
.wr-share-twitter { background: #000; }
.wr-share-facebook { background: #1877f2; }
.wr-share-instagram { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }

/* ── Oda Beacon ── */
.wr-room-visual {
  text-align: center;
  margin: 0.6rem 0 1.2rem;
}
.wr-room-beacon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px; height: 88px;
  margin-bottom: 0.7rem;
}
.wr-beacon-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: wr-ring-out 2.4s ease-out infinite;
}
.wr-ring-1 { width: 42px; height: 42px; }
.wr-ring-2 { width: 62px; height: 62px; animation-delay: 0.7s; }
.wr-ring-3 { width: 84px; height: 84px; animation-delay: 1.4s; }
@keyframes wr-ring-out {
  0%   { opacity: 0.65; transform: scale(0.82); }
  100% { opacity: 0;    transform: scale(1.18); }
}
.wr-beacon-icon {
  font-size: 2.2rem;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.45));
}
.wr-open-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 700;
}
.wr-badge-dot {
  width: 8px; height: 8px;
  background: #16a34a;
  border-radius: 50%;
  flex-shrink: 0;
  animation: wr-dot-pulse 1.3s ease-in-out infinite;
}
@keyframes wr-dot-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.55); }
  50%     { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
}

/* ── Masa Sahnesi (top-down) ── */
.wr-ts-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 0.6rem;
}
.wr-ts-table {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 96px; height: 96px;
  background: radial-gradient(circle at 38% 32%, #1a6b3c, #0d3d22);
  border-radius: 50%;
  border: 4px solid #22c55e;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22), 0 0 0 3px rgba(34,197,94,0.15), inset 0 2px 6px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 1;
}
.wr-ts-table-icon { font-size: 1.7rem; line-height: 1; }
.wr-ts-table-lbl {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
}
.wr-ts-seat {
  position: absolute;
  width: 48px;
  text-align: center;
  z-index: 2;
}
.wr-ts-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  margin: 0 auto 3px;
}
.wr-ts-avatar.wr-ts-host {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fde68a;
}
.wr-ts-empty {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px dashed #d1d5db;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.2rem;
  margin: 0 auto 3px;
  animation: wr-empty-seat 2s ease-in-out infinite;
}
@keyframes wr-empty-seat {
  0%,100% { border-color: #d1d5db; opacity: 0.55; }
  50%     { border-color: var(--primary); opacity: 1; color: var(--primary); }
}
.wr-ts-name {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 58px;
  margin: 0 auto;
  line-height: 1.2;
}
.wr-ts-empty-lbl { color: var(--text-muted); font-weight: 400; }

/* ── Oyun Animasyonları ── */
@keyframes wr-word-bounce {
  0%   { transform: translateY(-18px) scale(0.9); opacity: 0; }
  65%  { transform: translateY(5px) scale(1.04); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.wr-word-box.wr-new { animation: wr-word-bounce 0.42s cubic-bezier(0.34,1.56,0.64,1); }

@keyframes wr-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(3px); }
}
.wr-input-answer.wr-shake { animation: wr-shake 0.4s ease-out; }

.wr-flash {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  animation: wr-flash-fade 0.55s ease-out forwards;
}
.wr-flash-win  { background: rgba(34,197,94,0.28); }
.wr-flash-lose { background: rgba(220,38,38,0.18); }
@keyframes wr-flash-fade {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes wr-timer-crit {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.35; }
}
.wr-timer-fill.wr-crit { animation: wr-timer-crit 0.42s ease-in-out infinite; }

@keyframes wr-border-crit {
  0%,100% { border-color: var(--primary-light); box-shadow: none; }
  50%     { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
}
.wr-word-box.wr-crit { animation: wr-border-crit 0.42s ease-in-out infinite; }

@keyframes wr-score-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.5); color: #16a34a; }
  100% { transform: scale(1); }
}
.wr-score-pts.wr-pop { animation: wr-score-pop 0.38s ease-out; }

/* ── Mod Toggle ── */
.wr-mode-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.wr-mode-btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}
.wr-mode-btn.wr-mode-active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ── Harf Kutuları ── */
.wr-letter-boxes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}
.wr-boxes-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.wr-box {
  width: 18px;
  height: 22px;
  border-bottom: 2.5px solid var(--primary);
  display: inline-block;
  opacity: 0.7;
}
.wr-boxes-alt {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 480px) {
  .wr-word-tr { font-size: 2.2rem; }
  .wr-countdown-num { font-size: 5.5rem; }
  .wr-btn-group .wr-btn { font-size: 0.88rem; padding: 0.7rem 1rem; }
}
