        /* Basic styles for skeleton */
        :root {
            --cell-size: 30px;
        }
        body {
            font-family: sans-serif;
            margin: 2rem;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: clamp(0.5rem, 3vw, 2rem);
            background-color: #eef6ff; /* pastel blue background */
        }

        #grid {
            display: grid;
            gap: 1px; /* thin grid lines */
            border: 1px solid #000;
            position: relative;
            background-color: #000; /* lines rendered via grid background */
        }

        .cell {
            width: var(--cell-size);
            height: var(--cell-size);
            background-color: #fff;
            border: none;
            text-align: center;
            vertical-align: middle;
            font-size: calc(var(--cell-size) * 0.6);
            line-height: var(--cell-size);
            cursor: pointer;
            position: relative;
            /* avoid double events on mobile; allow text selection */
            touch-action: manipulation;
            user-select: text;
            caret-color: transparent;
        }

        .cell.selected {
            outline: 2px solid #333;
            background-color: #e6f0ff; /* faint blue */
        }

        .cell.highlight {
            background-color: #e0f7ff;
        }

.cell .num {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: calc(var(--cell-size) * 0.3);
    line-height: calc(var(--cell-size) * 0.3);
    pointer-events: none;
    user-select: none;
}

.cell .letter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 1em;
}

        /* Button styling */
        button {
            background-color: #e6eaff;
            border: 1px solid #888;
            border-radius: 4px;
            padding: 0.4em 0.8em;
            margin-bottom: 0.5em;
            cursor: pointer;
        }
        button:hover {
            background-color: #d4d8ff;
        }

        .block {
            background-color: #000;
        }


        /* Clue list styling */
        #clues ul {
            list-style: none;
            padding-left: 0;
            margin: 0;
        }

        .clue-num {
            font-weight: bold;
            margin-right: 0.4em;
            display: inline-block;
            width: 1.3em;
            text-align: left; /* left justify numbers */
        }

        #clues li {
            margin-bottom: 1em; /* spacing between clues */
        }

        #clues li.highlight {
            background-color: #fff4a3;
        }

        /* Faded style for solved clues */
        #clues li.complete {
            opacity: 0.5;
            text-decoration: line-through;
            text-decoration-color: #666;
        }

        #controls {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        #button-container {
            display: grid;
            grid-template-columns: repeat(2, auto);
            gap: 0.5em;
            margin-bottom: 1em;
        }

        .active-clue {
            font-size: 0.8em;
            text-align: center;
            margin: 0.25em 0;
        }

        #active-clue-bottom {
            margin-bottom: clamp(0.5rem, 3vw, 1rem);
        }


        #confirm-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        #confirm-box {
            background-color: #fff;
            padding: 1em;
            border-radius: 8px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            text-align: center;
        }

        #confirm-box p {
            margin-bottom: 1em;
        }

        #show-puzzles {
            margin-top: 1em;
            align-self: flex-start;
            width: auto;
        }

        #puzzle-list {
            margin-top: 1em;
            display: none;
            width: 100%;
        }

        #puzzle-links {
            list-style: none;
            padding-left: 0;
            margin: 0;
            display: flex;
            gap: 0.5em;
        }

        #puzzle-links a {
            text-decoration: none;
            padding: 0.2em 0.5em;
            background-color: #e6eaff;
            border: 1px solid #888;
            border-radius: 4px;
        }

        #puzzle-links a:hover {
            background-color: #d4d8ff;
        }

        .puzzle-meta {
            font-size: 0.8em;
            color: #444;
            margin-top: 0.5em;
        }



        #clues {
            display: flex;
            gap: clamp(0.5rem, 2vw, 2rem);
            max-width: 600px;
        }

        .clue-group {
            margin-bottom: 1em;
            flex: 1;
        }


        @media (max-width: 600px) {
            body {
                flex-direction: column;
                margin: 1rem;
                align-items: flex-start;
            }
            #clues {
                flex-direction: column;
                max-width: none;
            }
            #grid {
                margin-bottom: 0; /* margin handled by bottom clue */
            }
        }

