/* ═══════════════════════════════════════════════════════
   Spectator Pro — Full detailed view
   ═══════════════════════════════════════════════════════ */

.spec-wrap {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1300px) {
  .spec-wrap { grid-template-columns: 1fr; }
}

/* ═══ PHASE HEADER ═══ */
.spec-phase {
  background: linear-gradient(135deg, #7367F0 0%, #9E95F5 100%);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  color: #fff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.spec-phase h2 { color: #fff; margin: 0 0 .25rem 0; font-weight: 800; font-size: 1.5rem; }
.spec-phase .sub { opacity: .9; font-size: .85rem; }
.spec-phase .phase-info { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.spec-phase .phase-info > div { text-align: center; min-width: 70px; }
.spec-phase .phase-info .val { font-size: 1.75rem; font-weight: 800; line-height: 1; color: #fff; }
.spec-phase .phase-info .lbl { font-size: .75rem; opacity: .85; }
.spec-phase .controls { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ═══ SEATS GRID ═══ */
.seats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.seat-card {
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-border-color);
  border-radius: 14px;
  padding: .85rem .6rem;
  position: relative;
  text-align: center;
  transition: all .2s;
}
.seat-card.alive { border-color: rgba(40,199,111,.35); }
.seat-card.dead { border-color: rgba(234,84,85,.35); opacity: .6; }
.seat-card.dead::before {
  content: "💀";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  opacity: .15;
  pointer-events: none;
}
.seat-card.speaking { border-color: #7367F0; box-shadow: 0 0 0 3px rgba(115,103,240,.25); animation: glow 1.5s infinite; }
.seat-card.god { background: linear-gradient(135deg, #4b3fb8, #6d5ed6); color: #fff; border-color: rgba(255,255,255,.2); }
.seat-card.god .role, .seat-card.god .name { color: #fff; }

@keyframes glow {
  0%,100% { box-shadow: 0 0 0 3px rgba(115,103,240,.25); }
  50% { box-shadow: 0 0 0 6px rgba(115,103,240,.1); }
}

.seat-card .seat-num {
  position: absolute; top: 6px; right: 8px;
  background: rgba(0,0,0,.15); color: inherit;
  font-weight: 800; font-size: .75rem;
  padding: 2px 7px; border-radius: 6px;
}
.seat-card .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7367F0, #9E95F5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .5rem;
  font-size: 1.5rem;
  font-weight: 800;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.3);
}
.seat-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.seat-card .name { font-weight: 700; font-size: .85rem; margin-top: .25rem; }
.seat-card .role { font-size: .72rem; opacity: .85; margin-top: 2px; }
.seat-card .team-badge {
  display: inline-block;
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 4px;
  font-weight: 700;
}
.seat-card .team-badge.mafia { background: rgba(234,84,85,.2); color: #EA5455; }
.seat-card .team-badge.town { background: rgba(40,199,111,.2); color: #28C76F; }
.seat-card .team-badge.independent { background: rgba(255,159,67,.2); color: #FF9F43; }
.seat-card .team-badge.god { background: rgba(255,255,255,.2); color: #fff; }
.seat-card .mic-icon {
  position: absolute;
  top: 6px; left: 8px;
  font-size: 1.1rem;
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.seat-card .stats-row {
  display: flex; justify-content: space-around;
  margin-top: .5rem; padding-top: .5rem;
  border-top: 1px dashed var(--bs-border-color);
  font-size: .7rem;
  opacity: .8;
}
.seat-card .stats-row span { display: flex; align-items: center; gap: 2px; }

/* ═══ LOG PANEL ═══ */
.log-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
  position: sticky;
  top: 90px;
}
.log-header {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--bs-primary-rgb), .04);
}
.log-header h5 { margin: 0; font-weight: 700; display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.log-filters { display: flex; gap: 3px; padding: .5rem .75rem; border-bottom: 1px solid var(--bs-border-color); overflow-x: auto; }
.log-filter-btn {
  padding: 4px 10px; border-radius: 14px;
  border: 1px solid var(--bs-border-color);
  background: transparent; color: var(--bs-body-color);
  font-size: .7rem; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.log-filter-btn.active { background: #7367F0; color: #fff; border-color: #7367F0; }
.log-filter-btn:hover { border-color: #7367F0; }
.log-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: .5rem;
}
.log-item {
  display: flex;
  gap: .55rem;
  padding: .6rem .7rem;
  border-radius: 10px;
  margin-bottom: .35rem;
  font-size: .82rem;
  line-height: 1.45;
  background: rgba(0,0,0,.02);
  border-right: 3px solid transparent;
  transition: all .15s;
}
.log-item:hover { background: rgba(var(--bs-primary-rgb), .06); }

.log-item.kind-phase { border-right-color: #7367F0; background: rgba(115,103,240,.06); }
.log-item.kind-phase .log-icon { background: rgba(115,103,240,.15); color: #7367F0; }

.log-item.kind-vote { border-right-color: #00CFE8; background: rgba(0,207,232,.04); }
.log-item.kind-vote .log-icon { background: rgba(0,207,232,.15); color: #00CFE8; }

.log-item.kind-kill { border-right-color: #EA5455; background: rgba(234,84,85,.06); }
.log-item.kind-kill .log-icon { background: rgba(234,84,85,.15); color: #EA5455; }

.log-item.kind-heal { border-right-color: #28C76F; background: rgba(40,199,111,.05); }
.log-item.kind-heal .log-icon { background: rgba(40,199,111,.15); color: #28C76F; }

.log-item.kind-ability { border-right-color: #FF9F43; background: rgba(255,159,67,.05); }
.log-item.kind-ability .log-icon { background: rgba(255,159,67,.15); color: #FF9F43; }

.log-item.kind-action { border-right-color: #FF9F43; background: rgba(255,159,67,.05); }
.log-item.kind-action .log-icon { background: rgba(255,159,67,.15); color: #FF9F43; }

.log-item.kind-speaker { border-right-color: #7367F0; background: rgba(115,103,240,.04); }
.log-item.kind-speaker .log-icon { background: rgba(115,103,240,.15); color: #7367F0; }

.log-item.kind-result { border-right-color: #EA5455; background: rgba(234,84,85,.1); font-weight: 600; }
.log-item.kind-result .log-icon { background: rgba(234,84,85,.15); color: #EA5455; }

.log-item.kind-wake_slot { border-right-color: #6c757d; background: rgba(108,117,125,.06); }
.log-item.kind-wake_slot .log-icon { background: rgba(108,117,125,.15); color: #6c757d; }

.log-item.kind-system { border-right-color: #a8aaae; }
.log-item.kind-system .log-icon { background: rgba(168,170,174,.15); color: #a8aaae; }

.log-item .log-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.log-item .log-content { flex-grow: 1; min-width: 0; }
.log-item .log-text { color: var(--bs-body-color); word-wrap: break-word; }
.log-item .log-text strong { color: var(--bs-heading-color); }
.log-item .log-time {
  font-size: .65rem;
  color: var(--bs-secondary-color);
  margin-top: 3px;
  font-family: monospace;
}

/* ═══ VOTES DETAIL PANEL ═══ */
.votes-detail {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.votes-detail h6 { font-weight: 700; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.vote-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem;
  border-radius: 8px;
  background: rgba(0,207,232,.04);
  margin-bottom: .35rem;
  font-size: .82rem;
}
.vote-row .voter { font-weight: 600; }
.vote-row .arrow { color: #00CFE8; }
.vote-row .target { font-weight: 600; color: #EA5455; }

/* ═══ ACTIONS DETAIL PANEL ═══ */
.actions-detail {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.action-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem;
  border-radius: 8px;
  background: rgba(255,159,67,.04);
  margin-bottom: .35rem;
  font-size: .82rem;
}
.action-row .actor { font-weight: 600; }
.action-row .ability { color: #FF9F43; font-weight: 600; }
.action-row .target { color: #EA5455; }

/* ═══ DARK MODE ═══ */
html.dark-style .seat-card,
html.dark-style .log-panel,
html.dark-style .votes-detail,
html.dark-style .actions-detail,
html.dark-style .action-panel {
  background: #2f3349 !important;
  border-color: rgba(255,255,255,.1) !important;
}
html.dark-style .log-header {
  background: rgba(115,103,240,.08) !important;
  border-bottom-color: rgba(255,255,255,.1) !important;
}
html.dark-style .log-item { background: rgba(255,255,255,.03); }
html.dark-style .log-item .log-text { color: #cfcde4; }
html.dark-style .log-item .log-text strong { color: #fff; }
html.dark-style .seat-card.god { background: linear-gradient(135deg, #4b3fb8, #6d5ed6) !important; }
html.dark-style .vote-row { background: rgba(0,207,232,.08); }
html.dark-style .action-row { background: rgba(255,159,67,.08); }

/* ═══ ACTION PANEL ═══ */
.action-panel {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.action-panel h6 { font-weight: 700; margin-bottom: .75rem; }
.action-panel .action-btn {
  padding: .5rem .9rem;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  cursor: pointer;
  font-weight: 600;
  font-size: .8rem;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--bs-body-color);
}
.action-panel .action-btn:hover {
  background: rgba(var(--bs-primary-rgb), .08);
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}
