/* ----------------------------
   Style "inspiré GSK"
----------------------------- */

/* Reset léger */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Typographie */
html,body {
  font-family: Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; color: #333; background: #f5f5f7; line-height: 1.5;
}
h1,h2,h3,h4 { font-family: Georgia, serif; color: #3b3b3d; font-weight: 600; }

/* App container */
.app { max-width: 1200px; margin: 32px auto; padding: 0 16px 32px; }
.app-header { margin-bottom: 24px; }
.app-header h1 { font-size: 2.2rem; }

/* Layout */
.layout { display: grid; grid-template-columns: 2fr 1.2fr; gap: 24px; }
.game-panel, .sidebar {
  background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e3e3e7;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}

/* Hide game area initially */
.game-area.hidden { display: none; }
.current-question h2 { font-size: 1.4rem; margin-bottom: 4px; }
.question-info { font-size: 0.9rem; color: #6b6b6f; margin-bottom: 8px; }
#audioPlayer { width: 100%; margin: 12px 0 16px; border-radius: 8px; }

/* Buttons */
.primary-btn, .secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; border: none; padding: 10px 20px; font-weight: 600; cursor: pointer;
}
.primary-btn { background:#f26722; color:#fff; box-shadow: 0 4px 12px rgba(242,103,34,0.35); }
.primary-btn:hover { background:#d9581c; transform: translateY(-1px); }
.secondary-btn { background:#fff; color:#444; border:1px solid #d0d0d5; }
.secondary-btn:hover { background:#f5f5f7; transform: translateY(-1px); }
.small-btn { padding:6px 14px; font-size:0.85rem; }

/* Navigation */
.navigation { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.navigation-center { display:flex; flex-direction:column; align-items:center; gap:4px; }
#questionCounter { font-size:0.9rem; color:#6b6b6f; }

/* Timer circular */
.timer-container { display:flex; align-items:center; justify-content:center; }
.timer-ring { position:relative; width:40px; height:40px; display:flex; align-items:center; justify-content:center; }
.timer-svg { width:40px; height:40px; transform: rotate(-90deg); }
.timer-bg { fill:none; stroke:#e5e7eb; stroke-width:3; }
.timer-progress { fill:none; stroke:#f26722; stroke-width:3; stroke-linecap:round; stroke-dasharray:113 113; stroke-dashoffset:113; transition: stroke-dashoffset 0.2s linear; }
.timer-label { position:absolute; font-size:0.75rem; color:#555; }

/* Answer panel */
.answer-panel { border-top:1px solid #ececef; padding-top:16px; margin-top:4px; }
.answer-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.answer-row label { min-width:110px; font-size:0.9rem; color:#4b4b4f; }
.answer-row input, .answer-row select {
  flex:1; border-radius:8px; border:1px solid #d0d0d5; padding:8px 10px; background:#fff;
}

/* Sidebar */
.sidebar h2 { font-size:1.2rem; margin-bottom:10px; }
.team-form { display:flex; gap:8px; margin-bottom:10px; }
#teamNameInput { flex:1; border-radius:999px; border:1px solid #d0d0d5; padding:8px 12px; }
.team-list { list-style:none; max-height:190px; overflow-y:auto; padding-right:4px; }
.team-list li { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; margin-bottom:6px; background:#fafafa; border-radius:10px; border:1px solid #e3e3e7; }

/* Team action buttons */
.team-actions { display:flex; gap:6px; }
.team-actions .edit-btn { background:#e3f0ff; color:#174ea6; border-radius:999px; padding:4px 10px; border:none; cursor:pointer; }
.team-actions .delete-btn { background:#ffe5e5; color:#b3261e; border-radius:999px; padding:4px 10px; border:none; cursor:pointer; }

/* History */
.history-table-wrapper { max-height:260px; overflow-y:auto; border-radius:10px; border:1px solid #e3e3e7; background:#fff; }
.history-table { width:100%; border-collapse:collapse; font-size:0.8rem; }
.history-table th, .history-table td { padding:8px 10px; border-bottom:1px solid #f0f0f2; text-align:left; }
.history-table thead { background:#fafafa; position:sticky; top:0; z-index:1; }
.history-table tbody tr:nth-child(even) td { background:#fcfcfd; }

/* Badges */
.badge { display:inline-block; padding:3px 8px; border-radius:999px; font-size:0.7rem; font-weight:700; }
.badge.ok { background:#2e7d32; color:#fff; } .badge.ko { background:#c62828; color:#fff; }

/* History actions (badge + icon) */
.history-actions { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.history-edit-btn { display:flex; align-items:center; justify-content:center; padding:3px; background:transparent; border:none; cursor:pointer; border-radius:4px; }
.history-edit-btn:hover { background:#ececec; }
.history-edit-btn svg { width:16px; height:16px; display:block; color:#555; }

/* Scrollbars (webkit) */
.history-table-wrapper::-webkit-scrollbar, .team-list::-webkit-scrollbar { width:6px; }
.history-table-wrapper::-webkit-scrollbar-thumb, .team-list::-webkit-scrollbar-thumb { background:#d0d0d5; border-radius:999px; }

/* Responsive */
@media (max-width:900px) {
  .layout { grid-template-columns:1fr; }
  .game-panel, .sidebar { padding:16px; }
}
