/* ========================================================================
   WORTSUCHSPIEL (Word Search) - Dark Paper Theme with Gold Accent
   ======================================================================== */

:root {
    --ws-bg: #1a1914;
    --ws-bg-light: #2a2820;
    --ws-cell-size: 36px;
    --ws-cell-bg: var(--kendo-color-surface-alt, #f5f0e8);
    --ws-cell-text: var(--kendo-color-on-base, #212529);
    --ws-gold: #d4af37;
    --ws-gold-light: #e8c86e;
}

/* Background */
.ws-bg {
    background: radial-gradient(ellipse at center, var(--ws-bg-light) 0%, var(--ws-bg) 100%);
}

/* Layout: grid + word list side by side */
.ws-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* --- Grid --- */
.ws-grid-wrapper {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.ws-grid {
    display: grid;
    gap: 2px;
}

.ws-cell {
    width: var(--ws-cell-size);
    height: var(--ws-cell-size);
    background: var(--ws-cell-bg);
    color: var(--ws-cell-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    position: relative;
}

.ws-cell:hover {
    background: var(--kendo-color-base-hover, #e8e0d0);
    transform: scale(1.05);
    z-index: 2;
}

.ws-cell.ws-selected {
    background: var(--ws-gold) !important;
    color: #fff !important;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    transform: scale(1.1);
    z-index: 3;
}

.ws-cell.ws-found {
    border-radius: 4px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2);
}

.ws-letter {
    font-family: var(--kendo-font-family, 'Consolas', 'Courier New', monospace);
    font-size: var(--kendo-font-size, 16px);
    font-weight: 700;
    color: inherit;
    line-height: 1;
    pointer-events: none;
}

/* --- Word List --- */
.ws-word-list {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 160px;
    backdrop-filter: blur(4px);
}

.ws-word-list-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ws-gold-light);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.ws-word-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    color: #ffffff;
    transition: opacity 0.3s ease;
}

.ws-word-item.ws-word-found {
    opacity: 0.6;
}

.ws-word-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ws-word-text {
    font-weight: 500;
    letter-spacing: 1px;
}

.ws-strikethrough {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

/* --- Category Group --- */
.ws-category-group {
    display: flex;
    gap: 3px;
}

/* --- Win Overlay --- */
.ws-win-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20000;
    animation: wsFadeIn 0.5s ease;
    backdrop-filter: blur(6px);
}

.ws-win-card {
    background: linear-gradient(135deg, var(--ws-bg-light) 0%, var(--ws-bg) 100%);
    border: 3px solid var(--ws-gold);
    border-radius: var(--kendo-border-radius-md, 16px);
    padding: 40px 60px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 0 60px rgba(212, 175, 55, 0.3);
    animation: wsScaleIn 0.5s ease 0.2s both;
}

.ws-win-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--ws-gold-light);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.ws-win-stats {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.8;
}

.ws-win-stats strong {
    color: var(--ws-gold-light);
}

@keyframes wsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wsScaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --ws-cell-size: 28px;
    }

    .ws-layout {
        flex-direction: column;
        align-items: center;
    }

    .ws-word-list {
        min-width: unset;
        width: 100%;
        max-width: 400px;
    }

    .ws-letter { font-size: 13px; }
    .ws-win-card { padding: 24px 32px; }
    .ws-win-title { font-size: 24px; }
}

@media (max-width: 480px) {
    :root {
        --ws-cell-size: 22px;
    }
    .ws-letter { font-size: 11px; }
}
