/* (c) 2025 Kenny Young
 * This code is licensed under the MIT License.
 * https://github.com/tabascq/PuzzleJS
 */
.puzzle-entry {
    display: grid;
    gap: 10px;

    /* Make background colors print faithfully. */
   -webkit-print-color-adjust: exact;
   -moz-print-color-adjust: exact;
   -ms-print-color-adjust: exact;
   print-color-adjust: exact;
}

.puzzle-entry:not(.loaded) {
    display: none !important;
}

.puzzle-entry-content {
    display: flex;
    gap: 20px;
    flex-flow: row wrap;
    justify-content: center;
    margin: 0px auto;
}

.puzzle-entry .no-input * {
    cursor: default !important;
}

.puzzle-entry table {
    border-collapse: collapse;
    break-inside: avoid;
    display: inline-block;
    position: relative;
    user-select: none;
}

:root {
    --puzzle-cell-size: 40px;
    --puzzle-dot-size: 20px;
}

.puzzle-entry .puzzle-grid > tr {
    display: block;
    height: var(--puzzle-cell-size);
}

.puzzle-entry td {
    width: var(--puzzle-cell-size);
    height: var(--puzzle-cell-size);
    padding: 0px;
    position: relative;
    background: transparent;
    text-align: center;
    font-size: calc(var(--puzzle-cell-size) * 0.8);
    font-weight: bold;
    font-family: monospace;
    border: none;
    color: black;
    text-shadow: -2px -2px 0 #fff, 0 -2px 0 #fff, 2px -2px 0 #fff, 2px 0 0 #fff, 2px 2px 0 #fff, 0 2px 0 #fff, -2px 2px 0 #fff, -2px 0 0 #fff;
    user-select: none;
    cursor: pointer;
    text-transform: uppercase;
    caret-color: transparent;
    touch-action: pinch-zoom;
}

