.discovery-tools [hidden] { display: none !important; }
.discovery-tools form > label { display: block; margin: .8rem 0 .2rem; font-weight: 700; }
.discovery-tools form > select,
.discovery-tools textarea {
    display: block;
    width: 100%;
    max-width: 48rem;
    border: 1px solid #aab9d0;
    border-radius: .45rem;
    background: #fff;
    color: #172740;
    padding: .65rem .75rem;
    font: inherit;
}
.discovery-tools textarea { resize: vertical; }
.discovery-tools form > select { width: min(100%, 25rem); }
.discovery-tools #crossword-help { margin: 0 0 .45rem; }
.discovery-tools kbd { font: inherit; font-weight: 600; }
.discovery-tools :focus-visible { outline: 3px solid #1d56d7; outline-offset: 2px; }
.crossword-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.crossword-board-wrap { container-type: inline-size; overflow: auto; padding: .25rem .375rem .5rem; }
.crossword-board {
    --cell: clamp(1.65rem, calc(100cqi / var(--columns)), 2.45rem);
    display: grid;
    grid-template-columns: repeat(var(--columns), var(--cell));
    width: max-content;
}
.crossword-cell { position: relative; width: var(--cell); height: var(--cell); }
.crossword-active {
    box-shadow: inset 0 0 0 1px #586887;
    background: #fff;
}
.crossword-active input {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: .35rem 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #172740;
    text-align: center;
    font: 700 1rem/1 system-ui, sans-serif;
}
.crossword-active input:focus {
    z-index: 1;
    background: #e7efff;
    outline: 2px solid #1d56d7;
    outline-offset: -2px;
}
.crossword-active span {
    pointer-events: none;
    position: absolute;
    z-index: 2;
    top: .12rem;
    left: .2rem;
    color: #344367;
    font-size: .56rem;
    line-height: 1;
}
.crossword-wrong { background: #ffe5e5; box-shadow: inset 0 0 0 2px #b52323; }
.crossword-wrong input { color: #9f1e1e; }
#crossword-clues ol { margin: .4rem 0 1rem; padding-inline-start: 1.45rem; }
#crossword-clues h3 { margin: 0; color: #233a63; font-size: 1.05rem; }
#crossword-clues li { padding-inline-start: .2rem; margin-bottom: .35rem; }
#crossword-clues button {
    border: 0;
    padding: 0;
    background: none;
    color: #234a9f;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: .13em;
    font: inherit;
    cursor: pointer;
}
#crossword-feedback, #moon-feedback { font-weight: 700; }
#crossword-feedback:empty, #moon-feedback:empty { display: none; }

.moon-views {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: .75rem;
}
.moon-figure {
    min-width: 0;
    min-height: 14rem;
    margin: 0;
    padding: .8rem .65rem;
    border-radius: .7rem;
    background: #151f38;
    color: #f3f6ff;
    text-align: center;
}
.moon-figure figcaption { font-weight: 700; line-height: 1.35; }
.moon-figure svg { display: block; width: 100%; margin: .3rem auto 0; }
.moon-figure svg text { fill: #f3f6ff; font-size: 13px; font-weight: 600; }
.lunar-orbit { max-width: 400px; }
.lunar-disc { max-width: 172px; }
#moon-name { margin: .1rem 0; color: #fff6d4; font-size: 1.05rem; font-weight: 750; }
#moon-fraction, #moon-hidden { margin: .15rem 0; color: #dae3f6; }
#moon-hidden { padding: 2.5rem .4rem; }
#moon-explore, #moon-quiz { margin-top: 1rem; }
#moon-explore label { font-weight: 700; }
#moon-day-label { margin-inline-start: .5rem; color: #344d78; }
#moon-day { display: block; width: 100%; margin: .45rem 0 .8rem; accent-color: #1d56d7; }
.moon-shortcuts { display: flex; gap: .4rem; flex-wrap: wrap; }
.moon-shortcut {
    border: 1px solid #9caed0;
    border-radius: .4rem;
    padding: .35rem .55rem;
    background: #fff;
    color: #223a67;
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
}
.moon-shortcut[aria-pressed="true"] { color: #fff; background: #244ca1; border-color: #244ca1; }
#moon-explain { margin: .85rem 0; }

@media (max-width: 740px) {
    .crossword-layout { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
}
@media (max-width: 530px) {
    .moon-views { grid-template-columns: minmax(0, 1fr); }
    .moon-figure { min-height: auto; }
    .lunar-orbit { max-width: 265px; }
    .lunar-disc { max-width: 118px; }
}

