/* Wave 2.7.1: desktop-specific styles. Loaded only when shell == "desktop". */

/* From base style.css (Wave 2.4.x): polish at >=640px */
@media (min-width: 640px) {
  .site-main { padding: 1.5rem; }
  h1 { font-size: 1.75rem; }
}

/* Shell toggle in header — desktop variant (small icon top-right) */
.shell-toggle {
  margin-left: auto;
  font-size: 1.1rem;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
  padding: 0.25rem 0.5rem;
}
.shell-toggle:hover { opacity: 1; text-decoration: none; }

/* ─────────────────────────────────────────────────────────────────────
   Wave 2.7.4: Desktop schedule panel + mini bracket
   ───────────────────────────────────────────────────────────────────── */

.event-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.event-main {
  min-width: 0; /* prevent grid blowout from overflowing children */
}

@media (max-width: 768px) {
  /* Tablet desktop shell on narrow viewport — stack vertically */
  .event-layout {
    grid-template-columns: 1fr;
  }
}

/* Schedule panel */
.schedule-panel {
  position: sticky;
  top: 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
.schedule-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #334155;
}
.schedule-panel-title {
  margin: 0;
  font-size: 0.95rem;
  color: #f1f5f9;
}
.schedule-now-btn {
  background: transparent;
  color: #38bdf8;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.schedule-now-btn:hover { background: rgba(56, 189, 248, 0.1); }
.schedule-now-btn:active { background: rgba(56, 189, 248, 0.2); }

.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow-y: auto;
  flex: 1;
}
.schedule-row {
  display: grid;
  grid-template-columns: 3rem 1.2rem 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.schedule-row:hover { background: rgba(255,255,255,0.04); }
.schedule-row-active {
  background: rgba(56, 189, 248, 0.12);
  border-left-color: #38bdf8;
}
.schedule-row-done {
  color: #94a3b8;
}
.schedule-row-done .schedule-time { color: #64748b; }

.schedule-time {
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.schedule-status {
  text-align: center;
  font-size: 0.85rem;
}
.schedule-row-done .schedule-status { color: #4ade80; }
.schedule-row-active .schedule-status {
  color: #38bdf8;
  animation: live-pulse 1.5s ease-in-out infinite;
}
.schedule-row-pending .schedule-status { color: #94a3b8; }

.schedule-link {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  color: #f1f5f9;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}
.schedule-link:hover { color: #38bdf8; }
.schedule-cat {
  font-weight: 600;
  flex-shrink: 0;
}
.schedule-phase {
  color: #94a3b8;
  font-size: 0.78rem;
}
.schedule-row-done .schedule-link { color: #94a3b8; }

/* live-pulse keyframes also exist in mobile.css, but desktop.css is the
   only sheet loaded for the desktop shell — redefine here so the
   stylesheets stay independent. */
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

/* Mini bracket — kompaktní fáze list pod live chipem */
.mini-bracket {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0;
}
.mini-bracket-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.mini-bracket-phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mini-bracket-phase {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.6rem;
  align-items: center;
}
.mini-bracket-phase-label {
  font-weight: 700;
  color: #cbd5e1;
  font-size: 0.85rem;
  text-align: right;
  cursor: help;
}
.mini-bracket-races {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.mini-bracket-race {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
}
.mini-race-active {
  background: #38bdf8;
  color: #0f172a;
  border-color: #38bdf8;
  animation: live-pulse 1.5s ease-in-out infinite;
}
.mini-race-done {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}
.mini-race-pending { /* default */ }

/* ─────────────────────────────────────────────────────────────────────
   Wave 2.7.5: connection status badge (desktop — floating top-right)
   Auto-injected by connection_status.js on first kxrs:polling-state event.
   ───────────────────────────────────────────────────────────────────── */

.connection-status {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s, background 0.2s;
}
.connection-status[hidden] { display: none; }
.connection-status .connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
}
.connection-status-stale {
  background: #78350f;
  color: #fed7aa;
  border-color: #b45309;
}
.connection-status-stale .connection-dot {
  background: #fb923c;
  animation: live-pulse 1.5s ease-in-out infinite;
}
.connection-status-offline {
  background: #7f1d1d;
  color: #fee2e2;
  border-color: #991b1b;
}
.connection-status-offline .connection-dot {
  background: #ef4444;
}
.connection-status-recovered {
  background: #14532d;
  color: #d1fae5;
  border-color: #166534;
}
.connection-status-recovered .connection-dot {
  background: #4ade80;
}

/* Wave 2.7.5: tap target floor on desktop interactive elements */
.schedule-now-btn,
.shell-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
