/* ========================================================================
   WORTSUCHSPIEL

   Warmes Dunkelbraun als Flaeche, das Gitter als grosses cremefarbenes Panel
   ohne Zellenraster, rechts eine Karte mit Wortliste, Zeit und Bedienhinweis.
   ======================================================================== */

.ws-bg {
    /* --- Flaechen --- */
    --ws-bg: #14100c;
    --ws-bg-warm: #2a2018;
    --ws-panel: #f6efe1;          /* Gitterflaeche */
    --ws-card: #241c14;           /* Seitenkarte */
    --ws-card-line: rgba(255, 255, 255, 0.09);

    /* --- Schrift --- */
    --ws-ink: #4a3826;            /* Buchstaben im Gitter */
    --ws-text: #f0e7d8;
    --ws-muted: #a08e78;

    /* --- Akzent --- */
    --ws-gold: #e0aa53;
    --ws-gold-light: #f0c674;

    /* --- Gitter --- */
    --ws-cell-size: 44px;
    --ws-letter-size: 20px;

    background: radial-gradient(ellipse at 30% 0%, var(--ws-bg-warm) 0%, var(--ws-bg) 70%);
    color: var(--ws-text);
}

/* Layout: Gitter links, Karte rechts */
.ws-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 8px;
}

/* ========================================================================
   GITTER
   ======================================================================== */

.ws-grid-wrapper {
    background: var(--ws-panel);
    padding: 26px 30px;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.ws-grid {
    display: grid;
    gap: 0;   /* kein sichtbares Raster - die Buchstaben stehen frei */
}

.ws-cell {
    width: var(--ws-cell-size);
    height: var(--ws-cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    background: transparent;
    transition: background-color 0.12s ease, color 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
}

.ws-cell:hover {
    background: rgba(74, 56, 38, 0.10);
}

.ws-cell.ws-selected {
    background: var(--ws-gold);
    color: #2a2018;
}

/* Gefundene Zellen bekommen ihre Farbe per Inline-Style aus dem Code */
.ws-cell.ws-found {
    color: #fff;
}

.ws-letter {
    font-size: var(--ws-letter-size);
    font-weight: 600;
    line-height: 1;
    color: inherit;
    letter-spacing: 0.02em;
}

.ws-cell:not(.ws-found):not(.ws-selected) .ws-letter {
    color: var(--ws-ink);
}

/* ========================================================================
   SEITENSPALTE
   ======================================================================== */

.ws-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 260px;
    max-width: 320px;
}

.ws-word-list {
    background: var(--ws-card);
    border: 1px solid var(--ws-card-line);
    border-radius: 16px;
    padding: 20px 22px 22px;
}

.ws-word-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--ws-card-line);
}

.ws-word-list-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ws-gold-light);
}

.ws-word-count {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ws-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ws-word-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}

.ws-word-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ws-muted);
    opacity: 0.55;
    flex-shrink: 0;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.ws-word-found .ws-word-dot {
    opacity: 1;
}

.ws-word-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--ws-text);
}

.ws-word-found .ws-word-text {
    color: var(--ws-muted);
}

.ws-strikethrough {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

/* --- Zeit --- */
.ws-time-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 4px;
}

.ws-time-label {
    font-size: 0.9rem;
    color: var(--ws-muted);
}

.ws-time-value {
    font-size: 1.05rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ws-text);
}

/* --- Bedienhinweis --- */
.ws-hint {
    margin: 0;
    padding: 0 4px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--ws-muted);
}

/* Kategorie-Knoepfe stehen in der gemeinsamen Toolbar */
.ws-category-group {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* ========================================================================
   GEWONNEN
   ======================================================================== */

.ws-win-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    z-index: 20000;
    backdrop-filter: blur(6px);
    animation: wsFadeIn 0.4s ease;
}

.ws-win-card {
    background: linear-gradient(135deg, var(--ws-bg-warm) 0%, var(--ws-bg) 100%);
    border: 1px solid rgba(224, 170, 83, 0.5);
    border-radius: 18px;
    padding: 36px 52px;
    text-align: center;
    color: var(--ws-text);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    animation: wsScaleIn 0.4s ease 0.15s both;
}

.ws-win-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--ws-gold-light);
    margin-bottom: 14px;
}

.ws-win-stats {
    font-size: 15px;
    margin-bottom: 22px;
    line-height: 1.8;
}

.ws-win-stats strong {
    color: var(--ws-gold-light);
    font-weight: 500;
}

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

@keyframes wsScaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 900px) {
    .ws-bg {
        --ws-cell-size: 36px;
        --ws-letter-size: 17px;
    }

    .ws-layout { gap: 20px; }
    .ws-grid-wrapper { padding: 18px 20px; border-radius: 18px; }
    .ws-side { min-width: 210px; }
}

@media (max-width: 700px) {
    .ws-bg {
        --ws-cell-size: 30px;
        --ws-letter-size: 15px;
    }

    /* Karte unter das Gitter, sonst wird beides zu schmal */
    .ws-layout { flex-direction: column; align-items: center; }
    .ws-side { max-width: none; width: 100%; }
    .ws-grid-wrapper { padding: 14px 16px; }
    .ws-win-card { padding: 24px 30px; }
    .ws-win-title { font-size: 22px; }
}
