/* „Wo bin ich?“ (ui/geo.js): the tab #geo-tab (an .edge-tab, fortune.css), the call #geo-call, the game #geo. Everything under its id.
   Phones: the html.touch rules at the end (the window over the whole screen, fingers >= 44 CSS px). */

/* the call: the look of the OX-Wettbewerb (ox.css #ox-call) */
#geo-call { position: absolute; left: 50%; top: 106px; transform: translateX(-50%); width: 210px; padding: 5px 7px 6px; z-index: 6;
  background: linear-gradient(180deg, rgba(120, 76, 14, .5), rgba(20, 12, 10, .2) 60%), var(--panel, #17110d);
  box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #c9973f, inset 0 0 0 2px var(--edge), 0 0 10px rgba(255, 190, 70, .4);
  animation: geo-in .45s ease-out; }
#geo-call.hidden { display: none; }
#geo-call .wc-top { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 5px; align-items: center; }
#geo-call .wc-emb { width: 30px; height: 30px; object-fit: contain; image-rendering: auto; }
#geo-call .wc-head { min-width: 0; }
#geo-call .wc-kick { font-size: 6px; line-height: 7px; letter-spacing: 1px; text-transform: uppercase; color: #ffc35a; }
#geo-call .wc-name { font-size: 11px; line-height: 11px; color: #ffe2a0; overflow-wrap: anywhere; text-shadow: 0 1px 0 #000; }
#geo-call .wc-time { text-align: right; min-width: 36px; }
#geo-call .wc-tl { font-size: 6px; line-height: 7px; color: var(--dim); white-space: nowrap; }
#geo-call .wc-t { font-size: 15px; line-height: 15px; color: var(--gold); text-shadow: 0 1px 0 #000; }
#geo-call .wc-sub { margin-top: 3px; font-size: 7px; line-height: 8px; color: #e8dcc4; overflow-wrap: anywhere; }
#geo-call .wc-btns { gap: 4px; margin-top: 5px; }
@keyframes geo-in { from { opacity: 0; translate: 0 -8px; scale: 1.04; } }
#ui.compact #geo-call { top: 48px; }
/* another call stands there already (world boss, Drachenspiele, OX): below it, like the Invasion (invasion.css #inv-call); a call
   later in the page (the world boss's) is stacked by ui/notice.js stackCalls */
:is(#wb-call, #fest-call, #ox-call):not(.hidden) ~ #geo-call { top: 184px; }
#ui.compact :is(#wb-call, #fest-call, #ox-call):not(.hidden) ~ #geo-call { top: 126px; }

/* the game: a frame in the middle, the head, the body of the phase */
#geo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100% - 12px)); height: min(370px, calc(100% - 12px));
  z-index: 6900; display: flex; flex-direction: column; gap: 3px; padding: 4px 5px 5px; animation: geo-in .3s ease-out; }
#geo.hidden { display: none; }
#geo .geo-head { flex: none; display: flex; align-items: center; gap: 6px; min-height: 18px; padding: 0 1px 2px; border-bottom: 1px solid rgba(201, 151, 63, .35); }
#geo .geo-ic { flex: none; width: 18px; height: 18px; image-rendering: auto; }
#geo .geo-ttl { min-width: 0; display: flex; flex-direction: column; }
#geo .geo-name { font-size: 10px; line-height: 10px; color: #ffe2a0; text-shadow: 0 1px 0 #000; white-space: nowrap; }
#geo .geo-round { font-size: 7px; line-height: 8px; color: var(--dim); white-space: nowrap; }
#geo .geo-clock { flex: none; margin-left: auto; min-width: 34px; text-align: center; font-size: 14px; line-height: 14px; color: var(--gold); text-shadow: 1px 1px 0 #000; }
#geo .geo-clock.warn { color: #ff6a4c; }
#geo .geo-hp { flex: none; width: 96px; display: flex; flex-direction: column; gap: 1px; }
#geo .geo-bar { height: 5px; background: #1a0d0b; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #3a221c; overflow: hidden; }
#geo .geo-bar i { display: block; height: 100%; background: linear-gradient(#e2513c, #9c2416); transition: width .6s ease-out; }
#geo .geo-hpt { font-size: 7px; line-height: 7px; color: #f2d4c8; text-align: center; white-space: nowrap; text-shadow: var(--ol); }
#geo .geo-hp.out .geo-hpt { color: var(--dim); }
#geo .geo-left { flex: none; font-size: 7px; line-height: 8px; color: #e8dcc4; white-space: nowrap; }
#geo .geo-x { flex: none; }
#geo .geo-body { flex: 1; min-height: 0; }

