/* The topography games: see shared/topo.js. Loaded after game.css. */
/* the title's ring holds two letters (NL, EU), not one number */
.two{width:auto;padding-inline:.3em;border-radius:.7em}
/* the map: sea, land, water and dots in map colours; what is asked in the colours of the world */
.topomap{display:block;flex:1 1 0;min-height:140px;width:100%;background:#cfe7f6;border-radius:18px;overflow:hidden;contain:size}
.topomap svg{display:block;width:100%;height:100%}
.topomap svg *{pointer-events:none}
.topomap svg .tap{pointer-events:visiblePainted;cursor:pointer}
.topomap .off{display:none}
.topomap .water{fill:#b9dcf2}
/* where water takes taps, the water that is no place is as pale as the box around the map */
.topomap.pale .water:not([id]){fill:#cfe7f6}
.topomap .land{fill:#f4ecd4;stroke:#948866;stroke-width:1px;vector-effect:non-scaling-stroke;stroke-linejoin:round}
.topomap .land.other{fill:#e6e3dc;stroke:#cbc6ba}
.topomap .island{fill:#efe2b8}
.topomap .mountain{fill:#8a5a2b;fill-opacity:.22}
.topomap .river{fill:none;stroke:#3a8bd0;stroke-width:1.6px;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round}
.topomap .city{fill:#c0392b;stroke:#fff;stroke-width:1px;vector-effect:non-scaling-stroke}
/* drawn but not asked: context */
.topomap .land.muted{fill:#ebe7df;stroke:#cbc6ba}
.topomap .water.muted{fill:#cfe7f6}
.topomap .river.muted{stroke:#8db8dc}
.topomap .mountain.muted{fill-opacity:.1}
.topomap .city.muted{fill:#9a8f86}
/* lit: the place a question is about. Hit areas stay unseen, but a small place gets a ring: thick when it is lit or
   answered, thin while it can be tapped and is too small to see (see SPECK in topo.js). */
.topomap .lit:not(.hit){fill:var(--hot);fill-opacity:1;stroke:var(--hot-deep);animation:litpulse 1.2s ease-in-out infinite}
.topomap .river.lit{fill:none;stroke:var(--hot-deep);stroke-width:5px}
/* a lit city is a ring, unlike every other dot, whatever the theme's colour */
.topomap .city.lit{fill:#fff;stroke:var(--hot-deep);stroke-width:4px}
.topomap .hit.ring{stroke:#8a7d5c;stroke-width:1.5px;vector-effect:non-scaling-stroke}
.topomap .hit.ring.lit{stroke:var(--hot-deep);stroke-width:3px;fill:rgba(255,255,255,.25)}
@keyframes litpulse{50%{opacity:.7}}
.topomap .names text{font-family:var(--display);font-weight:700;fill:var(--ink);stroke:#fff;stroke-width:4px;vector-effect:non-scaling-stroke;stroke-linejoin:round;paint-order:stroke;dominant-baseline:central}
.topomap .ok:not(.hit){fill:var(--mint);fill-opacity:1;stroke:var(--mint-shade);animation:none}
.topomap .river.ok{fill:none;stroke:var(--mint-shade);stroke-width:5px}
.topomap .hit.ring.ok{stroke:var(--mint-shade);stroke-width:3px}
.topomap .wrong:not(.hit){fill:#ef8a80;fill-opacity:1;animation:wrongblink .5s 3}
.topomap .river.wrong{fill:none;stroke:#d9483b;stroke-width:5px}
.topomap .hit.ring.wrong{stroke:#d9483b;stroke-width:3px}
@keyframes wrongblink{50%{opacity:.4}}
/* the stars board: pale, light, fuller, and the hot colour for a place learned well */
.topomap .s0:not(.hit){fill:#f1ece3;fill-opacity:1}
.topomap .s1:not(.hit){fill:var(--r3);fill-opacity:1}
.topomap .s2:not(.hit){fill:var(--sun);fill-opacity:1}
.topomap .s3:not(.hit){fill:var(--hot);fill-opacity:1}
.topomap .river.s0,.topomap .river.s1,.topomap .river.s2,.topomap .river.s3{fill:none;stroke-width:4px}
.topomap .river.s0{stroke:#b8b0a4} .topomap .river.s1{stroke:var(--sun-deep)} .topomap .river.s2{stroke:var(--sun-deep)} .topomap .river.s3{stroke:var(--hot-deep)}
.topomap .water.s0{fill:#d9e6ee}

/* a question with a map: the map takes the room there is, the cards or the field stay in view */
.qtext{font-family:var(--display);font-weight:600;font-size:clamp(1.3rem,5.5vw,2rem);line-height:1.15;text-wrap:balance}
.qtext b{color:var(--hot-deep);font-weight:700}
#play .scroll:has(.topomap){flex:1 1 0}
#qcard:has(.topomap){flex:1 1 0;align-items:stretch}
.q:has(.topomap){flex:1 1 0;flex-direction:column;align-self:stretch;gap:var(--s2);font-size:clamp(1.3rem,5vw,2rem)}
.answers:has(#input:not([hidden]) .topomap){flex:1 1 0;min-height:0}
.input:has(.topomap){flex:1 1 auto;min-height:0;align-items:stretch;gap:var(--s1)}
.input .topomap{min-height:180px}
.tapped,.placename{margin:0;min-height:1.3em;text-align:center;font-family:var(--display);font-weight:600;font-size:1.2rem;color:var(--ink-soft)}
.placename{font-size:clamp(1.3rem,5vw,1.7rem);color:var(--hot-deep)}
/* name cards: words, not pictures, so smaller than game.css makes them */
.choices.cards{gap:var(--s3)}
.choices .choice.card{min-height:56px;font-size:clamp(1rem,4.4vw,1.35rem);padding:var(--s2) var(--s3);hyphens:auto;overflow-wrap:anywhere;line-height:1.15}
.choices.small .choice.card{padding-inline:var(--s1);font-size:clamp(.9rem,3.9vw,1.2rem)}
.answers:has(.choices.cards:not([hidden])){padding-bottom:var(--lift)}

/* typing a name */
.input:has(.typebox){gap:var(--s2)}
.typerow{display:flex;gap:var(--s2);width:100%;max-width:460px}
.typebox{flex:1;min-width:0;font:inherit;font-size:1.2rem;color:var(--ink);background:var(--card);padding:var(--s2) var(--s3);border-radius:14px;border:3px solid var(--line);-webkit-user-select:text;user-select:text}
.typebox:focus{outline:0;border-color:var(--cool)}
.typebox.ok{border-color:var(--mint);background:var(--mint-soft)}
.typerow .btn{flex:none;font-size:1.2rem;padding:var(--s2) var(--s4)}
.letters{margin:0;display:flex;flex-wrap:wrap;justify-content:center;column-gap:var(--s4);font-family:var(--display);font-weight:600;font-size:clamp(1.05rem,5vw,1.4rem);letter-spacing:.06em;color:var(--ink)}
.letters span{white-space:nowrap}
/* with the keyboard open: the screen is as high as what the keyboard leaves, the map smaller */
.app.fit:has(#play.typing:not([hidden])){height:calc(var(--vvh) - env(safe-area-inset-top,0px));top:calc(var(--vvt) + env(safe-area-inset-top,0px))}
#play.typing .topomap{min-height:96px}
#play.typing .qtext{font-size:clamp(1.1rem,4.4vw,1.6rem)}
/* on a touch screen the keyboard takes half of it: no tool buttons, and a hint of only the letters */
@media (pointer:coarse){#play.typing .tools,#play.typing .hint h3{display:none} #play.typing .hint{padding-block:var(--s2)}}

/* leren: pills for what and where, the map, and the name of the place tapped */
.topolearn{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:var(--s2)}
.pillrow{flex:none;display:flex;gap:var(--s2);overflow-x:auto;scrollbar-width:none;padding-bottom:var(--s1)}
.pillrow::-webkit-scrollbar{display:none}
.pillrow.more{mask-image:linear-gradient(to right,#000 calc(100% - var(--s6)),transparent)}
.pillrow .pill{flex:none;font-size:.95rem;padding:var(--s1) var(--s3);box-shadow:0 3px 0 var(--line)}
.pillrow .pill[aria-pressed="true"]{box-shadow:0 3px 0 var(--hot-deep)}
/* the kinds are few and come first: they wrap, so every one is in view */
#learnKinds{flex-wrap:wrap;row-gap:var(--s1)}
.topolearn .topomap{min-height:200px}

/* lessons: the map takes the room under the mascot */
.lwidget:has(.topomap){flex:1 1 0;min-height:0;align-items:stretch;gap:var(--s2)}
.lwidget .topomap{min-height:140px}

/* the stars board: the map, what its colours mean, and the name of the place tapped */
.boardmap{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s2)}
.boardmap .topomap{flex:none;max-height:70svh}
.boardmap .placename:empty{display:none}
.legend{margin:0;display:grid;grid-template-columns:repeat(4,auto);justify-content:center;gap:var(--s1) var(--s3);font-size:.9rem;font-weight:800;color:var(--ink-soft)}
/* on a phone two by two, so no word is left alone on a row */
@media (max-width:400px){.legend{grid-template-columns:repeat(2,auto)}}
.legend span{display:flex;align-items:center;gap:var(--s1)}
.legend i{width:14px;height:14px;border-radius:4px;box-shadow:inset 0 0 0 1px #a39878}
.legend .s0{background:#f1ece3} .legend .s1{background:var(--r3)} .legend .s2{background:var(--sun)} .legend .s3{background:var(--hot)}

/* a wide screen or a phone on its side: a map in the question gets the whole left column; cards or field, the line
   under the question and the hint go right */
@media (max-height:480px) and (min-width:560px),(min-aspect-ratio:4/3) and (min-width:560px){
  #play:has(#q .topomap){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr);align-items:start}
  #play:has(#q .topomap) .bar{grid-column:1/-1}
  #play:has(#q .topomap) .scroll{display:contents}
  #play:has(#q .topomap) #qcard{grid-column:1;grid-row:2/-1;align-self:stretch;margin-inline:var(--s4)}
  #play:has(#q .topomap) .answers{grid-column:2;grid-row:2;height:auto}
  /* a card is as wide as on a phone, so its name is as large as there */
  #play:has(#q .topomap) .choices .choice.card{font-size:1rem}
  #play:has(#q .topomap) #say{grid-column:2;grid-row:3;padding-inline:var(--s4)}
  #play:has(#q .topomap) #hint{grid-column:2;grid-row:4;margin-inline:var(--s4)}
}