.puzzle-entry .text {
    z-index: 2;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.puzzle-entry .pos-avoid-top .text {
    padding-top: 20%;
    height: 80%;
}

.puzzle-entry .pos-avoid-bottom .text {
    padding-bottom: 25%;
    height: 75%;
}

.puzzle-entry .cell:focus {
    outline: none;
}

.puzzle-entry .cell:focus .text {
    box-shadow: 0px 0px 3px 3px -webkit-focus-ring-color;
    box-shadow: 0px 0px 3px 3px Highlight;
}

.puzzle-entry.advance-horizontal .cell:focus .text {
    box-shadow: 0px 0px 3px 3px -webkit-focus-ring-color, calc(-5px - var(--puzzle-cell-size)/2) 0 2px calc(2px - var(--puzzle-cell-size)/2) -webkit-focus-ring-color, calc(5px + var(--puzzle-cell-size)/2) 0 2px calc(2px - var(--puzzle-cell-size)/2) -webkit-focus-ring-color;
    box-shadow: 0px 0px 3px 3px Highlight, calc(-5px - var(--puzzle-cell-size)/2) 0 2px calc(2px - var(--puzzle-cell-size)/2) Highlight, calc(5px + var(--puzzle-cell-size)/2) 0 2px calc(2px - var(--puzzle-cell-size)/2) Highlight;
}

.puzzle-entry.advance-vertical .cell:focus .text {
    box-shadow: 0px 0px 3px 3px -webkit-focus-ring-color, 0 calc(-5px - var(--puzzle-cell-size)/2) 2px calc(2px - var(--puzzle-cell-size)/2) -webkit-focus-ring-color, 0 calc(5px + var(--puzzle-cell-size)/2) 2px calc(2px - var(--puzzle-cell-size)/2) -webkit-focus-ring-color;
    box-shadow: 0px 0px 3px 3px Highlight, 0 calc(-5px - var(--puzzle-cell-size)/2) 2px calc(2px - var(--puzzle-cell-size)/2) Highlight, 0 calc(5px + var(--puzzle-cell-size)/2) 2px calc(2px - var(--puzzle-cell-size)/2) Highlight;
}

.puzzle-entry .corner-focus {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    pointer-events: none;
    background: none;
    border: 0px solid black;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.puzzle-entry .corner-focus.x-mode::after {
    content: "\2573";
    position: absolute;
    user-select: none;
    pointer-events: none;
    color: white;
    top: 50%;
    left: 50%;
    font-size: 8px;
    font-weight: bold;
    transform: translate(-50%, -50%);
}

.puzzle-entry .corner-focus:focus {
    box-shadow: 0px 0px 3px 3px Highlight;
    box-shadow: 0px 0px 3px 3px -webkit-focus-ring-color;
}

.puzzle-entry .interesting::after {
    content: "";
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    transform: translate(-50%, -50%);
    border-radius: 100px;
    border: 2px solid red;
}

.puzzle-entry .nopointer {
    pointer-events: none;
}

.puzzle-entry .cell > svg {
    z-index: 1;
}

.puzzle-entry td.unselectable {
    cursor: default;
    border: none;
    pointer-events: none;
}

.puzzle-entry td.top-clue, .puzzle-entry td.bottom-clue, .puzzle-entry td.left-clue, .puzzle-entry td.right-clue {
    border: none;
}

.puzzle-entry .link-label, .puzzle-entry .extract-label, .puzzle-entry .clue-label {
    position: absolute;
    font-size: calc(var(--puzzle-cell-size) * 0.3);
    text-shadow: none;
    color: black;
    font-weight: normal;
    font-family: sans-serif;
    text-transform: none;
}

.puzzle-entry .pos-top-left {
    top: 1px;
    left: 2px;
    z-index: 3;
    text-align: left;
}

.puzzle-entry .pos-top-right {
    top: 1px;
    right: 2px;
    z-index: 4;
    text-align: right;
}

.puzzle-entry .pos-bottom-left {
    bottom: 1px;
    left: 2px;
    z-index: 5;
    text-align: left;
}

.puzzle-entry .pos-bottom-right {
    bottom: 1px;
    right: 2px;
    z-index: 6;
    text-align: right;
}

.puzzle-entry .pos-top {
    top: 1px;
    left: 0;
    z-index: 7;
    width: 100%;
    text-align: center;
}

.puzzle-entry .pos-bottom {
    bottom: 1px;
    left: 0;
    z-index: 8;
    width: 100%;
    text-align: center;
}

.puzzle-entry .small-text {
    font-size: calc(var(--puzzle-cell-size) * 0.3);
}

.puzzle-entry td.extract {
    background-color: yellow;
}

.puzzle-entry td.marked {
    background-color: lightblue;
}

.puzzle-entry td.hovered {
    background-color: lightblue;
}

.puzzle-entry td.strikethrough {
    text-decoration: line-through;
}

.puzzle-entry td.black-cell {
    background-color: black;
    box-shadow: inset 50px 50px black; /* Make black box print when background graphics are off. */
}

.crossword-clues {
    display: inline-block;
    vertical-align: top;
    margin-block-start: 0;
    margin-block-end: 0;
}
.crossword-clues li.strikethrough {
    text-decoration: line-through;
}
.crossword-clues li:hover, .crossword-clues li.marked, .crossword-clues li:hover::before, .crossword-clues li.marked::before {
    background-color: lightblue;
}

.puzzle-entry .cell > svg {
    position: absolute;
    left: -25%;
    top: -25%;
    width: 150%;
    height: 150%;
}

.puzzle-entry use {
    fill: black;
    stroke: black;
}

.puzzle-entry .reticle-back {
    stroke-width: 2px;
    stroke: blue;
}

.puzzle-entry .reticle-front {
    stroke-width: 1px;
    stroke: lightblue;
}

.puzzle-toggle-item {
    cursor: pointer;
    user-select: none;
}

.puzzle-toggle-item:hover {
    background: #8080803f;
}

.puzzle-toggle-item.toggled {
    text-decoration: line-through;
    opacity: 0.6;
}

.puzzle-dot-zone {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: stretch;
    user-select: none;
}

.puzzle-dot-list-center {
    position: relative;
}

.puzzle-dot {
    position: absolute;
    margin-left: calc(var(--puzzle-dot-size) * -0.5);
    margin-top: calc(var(--puzzle-dot-size) * -0.5);
    width: var(--puzzle-dot-size);
    height: var(--puzzle-dot-size);
    background-color: black;
    border-radius: var(--puzzle-dot-size);
    border: calc(var(--puzzle-dot-size)/5) solid black;
    padding: 0px;
    z-index: 1;
}

.puzzle-dot:focus {
    box-shadow: 0px 0px 3px 3px Highlight;
}

.puzzle-dot:hover, .puzzle-dot:focus {
    background-color: #cccccc;
}

.puzzle-dot.anchor-dot {
    background-color: white;
}

.puzzle-dot::after {
    content: attr(data-dot-label);
    position: absolute;
    top: 100%;
    left: 100%;
}

.puzzle-dot-list {
    margin: 0 var(--puzzle-dot-size);
    display: grid;
    align-items: center;
    justify-content: stretch;
}

.puzzle-dot-line-layer {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
}

.puzzle-dot-line-layer line {
    stroke: black;
    stroke-width: 2;
    cursor: pointer;
}

.puzzle-dot-line-layer line.provisional {
    stroke-dasharray: 10 10;
}

.commands {
    margin: 0px auto;
}

.puzzle-commands {
    display: flex;
    justify-content: center;
}

.puzzle-about-back {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: #00000080;
}

.puzzle-about {
    position: fixed;
    max-width: 75vw;
    max-height: 75vh;
    left: 50%;
    top: 50%;
    z-index: 1001;
    padding: 20px;
    background: white;
    border: 2px solid black;
    font-family: Arial, Helvetica, sans-serif;
    transform: translate(-50%, -50%);
}

.puzzle-about-close {
    position: absolute;
    right: 20px;
    bottom: 15px;
}

.puzzle-about-credits {
    margin: 0px auto;
    margin-top: 20px;
    text-align: center;
}

.puzzle-about-savedstate {
    margin: 0px auto;
    text-align: center;
}

.puzzle-about-scroller {
    overflow-y: auto;
    max-height: calc(75vh - 30px);
}

.puzzle-entry .puzzle-about td {
    font-size: 16px;
    padding: 10px;
    width: unset;
    height: unset;
    text-transform: none;
    font-weight: normal;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid gray;
}

.puzzle-entry .puzzle-about th {
    font-size: 16px;
    padding: 10px;
    width: unset;
    height: unset;
    text-transform: none;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}

@media print {
    .puzzle-commands {
        display: none;
    }
}
