/* Treasure hunt (/gifts/treasure-hunt/): on top of the shared maker look (/gifts/globes/maker.css). */

.th .th-label { display: block; font-size: 0.8rem; color: var(--muted); margin: 14px 0 6px; }
.th .wm-seg button { padding: 6px 8px; }
.th .wm-views button .bx { vertical-align: -2px; margin-right: 2px; }
.th .wm-views button { padding: 5px 10px; }
.th .th-mapwrap { max-width: none; }
.th .th-mapwrap .wm-map { aspect-ratio: 4 / 3; }
.th-opt { font-size: 0.72rem; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* the map in the stage */
.th-mapview { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.th-mapview[hidden] { display: none; }
.th-mapview canvas { display: block; touch-action: none; cursor: crosshair; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); border-radius: 2px; }
.th-mapview canvas.is-over { cursor: grab; }
.th-mapview canvas.is-drag { cursor: grabbing; }
.th-tip {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; pointer-events: none;
    background: rgba(20, 23, 22, 0.86); color: var(--ink); font-size: 0.78rem; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
    max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis;
}
.th-tip[hidden] { display: none; }

/* the pages */
.th-pages { position: absolute; inset: 0; overflow: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-content: start; }
.th-page { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.th-page canvas { width: 100%; height: auto; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); border-radius: 2px; cursor: zoom-in; }
.th-page figcaption { font-size: 0.76rem; color: var(--muted); text-align: center; }
.th-light { position: absolute; inset: 0; z-index: 4; background: #121318; display: flex; flex-direction: column; }
.th-light[hidden] { display: none; }
.th-light-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 0.84rem; color: var(--muted); }
.th-light-bar .wm-btn { padding: 6px 10px; }
.th-light-bar .th-light-x { margin-left: auto; }
.th-light-page { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 4px 12px 16px; }
.th-light-page canvas { background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); height: auto; }

/* the 3D tile */
.th-tile { position: absolute; inset: 0; }
.th-tile[hidden] { display: none; }
.th-tile-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.th-tile-empty p { max-width: 420px; margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.th-tile-empty[hidden] { display: none; }

/* the stops list */
.th-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.th-stop { background: var(--field); border-radius: 10px; padding: 7px 8px; }
.th-stop.is-hi { box-shadow: inset 0 0 0 1.5px var(--accent); }
.th-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.th-tag {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: #a3281f; color: #fff6e6; font: 700 0.76rem/1 'Cormorant Garamond', Georgia, serif; font-size: 0.9rem;
}
.th-tag.is-start { background: transparent; color: var(--ink); font-size: 1.1rem; }
.th-tag.is-x { background: transparent; color: #e0574a; font: 800 1.3rem/1 'Schibsted Grotesk', system-ui, sans-serif; }
.th-what { display: flex; gap: 6px; min-width: 0; }
.th-what select, .th-what input {
    min-width: 0; background: #262b29; color: var(--ink); border: 1px solid transparent; border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 0.82rem;
}
.th-what select { flex: none; max-width: 46%; }
.th-what input { flex: 1; }
.th-what select:focus, .th-what input:focus, .th-edit textarea:focus, .th-edit input:focus { outline: none; border-color: var(--accent); }
.th-btns { display: flex; gap: 0; }
.th-btns button {
    width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 0;
    display: grid; place-items: center; cursor: pointer; font-size: 1rem;
}
.th-btns button:hover:not(:disabled) { color: var(--ink); background: #2a302d; }
.th-btns button:disabled { opacity: 0.25; cursor: default; }
.th-btns button[aria-expanded="true"] { color: var(--accent); }
.th-leg { margin: 2px 0 0 36px; font-size: 0.74rem; color: var(--muted); }
.th-leg b { color: var(--ink); font-weight: 600; }
.th-clue { margin: 4px 0 0 36px; font-size: 0.78rem; color: #c9cfca; line-height: 1.4; font-style: italic; }
.th-edit { margin: 8px 0 2px 36px; display: flex; flex-direction: column; gap: 6px; }
.th-edit[hidden] { display: none; }
.th-edit label { font-size: 0.74rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.th-edit textarea, .th-edit input {
    width: 100%; background: #262b29; color: var(--ink); border: 1px solid transparent; border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 0.82rem; resize: vertical;
}
.th-edit .wm-linkbtn { align-self: flex-start; }
.th-empty { font-size: 0.84rem; color: var(--muted); padding: 10px 4px; line-height: 1.45; }
.th-walk { margin: 10px 0 0; font-size: 0.86rem; line-height: 1.45; }
.th-walk:empty { display: none; }
.th-walk .is-warn { color: #ffb48a; }
.th-tools { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.th-tools .wm-btn .bx { vertical-align: -2px; }
.th .th-count { display: inline-flex; flex: 1; }
.th .th-count button { flex: 1; }
.th-tools2 { gap: 16px; margin-top: 10px; }
.th-tools2 .bx { vertical-align: -2px; }

/* map markers on the small map */
.th-pin {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: grab;
    background: #a3281f; color: #fff; font: 700 11px/1 'Schibsted Grotesk', system-ui, sans-serif;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}
.th-pin.is-start { background: #1d2b28; }
.th-pin.is-x { background: #fff; color: #a3281f; font-size: 13px; font-weight: 800; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), inset 0 0 0 2px #a3281f; }

.th-privacy { margin: 0 0 10px; font-size: 0.84rem; color: var(--muted); line-height: 1.45; }
.th-privacy .bx { color: var(--accent); vertical-align: -2px; }
.th-sharebox { background: #1f2422; border-radius: 10px; padding: 12px; }
.th-sharebox p { margin: 0; font-size: 0.84rem; line-height: 1.45; }
.th-sharebox[hidden] { display: none; }
.th #thShareOpen[hidden] { display: none; }

@media (max-width: 900px) {
    .th-pages { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 10px; }
}
@media (max-width: 560px) {
    .th .wm-seg button { padding: 6px 5px; font-size: 0.76rem; white-space: normal; line-height: 1.2; }
    .th .wm-views button { font-size: 0.78rem; }
    .th-what { flex-direction: column; }
    .th-what select { max-width: none; }
}
