/* Home: timer and per-game history */

.timer-active {
  background: var(--gradient-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.timer-info {
  flex: 1;
}

.timer-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.timer-game {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.timer-game .score-badge { font-size: 0.78rem; margin-left: 4px; }

.timer-duration {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-teal);
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.btn-stop-timer {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-stop-timer:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

.btn-stop-timer:active {
  transform: translateY(0);
}

.timer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cancel-timer {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-accent);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-timer:hover {
  color: var(--text-primary);
  border-color: #ef4444;
}

.timer-idle {
  background: var(--gradient-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.timer-idle-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }

.timer-idle-sub { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }

.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; margin-right: 6px; animation: pulse 1.4s ease-in-out infinite;
}

.btn-start-timer {
  flex-shrink: 0;
  background: var(--gradient-brand);
  color: #0a0a14;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s ease;
}

.btn-start-timer:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(61, 217, 179, 0.45);
}

.btn-start-timer:active {
  transform: translateY(0);
}

.btn-start-timer:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.history-list { display: flex; flex-direction: column; gap: 10px; }

.history-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.history-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; }

.history-row:hover { background: var(--bg-card-hover); }

.history-thumb {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0; background: var(--bg-surface);
}

.history-thumb-placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

.history-main { flex: 1; min-width: 0; }

.history-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--text-primary);
}
.history-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.history-row:hover .history-title { color: var(--accent-teal); }

.history-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-secondary); margin-top: 3px;
}

.history-meta .dot { color: var(--text-muted); }

.session-pill {
  background: rgba(167, 139, 250, 0.15); color: var(--accent-purple);
  border-radius: 999px; padding: 1px 8px; font-size: 0.75rem; font-weight: 600;
}

.platform-pill {
  background: rgba(61, 217, 179, 0.12); color: var(--accent-teal);
  border-radius: 999px; padding: 1px 8px; font-size: 0.75rem; font-weight: 600;
}

.btn-continue {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: transparent; color: var(--accent-teal);
  border: 1px solid var(--border-accent); border-radius: var(--radius-sm);
  padding: 8px 10px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
  transition: all 0.2s ease;
}

.btn-continue svg { width: 14px; height: 14px; }

.btn-continue:hover:not(:disabled) { background: var(--accent-teal); color: #0a0a14; }

/* complete mark, no box: an empty circle in soft white while the game is open (its tick lights up on hover), a filled
   green circle once it is completed this season. The hit area stays about 36 px even though nothing draws it. */
.btn-complete {
  display: flex; flex-shrink: 0; padding: 6px; background: none; border: none; border-radius: 50%;
  color: var(--check-pending); cursor: pointer; transition: color 0.2s ease;
}
.btn-complete svg { width: 24px; height: 24px; }
.btn-complete .ck-tick { opacity: 0.45; transition: opacity 0.2s ease; }
.btn-complete:hover, .btn-complete:focus-visible { color: var(--text-primary); }
.btn-complete:hover .ck-tick, .btn-complete:focus-visible .ck-tick { opacity: 1; }
.btn-complete.done, .btn-complete.done:hover { color: var(--accent-teal); }

.btn-continue:disabled { opacity: 0.35; cursor: not-allowed; }

.history-group.open { border-color: var(--border-accent); }

.history-chevron { color: var(--text-muted); display: flex; transition: transform 0.2s ease; }

.history-group.open .history-chevron { transform: rotate(180deg); }

.history-sessions {
  list-style: none; margin: 0; padding: 4px 14px 12px 76px;
  border-top: 1px solid var(--border); animation: fadeIn 0.2s ease;
}

.history-sessions li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 7px 0; font-size: 0.85rem; color: var(--text-secondary);
  border-bottom: 1px dashed var(--border);
}

.history-sessions li:last-child { border-bottom: none; }

.history-sessions .session-more { color: var(--text-muted); font-style: italic; justify-content: center; }

.session-duration { color: var(--text-primary); font-weight: 600; }

.history-more { display: flex; justify-content: center; margin-top: 16px; }

.btn-load-more {
  background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 24px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) { border-color: var(--accent-teal); background: var(--bg-card-hover); }

.btn-load-more:disabled { opacity: 0.6; cursor: wait; }

/* Manual sessions: entry point, per-session actions and the form */
.btn-manual {
  background: transparent; color: var(--accent-teal); border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill); padding: 5px 14px; font: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.2s ease;
}
.btn-manual:hover:not(:disabled) { background: var(--bg-card-hover); }
.btn-manual:disabled { opacity: 0.35; cursor: not-allowed; }
.manual-session-row { display: flex; justify-content: center; margin: 4px 0 16px; }
.session-end { display: flex; align-items: center; gap: 10px; }
.btn-session {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: var(--radius-sm); padding: 2px 10px; font: inherit; font-size: 0.75rem; cursor: pointer;
}
.btn-session:hover { border-color: var(--accent-teal); color: var(--text-primary); }

.sess-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; }
.sess-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.sess-input {
  background: var(--bg-base); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font: inherit; font-size: 0.9rem; padding: 9px 12px; min-width: 0;
}
.sess-input:focus { outline: none; border-color: var(--accent-teal); }
.sess-hint { font-size: 0.78rem; color: var(--text-muted); }
.sess-confirm { padding: 10px 12px; border: 1px solid var(--accent-teal); border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; }
.sess-error { min-height: 1.2em; font-size: 0.85rem; color: var(--accent-pink); }
.sess-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sess-spacer { flex: 1; }
.sess-btn {
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-primary);
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer;
}
.sess-btn:hover { border-color: var(--accent-teal); }
.sess-btn.primary { background: var(--gradient-brand); color: #0a0a14; border-color: transparent; }
.sess-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); }

@media (max-width: 640px) {
  .timer-idle, .timer-active { flex-direction: column; align-items: stretch; text-align: center; }
  .btn-start-timer, .btn-stop-timer { justify-content: center; }
  .timer-actions { flex-direction: column-reverse; align-items: stretch; }
  .history-sessions { padding-left: 14px; }
  .navbar-username { display: none; }
}

/* Completion modal (check button of a game of the history) and the rating question that follows it */
.comp-body { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.comp-score { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.comp-score label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-secondary); }
.comp-score .adm-input { width: 90px; }
.comp-list { display: flex; flex-direction: column; gap: 10px; }
.comp-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }

.sessions-head { margin-top: 16px; }
