/* Seed solver page: additions to the Alt Calculator styles */

body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* World: seed with Random button, World size / Resources as segmented buttons */
.field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);     /* let the seed row shrink to the field width */
    gap: 6px;
    width: var(--btn-w);
    max-width: calc(100vw - 32px);
    margin-bottom: 12px;
}

.field-label {
    font-size: 20px;
    color: #bbb;
}

.seed-row {
    display: flex;
    gap: 6px;
    min-width: 0;
}

/* a code font: I l 1 and 0 O o look different */
.seed-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    height: var(--btn-h);
    padding: 0 12px;
    font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Cascadia Mono", "DejaVu Sans Mono", "Liberation Mono", monospace;
    font-size: 22px;
    letter-spacing: 0.06em;
}

.seed-input::placeholder {
    font-family: inherit;
    letter-spacing: 0;
    color: #888;
}

.seed-random-btn {
    flex: none;
    height: var(--btn-h);
    padding: 0 14px;
    font-size: 20px;
}

.seed-random-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.seg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    box-sizing: border-box;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.seg label {
    position: relative;
}

.seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg span {
    display: block;
    height: calc(var(--btn-h) - 4px);
    line-height: calc(var(--btn-h) - 4px);
    text-align: center;
    font-size: 20px;
    background-color: var(--bg);
    border-left: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.seg label:first-child span {
    border-left: 0;
}

/* outer corners follow the rounded frame (its radius minus its 2px border), so the selected outline is rounded too */
.seg label:first-child span {
    border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
}

.seg label:last-child span {
    border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0;
}

.seg span:hover {
    background-color: var(--panel-hover);
}

/* same look as the active Steam / iOS button */
.seg input:checked + span {
    background-color: var(--panel);
    box-shadow: inset 0 0 0 2px #dcdcdc;
}

.seg input:focus-visible + span {
    outline: 2px solid #dcdcdc;
    outline-offset: -5px;
}

.seg input:disabled + span {
    opacity: 0.5;
    cursor: default;
}

.input-container .input-row {
    margin-bottom: 6px;
}

.version-block {
    flex-wrap: nowrap;
}

.version-btn {
    font-size: 20px;
}

.version-btn.active,
.button.active {
    border-color: #dcdcdc;
    background-color: var(--panel);
}

.stop-button {
    color: var(--warn);
}

.link-button {
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    line-height: calc(var(--btn-h) - 4px);
}

.status {
    width: var(--btn-w);
    margin-top: 6px;
}

.stat-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 14px;
    row-gap: 2px;
    margin: 8px 0;
    font-size: 20px;
}

.stat-label {
    color: #bbb;
}

.stat-value {
    font-variant-numeric: tabular-nums;
}

.result-score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    font-size: var(--font-size);
}

/* no text selection, long-press menu or tap flash on the map and its buttons (double taps while navigating) */
#map_block,
.map-wrap,
#map_canvas {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.map-btn {
    touch-action: manipulation;     /* no double-tap zoom on the + / - buttons */
}

.map-wrap {
    position: relative;
    width: min(calc(100vw - 32px), 720px);
    aspect-ratio: 1 / 1;
    margin: 8px 0;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #5678b8;
}

#map_canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

#map_canvas:active {
    cursor: grabbing;
}

.map-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    background-color: rgba(30, 30, 30, 0.85);
}

.legend {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    column-gap: 18px;
    row-gap: 4px;
    font-size: 18px;
    color: #ddd;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend i {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.small-print {
    font-size: 16px;
}

.small-print a {
    color: #9cdcfe;
}

.bottom-space {
    height: 120px;
}

.item-boosts th {
    text-align: left;
    font-size: 18px;
    color: #bbb;
    font-weight: normal;
}

.item-boosts td {
    font-size: 20px;
}

.mobile-note {
    display: none;
    font-size: 16px;
}

@media (hover: none) and (pointer: coarse) {
    .mobile-note {
        display: block;
    }
}

