← Mike Higgins Home
Custom Code Experiment •

French: Le Verlan

Source Code View HTML / CSS / JavaScript
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Le Verlan Parisien — Flashcard Game</title>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
<style>
  :root {
    --cream: #f5f0e8;
    --dark: #000000;
    --gold: #c9a84c;
    --gold-light: #e8d49a;
    --red: #e05545;
    --blue: #5b9fd4;
    --green: #3dba72;
    --purple: #a678e0;
    --card-shadow: 0 20px 60px rgba(0,0,0,0.5);
    --text-primary: #f0ece4;
    --text-muted: rgba(240,236,228,0.5);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    background: #000000;
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 60% 40% at 10% 20%, rgba(166,120,224,0.07) 0%, transparent 70%),
      radial-gradient(ellipse 50% 60% at 90% 80%, rgba(91,159,212,0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
  }

  header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px 20px;
    width: 100%;
  }

  header .label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
  }

  header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--text-primary);
    line-height: 1.1;
  }

  header h1 em {
    font-style: italic;
    color: var(--purple);
  }

  header .divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 16px auto 0;
  }

  .progress-wrap {
    position: relative;
    z-index: 1;
    width: min(500px, 90vw);
    margin: 24px auto 0;
  }

  .progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }

  .progress-info span {
    font-size: 12px;
    color: var(--text-primary);
    opacity: 0.6;
    letter-spacing: 1px;
  }

  .progress-info .score {
    font-weight: 500;
    opacity: 1;
    color: var(--purple);
  }

  .progress-bar-bg {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
  }

  .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--purple));
    border-radius: 2px;
    transition: width 0.4s ease;
  }

  .mode-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    margin: 28px auto 0;
    background: rgba(255,255,255,0.07);
    border-radius: 40px;
    padding: 5px;
    width: fit-content;
  }

  .mode-tab {
    padding: 8px 22px;
    border: none;
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--text-primary);
    opacity: 0.5;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.25s;
  }

  .mode-tab.active {
    background: var(--gold);
    color: #000;
    opacity: 1;
  }

  .card-stage {
    position: relative;
    z-index: 1;
    width: min(580px, 92vw);
    margin: 36px auto 0;
    perspective: 1200px;
  }

  .card-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
  }

  .card-wrapper.flipped {
    transform: rotateY(180deg);
  }

  .card-face {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-shadow: var(--card-shadow);
  }

  .card-front {
    background: #111111;
    color: var(--cream);
    border: 1px solid rgba(166,120,224,0.3);
  }

  .card-front::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--purple));
    border-radius: 20px 20px 0 0;
  }

  .card-back {
    background: #1a1a1a;
    color: var(--text-primary);
    transform: rotateY(180deg);
    border: 1px solid rgba(166,120,224,0.3);
  }

  .card-tag {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0.4;
  }

  .card-front .card-tag { color: var(--gold-light); }

  .card-main-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    text-align: center;
    line-height: 1.25;
    letter-spacing: 0.02em;
  }

  .card-front .card-main-text {
    color: var(--purple);
  }

  .card-back .card-main-text {
    color: var(--blue);
  }

  .card-sub-text {
    font-size: 13px;
    margin-top: 14px;
    opacity: 0.5;
    text-align: center;
    font-style: italic;
  }

  .card-front .card-sub-text { color: var(--gold-light); }

  .card-flip-hint {
    position: absolute;
    bottom: 18px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.3;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .translation-big {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 3.5vw, 1.7rem);
    color: var(--blue);
    text-align: center;
    line-height: 1.35;
    margin-bottom: 8px;
  }

  .origin-line {
    font-size: 13px;
    color: var(--gold-light);
    opacity: 0.7;
    text-align: center;
    margin-top: 6px;
  }

  .origin-line strong {
    color: var(--gold);
    font-weight: 500;
    opacity: 1;
  }

  .example-label {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
  }


  .controls {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    margin: 28px auto 0;
    width: min(580px, 92vw);
    justify-content: center;
    flex-wrap: wrap;
  }

  .btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    padding: 14px 28px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-wrong {
    background: rgba(192,57,43,0.1);
    color: var(--red);
    border: 1.5px solid rgba(192,57,43,0.25);
  }
  .btn-wrong:hover { background: rgba(192,57,43,0.18); transform: translateY(-2px); }

  .btn-correct {
    background: rgba(42,122,75,0.1);
    color: var(--green);
    border: 1.5px solid rgba(42,122,75,0.25);
  }
  .btn-correct:hover { background: rgba(42,122,75,0.18); transform: translateY(-2px); }

  .btn-flip {
    background: var(--gold);
    color: #000;
    flex: 1;
    max-width: 200px;
    justify-content: center;
    font-weight: 500;
  }
  .btn-flip:hover { background: #d4b05a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,0.3); }

  .btn-shuffle {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid rgba(255,255,255,0.15);
    opacity: 0.7;
  }
  .btn-shuffle:hover { opacity: 1; transform: translateY(-2px); }

  .answer-controls {
    display: none;
    gap: 14px;
    width: 100%;
    justify-content: center;
  }
  .answer-controls.visible { display: flex; }

  .flip-control {
    display: flex;
    gap: 14px;
    width: 100%;
    justify-content: center;
  }

  .quiz-area {
    position: relative;
    z-index: 1;
    width: min(580px, 92vw);
    margin: 30px auto 0;
    display: none;
  }

  .quiz-area.active { display: block; }

  .quiz-question-card {
    background: #111111;
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(166,120,224,0.2);
    box-shadow: var(--card-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .quiz-question-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--purple));
  }

  .quiz-q-label {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
    opacity: 0.7;
  }

  .quiz-q-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: var(--purple);
    line-height: 1.25;
  }

  .quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
  }

  .quiz-option {
    background: #111111;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 18px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.3;
  }

  .quiz-option:hover:not(:disabled) {
    border-color: var(--purple);
    background: rgba(166,120,224,0.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }

  .quiz-option.correct {
    background: rgba(42,122,75,0.1);
    border-color: var(--green);
    color: var(--green);
  }

  .quiz-option.wrong {
    background: rgba(192,57,43,0.08);
    border-color: var(--red);
    color: var(--red);
  }

  .quiz-option:disabled { cursor: default; }

  .quiz-feedback {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    min-height: 24px;
    font-weight: 500;
  }

  .quiz-feedback.correct { color: var(--green); }
  .quiz-feedback.wrong { color: var(--red); }

  .btn-next {
    background: var(--gold);
    color: #000;
    font-weight: 500;
    margin: 20px auto 0;
    display: none;
  }
  .btn-next.visible { display: flex; margin: 20px auto 0; }
  .btn-next:hover { background: #d4b05a; transform: translateY(-2px); }

  .stats-row {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 24px;
    margin: 24px auto 0;
    width: min(580px, 92vw);
    justify-content: center;
    flex-wrap: wrap;
  }

  .stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111111;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  }

  .stat-dot { width: 8px; height: 8px; border-radius: 50%; }
  .dot-correct { background: var(--green); }
  .dot-wrong { background: var(--red); }
  .dot-remaining { background: var(--gold); }

  .completion {
    position: relative;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
  }

  .completion.visible { display: flex; }

  .completion-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease;
  }

  @keyframes bounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
  }

  .completion h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    color: var(--text-primary);
    margin-bottom: 10px;
  }

  .completion p {
    font-size: 15px;
    color: var(--text-primary);
    opacity: 0.6;
    margin-bottom: 30px;
  }

  .completion-score {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: var(--purple);
    font-weight: 700;
    margin-bottom: 8px;
  }

  .btn-restart {
    background: var(--gold);
    color: #000;
    font-weight: 500;
    margin-top: 10px;
  }
  .btn-restart:hover { background: #d4b05a; transform: translateY(-2px); }

  footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dark);
    opacity: 0.25;
  }

  @keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .card-stage, .quiz-area, .controls, .stats-row, .progress-wrap {
    animation: slideUp 0.5s ease forwards;
  }

  .card-nav {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
  }

  .nav-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.15);
    background: #111111;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  }

  .nav-btn:hover { border-color: var(--purple); transform: scale(1.1); }

  .card-counter {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
  }

  .card-counter span { color: var(--gold); }

  @media (max-width: 480px) {
    .quiz-options { grid-template-columns: 1fr; }
    .controls { gap: 10px; }
    .btn { padding: 12px 20px; font-size: 12px; }
  }

  .info-btn {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1.5px solid rgba(166,120,224,0.35);
    border-radius: 50px;
    color: var(--purple);
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 9px 20px;
    cursor: pointer;
    transition: all 0.25s;
  }
  .info-btn:hover {
    background: rgba(166,120,224,0.1);
    border-color: var(--purple);
    transform: translateY(-1px);
  }
  .info-icon {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--purple);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }

  .modal {
    background: #0e0e0e;
    border: 1px solid rgba(166,120,224,0.2);
    border-radius: 24px;
    width: min(640px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(166,120,224,0.08);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(166,120,224,0.2) transparent;
  }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }
  .modal::-webkit-scrollbar { width: 4px; }
  .modal::-webkit-scrollbar-track { background: transparent; }
  .modal::-webkit-scrollbar-thumb { background: rgba(166,120,224,0.2); border-radius: 2px; }

  .modal-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px 16px 0 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
  }
  .modal-close:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }

  .modal-header {
    padding: 36px 40px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    clear: both;
  }
  .modal-eyebrow {
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
  }
  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 6px;
  }
  .modal-title em { color: var(--purple); font-style: italic; }
  .modal-subtitle {
    font-size: 13px;
    color: var(--text-primary);
    opacity: 0.4;
    letter-spacing: 1px;
  }

  .modal-body {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .modal-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }
  .modal-section p {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.8;
    line-height: 1.7;
    margin-bottom: 10px;
  }
  .modal-section p:last-child { margin-bottom: 0; }
  .modal-section strong { color: var(--text-primary); opacity: 1; font-weight: 500; }
  .modal-section em { color: var(--gold-light); font-style: italic; }

  .example-table {
    margin-top: 14px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
  }
  .et-header, .et-row {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1.5fr;
    padding: 10px 16px;
    font-size: 13px;
    gap: 8px;
    align-items: center;
  }
  .et-header {
    background: rgba(166,120,224,0.1);
    color: var(--purple);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
  }
  .et-row {
    color: var(--text-primary);
    opacity: 0.85;
    border-top: 1px solid rgba(255,255,255,0.04);
  }
  .et-row:nth-child(even) { background: rgba(255,255,255,0.02); }
  .verlan-word { color: var(--purple); font-style: italic; font-family: 'Playfair Display', serif; }
  .standard-word { color: var(--blue); font-style: italic; font-family: 'Playfair Display', serif; }

  .type-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
  }
  .type-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 16px 20px;
  }
  .type-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
  }
  .type-card p {
    font-size: 13px;
    margin-bottom: 8px !important;
    opacity: 0.6;
  }
  .type-example {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: var(--text-primary);
  }
  .type-example em { color: var(--purple); font-style: italic; }
  .type-example span {
    font-size: 12px;
    opacity: 0.5;
    font-family: 'DM Sans', sans-serif;
    margin-left: 6px;
  }

  .tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }
  .tips-list li {
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.8;
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
  }
  .tips-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--purple);
    font-size: 18px;
    line-height: 1.3;
  }
  .tips-list li strong { color: var(--gold-light); font-weight: 500; }
  .tips-list li em { color: var(--blue); font-style: italic; }

  .modal-footer { padding: 0 40px 32px; }

  @media (max-width: 500px) {
    .modal-header, .modal-body, .modal-footer { padding-left: 24px; padding-right: 24px; }
    .et-header, .et-row { font-size: 11px; padding: 9px 12px; }
  }
