/* CSS-Variablen - leicht anpassbar */
:root {
    --bs-grid-size: 20px;
    --bs-cell-size: 20px;
    --bs-font-size: 18px;
    --bs-border-color: #333;
    --bs-border-radius: 4px;
    --bs-bg-default: #fff;
    --bs-bg-selected: #b3d9ff;
    --bs-bg-found: #90ee90;
    --bs-bg-highlight: #ffe44d;
    --bs-text-color: #222;
    --bs-text-found: #006400;
    --bs-primary-color: #338899;
    --bs-success-color: #28a745;
    --bs-danger-color: #cc3333;
    --bs-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --bs-transition: all 0.2s ease;
}

.entry-content tr td {
    border-top: 1px solid var(--bs-border-color) !important;
    padding: 4px 2px !important;
}

.entry-content table:not(.variations) {
    border: 1px solid #eee;
    margin: 0 0 15px;
    text-align: left;
}
/* Container */
#bs-game {
    font-family: "Inter", Arial, sans-serif;
    max-width: 100%;
    overflow-x: auto;
    padding: 20px;
    background: #e7ebee;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #ccc;
}

/* Spielbereich */
.bs-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Steuerung */
.bs-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.bs-btn {
    padding: 20px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--bs-transition);
    background: var(--bs-primary-color);
    color: white;
}

.bs-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.bs-btn-danger {
    background: var(--bs-danger-color);
}

.bs-btn-solution {
    background: #ff8800;
}

.bs-mode-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bs-mode-btn {
    padding: 8px 16px;
    font-size: 14px;
    border: 2px solid var(--bs-primary-color);
    background: white;
    color: var(--bs-primary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--bs-transition);
}

.bs-mode-btn.active {
    background: var(--bs-primary-color);
    color: white;
}

/* Grid Tabelle */
.bs-grid {
    margin: 0 auto;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--bs-shadow);
}

.bs-grid td {
    width: var(--bs-cell-size);
    height: var(--bs-cell-size);
    text-align: center;
    vertical-align: middle;
    border: 1px solid var(--bs-border-color);
    font-size: var(--bs-font-size);
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: var(--bs-transition);
    color: var(--bs-text-color);
}

.bs-grid td:hover {
    background: #e0e0e0;
    transform: scale(1.02);
}

.bs-grid td.selected {
    background: var(--bs-bg-selected);
}

.bs-grid td.found {
    background: var(--bs-bg-found);
    color: var(--bs-text-found);
    text-decoration: line-through;
}

.bs-grid td.highlight {
    background: var(--bs-bg-highlight);
}

/* Wortliste */
.bs-wordlist {
    background: white;
    border-radius: 10px;
    padding: 15px 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #ccc;
    min-width: 250px;
}

.bs-wordlist h3 {
    margin: 0 0 10px 0;
    color: var(--bs-primary-color);
    text-align: center;
    font-weight: 700;
}

.bs-wordlist ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.bs-wordlist li {
    padding: 6px 14px;
    background: #e7ebee;
    border-radius: 20px;
    font-weight: 600;
    transition: var(--bs-transition);
    letter-spacing: 0.04em;
}

.bs-wordlist li.found {
    background: var(--bs-bg-found);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Spiegelmodus - Buchstaben horizontal spiegeln */
.bs-grid.bs-mirror td {
    transform: scaleX(-1);
}

.bs-mirror-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    color: #444;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.bs-mirror-label:hover {
    background: #dce4ec;
}

.bs-mirror-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Feedback - Overlay über dem Grid */
.bs-game-area {
    position: relative;
}

#bs-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 22px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bs-feedback {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    transition: var(--bs-transition);
}

.bs-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bs-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bs-feedback.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Statuszeile */
.bs-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
    align-items: center;
}

#bs-timer {
    font-family: "Inter", monospace;
    font-size: 18px;
    font-weight: bold;
    color: var(--bs-primary-color);
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --bs-cell-size: 28px;
        --bs-font-size: 14px;
    }

    .bs-wordlist li {
        font-size: 12px;
        padding: 4px 10px;
    }

    .bs-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Lösungs-Overlay */
.bs-solution-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: bsFadeIn 0.2s ease;
}

.bs-solution-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    text-align: center;
}

.bs-solution-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.bs-solution-close:hover {
    color: #000;
}

.bs-solution-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--bs-primary-color);
}

.bs-solution-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes bsFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    :root {
        --bs-cell-size: 22px;
        --bs-font-size: 11px;
    }
}
