/* ============================================
   MEESTERTOOLS - Lingo
   Versie: v2.0.0 — klassieke tv-stijl:
   blauw raster, rood = goed, geel rondje = verkeerde plek.
   ============================================ */

.lingo-wrap {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---------- Topbalk ---------- */
.lingo-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.lingo-chip {
    background: var(--bg-light, #F1F1F8);
    color: var(--text-medium, #636E72);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 700;
}
.lingo-btn {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 14.5px;
    font-weight: 700;
    transition: all .15s ease;
}
.lingo-btn-primary { background: var(--primary, #6C63FF); color: #fff; }
.lingo-btn-primary:hover { background: var(--primary-dark, #5A52D5); transform: translateY(-1px); }

/* ---------- Bord: donkerblauw tv-paneel ---------- */
.lingo-board {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    margin-bottom: 14px;
    background: #0C2D6B;
    border: 4px solid #0A2455;
    border-radius: 14px;
    padding: 10px;
    box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(12, 45, 107, 0.35);
}
.lingo-row {
    display: grid;
    gap: 7px;
}

/* Standaardtegel: blauw met witte letter (= "niet goed" / leeg / getypt) */
.lingo-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid #5B8FE8;
    background: linear-gradient(160deg, #2E6FD3, #1E56AE);
    font-size: clamp(22px, 7vw, 34px);
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    user-select: none;
}
.lingo-tile.is-cursor {
    border-color: #FFD23E;
    box-shadow: 0 0 0 3px rgba(255, 210, 62, 0.35);
}

/* Puntje in een leeg vakje van de actieve rij (zoals de echte Lingo) */
.lingo-dot {
    width: 15%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

/* ---------- Resultaat-kleuren (klassiek Lingo) ---------- */
/* Rood = letter goed én op de juiste plaats */
.lingo-tile.lingo-correct {
    background: linear-gradient(160deg, #CE1F3B, #A6122A);
    border-color: #E85A6F;
    color: #fff;
}
/* Blauw = letter zit niet in het woord (tegel blijft zoals 'ie was) */
.lingo-tile.lingo-absent {
    background: linear-gradient(160deg, #2E6FD3, #1E56AE);
    border-color: #5B8FE8;
    color: #fff;
}
/* Geel rondje = letter zit wel in het woord, maar op een andere plaats */
.lingo-tile.lingo-present {
    background: linear-gradient(160deg, #2E6FD3, #1E56AE);
    border-color: #5B8FE8;
    color: #0C2D6B;
}
.lingo-tile.lingo-present::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFE27A, #F7C93C 70%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.lingo-tile.lingo-present > span,
.lingo-tile.lingo-present {
    z-index: 0;
}
.lingo-tile.lingo-present .lingo-letter {
    position: relative;
    z-index: 1;
}

/* Pop-animatie op het moment dat een letter onthuld wordt (op het piepje) */
.lingo-tile.is-pop { animation: lingoPop .32s ease; }
@keyframes lingoPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.lingo-row.lingo-shake { animation: lingoShake .4s ease; }
@keyframes lingoShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

/* ---------- Bericht ---------- */
.lingo-message {
    min-height: 26px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
}
.lingo-msg-win { color: #2C7A3D; }
.lingo-msg-lose { color: var(--secondary, #FF6B6B); }
.lingo-msg-warn { color: var(--accent-orange, #FF8C42); }

/* ---------- Toetsenbord ---------- */
.lingo-keyboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.lingo-kb-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.lingo-key {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 44px;
    height: 50px;
    border: none;
    border-radius: 9px;
    background: #E7E8EF;
    color: var(--text-dark, #2D3436);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s ease, transform .08s ease, color .12s ease;
}
.lingo-key:hover { background: #DBDCE6; }
.lingo-key:active { transform: translateY(1px); }
.lingo-key-wide { flex: 1.6 1 auto; max-width: 72px; font-size: 13px; }
.lingo-key.lingo-correct { background: #BE1931; color: #fff; }
.lingo-key.lingo-present { background: #F7C93C; color: #0C2D6B; }
.lingo-key.lingo-absent  { background: #2E6FD3; color: rgba(255, 255, 255, 0.55); }

/* ---------- Instellingen ---------- */
.lingo-field-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-dark, #2D3436); margin-bottom: 8px; }
.lingo-seg {
    display: inline-flex;
    background: var(--bg-light, #F8F9FE);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
}
.lingo-seg-btn {
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-medium, #636E72);
}
.lingo-seg-btn.is-active { background: var(--primary, #6C63FF); color: #fff; }

.lingo-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #F0F0F5;
}
.lingo-legend-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-medium, #636E72); }
.lingo-swatch { width: 18px; height: 18px; border-radius: 5px; }
.lingo-swatch.lingo-correct { background: #BE1931; }
.lingo-swatch.lingo-present { background: radial-gradient(circle, #F7C93C 56%, #2E6FD3 60%); }
.lingo-swatch.lingo-absent  { background: #2E6FD3; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .lingo-key { height: 46px; font-size: 15px; }
    .lingo-tile { border-radius: 7px; }
    .lingo-board { padding: 7px; border-width: 3px; }
}
