/* ==========================================
   RISE ONLINE - PIXEL DETECTIVE (PİKSEL DEDEKTİFİ)
   ========================================== */

.detective-layout {
  display: grid;
  grid-template-columns: 340px 1fr 340px;
  gap: 18px;
  height: calc(100vh - 110px);
  max-width: 1750px;
  margin: 0 auto;
  padding: 10px 16px;
}

@media (max-width: 1300px) {
  .detective-layout {
    grid-template-columns: 300px 1fr 300px;
    gap: 12px;
  }
}

@media (max-width: 1050px) {
  .detective-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
}

/* Detective Panel Base */
.detective-panel {
  background: linear-gradient(180deg, rgba(16, 21, 33, 0.94) 0%, rgba(10, 13, 20, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detective-panel-header {
  padding: 14px 18px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detective-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-light, #fbbf24);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.detective-panel-body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Center Stage */
.detective-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: radial-gradient(circle at center, rgba(30, 41, 67, 0.6) 0%, rgba(8, 11, 18, 0.95) 75%);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), inset 0 0 60px rgba(245, 158, 11, 0.05);
  padding: 20px;
}

/* Clue Banner & Round Header */
.detective-header-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 18px;
}

.detective-round-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 4px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detective-category-pill {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light, #fbbf24);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Mystery Frame & Canvas */
.detective-frame-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detective-canvas-container {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #000;
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.detective-canvas-container.solved {
  border-color: #22c55e;
  box-shadow: 0 0 50px rgba(34, 197, 94, 0.6), inset 0 0 30px rgba(34, 197, 94, 0.2);
  animation: pulseGreen 1.5s infinite alternate;
}

@keyframes pulseGreen {
  from { box-shadow: 0 0 30px rgba(34, 197, 94, 0.4); }
  to { box-shadow: 0 0 60px rgba(34, 197, 94, 0.8); }
}

#detective-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Timer Bar Overlay */
.detective-timer-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: 8px;
}

.detective-timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.detective-timer-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.detective-timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 60%, #ef4444 100%);
  border-radius: 10px;
  transition: width 0.1s linear;
}

/* Letters Word Clue Box */
.detective-letters-box {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  min-height: 52px;
  margin-top: 6px;
}

.detective-letter-slot {
  width: 34px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light, #fbbf24);
  text-transform: uppercase;
  font-family: monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.detective-letter-slot.revealed {
  background: rgba(245, 158, 11, 0.2);
  border-color: #fbbf24;
  color: #fff;
  transform: scale(1.05);
}

.detective-letter-slot.space {
  width: 14px;
  height: 42px;
  border: none;
  background: transparent;
  box-shadow: none;
}

/* Solved Winner Popup Box in Stage */
.detective-winner-banner {
  position: absolute;
  inset: 20px;
  background: rgba(10, 14, 24, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid #22c55e;
  border-radius: 20px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  z-index: 50;
  box-shadow: 0 0 60px rgba(34, 197, 94, 0.5);
  animation: detectivePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes detectivePopIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.detective-winner-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 25px rgba(74, 222, 128, 0.8);
  margin: 0;
  letter-spacing: 1px;
}

.detective-winner-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 20px;
  border-radius: 30px;
}

.detective-winner-item-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-light, #fbbf24);
}

/* Live Guesses Stream Feed */
.detective-guesses-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 4px;
}

.detective-guess-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  transition: all 0.15s;
}

.detective-guess-item.correct {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #86efac;
  font-weight: 800;
}

.detective-guess-user {
  font-weight: 700;
  color: var(--gold-light, #fbbf24);
  display: flex;
  align-items: center;
  gap: 6px;
}

.detective-guess-text {
  color: #e2e8f0;
  font-family: monospace;
}

/* Leaderboard Ranking Table */
.detective-leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
}

.detective-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.85rem;
}

.detective-rank-row:nth-child(1) {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  font-weight: 800;
}

.detective-rank-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
}

.detective-rank-row:nth-child(1) .detective-rank-badge {
  background: #fbbf24;
  color: #000;
}
