/* ==========================================================================
   Outils Michoko — composants communs des pages d'outils refaites
   (testeur de clavier, de manette, CPS, réflexes, écran, micro/webcam,
   tirage au sort, adresse IP). À charger après /assets/css/navbar.css,
   qui fournit le ciel, l'en-tête, les cartes (.tool-card) et les champs.
   ========================================================================== */
.container-main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 32px; box-sizing: border-box; }
.container-main *, .container-main *::before, .container-main *::after { box-sizing: border-box; }
.tool-card { padding: 32px; margin: 0 0 24px; }
.container-main [hidden] { display: none !important; }
.o-title { margin: 0 0 16px !important; font-size: 28px !important; line-height: 1.2; color: #F4F6FF; }
.o-sub { margin: -8px 0 20px; color: #C3CDE3; font-size: 15px; line-height: 1.55; }
.o-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.o-row.end { justify-content: flex-end; }
.o-gap { margin-top: 20px; }

/* boutons */
.o-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; border: 0; border-radius: 999px; background: #2559D9; color: #fff !important; font: 600 16px/1 var(--c-sans); text-decoration: none !important; cursor: pointer; transition: transform .2s, box-shadow .25s, background .25s; -webkit-tap-highlight-color: transparent; }
.o-btn.ghost { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18); color: #F4F6FF !important; }
.o-btn:disabled { opacity: .45; cursor: not-allowed; }
.o-btn:not(:disabled):active { transform: scale(.97); }
.o-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (hover: hover) {
    .o-btn:not(:disabled):hover { background: #3A6BEA; box-shadow: 0 12px 30px -8px #2559D9; transform: translateY(-2px); }
    .o-btn.ghost:not(:disabled):hover { background: rgba(255,255,255,.12); box-shadow: none; }
}

/* choix exclusif (durées, modes…) */
.o-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 26px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); }
.o-seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: #C3CDE3; font: 500 15px/1 var(--c-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.o-seg button[aria-pressed="true"] { background: #2559D9; color: #fff; }
@media (hover: hover) { .o-seg button:not([aria-pressed="true"]):hover { background: rgba(255,255,255,.08); color: #fff; } }

/* chiffres clés */
.o-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.o-stat { padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); min-width: 0; }
.o-stat span { display: block; margin-bottom: 6px; font-size: 13px; color: #C3CDE3; }
.o-stat b { display: block; font: 400 32px/1.1 var(--c-serif); color: #F4F6FF; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.o-stat b.small { font: 500 17px/1.35 var(--c-sans); }

/* champs */
.o-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.o-label { margin: 0; font-weight: 500; font-size: 15px; color: #F4F6FF; }
.o-input { width: 100%; min-height: 48px; padding: 10px 16px; font: 400 16px/1.4 var(--c-sans); color: #F4F6FF; }
textarea.o-input { min-height: 160px; resize: vertical; line-height: 1.5; }
select.o-input { padding-right: 36px; }
.o-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: #E8EEFF; cursor: pointer; }
.o-check input { width: 20px; height: 20px; margin: 0; flex: none; }

/* textes */
.o-note { margin: 12px 0 0; color: #8D97AE; font-size: 14px; line-height: 1.55; }
.o-msg { margin: 16px 0 0; padding: 14px 18px; border-radius: 14px; background: rgba(255,159,168,.1); border: 1px solid rgba(255,159,168,.35); color: #FFD5DA; font-size: 15px; line-height: 1.5; }
.o-msg.ok { background: rgba(143,232,208,.08); border-color: rgba(143,232,208,.35); color: #CFF5EA; }
.o-info h2 { margin: 0 0 10px !important; font-size: 26px !important; line-height: 1.2; }
.o-info h2:not(:first-child) { margin-top: 28px !important; }
.o-info p, .o-info li { color: #C3CDE3; font-size: 16px; line-height: 1.65; max-width: 760px; }
.o-info p { margin: 0 0 12px; }
.o-info ul { margin: 0 0 12px; padding-left: 20px; }
.o-info a { color: #8EC5FF; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); border-bottom-width: 2px; background: rgba(255,255,255,.06); font: 500 13px/1.5 var(--c-sans); text-align: center; color: #F4F6FF; }

@media (max-width: 760px) {
    .container-main { padding: 0 16px; }
    .tool-card { padding: 20px; margin-bottom: 16px; }
    .o-title { font-size: 24px !important; }
    .o-stat b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .o-btn, .o-seg button { transition: none; } }