/* the countdown */
#geo .geo-count { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 6px; }
#geo .geo-cic { width: 48px; height: 48px; image-rendering: auto; }
#geo .geo-ctitle { font-size: 14px; line-height: 15px; text-shadow: var(--ol); overflow-wrap: anywhere; }
#geo .geo-rules { display: flex; flex-direction: column; gap: 3px; max-width: 420px; font-size: 8px; line-height: 9px; color: #e8dcc4; overflow-wrap: anywhere; }
#geo .geo-cmaps { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 460px; }
#geo .geo-cmaps span { padding: 1px 4px; font-size: 7px; line-height: 9px; color: #d8cba8; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px #47423a; }

/* a round: the picture, the side with the maps */
#geo .geo-guess { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 4px; }
#geo .geo-guess.big { grid-template-columns: minmax(0, 1fr); }
#geo .geo-guess.big .geo-side { display: none; }
#geo .geo-shot { position: relative; min-width: 0; min-height: 0; background: #000; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #47423a; cursor: zoom-in; overflow: hidden; }
#geo .geo-shot.big { cursor: zoom-out; }
#geo .geo-shot img { position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); object-fit: contain; image-rendering: auto; user-select: none; -webkit-user-drag: none; }
#geo .geo-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
#geo .geo-sq { flex: none; display: flex; align-items: center; gap: 4px; min-height: 12px; font-size: 9px; line-height: 10px; overflow-wrap: anywhere; }
#geo .geo-mn { min-width: 0; color: #fff3d1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#geo .geo-back { flex: none; }
#geo .geo-cards { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; align-content: start; padding: 1px; }
#geo .geo-card { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 2px; background: linear-gradient(180deg, #2a221a, #15110d); border: 0; cursor: pointer;
  box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #5c4934; color: #e8dcc4; font: inherit; font-size: 7px; line-height: 8px; text-align: center; }
#geo .geo-card:hover { box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--gold); color: #fff; }
#geo .geo-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: auto; }
#geo .geo-card span { min-height: 8px; overflow-wrap: anywhere; }
#geo .geo-mapbox { position: relative; flex: 1; min-height: 60px; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #47423a; background: #0c0a08; overflow: hidden; }
#geo .geo-cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#geo .geo-cv.pick { cursor: crosshair; }
#geo .geo-zs { position: absolute; right: 2px; top: 2px; display: flex; flex-direction: column; gap: 2px; }
#geo .geo-z { min-width: 0; width: 13px; height: 13px; padding: 0; font-size: 10px; line-height: 10px; }
#geo .geo-hint { flex: none; font-size: 6px; line-height: 7px; color: var(--dim); overflow-wrap: anywhere; }
#geo .geo-ok { flex: none; width: 100%; }
#geo .geo-ok > .btn { height: 16px; font-size: 9px; }
#geo .geo-wait { flex: none; font-size: 7px; line-height: 8px; color: #e8dcc4; text-align: center; overflow-wrap: anywhere; }
#geo .geo-note { justify-content: center; text-align: center; font-size: 8px; line-height: 9px; color: #e8dcc4; }
#geo .geo-note .geo-sq { justify-content: center; }

