/* ══════════════════════════════════════════
   MEMORY OCÉAN — Shield Marine
   CSS — tous les sélecteurs préfixés .mo-
   pour éviter les conflits avec le thème WP
══════════════════════════════════════════ */

#memory-ocean-app {
    --mo-blue:      #0b84b8;
    --mo-dark-blue: #0F6C99;
    --mo-red:       #CC1B27;
    --mo-cream:     #f8f5ef;
    --mo-deep:      #0a2a3a;
    --mo-cw:        125px;
    --mo-ch:        165px;
    --mo-gap:       12px;

    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* ── Ocean background ── */
.mo-ocean-bg {
    position: fixed; inset: 0; z-index: 0;
    background: linear-gradient(180deg, #071520 0%, #0a2a3c 45%, #0b4a70 100%);
    pointer-events: none;
}
.mo-shimmer {
    position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
    background: linear-gradient(to top, rgba(11,132,184,.12), transparent);
    animation: mo-shimmer 6s ease-in-out infinite alternate;
}
@keyframes mo-shimmer { from { opacity: .5; } to { opacity: 1; } }

.mo-bubble {
    position: fixed; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.07);
    animation: mo-rise linear infinite;
    pointer-events: none; z-index: 1;
}
@keyframes mo-rise {
    0%   { transform: translateY(110vh) scale(.3); opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: .5; }
    100% { transform: translateY(-40px) scale(1); opacity: 0; }
}

/* ── Game view ── */
#mo-view-game {
    position: relative; z-index: 10;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; padding: 0 16px 60px;
}

.mo-header { width: 100%; text-align: center; padding: 24px 0 16px; }
.mo-brand {
    display: inline-flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 60px; padding: 8px 20px 8px 8px;
    backdrop-filter: blur(8px);
}
.mo-brand img { height: 36px; width: auto; }
.mo-brand-text h1 {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem; color: var(--mo-cream);
    line-height: 1.1; text-align: left; margin: 0;
}
.mo-brand-text h1 em { color: var(--mo-blue); font-style: italic; }
.mo-brand-text p {
    font-size: .65rem; color: rgba(248,245,239,.4);
    text-transform: uppercase; letter-spacing: 1.5px; margin: 0;
}

.mo-ribbon {
    margin-bottom: 14px;
    background: rgba(11,132,184,.1);
    border: 1px solid rgba(11,132,184,.25);
    border-radius: 30px; padding: 5px 18px;
    display: flex; align-items: center; gap: 8px;
}
.mo-ribbon-name {
    font-family: 'Fraunces', serif; font-style: italic;
    font-size: .88rem; color: var(--mo-cream);
}
.mo-ribbon-count { font-size: .62rem; color: rgba(248,245,239,.38); }

.mo-stats-bar {
    display: flex;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50px; overflow: hidden;
    backdrop-filter: blur(10px); margin-bottom: 20px;
}
.mo-stat { display: flex; flex-direction: column; align-items: center; padding: 9px 20px; }
.mo-stat + .mo-stat { border-left: 1px solid rgba(255,255,255,.08); }
.mo-stat-val {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem; color: var(--mo-cream); line-height: 1;
}
.mo-stat-lbl {
    font-size: .62rem; color: rgba(248,245,239,.38);
    text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}

/* ── Cards ── */
.mo-grid {
    display: grid;
    grid-template-columns: repeat(4, var(--mo-cw));
    gap: var(--mo-gap);
}

.mo-card {
    width: var(--mo-cw); height: var(--mo-ch);
    cursor: pointer; position: relative;
}
.mo-card .mo-face {
    position: absolute; inset: 0; border-radius: 13px;
    overflow: hidden; display: flex; flex-direction: column;
    align-items: center;
    transition: opacity .35s ease, transform .35s ease;
}
.mo-card .mo-back  { opacity: 1; transform: scale(1);   z-index: 2; }
.mo-card .mo-front { opacity: 0; transform: scale(.92); z-index: 1; }
.mo-card.mo-flipped .mo-back,
.mo-card.mo-matched .mo-back  { opacity: 0; transform: scale(.92); z-index: 1; }
.mo-card.mo-flipped .mo-front,
.mo-card.mo-matched .mo-front { opacity: 1; transform: scale(1);   z-index: 2; }

