:root {
    --primary-color: #e91e63;
    --secondary-color: #fce4ec;
    --accent-color: #880e4f;
    --grid-bg: #fff;
    --cell-size: 30px;
    --border-color: #333;
}

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Georgia', serif;
    font-display: swap;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #f7eff0;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #640106;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    border-bottom: 5px solid #f14951;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.container {
    width: 95%;
    max-width: 1140px;
    margin: 30px auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #640106;
    text-align: center;
}

.reading-info {
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #777;
}

/* Puzzle Container */
.puzzle-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    gap: 1px;
    background-color: var(--border-color);
    border: 2px solid var(--border-color);
}

.cell {
    background-color: var(--border-color);
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell.active {
    background-color: var(--grid-bg);
    cursor: text;
}

.cell.active:focus-within {
    background-color: #fff9c4;
}

.cell.correct {
    background-color: #c8e6c9 !important;
}

.cell.wrong {
    background-color: #ffcdd2 !important;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    background: transparent;
    outline: none;
    padding: 0;
    margin: 0;
    color: var(--border-color);
}

.cell .number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 9px;
    font-weight: bold;
    color: var(--border-color);
    pointer-events: none;
}

/* Clues */
.clues-container {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 0px rgba(0,0,0,0.1);
    margin-top: 20px;
}

h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    color: var(--accent-color);
}

.clue-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

.clue-item {
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.clue-item:hover {
    background-color: var(--secondary-color);
}

.clue-item.highlighted {
    background-color: #ffe0b2;
    font-weight: bold;
}

/* Controls */
.controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    flex: 1;
    min-width: 120px;
}

.btn-check { background-color: var(--primary-color); color: white; }
.btn-reset { background-color: #607d8b; color: white; }

/* Message Box */
.message-box {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.message-success { background-color: #dcedc8; color: #33691e; }
.message-error { background-color: #ffcdd2; color: #b71c1c; }

/* Social Share Buttons */
.share-section {
    margin-top: 30px;
    text-align: center;
}

.share-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.facebook { background:#1877f2; }
.twitter { background:#000000; }
.linkedin { background:#0077b5; }
.whatsapp { background:#25d366; }
.pinterest { background:#bd081c; }
.email { background:#607d8b; }
.best-score { background: var(--primary-color); }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .puzzle-container {
        width: 100%;
        padding: 15px;
    }

    .clues-container {
        width: 100%;
        max-width: 100%;
    }

    .controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    button {
        width: 100%;
        font-size: 13px;
        padding: 12px 0;
    }

    h1 {
        font-size: 22px;
    }

    .logo-text {
        font-size: 20px;
    }

    .clue-item {
        font-size: 13px;
    }

    .cell input {
        font-size: 14px;
    }
}

/* Crossword page header styling — match main site header */
.crossword-header-title .site-title {
    color: #cc0000; /* Same strong red theme color */
    text-align: center;
    margin: 0;
    font-size: 2.5rem; /* Matches site header size */
    font-weight: bold;
}

.crossword-header-title .site-description {
    color: #cc0000 !important;
    opacity: 1 !important;
    text-align: center;
    margin-top: 5px;
    font-size: 1rem; /* Matches site subtitle font size */
}

/* Post Content Paragraphs */
.container p {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

/* WordPress Content Headings */
.container h2,
.container h3,
.container h4 {
    color: var(--accent-color);
    margin-top: 24px;
    margin-bottom: 10px;
    font-weight: bold;
}

.container h2 {
    font-size: 22px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 6px;
}

.container h4 {
    font-size: 16px;
}

/* Accordion / Details */
.container details {
    margin: 15px 0;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.container summary {
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    color: var(--primary-color);
}

.container details[open] {
    background: #fce4ec;
}

.container details p {
    margin-top: 10px;
}