/* ==========================================================================
   LEXIPEDE B2B WHITE-LABEL EDITION (Clean Layout Style)
   ========================================================================== */

:root {
    --spon-red: #E64415;
    --spon-border-light: #DDDBD9;
    --text-light: #000000;
    --text-dark: #F1EFED;
    --accent-color: #f39c12;    /* Holzweg-Orange */
    --success-color: #27ae60;   /* Master-Lösung Grün */
    --hint-color: #f1c40f;
}

* { box-sizing: border-box; touch-action: pan-y; }

/* 50% Desktop-Bremse */
.pt-16 { max-width: 480px !important; margin: 0 auto !important; }

#game-container { position: relative; padding: 12px; background: #F1EFED; border-radius: 12px; width: 100%; max-width: 360px; margin: 0 auto; box-shadow: inset 0 2px 6px rgba(0,0,0,0.08); }
.dark #game-container { background: #141718; }

#grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(6, 1fr); gap: 6px; width: 100%; height: 100%; }

.cell { aspect-ratio: 1 / 1; background-color: #FFFFFF; color: var(--text-light); display: flex !important; justify-content: center !important; align-items: center !important; font-family: "SpiegelSansUI", sans-serif; font-size: 1.5em; font-weight: 800; border-radius: 8px; cursor: pointer; border: 1px solid var(--spon-border-light); }
.dark .cell { background-color: #1A1D1E; color: var(--text-dark); border-color: #2C3032; }

.cell.active { background-color: var(--spon-red) !important; color: #FFFFFF !important; transform: scale(1.08); }
.cell.locked { background: transparent !important; border: none !important; color: #FFFFFF !important; text-shadow: 0 0 8px var(--success-color), 0 0 12px var(--success-color); font-weight: 900; animation: pulse 2s infinite ease-in-out; }
.cell.locked.off-path { text-shadow: 0 0 8px var(--accent-color), 0 0 12px var(--accent-color) !important; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
#line-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.permanent-line { stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; fill: none; }

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 20px auto 0 auto;
    padding: 10px;
    background: #FFF3D5;
    border: 1px solid rgba(230, 68, 21, 0.25);
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
#controls button {
    font-family: "SpiegelSansUI", sans-serif;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--spon-border-light) !important;
    transition: all 0.2s;
    background: #FFF3D5 !important;
    color: #111111 !important;
    box-shadow: none !important;
}
#controls button:hover { background: #FFFFFF !important; }
#controls #solve-trigger-btn { color: #c0392b !important; }
#controls #quick-hint-btn { color: #7A5A00 !important; }
#controls button:active { transform: scale(0.96); }

/* B2B MODAL OVERLAYS (Vernichtet die unsichtbare Blockade) */
.custom-modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    display: none !important; /* Startet absolut inaktiv im Äther */
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
}

#settings-dropdown {
    width: 44px;
    background-color: #FFFFFF !important;
    border: 1px solid var(--spon-border-light);
    position: absolute;
    top: 40px; left: 0;
    z-index: 99999 !important;
    display: none; 
    flex-direction: column;
    align-items: center;
    border-radius: 25px;
    padding: 8px 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
#settings-dropdown.show-menu { display: flex !important; }

.menu-icon-btn { width: 36px; height: 36px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; border-radius: 50%; }
.menu-icon-btn:hover { background-color: #F1EFED; }
.menu-separator { width: 24px; height: 1px; background-color: #E2E2E2; margin: 4px 0; }

.difficulty-row { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.diff-ellipse { display: inline-flex; align-items: center; justify-content: center; background-color: #FFFFFF; color: #000000; border: 1px solid #000000; padding: 6px 14px; border-radius: 20px; font-family: sans-serif; font-size: 0.8rem; font-weight: bold; text-decoration: none; }
.diff-ellipse.active { background-color: #000000 !important; color: #FFFFFF !important; }

.stats-bar { border: 1px solid var(--spon-border-light); }
.hint-word { font-family: monospace; font-weight: bold; font-size: 0.9rem; background: #FFF3D5; padding: 4px 10px; border-radius: 4px; border: 1px solid #E64415; }
.word-badge { background: var(--success-color) !important; color: white; font-weight: bold; padding: 6px 12px; border-radius: 20px; font-size: 0.8em; display: inline-flex; align-items: center; gap: 6px; }
.word-badge-extra { background: var(--accent-color) !important; }
.remove-btn { margin-left: 6px; cursor: pointer; }
.shake { animation: shake 0.4s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }


/* Feinabstimmung der unteren Steuerleiste */
#controls #connect-btn {
    border: 2px solid var(--success-color) !important;
    color: #1f7f45 !important;
}

#controls #reset-btn {
    border: 2px solid #7f8c8d !important;
    color: #4f5b5f !important;
}

#controls #connect-btn:hover {
    background: rgba(39, 174, 96, 0.08) !important;
}

#controls #reset-btn:hover {
    background: rgba(127, 140, 141, 0.10) !important;
}


.word-badge-noscore { opacity: 0.78; outline: 2px dashed rgba(0,0,0,0.25); outline-offset: 2px; }

.final-score-line { font-weight: 900; font-size: 1.15rem; color: #E64415; margin-bottom: 12px; text-align: center; }


.score-breakdown {
    background: #FFF3D5;
    border: 1px solid rgba(230, 68, 21, 0.25);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0 auto 14px auto;
    max-width: 420px;
    text-align: left;
    color: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.score-breakdown-title {
    font-weight: 900;
    color: #E64415;
    text-align: center;
    margin-bottom: 8px;
}

.score-breakdown-row,
.score-breakdown-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    font-weight: 700;
}

.score-breakdown-total {
    border-top: 1px solid rgba(0,0,0,0.12);
    margin-top: 6px;
    padding-top: 8px;
    font-size: 1.08rem;
    font-weight: 900;
}



/* Einheitliche Ellipsen-Optik für untere Spielbuttons */
.control-ellipse-row {
    width: 100%;
    max-width: 440px;
    margin: 20px auto 0 auto;
    padding: 10px;
    background: #FFF3D5;
    border: 1px solid rgba(230, 68, 21, 0.25);
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.control-ellipse {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    padding: 6px 14px !important;
    min-height: 34px !important;
    border-radius: 20px !important;
    font-family: sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: bold !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: background-color .16s ease, transform .16s ease;
}

.control-ellipse:hover {
    background-color: #F1EFED !important;
}

.control-ellipse:active {
    transform: scale(0.96);
}

.control-connect {
    border-color: #27ae60 !important;
    color: #1f7f45 !important;
}

.control-reset {
    border-color: #7f8c8d !important;
    color: #4f5b5f !important;
}

.control-hint {
    border-color: #f1c40f !important;
    color: #7A5A00 !important;
    min-width: 46px !important;
    font-size: 1rem !important;
}

.control-solve {
    border-color: #c0392b !important;
    color: #c0392b !important;
}

@media (max-width: 420px) {
    .control-ellipse-row { max-width: 360px; }
    .control-ellipse { padding: 6px 10px !important; font-size: 0.76rem !important; }
}

#controls.control-ellipse-row {
    display: flex !important;
    max-width: 440px !important;
}
#controls.control-ellipse-row button {
    flex: 0 0 auto !important;
}


/* Zur Lösung rot */
.control-solve {
    border-color: #c0392b !important;
    color: #c0392b !important;
}
#controls.control-ellipse-row .control-solve {
    border-color: #c0392b !important;
    color: #c0392b !important;
}


/* Persönliche Statistik */
.stats-circle-btn {
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #9aa0a6;
    color: #111;
    font-size: 2rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.stats-circle-btn:hover {
    background: #F1EFED;
}

.stats-modal-content {
    background: #FFF3D5;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(230,68,21,0.18);
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.stats-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.stats-card strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.2;
}

.stats-card span {
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
}

.stats-section-title {
    font-weight: 900;
    margin: 12px 0 6px;
    color: #E64415;
}

.stats-mini-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.82rem;
}

.stats-mini-table th,
.stats-mini-table td {
    border-bottom: 1px solid #eee;
    padding: 6px 8px;
    text-align: left;
}

.stats-empty {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    font-weight: 800;
}

@media (max-width: 520px) {
    .stats-circle-btn {
        width: 54px;
        height: 54px;
        font-size: 1.35rem;
    }
    .stats-cards {
        grid-template-columns: 1fr;
    }
}



/* Statistik-Icon wie Zahnrad: gleich groß und mit drei Balken */
.stats-circle-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 1px solid #9aa0a6 !important;
    color: #111 !important;
    padding: 0 !important;
    font-size: 0 !important;
}

.stats-bars-icon {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 18px;
    height: 18px;
}

.stats-bars-icon span {
    display: block;
    width: 4px;
    background: #ffffff;
    border: 1px solid #111111;
    box-sizing: border-box;
}

.stats-bars-icon .stats-bar-one { height: 17px; }
.stats-bars-icon .stats-bar-two { height: 8px; }
.stats-bars-icon .stats-bar-three { height: 13px; }

.stats-cards-two {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 520px) {
    .stats-circle-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
    .stats-cards-two {
        grid-template-columns: repeat(2, 1fr);
    }
}



/* Legal footer + dezenter Datenschutz-Hinweis */
.legal-footer { max-width: 720px; margin: 22px auto 18px; text-align: center; font-family: sans-serif; font-size: 0.78rem; color: #555; }
.legal-footer a { color: #555; text-decoration: none; font-weight: 700; }
.legal-footer a:hover { color: #E64415; }
.privacy-note { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999; max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid rgba(230,68,21,.25); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-family: sans-serif; font-size: 0.86rem; line-height: 1.35; }
.privacy-note a { color: #E64415; font-weight: 800; }
.privacy-note button { margin-left: auto; border: none; border-radius: 999px; padding: 8px 14px; background: #E64415; color: #fff; font-weight: 900; cursor: pointer; }
@media (max-width: 620px) { .privacy-note { flex-direction: column; align-items: stretch; } .privacy-note button { margin-left: 0; } }