/* narrow phones: keep everything inside the screen */
@media (max-width: 400px) {
    :root {
        --btn-w: calc(100vw - 32px);
        --font-size: 21px;
    }
    .version-btn,
    .seg span,
    .seed-random-btn {
        font-size: 17px;
    }
    .item-boosts th,
    .item-boosts td {
        padding: 3px 5px;
    }
}

.color-red {
    color: var(--warn);
}

.import-example {
    margin: 6px 0;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre;
    overflow-x: auto;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.blp-box {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 14px;
    row-gap: 2px;
    align-items: baseline;
    width: var(--btn-w);
    max-width: calc(100vw - 32px);
    margin: 4px 0 8px;
    font-size: 20px;
}

.blp-id {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 22px;
    user-select: all;
}

.blp-link {
    grid-column: 1 / -1;
    font-size: 16px;
    color: #9cdcfe;
    overflow-wrap: anywhere;
}

.partial-note {
    width: var(--btn-w);
    max-width: calc(100vw - 32px);
    margin: 4px 0 0;
    font-size: 20px;
    color: #dcdcaa;
}

/* same look as before: the site's p style would make it white and 24px */
.partial-note .partial-none {
    margin: 0;
    font-size: 20px;
    color: #dcdcaa;
}

.partial-table .goto-cell {
    padding-left: 10px;
}

.partial-goto-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 16px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.partial-table {
    margin: 4px 0 6px;
}

.partial-table td {
    color: #dcdcaa;
}

/* map: "Looking at" label and "Go to" */
.map-hud {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 8px;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background-color: rgba(30, 30, 30, 0.85);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.goto-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: var(--btn-w);
    max-width: calc(100vw - 32px);
    margin-bottom: 8px;
}

.goto-label {
    font-size: 20px;
    color: #bbb;
    flex: none;
}

.coord-input {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    height: var(--btn-h);
    padding: 0 10px;
    font-variant-numeric: tabular-nums;
}

.input-bad {
    border-color: var(--warn);
}

.goto-btn {
    flex: none;
    height: var(--btn-h);
    padding: 0 16px;
    font-size: 20px;
}

.goto-row-link {
    cursor: pointer;
}

.goto-row-link:hover td {
    background-color: var(--panel-hover);
}

/* while solving: everything that cannot be changed looks like World size / Resources (half transparent) */
.button:disabled,
.input:disabled,
.mp-input-field:disabled,
.mp-input-btn:disabled,
.check-label-container.is-disabled {
    opacity: 0.5;
    cursor: default;
}

.button:disabled:hover,
.mp-input-btn:disabled:hover,
.input:disabled:hover {
    background-color: var(--bg);
}

.check-label-container.is-disabled,
.check-label-container.is-disabled .checkmark,
.fake-select.is-disabled .selected {
    pointer-events: none;
}

/* the extractor tier icon next to its locked input */
.input-row:has(.mp-input-field:disabled) .input-icon {
    opacity: 0.5;
}


.title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-logo {
    width: 1.2em;            /* scales with the title text, also on phones */
    height: 1.2em;
    flex: none;
    border-radius: 18%;      /* soft corners, like an app icon */
}

/* Extractor boost table: more compact, so all columns fit on a phone */
#boost_table {
    margin-bottom: 8px;
}

#boost_table th {
    font-size: 15px;
}

#boost_table td {
    font-size: 18px;
    padding-top: 1px;
    padding-bottom: 1px;
}

#boost_table .item-img {
    width: 24px;
    height: 24px;
    display: block;
}

/* Deposits: one row of 7 tiles (icon with its count underneath), as wide as the buttons */
#deposit_table,
#deposit_table tbody {
    display: block;
    width: var(--btn-w);
}

#deposit_table tr {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

#deposit_table caption {
    display: block;
    margin-bottom: 6px;
    text-align: left;
    font-size: 18px;
    color: #bbb;
}

#deposit_table td.deposit-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    font-size: 16px;
    background-color: var(--panel);
    border-radius: var(--radius-sm);
}

#deposit_table .deposit-none {
    opacity: 0.4;
}
