
  :root {
    --wood: #c8882a;
    --wood-dark: #9b6318;
    --wood-light: #e8b96a;
    --cream: #f5f0e8;
    --tile: #f9f3e3;
    --tile-shadow: #c4a96b;
    --navy: #1a2744;
    --navy-light: #2a3f6f;
    --valid: #2d7a3e;
    --valid-bg: #eaf6ec;
    --invalid: #b92c2c;
    --invalid-bg: #fdeaea;
    --text: #1a1a2e;
    --muted: #6b6b80;
    --radius: 12px;
    --radius-lg: 20px;
  }

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

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--navy);
    min-height: 100vh;
    color: var(--text);
    position: relative;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,0.03) 60px),
      repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.03) 60px);
    pointer-events: none;
    z-index: 0;
  }

  .app {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
  }

  /* HEADER */
  header {
    text-align: center;
    margin-bottom: 2.5rem;
  }

  .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
  }

  .tiles-logo {
    display: flex;
    gap: 4px;
  }

  .tile-letter {
    width: 38px;
    height: 38px;
    background: var(--tile);
    border-radius: 6px;
    border-bottom: 4px solid var(--tile-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 18px;
    color: var(--navy);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform 0.15s;
  }

  .tile-letter .score {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-family: 'DM Sans', sans-serif;
    font-size: 7px;
    font-weight: 600;
    color: var(--tile-shadow);
    line-height: 1;
  }

  .site-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--cream);
    letter-spacing: -0.5px;
  }

  .site-subtitle {
    font-size: 0.9rem;
    color: rgba(245,240,232,0.55);
    letter-spacing: 0.5px;
  }

  /* CARD PRINCIPALE */
  .card {
    background: var(--cream);
	overflow: visible;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(200,136,42,0.3);
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  }
  
  .info-block {
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid rgba(155,99,24,0.15);
}

  /* LANGUE */
  .lang-section {
    margin-bottom: 1.75rem;
  }

  .lang-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.6rem;
    display: block;
  }

  .lang-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1.5px solid rgba(155,99,24,0.3);
    background: white;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    transition: all 0.2s;
  }

  .lang-btn:hover {
    border-color: var(--wood);
    color: var(--wood-dark);
  }

  .lang-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
  }

  .lang-flag { font-size: 18px; }

  /* LOADER */
  .load-status {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
    min-height: 1.2em;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(155,99,24,0.2);
    border-top-color: var(--wood);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
  }

  .spinner.active { display: block; }

  @keyframes spin { to { transform: rotate(360deg); } }

  /* UPLOAD (fallback) */
  .upload-zone {
    border: 2px dashed rgba(155,99,24,0.35);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(200,136,42,0.04);
    margin-top: 0.75rem;
    display: none;
  }

  .upload-zone.visible { display: block; }
  .upload-zone:hover { border-color: var(--wood); background: rgba(200,136,42,0.08); }
  .upload-zone input { display: none; }
  .upload-zone p { font-size: 0.85rem; color: var(--muted); }
  .upload-zone strong { color: var(--wood-dark); }

  /* SEPARATEUR */
  .divider {
    height: 1px;
    background: rgba(155,99,24,0.15);
    margin: 1.5rem 0;
  }

  /* CHAMP DE SAISIE */
.input-section { position: static; }

  .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  .input-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 10;
  background: var(--cream);
  padding-bottom: 0.5rem;
}

