/* === SIMON DEV — Styles dédiés ===
 * Chargé après assets/css/games.css (commun catégorie games)
 * Plateau Simon 3×3 : HTML · CSS · JS · PHP · NodeJS · NestJS · Next.js · Angular · Java
 */

/* ── Plateau Simon (grille 3×3) ──────────────────────────────────────── */
.sd-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    max-width: 480px;
    margin: 1.25rem auto;
    position: relative;
    padding: 4px;
}

/* ── Bouton générique ─────────────────────────────────────────────────── */
.sd-pad {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .92);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .22);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: filter .12s ease, transform .12s ease, box-shadow .12s ease;
}

.sd-pad:disabled {
    cursor: not-allowed;
}

.sd-pad:not(:disabled):hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
}

.sd-pad:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .85);
    outline-offset: 3px;
    z-index: 2;
}

/* ── Couleurs et formes par techno ───────────────────────────────────── */
/* Coins extérieurs arrondis — grille 3×3 */
.sd-pad-html    { background: linear-gradient(145deg, #c0390f 0%, #e44d26 55%, #f16529 100%);   border-radius: 16px 6px 6px 6px; }
.sd-pad-css     { background: linear-gradient(145deg, #1738b8 0%, #264de4 55%, #4a6cf7 100%);   border-radius: 6px; }
.sd-pad-js      { background: linear-gradient(145deg, #c8a100 0%, #f0db4f 55%, #ffe66b 100%);   color: #1a1a1a; border-radius: 6px 16px 6px 6px; }
.sd-pad-php     { background: linear-gradient(145deg, #5b69a5 0%, #8892bf 55%, #a3aed6 100%);   border-radius: 6px; }
.sd-pad-nodejs  { background: linear-gradient(145deg, #235f1e 0%, #3c873a 55%, #4fae4e 100%);   border-radius: 6px; }
.sd-pad-nestjs  { background: linear-gradient(145deg, #930b27 0%, #e0234e 55%, #f5547a 100%);   border-radius: 6px; }
.sd-pad-nextjs  { background: linear-gradient(145deg, #111 0%, #2a2a2a 55%, #444 100%);          border-radius: 6px 6px 6px 16px; }
.sd-pad-angular { background: linear-gradient(145deg, #9b001d 0%, #dd0031 55%, #ff2655 100%);   border-radius: 6px; }
.sd-pad-java    { background: linear-gradient(145deg, #2c5c7d 0%, #4a8ab5 55%, #5fa0cc 100%);   border-radius: 6px 6px 16px 6px; }

/* ── Icône et label dans chaque pad ─────────────────────────────────── */
.sd-pad-icon {
    font-size: 1.9rem;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .25));
    transition: transform .12s ease;
}

.sd-pad-label {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    pointer-events: none;
    opacity: .92;
    line-height: 1;
}

/* ── Flash actif (séquence ordinateur + clic joueur) ─────────────────── */
.sd-pad.is-active {
    filter: brightness(1.7) saturate(1.4) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 30px rgba(255, 255, 255, .4), 0 0 0 5px rgba(255, 255, 255, .2) !important;
    z-index: 3;
}

.sd-pad.is-active .sd-pad-icon {
    transform: scale(1.15);
}

/* ── Pad inactif (mode 4 boutons) ────────────────────────────────────── */
.sd-pad.sd-inactive {
    opacity: .28;
    filter: grayscale(.8);
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Erreur (flash sur tous les pads actifs) ────────────────────────── */
.sd-pad.is-error {
    animation: sd-shake .5s ease;
    filter: brightness(0.5) saturate(0.2) !important;
}

/* ── Cercle central Simon (masqué en 3×3) ────────────────────────────── */
.sd-center { display: none; }

/* ── Rangée d'options (vitesse + mode strict) ───────────────────────── */
.sd-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
}

/* ── Hints clavier ──────────────────────────────────────────────────── */
.sd-kbd-hints {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
    margin-top: .75rem;
}

.sd-kbd-hints kbd {
    font-size: .7rem;
    padding: .15rem .48rem;
    border-radius: 5px;
    background: var(--bg-soft, #f0f0f0);
    border: 1px solid #ccc;
    border-bottom: 2px solid #aaa;
    color: var(--text, #333);
    font-family: inherit;
    white-space: nowrap;
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes sd-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    20%      { transform: translateX(-6px) scale(.97); }
    40%      { transform: translateX(6px) scale(.97); }
    60%      { transform: translateX(-3px) scale(.98); }
    80%      { transform: translateX(3px) scale(.98); }
}

/* ── Dark mode ───────────────────────────────────────────────────────── */
[data-theme="dark"] .sd-center {
    background: #1a1d29;
    border-color: #2f3445;
    color: #e5e7eb;
}

[data-theme="dark"] .sd-kbd-hints kbd {
    background: #232735;
    border-color: #3a3f52;
    color: #d1d5db;
}

/* ── Responsive mobile ───────────────────────────────────────────────── */
@media (max-width: 520px) {
    .sd-board     { max-width: 100%; gap: 5px; }
    .sd-pad-icon  { font-size: 1.5rem; }
    .sd-pad-label { font-size: .63rem; }
}
@media (max-width: 380px) {
    .sd-board     { gap: 4px; }
    .sd-pad-icon  { font-size: 1.2rem; }
    .sd-pad-label { font-size: .55rem; letter-spacing: .01em; }
}