</style>
</head>
<body>

<header>
  <div class="label">Argot Parisien</div>
  <h1>Le <em>Verlan</em></h1>
  <div class="divider"></div>
  <button class="info-btn" onclick="openModal()" aria-label="Guide to Verlan">
    <span class="info-icon">?</span> What is Verlan?
  </button>
</header>

<!-- INFO MODAL -->
<div class="modal-overlay" id="modalOverlay" onclick="closeModalOutside(event)">
  <div class="modal" id="modal" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
    <button class="modal-close" onclick="closeModal()" aria-label="Close">✕</button>

    <div class="modal-header">
      <div class="modal-eyebrow">Language Guide</div>
      <h2 class="modal-title" id="modalTitle">Le <em>Verlan</em></h2>
      <p class="modal-subtitle">Parisian Back-Slang Explained</p>
    </div>

    <div class="modal-body">

      <div class="modal-section">
        <h3>What is Verlan?</h3>
        <p><strong>Verlan</strong> (itself the inversion of <em>l'envers</em> — "the reverse") is a form of French back-slang that emerged from the Parisian banlieues in the 1970s–80s. Words are created by inverting the syllables of standard French words.</p>
        <p>Originally a secret coded language among marginalised youth, Verlan crossed over into mainstream French culture through hip-hop, cinema, and everyday speech. Today many Verlan words appear in the French dictionary.</p>
        <div class="example-table">
          <div class="et-header"><span>Verlan</span><span>Standard French</span><span>English</span></div>
          <div class="et-row"><span class="verlan-word">l'envers</span><span class="standard-word">→ verlan</span><span>the reverse (meta!)</span></div>
          <div class="et-row"><span class="verlan-word">laisse béton</span><span class="standard-word">laisse tomber</span><span>forget it / drop it</span></div>
          <div class="et-row"><span class="verlan-word">meuf</span><span class="standard-word">femme</span><span>woman / girl</span></div>
          <div class="et-row"><span class="verlan-word">keum</span><span class="standard-word">mec</span><span>guy / bloke</span></div>
          <div class="et-row"><span class="verlan-word">ouf</span><span class="standard-word">fou</span><span>crazy / intense</span></div>
        </div>
      </div>

      <div class="modal-section">
        <h3>How is it formed?</h3>
        <div class="type-cards">
          <div class="type-card">
            <div class="type-label">① Simple syllable swap</div>
            <p>Two-syllable words are reversed directly.</p>
            <div class="type-example"><em>ver-lan</em> ← <em>l'en-vers</em><span>— the reverse</span></div>
          </div>
          <div class="type-card">
            <div class="type-label">② Phonetic reshaping</div>
            <p>The result is often tweaked for natural pronunciation — silent letters are dropped or vowels adjusted.</p>
            <div class="type-example"><em>meuf</em> ← <em>femme</em><span>— woman (fem → meuf, with phonetic shift)</span></div>
          </div>
          <div class="type-card">
            <div class="type-label">③ Double Verlan</div>
            <p>Some words were Verlan'd a second time when the first form became too mainstream.</p>
            <div class="type-example"><em>reubeu</em> ← <em>beur</em> ← <em>arabe</em><span>— Arab / North African</span></div>
          </div>
        </div>
      </div>

      <div class="modal-section">
        <h3>Tips for learners</h3>
        <ul class="tips-list">
          <li>Verlan is <strong>informal speech</strong> — never use it in formal contexts, professional settings, or written French exams.</li>
          <li>Many Verlan words have entered <strong>standard spoken French</strong> — <em>meuf</em>, <em>ouf</em>, <em>zarbi</em> are widely understood by all age groups today.</li>
          <li>Context is everything: the same word can shift in register depending on the speaker and neighbourhood.</li>
          <li>The flashcard shows the <strong>Verlan phrase in use</strong> — flip to see the standard French equivalent and the English meaning.</li>
          <li>Pay attention to the <strong>register badges</strong>: Classic = widely known, Street = banlieue slang, Youth = younger generations, Common = everyday French now.</li>
        </ul>
      </div>

    </div>

    <div class="modal-footer">
      <button class="btn btn-flip" onclick="closeModal()" style="max-width:100%;width:100%;justify-content:center;">C'est bon — let's learn!</button>
    </div>
  </div>
</div>

<div class="progress-wrap">
  <div class="progress-info">
    <span id="progressText">Card 1 of 50</span>
    <span class="score" id="scoreText">✓ 0 &nbsp; ✗ 0</span>
  </div>
  <div class="progress-bar-bg">
    <div class="progress-bar-fill" id="progressFill" style="width:2%"></div>
  </div>
</div>

<div class="mode-tabs">
  <button class="mode-tab active" onclick="setMode('flashcard')">Flashcards</button>
  <button class="mode-tab" onclick="setMode('quiz')">Quiz</button>
</div>

<div class="stats-row">
  <div class="stat-pill"><div class="stat-dot dot-correct"></div><span id="correctCount">0 correct</span></div>
  <div class="stat-pill"><div class="stat-dot dot-wrong"></div><span id="wrongCount">0 incorrect</span></div>
  <div class="stat-pill"><div class="stat-dot dot-remaining"></div><span id="remainingCount">50 left</span></div>
</div>

<!-- FLASHCARD MODE -->
<div class="card-stage" id="flashcardMode">
  <div class="card-wrapper" id="cardWrapper" onclick="flipCard()">
    <div class="card-face card-front">
      <div class="card-tag">Verlan — Tap to reveal</div>
      <div class="card-main-text" id="verlanText"></div>
      <div class="card-sub-text" id="contextHint"></div>
      <div class="card-flip-hint">↺ &nbsp; flip</div>
    </div>
    <div class="card-face card-back">
      <div class="card-tag">Standard French → English</div>
      <div class="card-main-text" id="englishText"></div>
      <div class="card-sub-text" id="originText"></div>
    </div>
  </div>
</div>

<div class="card-nav" id="cardNav">
  <button class="nav-btn" onclick="prevCard()">←</button>
  <div class="card-counter"><span id="cardNum">1</span> / 50</div>
  <button class="nav-btn" onclick="nextCard()">→</button>
</div>

<div class="controls" id="flashControls">
  <div class="flip-control" id="flipControl">
    <button class="btn btn-flip" onclick="flipCard()">Flip Card</button>
    <button class="btn btn-shuffle" onclick="shuffleCards()">⇌ Shuffle</button>
  </div>
  <div class="answer-controls" id="answerControls">
    <button class="btn btn-wrong" onclick="markAnswer(false)">✗ &nbsp;Didn't know</button>
    <button class="btn btn-correct" onclick="markAnswer(true)">✓ &nbsp;Got it!</button>
  </div>
</div>

<!-- QUIZ MODE -->
<div class="quiz-area" id="quizMode">
  <div class="quiz-question-card">
    <div class="quiz-q-label">What does this Verlan phrase mean?</div>
    <div class="quiz-q-text" id="quizQuestion"></div>
  </div>
  <div class="quiz-options" id="quizOptions"></div>
  <div class="quiz-feedback" id="quizFeedback"></div>
  <button class="btn btn-next" id="nextBtn" onclick="nextQuiz()">Next Question →</button>
</div>

<!-- COMPLETION -->
<div class="completion" id="completion">
  <div class="completion-icon">🎤</div>
  <h2>Trop ouf !</h2>
  <p>You've completed all 50 Verlan phrases</p>
  <div class="completion-score" id="finalScore"></div>
  <p id="finalMsg"></p>
  <button class="btn btn-restart" onclick="restart()">↺ &nbsp; Start Over</button>
</div>

<footer>50 Verlan phrases · Parisian Street French</footer>

<script>
const cards = [
  { verlan: "C'est ouf !",        standard: "C'est fou !",          en: "It's crazy! / Insane!",                    origin: "fou → ouf",         register: "classic",  notes: "One of the most used Verlan words today" },
  { verlan: "T'as vu cette meuf ?", standard: "T'as vu cette femme ?", en: "Did you see that woman/girl?",            origin: "femme → meuf",       register: "classic",  notes: "Very common — heard everywhere in Paris" },
  { verlan: "Ce keum est chelou.", standard: "Ce mec est louche.",   en: "That guy is shady/weird.",                  origin: "mec → keum",         register: "street",   notes: "chelou = louche (Verlan'd too)" },
  { verlan: "C'est zarbi.",       standard: "C'est bizarre.",        en: "It's weird/strange.",                       origin: "bizarre → zarbi",    register: "common",   notes: "Now used by all generations" },
  { verlan: "Laisse béton !",     standard: "Laisse tomber !",       en: "Forget it! / Drop it!",                    origin: "tomber → béton",     register: "classic",  notes: "Popularised by Renaud's 1977 song" },
  { verlan: "Il est trop reum.", standard: "Il est trop mur(e).",   en: "He's super mature / serious.",               origin: "mûr → reum",         register: "youth",    notes: "Also used for 'mère' (mother) in some contexts" },
  { verlan: "Vas-y, fonce feuj.", standard: "Vas-y, fonce fieu.",   en: "Go on, go for it, bro.",                     origin: "fieu → feuj",        register: "street",   notes: "Fieu itself is slang for 'fils' (son/bro)" },
  { verlan: "C'est relou.",       standard: "C'est lourd.",          en: "It's annoying / a drag.",                   origin: "lourd → relou",      register: "common",   notes: "Very widespread in everyday French now" },
  { verlan: "J'ai le seum.",      standard: "J'ai la somme.",        en: "I'm gutted / pissed off.",                  origin: "some(uh) → seum",    register: "youth",    notes: "From 'ça fait la somme' meaning 'it stings'" },
  { verlan: "C'est chanmé !",     standard: "C'est méchant !",       en: "It's wicked! / Awesome!",                  origin: "méchant → chanmé",   register: "youth",    notes: "Positive slang — 'méchant' flipped to mean great" },
  { verlan: "Trop stylé, ce reup !", standard: "Trop stylé, ce père !", en: "So cool, that dad/older guy!",           origin: "père → reup",        register: "street",   notes: "Père used affectionately for an older mentor" },
  { verlan: "Ce teufeur déchire.", standard: "Ce fêtard déchire.",   en: "That party-goer is killing it.",            origin: "fête → teuf",        register: "common",   notes: "Teuf (party) is now mainstream French slang" },
  { verlan: "On va se faire une teuf.", standard: "On va faire la fête.", en: "We're going to party.",               origin: "fête → teuf",        register: "common",   notes: "Used widely across France" },
  { verlan: "Il habite en banlieue, dans la cité.", standard: "Il habite en banlieue.", en: "He lives in the suburbs/projects.", origin: "banlieue (Verlan context)", register: "street", notes: "Banlieue and Verlan are deeply intertwined" },
  { verlan: "C'est le bolos du groupe.", standard: "C'est le boloss du groupe.", en: "He's the loser of the group.",  origin: "boloss (origin disputed)", register: "youth", notes: "Some say boloss = double Verlan of 'boss'" },
  { verlan: "Arrête de faire le zoulou.", standard: "Arrête de faire le fou.",  en: "Stop acting crazy/stupid.",       origin: "fou → (zoulou register)", register: "street", notes: "More intense version of ouf in some banlieues" },
  { verlan: "J'ai grave la dalle.",  standard: "J'ai vraiment faim.", en: "I'm seriously starving.",                  origin: "dalle = hunger (argot)",  register: "common",  notes: "'Grave' itself = 'vraiment' in verlan register" },
  { verlan: "Ce keuf m'a contrôlé.", standard: "Ce flic m'a contrôlé.", en: "That cop stopped and checked me.",       origin: "flic → keuf",        register: "street",   notes: "Sensitive term — describes police in banlieue context" },
  { verlan: "Il parle en lascar.",  standard: "Il parle en caïd.",   en: "He talks like a tough guy.",                origin: "caïd → lascar (slang)", register: "street", notes: "Lascar = tough / respected street figure" },
  { verlan: "T'inquiète, c'est du béton.", standard: "T'inquiète, c'est solide.", en: "Don't worry, it's solid/reliable.", origin: "béton = concrete (metaphor)", register: "common", notes: "Béton used figuratively for something solid" },
  { verlan: "Il est vénère.",       standard: "Il est énervé.",       en: "He's angry / furious.",                    origin: "énervé → vénère",    register: "classic",  notes: "One of the most recognised Verlan words" },
  { verlan: "C'est chébran ici.",   standard: "C'est branché ici.",   en: "It's trendy/hip here.",                    origin: "branché → chébran",  register: "classic",  notes: "80s Verlan — feels slightly retro now" },
  { verlan: "Ce reubeu est cool.", standard: "Cet Arabe est cool.",   en: "That North African/Arab guy is cool.",      origin: "arabe → beur → reubeu", register: "street", notes: "Double Verlan — beur became mainstream, then re-Verlan'd" },
  { verlan: "T'es une tepu.",       standard: "T'es une pute.",       en: "You're a prostitute / (insult).",           origin: "pute → tepu",        register: "street",   notes: "Crude insult — usage is highly offensive" },
  { verlan: "Il est au renoi.",     standard: "Il est au noir.",      en: "He's doing it cash in hand / off the books.", origin: "noir → renoi",      register: "street",   notes: "Working 'au black' = undeclared work" },
  { verlan: "On se fait un ciné ce soir ?", standard: "On va au cinéma ce soir ?", en: "Shall we go to the cinema tonight?", origin: "cinéma → ciné (standard abbreviation)", register: "common", notes: "Ciné is everyday French, not strictly Verlan" },
  { verlan: "Ça fait grave du mal ce son.", standard: "Cette musique est incroyable.", en: "That track is seriously incredible.", origin: "grave = vraiment (intensifier)", register: "youth", notes: "'Grave' as an intensifier is quintessential banlieue French" },
  { verlan: "Le verlan, c'est trop stylé.", standard: "L'argot inversé, c'est très cool.", en: "Verlan is super cool.", origin: "l'envers → verlan", register: "classic", notes: "The word verlan is itself a Verlan word" },
  { verlan: "Ce gars est un vrai caïd.",  standard: "Ce gars est un vrai chef.",  en: "That guy is a real boss/leader.", origin: "caïd = boss (Arabic loanword)", register: "street", notes: "Caïd entered French via Verlan-adjacent banlieue slang" },
  { verlan: "J'ai trouvé un appart ouf.", standard: "J'ai trouvé un appartement dingue.", en: "I found an insane apartment.", origin: "fou → ouf",      register: "common",  notes: "Ouf used as adjective — very natural in spoken French" },
  { verlan: "Il est frère, ce gars.",    standard: "Il est comme un frère, ce gars.", en: "He's like a brother, that guy.", origin: "frère (slang affectionate use)", register: "common", notes: "Frère/frangin used widely as 'bro'" },
  { verlan: "C'est trop le bordel.",     standard: "C'est le chaos.",          en: "It's total chaos / a mess.",         origin: "bordel (standard slang)",   register: "common",  notes: "Not Verlan per se — but core Parisian informal speech" },
  { verlan: "Ce son est too much.",      standard: "Cette chanson est excessive.", en: "That track is too much / over the top.", origin: "English borrowing in Verlan register", register: "youth", notes: "Franglais mixing is common in Verlan speech" },
  { verlan: "Mate le style de ce mec.", standard: "Regarde le style de ce gars.", en: "Check out the style of that guy.", origin: "mater = regarder (argot)",  register: "common",  notes: "Mater = to stare/check out in Parisian slang" },
  { verlan: "Je suis à donf.",          standard: "Je suis à fond.",           en: "I'm fully into it / going all in.",   origin: "fond → donf",        register: "youth",   notes: "À fond (fully committed) becomes à donf" },
  { verlan: "C'est nickel chrome.",     standard: "C'est parfait.",            en: "It's perfect / spot on.",             origin: "nickel + chrome (intensified)", register: "common", notes: "Nickel alone means 'perfect' in French slang" },
  { verlan: "Il a la tchatche.",        standard: "Il a le bagou.",            en: "He's got the gift of the gab.",       origin: "tchatche (banlieue origin)",  register: "common", notes: "Tchatche = smooth talking, widely understood" },
  { verlan: "Ça craint grave.",         standard: "C'est vraiment mauvais.",   en: "It seriously sucks.",                 origin: "craindre (to be terrible) + grave intensifier", register: "common", notes: "Ça craint is classic Parisian — add grave for emphasis" },
  { verlan: "T'as le look ce soir.",    standard: "Tu es très bien habillé(e).", en: "You're looking good tonight.",      origin: "look (English borrowing)",    register: "youth",   notes: "English 'look' fully absorbed into French slang" },
  { verlan: "Vas-y mollo.",             standard: "Vas-y doucement.",          en: "Take it easy / slow down.",           origin: "mollo = doucement (argot)",   register: "common",  notes: "Mollo is classic French informal, not strict Verlan" },
  { verlan: "On se retrouve à Châtelet ?", standard: "On se retrouve à Châtelet ?", en: "Shall we meet at Châtelet?",   origin: "Châtelet — iconic Paris meeting point", register: "common", notes: "Châtelet-Les Halles: the cultural heart of Parisian youth" },
  { verlan: "Il est charo ce soir.",    standard: "Il est charmeur ce soir.",  en: "He's being a charmer tonight.",       origin: "charmeur → charo",   register: "youth",   notes: "Charo can also mean show-off depending on context" },
  { verlan: "C'est quoi ce bouzin ?",  standard: "C'est quoi ce truc ?",      en: "What is this thing / this mess?",     origin: "bouzin = truc/bazar (argot)", register: "common", notes: "Bouzin is classic Parisian slang for a chaotic thing" },
  { verlan: "Elle assure grave.",       standard: "Elle est vraiment compétente.", en: "She seriously delivers / is really good.", origin: "assurer = to be capable (argot)", register: "common", notes: "'Assurer' in this sense is core Parisian informal" },
  { verlan: "Je gère.",                standard: "Je m'en occupe.",           en: "I've got it handled. / I'm managing it.", origin: "gérer = to handle",   register: "common",  notes: "'Je gère' signals confident control — very Parisian" },
  { verlan: "C'est du lourd.",         standard: "C'est impressionnant.",     en: "It's impressive / heavy duty.",        origin: "lourd → figurative",  register: "common",  notes: "Contrast with 'relou' — context flips the meaning" },
  { verlan: "T'as les boules ?",       standard: "T'es angoissé(e) ?",        en: "Are you stressed out / scared?",       origin: "boules = angoisse (argot)",  register: "common",  notes: "Avoir les boules = to be gutted/anxious" },
  { verlan: "C'est mort.",             standard: "C'est fichu / terminé.",    en: "It's done / finished / no hope.",       origin: "mort (dead) used figuratively", register: "common", notes: "C'est mort is heard constantly in casual Parisian speech" },
  { verlan: "Ça gaze ?",              standard: "Ça va ?",                   en: "How's it going? / All good?",           origin: "gazer = aller bien (argot)", register: "classic", notes: "Older Parisian slang — charmingly retro" },
  { verlan: "Il est au taquet.",       standard: "Il est à fond / motivé.",   en: "He's fired up / at 100%.",             origin: "taquet = fully engaged (argot)", register: "youth", notes: "Être au taquet = giving maximum effort" }
];

let currentIndex = 0;
let isFlipped = false;
let correctCount = 0;
let wrongCount = 0;
let mode = 'flashcard';
let shuffled = [...cards];
let quizIndex = 0;
let quizAnswered = false;

function setMode(m) {
  mode = m;
  document.querySelectorAll('.mode-tab').forEach((t,i) => {
    t.classList.toggle('active', (i===0 && m==='flashcard') || (i===1 && m==='quiz'));
  });
  document.getElementById('flashcardMode').style.display = m==='flashcard' ? 'block' : 'none';
  document.getElementById('cardNav').style.display = m==='flashcard' ? 'flex' : 'none';
  document.getElementById('flashControls').style.display = m==='flashcard' ? 'flex' : 'none';
  document.getElementById('quizMode').classList.toggle('active', m==='quiz');
  if (m==='quiz') { quizIndex = 0; loadQuiz(); }
  else { loadCard(); }
}

function loadCard() {
  if (currentIndex >= shuffled.length) { showCompletion(); return; }
  const card = shuffled[currentIndex];

  document.getElementById('verlanText').textContent = card.verlan;
  document.getElementById('contextHint').textContent = card.notes;
  document.getElementById('englishText').textContent = card.en;
  document.getElementById('originText').textContent = `${card.standard}  ·  ${card.origin}`;

  document.getElementById('cardNum').textContent = currentIndex + 1;
  updateProgress();
  updateStats();
  isFlipped = false;
  document.getElementById('cardWrapper').classList.remove('flipped');
  document.getElementById('answerControls').classList.remove('visible');
  document.getElementById('flipControl').style.display = 'flex';
}

function flipCard() {
  isFlipped = !isFlipped;
  document.getElementById('cardWrapper').classList.toggle('flipped', isFlipped);
  if (isFlipped) {
    document.getElementById('answerControls').classList.add('visible');
    document.getElementById('flipControl').style.display = 'none';
  } else {
    document.getElementById('answerControls').classList.remove('visible');
    document.getElementById('flipControl').style.display = 'flex';
  }
}

function markAnswer(correct) {
  if (correct) correctCount++; else wrongCount++;
  updateStats();
  currentIndex++;
  loadCard();
}

function nextCard() {
  if (currentIndex < shuffled.length - 1) { currentIndex++; isFlipped = false; loadCard(); }
}
function prevCard() {
  if (currentIndex > 0) { currentIndex--; isFlipped = false; loadCard(); }
}

function shuffleCards() {
  shuffled = [...cards].sort(() => Math.random() - 0.5);
  currentIndex = 0; correctCount = 0; wrongCount = 0;
  updateStats(); loadCard();
}

function updateProgress() {
  const pct = Math.max(2, ((currentIndex) / shuffled.length) * 100);
  document.getElementById('progressFill').style.width = pct + '%';
  document.getElementById('progressText').textContent = `Card ${Math.min(currentIndex+1, shuffled.length)} of ${shuffled.length}`;
}

function updateStats() {
  document.getElementById('correctCount').textContent = `${correctCount} correct`;
  document.getElementById('wrongCount').textContent = `${wrongCount} incorrect`;
  const remaining = mode === 'quiz'
    ? Math.max(0, quizDeck.length - quizIndex - 1)
    : Math.max(0, shuffled.length - currentIndex - 1);
  document.getElementById('remainingCount').textContent = `${remaining} left`;
  const total = correctCount + wrongCount;
  document.getElementById('scoreText').textContent = total > 0 ? `${correctCount} correct · ${wrongCount} wrong` : '';
}

let quizDeck = [];
function loadQuiz() {
  quizDeck = [...cards].sort(() => Math.random() - 0.5);
  quizIndex = 0; correctCount = 0; wrongCount = 0;
  showQuizQuestion();
}

function showQuizQuestion() {
  if (quizIndex >= quizDeck.length) { showCompletion(); return; }
  const card = quizDeck[quizIndex];
  document.getElementById('quizQuestion').textContent = card.verlan;
  document.getElementById('quizFeedback').textContent = '';
  document.getElementById('quizFeedback').className = 'quiz-feedback';
  document.getElementById('nextBtn').classList.remove('visible');

  let wrongOptions = cards.filter(c => c.en !== card.en).sort(() => Math.random() - 0.5).slice(0,3).map(c=>c.en);
  let options = [...wrongOptions, card.en].sort(() => Math.random() - 0.5);

  const container = document.getElementById('quizOptions');
  container.innerHTML = '';
  options.forEach(opt => {
    const btn = document.createElement('button');
    btn.className = 'quiz-option';
    btn.textContent = opt;
    btn.onclick = () => selectQuizAnswer(btn, opt, card.en);
    container.appendChild(btn);
  });

  document.getElementById('cardNum').textContent = quizIndex + 1;
  document.getElementById('progressText').textContent = `Question ${quizIndex+1} of ${quizDeck.length}`;
  document.getElementById('progressFill').style.width = Math.max(2, (quizIndex/quizDeck.length)*100) + '%';
  updateStats();
}

function selectQuizAnswer(btn, chosen, correct) {
  if (quizAnswered) return;
  quizAnswered = true;
  document.querySelectorAll('.quiz-option').forEach(b => {
    b.disabled = true;
    if (b.textContent === correct) b.classList.add('correct');
  });
  const fb = document.getElementById('quizFeedback');
  if (chosen === correct) {
    btn.classList.add('correct');
    fb.textContent = '✓ Correct — trop fort(e) !';
    fb.className = 'quiz-feedback correct';
    correctCount++;
  } else {
    btn.classList.add('wrong');
    fb.textContent = '✗ Pas tout à fait — the correct answer is highlighted.';
    fb.className = 'quiz-feedback wrong';
    wrongCount++;
  }
  updateStats();
  document.getElementById('nextBtn').classList.add('visible');
  quizAnswered = false;
}

function nextQuiz() { quizIndex++; showQuizQuestion(); }

function showCompletion() {
  document.getElementById('flashcardMode').style.display = 'none';
  document.getElementById('cardNav').style.display = 'none';
  document.getElementById('flashControls').style.display = 'none';
  document.getElementById('quizMode').classList.remove('active');
  const comp = document.getElementById('completion');
  comp.classList.add('visible');
  const total = correctCount + wrongCount;
  const pct = total > 0 ? Math.round((correctCount/total)*100) : 0;
  document.getElementById('finalScore').textContent = pct + '%';
  const msg = pct >= 90 ? 'Trop ouf ! You speak Paris now.' :
    pct >= 70 ? 'Chanmé ! Keep at it and you\'ll blend right in.' :
    pct >= 50 ? 'Pas mal — a few more rounds and you\'ll have it.' :
    'C\'est pas grave — Verlan takes time. Keep going !';
  document.getElementById('finalMsg').textContent = msg;
}

function restart() {
  currentIndex = 0; quizIndex = 0; correctCount = 0; wrongCount = 0;
  shuffled = [...cards]; quizAnswered = false;
  document.getElementById('completion').classList.remove('visible');
  updateStats();
  if (mode === 'flashcard') {
    document.getElementById('flashcardMode').style.display = 'block';
    document.getElementById('cardNav').style.display = 'flex';
    document.getElementById('flashControls').style.display = 'flex';
    loadCard();
  } else {
    document.getElementById('quizMode').classList.add('active');
    loadQuiz();
  }
}

document.addEventListener('keydown', e => {
  if (e.key === 'Escape') { closeModal(); return; }
  if (mode !== 'flashcard') return;
  if (e.key === 'ArrowRight' || e.key === ' ') { e.preventDefault(); isFlipped ? markAnswer(true) : flipCard(); }
  if (e.key === 'ArrowLeft') { e.preventDefault(); isFlipped ? markAnswer(false) : prevCard(); }
  if (e.key === 'ArrowUp') flipCard();
});

function openModal() {
  document.getElementById('modalOverlay').classList.add('open');
  document.body.style.overflow = 'hidden';
}
function closeModal() {
  document.getElementById('modalOverlay').classList.remove('open');
  document.body.style.overflow = '';
}
function closeModalOutside(e) {
  if (e.target === document.getElementById('modalOverlay')) closeModal();
}

loadCard();
updateStats();
</script>
</body>
</html>