.input-wrapper {
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

  #word-input {
    width: 100%;
    padding: 1rem 5.5rem 1rem 1.25rem;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    background: white;
    border: 2px solid rgba(155,99,24,0.25);
    border-radius: var(--radius);
    outline: none;
    text-transform: uppercase;
    letter-spacing: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.04);
  }

  #word-input:focus {
    border-color: var(--wood);
    box-shadow: 0 0 0 3px rgba(200,136,42,0.15);
  }

  #word-input::placeholder {
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: rgba(107,107,128,0.4);
    font-weight: 400;
  }

  #word-input.valid { border-color: var(--valid); box-shadow: 0 0 0 3px rgba(45,122,62,0.12); }
  #word-input.invalid { border-color: var(--invalid); box-shadow: 0 0 0 3px rgba(185,44,44,0.12); }

  .check-btn {
    position: absolute;
    right: 8px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
  }

  .check-btn:hover { background: var(--navy-light); }
  .check-btn:active { transform: scale(0.97); }
  .check-btn:disabled { opacity: 0.5; cursor: not-allowed; }

  /* TILES PREVIEW */
  .tiles-preview {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 1rem;
    min-height: 48px;
    align-items: center;
  }

  .tile-sm {
    width: 40px;
    height: 46px;
    background: var(--tile);
    border-radius: 5px;
    border-bottom: 3px solid var(--tile-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 20px;
    color: var(--navy);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
    animation: tileIn 0.25s ease backwards;
  }

  .tile-sm .score {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-family: 'DM Sans', sans-serif;
    font-size: 7px;
    font-weight: 600;
    color: var(--tile-shadow);
  }

  .tile-sm.valid-tile { background: #d4edda; border-color: #82c990; }
  .tile-sm.invalid-tile { background: #f8d7da; border-color: #d48c8c; }

  @keyframes tileIn {
    from { transform: translateY(-10px) scale(0.8); opacity: 0; }
    to { transform: none; opacity: 1; }
  }

  /* RÉSULTAT */
  .result-badge {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1rem;
    animation: fadeUp 0.3s ease;
  }

  .result-badge.show { display: flex; }
  .result-badge.valid-badge { background: var(--valid-bg); color: var(--valid); border: 1px solid rgba(45,122,62,0.25); }
  .result-badge.invalid-badge { background: var(--invalid-bg); color: var(--invalid); border: 1px solid rgba(185,44,44,0.25); }

  .badge-icon { font-size: 22px; flex-shrink: 0; }

  @keyframes fadeUp {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }

  /* DÉFINITION + WIKIPEDIA */
  .info-section {
    margin-top: 1.5rem;
    display: none;
    animation: fadeUp 0.4s ease 0.1s backwards;
  }

  .info-section.show { display: block; }

  .info-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
  }

  .info-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
  }

  .info-tab.active {
    background: var(--navy);
    color: white;
  }

  .tab-content { display: none; }
  .tab-content.active { display: block; }

  .def-box {
    background: white;
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid rgba(155,99,24,0.15);
  }

  .def-source {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
  }

  .def-word {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.4rem;
  }

  .def-type {
    font-size: 0.8rem;
    color: var(--wood-dark);
    font-style: italic;
    margin-bottom: 0.75rem;
  }

  .def-text {
    font-size: 0.925rem;
    color: #2a2a3e;
    line-height: 1.7;
  }

  .def-text li { margin-left: 1rem; margin-bottom: 4px; }

  .wiki-box {
    background: white;
    border-radius: var(--radius);
    border: 1px solid rgba(155,99,24,0.15);
    overflow: hidden;
  }

  .wiki-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
  }

  .wiki-body { padding: 1.25rem; }

  .wiki-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
  }

  .wiki-extract {
    font-size: 0.9rem;
    color: #2a2a3e;
    line-height: 1.7;
  }

  .wiki-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--navy-light);
    font-weight: 600;
    text-decoration: none;
  }

  .wiki-link:hover { color: var(--wood-dark); }

  .no-data {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
  }

  .no-data-icon { font-size: 2rem; margin-bottom: 0.5rem; }

  .loading-info {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
  }

  /* FOOTER */
  footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: rgba(245,240,232,0.3);
  }

  /* RESPONSIVE */
  @media (max-width: 480px) {
    #word-input { font-size: 1.5rem; letter-spacing: 3px; }
    .site-title { font-size: 1.7rem; }
    .card { padding: 1.25rem; }
    .tile-letter { width: 32px; height: 32px; font-size: 15px; }
  }
