.ths-public-wrap { max-width: 620px; }
.ths-public-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid #111; margin-bottom: 14px; padding-bottom: 9px; }
.ths-public-header h2 { margin: 0 0 4px; }
.ths-public-header p { margin: 0; }
.ths-reference { margin-left: 12px; }
.ths-filled { white-space: nowrap; }
.ths-rules { margin: 12px 0 16px; }

/* Do not change: this is the proven crossword-style visible-grid construction. */
.ths-sudoko-grid {
    --ths-cell: min(9.8vw, 54px);
    display: grid;
    grid-template-columns: repeat(9, var(--ths-cell));
    width: max-content;
    max-width: 100%;
    border-top: 3px solid #111;
    border-left: 3px solid #111;
    background: #fff;
    user-select: none;
}
.ths-cell {
    position: relative;
    width: var(--ths-cell);
    height: var(--ths-cell);
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-right: 1px solid #111;
    border-bottom: 1px solid #111;
    background: #fff;
    cursor: pointer;
    font: inherit;
}
.ths-cell:nth-child(9n + 3), .ths-cell:nth-child(9n + 6), .ths-cell:nth-child(9n) { border-right-width: 3px; }
.ths-cell:nth-child(n + 19):nth-child(-n + 27), .ths-cell:nth-child(n + 46):nth-child(-n + 54), .ths-cell:nth-child(n + 73):nth-child(-n + 81) { border-bottom-width: 3px; }
.ths-cell:focus { outline: 3px solid #2271b1; outline-offset: -3px; z-index: 2; }
.ths-cell.is-given { cursor: default; background: #f5f5f5; }
.ths-cell-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--ths-cell) * .52); line-height: 1; font-weight: 500; color: #111; pointer-events: none; }
.ths-cell.is-given .ths-cell-value { font-weight: 800; }
.ths-public-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ths-public-actions button { padding: 8px 14px; }
.ths-message { min-height: 1.5em; margin-top: 10px; }

/* =========================================================
   PUZZLERS PAGE COMPACT PLAYER
   Applies only to [thames_sudoko_1] / [thames_sudoko_2].
   The normal standalone Sudoko player remains unchanged.
   ========================================================= */
.ths-puzzler-slot {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.ths-puzzler-slot .ths-public-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
}

.ths-puzzler-slot .ths-public-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 3px;
    margin: 0 0 3px;
    padding: 0 0 2px;
    border-bottom: 1px solid #333;
}

.ths-puzzler-slot .ths-public-header h2 {
    margin: 0 0 1px !important;
    padding: 0 !important;
    color: #111 !important;
    font: 700 6.2px/1.05 Arial, Helvetica, sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
}

.ths-puzzler-slot .ths-public-header p {
    margin: 0 !important;
    padding: 0 !important;
    font: 400 4.8px/1.05 Arial, Helvetica, sans-serif !important;
    white-space: normal;
}

.ths-puzzler-slot .ths-public-header p strong {
    font-weight: 700;
}

.ths-puzzler-slot .ths-reference {
    display: block;
    margin: 1px 0 0 !important;
    font-size: 4.1px !important;
    line-height: 1 !important;
    white-space: nowrap;
}

.ths-puzzler-slot .ths-filled {
    align-self: end;
    margin: 0;
    font: 700 4.7px/1 Arial, Helvetica, sans-serif !important;
    white-space: nowrap;
}

.ths-puzzler-slot .ths-rules {
    margin: 0 0 3px !important;
    padding: 0 !important;
    font: 400 4.45px/1.08 Arial, Helvetica, sans-serif !important;
}

/* Preserve the accepted 81-cell border construction, but make the
   cells fluid inside the fixed newspaper column instead of 54px each. */
.ths-puzzler-slot .ths-sudoko-grid {
    --ths-cell: auto;
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    border-top-width: 2px;
    border-left-width: 2px;
}

.ths-puzzler-slot .ths-cell {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-right-width: .55px;
    border-bottom-width: .55px;
}

.ths-puzzler-slot .ths-cell:nth-child(9n + 3),
.ths-puzzler-slot .ths-cell:nth-child(9n + 6),
.ths-puzzler-slot .ths-cell:nth-child(9n) {
    border-right-width: 2px;
}

.ths-puzzler-slot .ths-cell:nth-child(n + 19):nth-child(-n + 27),
.ths-puzzler-slot .ths-cell:nth-child(n + 46):nth-child(-n + 54),
.ths-puzzler-slot .ths-cell:nth-child(n + 73):nth-child(-n + 81) {
    border-bottom-width: 2px;
}

.ths-puzzler-slot .ths-cell-value {
    font-size: clamp(8px, 1.45vw, 13px);
    line-height: 1;
}

.ths-puzzler-slot .ths-cell:focus {
    outline-width: 2px;
    outline-offset: -2px;
}

.ths-puzzler-slot .ths-public-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    margin: 3px 0 0;
}

.ths-puzzler-slot .ths-public-actions button {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 2px 3px;
    font: 700 4.7px/1 Arial, Helvetica, sans-serif;
    white-space: nowrap;
}

.ths-puzzler-slot .ths-message {
    min-height: 7px;
    margin: 2px 0 0;
    font: 400 4.5px/1.05 Arial, Helvetica, sans-serif;
}


/* v0.5.5: reclaim the unused space above the compact Puzzlers-page player.
   Scoped to Sudoku 1/2 only; standalone players and the grid are unchanged. */
.ths-puzzler-slot {
    margin-top: -12px;
}