.mo-back {
    background: linear-gradient(160deg, #0a3a5c, #071a2e);
    border: 1.5px solid rgba(11,132,184,.35);
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    justify-content: center; gap: 10px;
}
.mo-back::before {
    content: ''; position: absolute; inset: 7px;
    border: 1px solid rgba(11,132,184,.2); border-radius: 8px;
}
.mo-back-logo { width: 70%; max-width: 90px; opacity: .9; }
.mo-back-wave { font-size: .85rem; opacity: .3; letter-spacing: 3px; }

.mo-front { box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.mo-front.species { background: linear-gradient(160deg,#e4f4fc,#c6e8f8); border: 1.8px solid var(--mo-blue); }
.mo-front.threat  { background: linear-gradient(160deg,#fce4e6,#f8c4c8); border: 1.8px solid var(--mo-red); }

.mo-front-band {
    width: 100%; padding: 7px 6px 6px;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.mo-front.species .mo-front-band { background: var(--mo-blue); }
.mo-front.threat  .mo-front-band { background: var(--mo-red); }

.mo-front-type { font-size: .46rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.9); }
.mo-front-num  { background: rgba(255,255,255,.25); border-radius: 20px; padding: 1px 6px; font-size: .48rem; font-weight: 700; color: #fff; }
.mo-front-emoji { font-size: 2.9rem; line-height: 1; flex-shrink: 0; margin: 8px 0 4px; }
.mo-front-title { font-family: 'Fraunces', serif; font-size: .73rem; font-weight: 700; text-align: center; color: var(--mo-deep); line-height: 1.2; padding: 0 7px; }
.mo-front-sub   { font-size: .56rem; text-align: center; line-height: 1.3; padding: 0 7px; font-style: italic; flex-shrink: 0; }
.mo-front.species .mo-front-sub { color: rgba(10,42,58,.5); }
.mo-front.threat  .mo-front-sub { color: rgba(80,10,15,.5); }
.mo-front-fact  { margin: auto 6px 6px; background: rgba(255,255,255,.55); border-radius: 6px; padding: 5px 7px; font-size: .54rem; text-align: center; color: var(--mo-deep); line-height: 1.4; width: calc(100% - 12px); }

.mo-card.mo-matched { cursor: default; opacity: .65; }
.mo-card.mo-matched .mo-front { animation: mo-pop .45s ease-out; }
@keyframes mo-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Info panel */
.mo-info-panel {
    margin-top: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; padding: 13px 18px;
    width: 100%; max-width: 556px;
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap; justify-content: center;
}
.mo-info-panel p { font-size: .76rem; color: rgba(248,245,239,.5); text-align: center; flex: 1; min-width: 180px; }
.mo-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.mo-leg { display: flex; align-items: center; gap: 6px; }
.mo-leg-dot { width: 9px; height: 9px; border-radius: 50%; }
.mo-leg-dot.mo-species { background: var(--mo-blue); }
.mo-leg-dot.mo-threat  { background: var(--mo-red); }
.mo-leg-lbl { font-size: .7rem; color: rgba(248,245,239,.55); }

/* Prof button */
.mo-btn-prof {
    margin-top: 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    color: var(--mo-cream); border-radius: 50px;
    padding: 10px 24px; font-size: .82rem; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: all .2s; font-family: inherit;
}
.mo-btn-prof:hover { background: rgba(255,255,255,.13); }

/* Victory */
.mo-overlay {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(7,21,32,.92); backdrop-filter: blur(12px);
    align-items: center; justify-content: center; flex-direction: column;
}
.mo-overlay.mo-show { display: flex; animation: mo-fadeIn .5s ease; }
@keyframes mo-fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mo-vbox {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
    border-radius: 24px; padding: 40px 48px; text-align: center; max-width: 400px;
}
.mo-vbox .mo-big { font-size: 3.5rem; margin-bottom: 10px; }
.mo-vbox h2 { font-family: 'Fraunces', serif; font-size: 2rem; color: var(--mo-cream); margin-bottom: 6px; }
.mo-vbox p  { color: rgba(248,245,239,.6); font-size: .88rem; margin-bottom: 4px; }
.mo-vscore  { font-family: 'Fraunces', serif; font-size: .95rem; color: var(--mo-blue); margin: 14px 0 18px; }
.mo-btn-group { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.mo-btn {
    background: var(--mo-blue); color: #fff; border: none;
    padding: 12px 26px; border-radius: 50px; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: all .2s; font-family: inherit;
}
.mo-btn:hover { background: var(--mo-dark-blue); transform: translateY(-2px); }
.mo-btn.mo-sec { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); }
.mo-btn.mo-sec:hover { background: rgba(255,255,255,.14); transform: none; }
.mo-vcta { margin-top: 14px; font-size: .7rem; color: rgba(248,245,239,.3); }
.mo-vcta span { color: var(--mo-blue); }

/* ══ TEACHER VIEW ══ */
#mo-view-teacher {
    display: none; background: var(--mo-cream); min-height: 100vh; padding: 0 0 60px;
    position: relative; z-index: 10;
}

.mo-teacher-header {
    background: var(--mo-deep); padding: 24px 40px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.mo-teacher-header-left { display: flex; align-items: center; gap: 16px; }
.mo-teacher-header img { height: 44px; width: auto; }
.mo-teacher-header h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; color: var(--mo-cream); margin: 0; }
.mo-teacher-header p  { font-size: .75rem; color: rgba(248,245,239,.5); margin: 2px 0 0; }

.mo-btn-back {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: var(--mo-cream); border-radius: 50px; padding: 9px 20px;
    font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s; font-family: inherit;
}
.mo-btn-back:hover { background: rgba(255,255,255,.18); }

.mo-teacher-intro {
    max-width: 860px; margin: 32px auto 0; padding: 0 32px 32px;
    border-bottom: 1px solid #ddd;
}
.mo-teacher-intro h3 { font-family: 'Fraunces', serif; font-size: 1.1rem; color: var(--mo-deep); margin-bottom: 8px; }
.mo-teacher-intro > p { font-size: .85rem; color: #444; line-height: 1.7; }
.mo-blue { color: var(--mo-blue); font-weight: 600; }
.mo-red  { color: var(--mo-red);  font-weight: 600; }

.mo-pairs-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mo-answer-pill {
    background: var(--mo-deep); color: var(--mo-cream); border-radius: 30px;
    padding: 5px 14px; font-size: .72rem; display: flex; align-items: center; gap: 6px;
}
.mo-answer-pill .mo-arrow { color: rgba(248,245,239,.4); }

.mo-fiches { max-width: 860px; margin: 0 auto; padding: 24px 32px; display: flex; flex-direction: column; gap: 32px; }

.mo-pair-block { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 2px solid #e0ddd8; }
.mo-pair-label { font-family: 'Fraunces', serif; font-size: 1rem; color: var(--mo-deep); }
.mo-pair-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.mo-fiche {
    background: #fff; border-radius: 14px; border: 1px solid #e0ddd8;
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.mo-fiche-header { display: flex; align-items: flex-start; gap: 12px; }
.mo-fiche-emoji  { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.mo-fiche-badge  {
    font-size: .55rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    padding: 2px 9px; border-radius: 20px; display: inline-block; margin-bottom: 5px;
}
.mo-fiche-badge.species { background: #ddf0fa; color: var(--mo-dark-blue); }
.mo-fiche-badge.threat  { background: #fde8ea; color: var(--mo-red); }
.mo-fiche-title { font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 700; color: var(--mo-deep); line-height: 1.2; margin: 0; }
.mo-fiche-sci   { font-size: .72rem; font-style: italic; color: #777; margin-top: 2px; }
.mo-fiche hr    { border: none; border-top: 1px solid #eee; }
.mo-fiche-body  { font-size: .8rem; color: #333; line-height: 1.75; }

.mo-pair-connector {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fff7f0; border: 1px solid #f0c8a0; border-radius: 10px; padding: 10px 14px;
    grid-column: 1 / -1;
}
.mo-pair-connector p { font-size: .75rem; color: #6b3a1a; line-height: 1.5; margin: 0; }

.mo-print-bar { text-align: center; padding: 20px; }
.mo-btn-print {
    background: var(--mo-blue); color: #fff; border: none;
    padding: 12px 28px; border-radius: 50px; font-size: .9rem; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all .2s;
}
.mo-btn-print:hover { background: var(--mo-dark-blue); }

/* ── Print ── */
@media print {
    #mo-view-game, .mo-ocean-bg, .mo-btn-back, .mo-print-bar { display: none !important; }
    #mo-view-teacher { display: block !important; background: white; }
    .mo-teacher-header { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .mo-fiche { break-inside: avoid; }
    .mo-pair-block { break-inside: avoid; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    #memory-ocean-app { --mo-cw: 82px; --mo-ch: 112px; --mo-gap: 7px; }
    .mo-front-emoji { font-size: 2rem; margin: 5px 0 3px; }
    .mo-front-title { font-size: .6rem; }
    .mo-front-fact  { font-size: .5rem; }
    .mo-pair-cards  { grid-template-columns: 1fr; }
    .mo-teacher-header { padding: 16px 20px; }
    .mo-teacher-intro, .mo-fiches { padding: 16px 20px; }
    .mo-stat { padding: 9px 14px; }
}

/* ══ NAV SHIELD MARINE (identique site) ══ */
.nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 48px;
  background: rgba(248,245,239,0.97);
  border-bottom: 1px solid rgba(11,132,184,0.12);
  backdrop-filter: blur(10px);
}
.nav-logo img { height: 24px; width: auto; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { font-size: 15px; font-weight: 400; color: #3d6070; transition: color .2s; text-decoration: none; }
.nav-links a:hover { color: #0b84b8; }
.nav-links .signal-red  { color: #CC1B27; font-weight: 600; }
.nav-links .signal-blue { color: #0F6C99; font-weight: 600; }

/* Dropdown outils pédagogiques */
.nav-has-sub { position: relative; }
.nav-sub {
  display: none; position: absolute; top: calc(100% + 10px); left: 0;
  background: #fff; border: 1px solid rgba(11,132,184,.15);
  border-radius: 10px; padding: 8px 0; min-width: 210px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); list-style: none; z-index: 300;
}
.nav-has-sub:hover .nav-sub { display: block; }
.nav-sub li a { display: block; padding: 9px 16px; font-size: 14px; color: #3d6070; white-space: nowrap; }
.nav-sub li a:hover { background: #f0f8fd; color: #0b84b8; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0b84b8; color: #fff !important;
  padding: 10px 22px; border-radius: 100px;
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background .2s;
}
.nav-cta:hover { background: #086a96; }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 6px;
}
.nav-hamburger span { display: block; width: 24px; height: 2px; background: #0d2b3e; border-radius: 2px; }
.nav-mobile {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: #f8f5ef; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
  font-family: 'Fraunces', serif;
}
.nav-mobile.open { display: flex; }
.nav-mobile a { font-size: 22px; font-weight: 600; color: #0d2b3e; text-decoration: none; }
.nav-mobile a:hover { color: #0b84b8; }
.nav-mobile-close { position: absolute; top: 20px; right: 24px; background: none; border: none; font-size: 28px; cursor: pointer; color: #0d2b3e; }

@media (max-width: 800px) {
  .nav { padding: 14px 20px; }
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
}

/* ══ CORRECTION CARTES : texte fait + hauteur ══ */
#memory-ocean-app {
  --mo-ch: 178px;   /* légèrement plus haut qu'avant (165px) */
}
/* Fait réduit pour ne pas déborder */
.mo-front-fact {
  font-size: .5rem !important;
  line-height: 1.35 !important;
  padding: 4px 6px !important;
}
/* Titre légèrement plus petit sur petites cartes */
.mo-front-title { font-size: .7rem !important; }
/* Sous-titre */
.mo-front-sub { font-size: .54rem !important; }

/* Bouton prof — maintenant c'est un lien vers page dédiée */
.mo-btn-prof {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--mo-cream) !important;
  border-radius: 50px; padding: 10px 24px;
  font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: all .2s;
}
.mo-btn-prof:hover { background: rgba(255,255,255,.13); color: var(--mo-cream) !important; }

/* ── COMPTEUR ── */
.mo-counter-bar {
    display: flex; align-items: center; gap: 10px;
    background: rgba(11,132,184,.12);
    border: 1px solid rgba(11,132,184,.25);
    border-radius: 50px; padding: 8px 20px;
    margin-bottom: 14px;
    font-size: .82rem; color: rgba(248,245,239,.8);
}
.mo-counter-wave { font-size: 1.1rem; }
.mo-counter-bar strong {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem; color: var(--mo-blue);
    margin-right: 4px;
}

/* Compteur dans l'écran de victoire */
.mo-victory-counter {
    background: rgba(11,132,184,.15);
    border: 1px solid rgba(11,132,184,.25);
    border-radius: 10px; padding: 10px 16px;
    font-size: .8rem; color: rgba(248,245,239,.7);
    margin: 0 0 16px; line-height: 1.5;
}
.mo-victory-counter strong {
    font-family: 'Fraunces', serif;
    font-size: 1rem; color: var(--mo-blue);
}

/* ══ COMPTEUR ══ */
.mo-counter-bar {
    display: flex; align-items: center; gap: 10px;
    background: rgba(11,132,184,.12);
    border: 1px solid rgba(11,132,184,.25);
    border-radius: 50px; padding: 8px 20px;
    margin-bottom: 14px;
}
.mo-counter-wave { font-size: 1.1rem; }
.mo-counter-text { font-size: .82rem; color: rgba(248,245,239,.75); }
.mo-counter-text strong {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem; color: var(--mo-blue);
    margin-right: 4px;
}
.mo-victory-counter {
    font-size: .82rem; color: rgba(248,245,239,.6);
    margin: 8px 0 16px; padding: 10px 16px;
    background: rgba(11,132,184,.12);
    border-radius: 30px;
}
.mo-victory-counter strong { color: var(--mo-blue); font-family: 'Fraunces', serif; }