/* the overview of a round */
#geo .geo-rev { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 4px; }
#geo .geo-rmap { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
#geo .geo-ans { flex: none; display: flex; align-items: center; gap: 3px; font-size: 9px; line-height: 10px; color: #a8e08a; overflow-wrap: anywhere; }
#geo .geo-ans img { width: 12px; height: 12px; image-rendering: auto; }
#geo .geo-sum { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
#geo .geo-thumb { flex: none; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: auto; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #47423a; }
#geo .geo-mine { flex: none; display: flex; flex-direction: column; gap: 1px; padding: 2px 3px; background: linear-gradient(180deg, #1c1814, #110e0c); box-shadow: inset 0 0 0 1px var(--gold-d); }
#geo .geo-ml { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1px 6px; font-size: 8px; line-height: 9px; color: #fff3d1; overflow-wrap: anywhere; }
#geo .geo-dmg { color: #ff6a4c; }
#geo .geo-nodmg { color: #86e070; }
#geo .geo-auto { color: var(--dim); }
#geo .geo-rule { flex: none; font-size: 6px; line-height: 7px; color: var(--dim); overflow-wrap: anywhere; }
#geo .geo-sub { flex: none; font-size: 8px; line-height: 9px; }
#geo .geo-tab { display: flex; flex-direction: column; gap: 1px; padding: 2px 3px; background: linear-gradient(180deg, #1c1814, #110e0c); box-shadow: inset 0 0 0 1px #47423a; }
#geo .geo-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px; align-items: center; font-size: 8px; line-height: 10px; color: #e8dcc4; }
#geo .geo-row.me { color: var(--gold); }
#geo .geo-rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#geo .geo-rv { white-space: nowrap; color: #d8cba8; text-align: right; }
#geo .geo-cnt, #geo .geo-outs { flex: none; font-size: 7px; line-height: 8px; color: #d8cba8; overflow-wrap: anywhere; }
#geo .geo-outs { color: #ff8a6c; }

/* the end */
#geo .geo-done { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
#geo .geo-res { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
#geo .geo-res .geo-ml { justify-content: center; }
#geo .geo-gain { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
#geo .geo-gl { flex: 0 0 72px; min-height: 40px; padding: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  font-size: 7px; line-height: 8px; color: #fff3d1; overflow-wrap: anywhere; background: linear-gradient(180deg, #1c1814, #110e0c); box-shadow: inset 0 0 0 1px var(--gold-d); }
#geo .geo-gl > span { max-width: 100%; }
#geo .geo-lic { flex: none; width: 22px; height: 22px; image-rendering: auto; }
#geo .geo-res .geo-ok { width: auto; min-width: 90px; }
#geo .geo-rank { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
#geo .geo-rank .geo-tab { flex: 1; min-height: 0; overflow-y: auto; align-content: start; }
#geo .geo-rank .geo-row { grid-template-columns: 14px minmax(0, 1fr) auto 34px; }

/* phones: the window over the whole screen, the side a little narrower, bigger buttons */
html.touch #ui #geo-call { width: 236px; top: 40px; }
html.touch #ui #geo-call .btn { min-height: calc(44px / var(--px)); display: flex; align-items: center; justify-content: center; }
html.touch #ui :is(#wb-call, #fest-call, #ox-call):not(.hidden) ~ #geo-call { top: 118px; }
html.touch #ui #geo { width: calc(100% - 4px); height: calc(100% - 4px); padding: 3px 4px 4px; }
html.touch #ui #geo .btn { min-height: calc(44px / var(--px)); display: flex; align-items: center; justify-content: center; }
html.touch #ui #geo .geo-z { width: calc(44px / var(--px)); height: calc(44px / var(--px)); min-height: 0; font-size: 12px; }
html.touch #ui #geo .geo-guess, html.touch #ui #geo .geo-rev { grid-template-columns: minmax(0, 1fr) 46%; }
html.touch #ui #geo .geo-guess.big { grid-template-columns: minmax(0, 1fr); }
html.touch #ui #geo .geo-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.touch #ui #geo .geo-card { min-height: calc(44px / var(--px)); }
html.touch #ui #geo .geo-hint { display: none; }
html.touch #ui #geo .geo-ok > .btn { height: auto; }
