/* guess.css — the "which country is this?" field and its tally, wherever the
   widget is put. The page around it decides where it sits; this is only the
   parts that are the same on the home page and on a photo's own page. */

.guess-fields {
    display: flex;
    gap: 0.5rem;
}

.guess-combo {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

/* 16px, or a phone zooms the page in when the field takes focus. */
.guess-form input[type="text"] {
    display: block;
    width: 100%;
    background: #171717;
    border: 1px solid #4a4a4a;
    color: #e4e4e4;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 16px;
}

.guess-form input[type="text"]::placeholder {
    color: #6f6f6f;
}

.guess-form input[type="text"]:focus {
    border-color: #858585;
    outline: none;
}

.guess-options {
    position: absolute;
    z-index: 5;
    top: 100%;
    left: 0;
    right: 0;
    margin: -1px 0 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #1b1b1b;
    border: 1px solid #858585;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    max-height: 15rem;
    overflow-y: auto;
    text-align: left;
}

.guess-options li {
    padding: 0.45rem 0.75rem;
    color: #c8c8c8;
    font-size: 0.95rem;
    cursor: pointer;
}

.guess-options li mark {
    background: none;
    color: #fff;
    text-decoration: underline;
    text-decoration-color: #777;
    text-underline-offset: 3px;
}

.guess-options li.is-active {
    background: #333;
    color: #fff;
}

.guess-options li.is-empty {
    color: #777;
    font-size: 0.85rem;
    cursor: default;
}

.guess-fields button,
.guess-next {
    flex: 0 0 auto;
    background: #3a3a3a;
    border: 1px solid #666;
    color: #e4e4e4;
    padding: 0.55rem 1.2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.guess-fields button:hover:not([disabled]),
.guess-next:hover {
    background: #484848;
    border-color: #999;
    color: #fff;
}

.guess-fields button[disabled] {
    background: none;
    border-color: #444;
    color: #666;
    cursor: default;
}

/* The note is for the few who have something to add; it stays a small grey
   word until asked for. */
.guess-asides {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.6rem;
}

.guess-note-toggle,
.guess-skip {
    background: none;
    border: 0;
    padding: 0;
    color: #666;
    font-family: inherit;
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.guess-note-toggle:hover,
.guess-skip:hover {
    color: #999;
}

.guess-skip[disabled] {
    opacity: 0.5;
    cursor: default;
}

.guess-form input.guess-note {
    margin-top: 0.5rem;
}

.guess-error {
    margin-top: 0.75rem;
    color: #c88;
    font-size: 0.9rem;
}

.guess-error a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guess-verdict {
    color: #d0d0d0;
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
}

.guess-verdict.is-right {
    color: #a8d8a8;
}

.guess-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guess-rows li {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.28rem 0.6rem;
    margin-bottom: 0.2rem;
    color: #b0b0b0;
    font-size: 0.9rem;
    background: #1c1c1c;
    overflow: hidden;
}

/* How much of the crowd said it, as a bar behind the row. */
.guess-rows li::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--share, 0%);
    background: rgba(255, 255, 255, 0.07);
    transition: width 0.4s ease;
}

.guess-rows li > * {
    position: relative;
}

.guess-rows li.is-yours {
    color: #e4e4e4;
    outline: 1px solid #666;
}

.guess-rows li.is-correct {
    color: #a8d8a8;
}

.guess-rows li.is-correct::before {
    background: rgba(168, 216, 168, 0.13);
}

.guess-tag {
    color: #777;
    font-size: 0.75rem;
    margin-left: 0.4rem;
}

.guess-rows li.is-correct .guess-tag {
    color: #7fa87f;
}

.guess-total {
    margin-top: 0.5rem;
    color: #777;
    font-size: 0.8rem;
}

.guess-after {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.1rem;
}

.guess-photo-link {
    color: #888;
    font-size: 0.9rem;
    text-decoration: none;
    border-bottom: 1px solid #555;
}

.guess-photo-link:hover {
    color: #ccc;
    border-color: #888;
}

/* The photo opened large: over the whole page, shut by a tap or Escape. */
.guess-zoom {
    position: fixed;
    inset: 0;
    z-index: 100000; /* over the cookie bar too */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
    outline: none;
}

.guess-zoom img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.guess-fields button:focus-visible,
.guess-next:focus-visible,
.guess-note-toggle:focus-visible,
.guess-skip:focus-visible,
.guess-photo-link:focus-visible {
    outline: 2px solid #999;
    outline-offset: 2px;
}

/* !important: the rules above give these elements a display of their own,
   and a hidden field or list has to stay hidden whatever they say. */
[data-guess][hidden],
[data-guess] [hidden] {
    display: none !important;
}

/* The tally on a world map, on a photo's own page. Grey for how many said
   it, green for the answer, an outline for yours. */
.guess-map svg {
    display: block;
    width: 100%;
    height: auto;
    animation: guess-map-in 0.4s ease;
}

@keyframes guess-map-in {
    from { opacity: 0; }
}

.guess-map path,
.guess-map circle {
    vector-effect: non-scaling-stroke;
}

.guess-map-land {
    fill: #222;
    stroke: #141414;
    stroke-width: 0.5;
}

.guess-map-country {
    fill: #222;
    stroke: #141414;
    stroke-width: 0.5;
}

.guess-map-country.is-guessed {
    fill: rgba(220, 220, 220, var(--share, 0.2));
}

.guess-map-country.is-correct {
    fill: rgba(168, 216, 168, var(--share, 0.35));
    stroke: #a8d8a8;
    stroke-width: 1;
}

.guess-map-country.is-yours {
    stroke: #e4e4e4;
    stroke-width: 1.2;
}

circle.guess-map-country {
    stroke: #141414;
}

circle.guess-map-country.is-yours {
    stroke: #e4e4e4;
}

circle.guess-map-country.is-correct {
    stroke: #a8d8a8;
}
