/* Windows 95 look, drawn with CSS bevels. Colours of the original palette. */
:root {
  --desk: #008080;
  --face: #c0c0c0;
  --light: #ffffff;
  --hi: #dfdfdf;
  --shadow: #808080;
  --dark: #000000;
  --title: #000080;
  --font: Tahoma, "MS Sans Serif", "Segoe UI", "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body {
  background: var(--desk);
  font: 11px/1.3 var(--font);
  color: var(--dark);
  overflow: hidden;
  -webkit-font-smoothing: none;
  -webkit-user-select: none; /* Safari still needs the prefix */
  user-select: none;
  -webkit-touch-callout: none; /* no iOS loupe / copy menu on long press */
}
input, .dialog-body { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px dotted var(--dark); outline-offset: -4px; }

/* ---- bevels ---- */
.window, .raised, .button, .tb, .tlb, .smiley, .menu-list {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light);
}
.sunken-thin { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); }
.sunken-thick { border: 3px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
.raised-thick { border: 3px solid; border-color: var(--light) var(--shadow) var(--shadow) var(--light); }
.button:active, .tb:active, .tlb:active, .smiley:active {
  box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--dark), inset -2px -2px var(--hi), inset 2px 2px var(--shadow);
}

/* ---- main window ---- */
.window { padding: 3px; display: flex; flex-direction: column; }
.main-window { position: fixed; inset: 8px; }
.main-window.maximized { inset: 0; }
.titlebar {
  display: flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 2px 0 3px; margin-bottom: 1px;
  background: var(--title); color: var(--light); font-weight: bold;
}
.titlebar .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-icon { width: 16px; height: 16px; image-rendering: pixelated; }
.title-buttons { display: flex; gap: 2px; }
.tb { width: 16px; height: 14px; padding: 0; border: 0; font-size: 9px; line-height: 12px; font-weight: bold; }

/* ---- menus ---- */
.menubar { display: flex; height: 20px; }
.menu { position: relative; }
.menu-title { border: 0; background: none; padding: 2px 7px; height: 20px; }
.menu.open .menu-title { background: var(--title); color: var(--light); }
.menu-list { display: none; position: absolute; top: 20px; left: 0; z-index: 10; min-width: 190px; padding: 3px; }
.menu.open .menu-list { display: block; }
.menu-item {
  display: flex; width: 100%; border: 0; background: none; text-align: left;
  padding: 3px 18px 3px 3px; white-space: nowrap;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--title); color: var(--light); outline: none; }
.menu-item .check { width: 18px; text-align: center; }
.menu-list hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); margin: 3px 1px; }

/* ---- game area ---- */
.game { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px; gap: 6px; }
.header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; }
.led { display: block; }
.smiley { width: 26px; height: 26px; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; }
/* Share sits left of the smiley; the spacer on the right keeps the smiley centred.
   1.17: on computers the share button also says what it shares ("Share this spot"). */
.header-center { flex: 1; min-width: 0; margin: 0 8px; display: flex; justify-content: center; gap: 4px; align-items: center; } /* 1.21: the buttons as one group in the middle */
#share, #contact { flex: 0 1 auto; min-width: 0; width: auto; padding: 0 6px 0 2px; display: flex; gap: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; }
/* 1.21: the field column - the top bar over the field only; the side column reaches up beside it */
.field-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.online-top { flex: none; height: 22px; display: inline-flex; align-items: center; padding: 0 7px; font-size: 11px; white-space: nowrap; }
body.mobile .desktop-only { display: none; }
#share canvas, #contact canvas { flex: none; }
/* 1.25: dynamite */
.dyn-btn { flex: none; width: auto; padding: 0 6px 0 2px; display: flex; gap: 3px; font-size: 11px; white-space: nowrap; position: relative; }
.dyn-btn canvas { flex: none; }
.dyn-btn:not(.dyn-ready):not(.pressed) .dyn-label { color: #606060; }
.dyn-btn.dyn-ready .dyn-label { font-weight: bold; color: #a00000; }
.dyn-btn.pressed { box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--dark), inset -2px -2px var(--hi), inset 2px 2px var(--shadow); }
.dyn-badge { display: none; }
body.mobile .dyn-btn { width: 36px; padding: 0; display: grid; place-items: center; }
body.mobile .dyn-label { display: none; }
body.mobile .dyn-badge { display: block; position: absolute; right: -3px; top: -4px; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box; border-radius: 8px; background: #808080; color: #fff; font: bold 10px/15px Arial, sans-serif; text-align: center; }
body.mobile .dyn-btn.dyn-ready { outline: 2px solid #d00000; outline-offset: -2px; }
body.mobile .dyn-btn.dyn-ready .dyn-badge { background: #d00000; }
.dyn-flash { animation: dyn-flash 0.35s steps(1) 4; }
@keyframes dyn-flash { 50% { background: #ffd060; } }
@media (prefers-reduced-motion: reduce) { .dyn-flash { animation: none; } }
.tnt-ico { vertical-align: -3px; }
.toast.dyn-toast { font-size: 14px; font-weight: bold; padding: 6px 12px; }
.dyn-hint { display: flex; gap: 10px; align-items: flex-start; }
.dyn-hint canvas { flex: none; }
.dyn-hint p { margin: 0; line-height: 1.4; }
.aim-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 20px); padding: 5px 6px 5px 10px; background: #ffffe1; border: 1px solid var(--dark); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35); font-size: 12px; }
.aim-bar[hidden] { display: none; }
body:not(.mobile) .aim-bar .aim-text { white-space: nowrap; }
.aim-bar .aim-btns { display: flex; gap: 6px; flex: none; }
.aim-bar .button { min-width: 0; }
.aim-bar .dyn-go { font-weight: bold; }
body.mobile .aim-bar { flex-wrap: wrap; font-size: 14px; width: calc(100% - 20px); box-sizing: border-box; }
body.mobile .aim-bar .aim-btns { width: 100%; justify-content: flex-end; }
body.mobile .aim-bar .button { height: 34px; padding: 0 14px; }
/* 1.24: "Contact us" */
body.mobile #contact { display: none; } /* phones: in the menu */
.contact-dialog { width: min(440px, calc(100vw - 24px)); }
.contact-text { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 96px; font: inherit; font-size: 12px; line-height: 1.35; padding: 3px 4px; border: 0; box-shadow: inset -1px -1px #fff, inset 1px 1px #808080, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a; background: #fff; }
.contact-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 4px; min-height: 16px; }
.contact-note { margin: 0 !important; color: #800000; }
.contact-count { color: #404040; font-size: 11px; white-space: nowrap; }
.reply-dialog { width: min(440px, calc(100vw - 24px)); }
.reply-label { margin: 0 0 4px !important; font-weight: bold; }
.reply-quote { white-space: pre-wrap; padding: 4px 6px; margin-bottom: 10px; color: #404040; max-height: 30vh; overflow: auto; background: #fff; }
.reply-text { white-space: pre-wrap; margin-bottom: 8px; }
.share-label { overflow: hidden; text-overflow: ellipsis; }
.smiley:active .share-label { transform: translate(1px, 1px); }
.smiley:active canvas { transform: translate(1px, 1px); }
.main { flex: 1; min-height: 0; display: flex; gap: 6px; }
.field-box { flex: 1; min-width: 0; position: relative; overflow: hidden; background: #7b7b7b; }
#field { display: block; touch-action: none; cursor: default; outline: none; }
#field.knocked { filter: grayscale(1) brightness(0.8); }
.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 6px 12px; font-weight: bold; white-space: nowrap; }

/* ---- side panel ---- */
/* 1.2: the map is 314 x 314 (two screen pixels per chunk, a 16 x 12 flag per plot);
   "You" and "Countries" sit side by side under it. */
.side { width: 336px; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.side-cols { flex: 0 1 150px; min-height: 0; display: flex; gap: 4px; } /* 1.19: the feed takes the rest */
.side:has(> #feed-box[hidden]) .side-cols { flex: 1 1 0; }
.side-cols > .group { flex: 1 1 0; min-width: 0; overflow: hidden; }
.group { margin: 0; padding: 4px 6px 6px; border: 2px groove var(--light); min-height: 0; }
.group.grow { flex: 1; overflow: hidden; }
.group legend { padding: 0 3px; }
#minimap { display: block; width: 314px; height: 314px; margin: 2px auto 0; image-rendering: pixelated; cursor: crosshair; background: #707070; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 2px 0 0; }
.facts dt { color: #404040; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts dd { margin: 0; text-align: right; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top { list-style: none; margin: 2px 0 0; padding: 0; counter-reset: place; }
.top li { display: flex; gap: 4px; padding: 1px 0; counter-increment: place; }
.top li::before { content: counter(place) "."; width: 18px; color: #404040; }
.top li.empty { color: #404040; }
.top li.empty::before { content: none; }
.top .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .sub { color: #404040; }
.top .pts { font-weight: bold; }

/* ---- status bar ---- */
.statusbar { display: flex; gap: 2px; margin-top: 2px; }
.pane { height: 18px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); }
.pane.grow { flex: 1; }
.pane.pos { width: 90px; text-align: right; }
.pane.conn { width: 150px; }

/* ---- dialogs ---- */
.dialogs { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; }
.dialogs[hidden] { display: none; }
.dialog { min-width: 300px; max-width: min(560px, 92vw); max-height: 86vh; }
.dialog-body { padding: 10px 12px 4px; overflow: auto; user-select: text; }
.dialog-body p { margin: 0 0 8px; max-width: 66ch; }
.dialog-body h3 { font-size: 11px; margin: 8px 0 4px; }
.dialog-body .hint { color: #404040; }
.dialog-body .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 12px 10px; }
.button { min-width: 75px; height: 23px; border: 0; padding: 0 10px; }
.field-input {
  flex: 1; height: 21px; padding: 2px 3px; font: inherit; background: var(--light); border: 0;
  box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light), inset 2px 2px var(--dark), inset -2px -2px var(--hi);
}
.grid { width: 100%; border-collapse: collapse; background: var(--light); margin-bottom: 4px; }
.grid th { background: var(--face); font-weight: normal; text-align: left; padding: 2px 4px;
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--light); }
.grid td { padding: 1px 4px; }
.grid td:first-child, .grid td:last-child { text-align: right; }
a { color: #0000ee; }

@media (max-width: 820px) { .side { display: none; } }

/* ---- 1.8: timelapse under the minimap ---- */
.mm-wrap { position: relative; width: fit-content; margin: 0 auto; }
body.mobile .mm-wrap { width: min(314px, 100%); }
.tl-badge { position: absolute; left: 8px; top: 8px; background: #000080; color: #fff; font-weight: bold; font-size: 11px; padding: 2px 5px; pointer-events: none; }
.tl { width: 314px; max-width: 100%; margin: 6px auto 0; }
.tl-row { display: flex; gap: 2px; align-items: stretch; height: 22px; }
.tlb { min-width: 24px; height: 22px; padding: 0 4px; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
.tlb svg { width: 11px; height: 11px; fill: #000; }
.tlb:disabled svg { fill: var(--shadow); }
.tl-speed { min-width: 30px; margin-left: 4px; font-weight: bold; }
.tl-live { margin-left: 4px; }
.tl-live.on { box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--dark), inset -2px -2px var(--hi), inset 2px 2px var(--shadow); }
.tl-time { flex: 1; min-width: 0; background: #fff; text-align: right; padding: 3px 5px 0; font-size: 11px; white-space: nowrap; overflow: hidden; }
.tl-track { position: relative; margin-top: 6px; --now: 100%; --pos: 0%; } /* 1.19: no day marks under it */
.tl-track::before { /* the groove: blue up to the shown moment, hatched after now */
  content: ''; position: absolute; left: 2px; right: 2px; top: 8px; height: 4px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light);
  background:
    linear-gradient(90deg, #000080 0 var(--pos), transparent var(--pos)),
    linear-gradient(90deg, transparent 0 var(--now), rgba(255,255,255,0) var(--now)),
    repeating-linear-gradient(90deg, #fff 0 2px, #a0a0a0 2px 3px);
  background-blend-mode: normal;
}
/* 1.10: the piece the admin is about to cut, in red over the groove */
.tl-cutbar { position: absolute; left: 7px; right: 7px; top: 0; height: 0; pointer-events: none; }
.tl-track.has-cut .tl-cutbar::before { content: ''; position: absolute; left: calc(var(--cut0) - 5px); width: max(3px, calc(var(--cut1) - var(--cut0))); top: 6px; height: 8px; background: rgba(220,0,0,0.6); outline: 1px solid #a00000; }
.tl-track::after { content: ''; position: absolute; top: 3px; height: 14px; width: 2px; left: calc(2px + (100% - 4px) * var(--now) / 100%); background: #c00000; transform: translateX(-1px); pointer-events: none; }
#tl-slider, .wp-slider { position: relative; width: 100%; margin: 0; height: 20px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; z-index: 1; }
#tl-slider::-webkit-slider-runnable-track, .wp-slider::-webkit-slider-runnable-track { height: 20px; background: transparent; }
#tl-slider::-moz-range-track, .wp-slider::-moz-range-track { height: 20px; background: transparent; }
#tl-slider::-webkit-slider-thumb, .wp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 19px; background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light); }
#tl-slider::-moz-range-thumb, .wp-slider::-moz-range-thumb { width: 11px; height: 19px; border: 0; border-radius: 0; background: var(--face); box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--light); }
.tl-days { position: absolute; left: 7px; right: 7px; bottom: 0; height: 14px; font-size: 9px; color: #404040; }
.tl-days span { position: absolute; top: 2px; transform: translateX(-50%); }
.tl-days span:first-child { transform: none; }
.tl-days span:last-child { transform: translateX(-100%); }

.tl-share[hidden] { display: none; }
.tl-share { padding: 0 6px 0 5px; } /* 1.19: in the row, after play */

/* ---- 1.6: congratulation for the first zone: a Windows 95 box that pops up and fades ---- */
.congrats {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  min-width: 220px; max-width: min(360px, calc(100% - 24px)); padding: 0 0 10px;
  background: var(--face, #c0c0c0); border: 2px outset #fff; box-shadow: 2px 2px 0 #000;
  text-align: center; pointer-events: none; animation: congrats-in 0.35s ease-out;
}
.congrats.out { opacity: 0; transition: opacity 0.6s; }
.congrats-title { background: #000080; color: #fff; font-weight: bold; padding: 3px 6px; margin-bottom: 8px; text-align: left; }
.congrats-text { padding: 0 12px; font-size: 13px; line-height: 1.35; }
@keyframes congrats-in { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) { .congrats { animation: none; } }

/* ---- touch / phone ---- */
.mobile-only { display: none; }
.toast {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  max-width: calc(100% - 20px); padding: 4px 8px;
  background: #ffffe1; border: 1px solid var(--dark); /* the Windows 95 tooltip */
  font-size: 12px; text-align: center; pointer-events: none;
}
body.mobile { font-size: 12px; }
body.mobile .titlebar, body.mobile .menubar, body.mobile .side, body.mobile .statusbar { display: none; }
body.mobile .main-window { inset: 0; padding: 0; box-shadow: none; }
body.mobile .game { padding: 0; gap: 0; border: 0; }
body.mobile .field-box { border: 0; }
body.mobile .header {
  gap: 6px; padding: calc(5px + env(safe-area-inset-top)) 6px 5px 6px;
  box-shadow: inset 0 -1px var(--shadow);
}
body.mobile .smiley { width: 36px; height: 36px; }
body.mobile .header-center { margin: 0; gap: 6px; }
body.mobile .field-col { gap: 0; }
body.mobile #share { flex: none; width: 36px; padding: 0; display: grid; }
body.mobile .share-label { display: none; }
body.mobile .mobile-only { display: block; }
body.mobile #mobile-menu { min-width: 0; height: 36px; padding: 0 10px; font-weight: bold; }
body.mobile .button { height: 32px; }
body.mobile .dialog { min-width: 0; width: 92vw; }
body.mobile .banner { top: 46px; white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 20px); }
/* Phone: "You", countries and the map in a panel over the field, folded to one line. */
.mpanel { position: absolute; top: 6px; left: 6px; right: 6px; z-index: 5; }
body:not(.mobile) .mpanel { display: none; }
.mpanel-bar { display: flex; width: 100%; height: 30px; align-items: center; gap: 12px; padding: 0 10px; border: 0; font-size: 12px; }
.mpanel-bar .mpanel-label { font-weight: bold; }
.mpanel-bar .chevron { margin-left: auto; }
.mpanel-bar .chevron { transition: transform 0.15s; }
.mpanel-bar[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.mpanel-body { margin-top: 2px; padding: 6px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100dvh - 140px); overflow-y: auto; }
.mpanel-body[hidden] { display: none; }
/* Boxes keep their full height and the panel scrolls (without this they shrank and overlapped). */
.mpanel-body > * { flex: none; }
body.mobile #minimap { width: min(314px, 100%); height: auto; aspect-ratio: 1; }
.popup { position: fixed; top: auto; left: auto; z-index: 15; display: block; min-width: 220px; max-width: calc(100vw - 8px); padding: 3px; }
.popup .facts { padding: 4px 6px 6px; }
.popup .menu-item { padding: 9px 18px 9px 3px; font-size: 13px; }
/* LEDs shrink on narrow phones so the five controls fit in one row */
@media (max-width: 400px) { body.mobile .led { transform: scale(0.85); margin: 0 -7px; } }
@media (max-width: 345px) { body.mobile .led { transform: scale(0.7); margin: 0 -15px; } }

/* ---- flags and pickers (stage 6) ---- */
.flag { display: inline-block; width: 16px; height: 12px; vertical-align: -2px; margin-right: 4px; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); background: var(--light); }
.flag.none { box-shadow: inset 0 0 0 1px var(--shadow); background: none; }
.country { white-space: nowrap; }
.facts dd .flag { margin-right: 3px; }
.top li { align-items: center; }
.top li .flag { margin: 0; }
.pick-list { background: var(--light); height: min(320px, 50vh); overflow-y: auto; margin-top: 6px; padding: 2px; }
.pick-list.short { height: auto; max-height: 60vh; }
.pick-list hr { border: 0; border-top: 1px dotted var(--shadow); margin: 2px 0; }
.pick { display: flex; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 3px 4px; }
.pick:hover, .pick:focus-visible { background: var(--title); color: var(--light); outline: none; }
.pick.current { font-weight: bold; }
.dialog-body input[type=search] { width: 100%; }
body.mobile .pick { padding: 8px 6px; font-size: 13px; }

/* ---- statistics window (stage 7) ---- */
.dialog.wide { width: min(720px, 94vw); max-width: 94vw; }
.stats { display: grid; grid-template-columns: 150px 1fr; gap: 10px; min-height: 0; }
.stats-days.pick-list { height: min(380px, 60vh); margin: 0; }
.stats-detail { max-height: min(380px, 60vh); overflow-y: auto; padding-right: 4px; }
.stats-detail .title { margin-top: 0; font-size: 12px; }
.stats-detail p { margin: 0 0 4px; }
.stats-detail .you { font-weight: bold; margin-bottom: 8px; }
body.mobile .stats { grid-template-columns: 1fr; }
body.mobile .stats-days.pick-list { height: auto; max-height: 120px; }
body.mobile .stats-detail { max-height: 50vh; }

/* ---- share window (1.1) ---- */
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.share-grid .button { min-width: 0; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-link { min-width: 0; }

body.mobile .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- 1.9: administrator page ---- */
.admin-tools { position: fixed; left: 16px; bottom: 34px; z-index: 50; width: 330px; padding-bottom: 6px; }
.admin-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; }
.admin-buttons .button { min-width: 0; }
.admin-buttons .button.pressed { box-shadow: inset -1px -1px var(--light), inset 1px 1px var(--dark), inset -2px -2px var(--hi), inset 2px 2px var(--shadow); font-weight: bold; }
.admin-sub { margin: 8px 6px 0; font-weight: bold; font-size: 11px; }
.admin-buttons3 { grid-template-columns: 1fr 1fr 1fr; }
.admin-buttons3 .button { padding: 0 4px; font-size: 11px; }
.admin-status { margin: 0 6px; padding: 3px 5px; background: #fff; font-size: 11px; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); min-height: 16px; }
.admin-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.admin-note { color: #c00000; min-height: 16px; margin: 4px 0; }
.admin-confirm { max-width: 360px; line-height: 1.4; }
.admin-wide { grid-column: 1 / -1; }
.admin-buttons .admin-new, .admin-msg.admin-new .admin-msg-head b { color: #c00000; }
/* 1.24: players' messages */
.admin-msgs-dialog { width: min(640px, calc(100vw - 24px)); }
.admin-msgs { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow: auto; background: #fff; }
.admin-msg { padding: 6px 8px 8px; border-bottom: 1px solid #c0c0c0; }
.admin-msg.admin-new { background: #fff8e0; }
.admin-msg-head { font-size: 11px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 3px; margin-bottom: 4px; }
.admin-msg-head .flag { vertical-align: middle; }
.admin-show { min-width: 0 !important; height: 19px !important; padding: 0 6px !important; margin-left: auto; font-size: 11px; }
.admin-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-msg-reply { margin: 6px 0 0 14px; padding-left: 8px; border-left: 2px solid #000080; }
.admin-msg-when { font-size: 11px; color: #404040; }
.admin-msg-form { margin: 6px 0 0 14px; }
.admin-msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.admin-log { max-height: 360px; overflow: auto; background: #fff; }
.admin-log table { border-collapse: collapse; font-size: 11px; }
.admin-log td { padding: 2px 8px; border-bottom: 1px solid #e0e0e0; white-space: nowrap; }
body.admin-selecting #field { cursor: crosshair; }

/* ---- 1.11: a finished week's timelapse in the statistics window ---- */
.wp { --wp-map: 500px; width: calc(var(--wp-map) + 4px); }
.wp-map { position: relative; }
.wp-canvas { display: block; width: var(--wp-map); height: var(--wp-map); image-rendering: pixelated; background: #707070; cursor: default; }
.wp-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: #707070; color: #fff; text-align: center; box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--light); }
.wp-note[hidden] { display: none; }
.wp-row { margin-top: 6px; }
.wp-track::after { display: none; } /* a finished week: no "now" mark */
.wp-track { padding-bottom: 16px; } /* its day marks (1.19: the timelapse under the minimap has none) */
.wp-video { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 4px; }
.wp-video[hidden] { display: none; }
.wp-video svg, .wp-actions svg { width: 13px; height: 13px; flex: none; }
/* computers: list | player | tables, all as tall as the player */
.dialog.wp-dialog { max-width: 98vw; max-height: 98vh; }
.stats.with-player { grid-template-columns: 150px auto minmax(0, 1fr); align-items: start; }
.stats.with-player .stats-days.pick-list, .stats.with-player .stats-detail { height: var(--wp-h); max-height: var(--wp-h); }
.stats.with-player.no-player .stats-detail { grid-column: 2 / 4; }
.stats.with-player.no-player .grid { max-width: 640px; }
.wp-box { padding: 4px 7px 8px; }
/* phones: two buttons under the totals of a week */
.wp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 8px; }
.wp-actions[hidden] { display: none; }
.wp-actions .button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 36px; padding: 0 6px; }
.wp-actions .wp-watch { font-weight: bold; }
.wp-actions .button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the player over the whole screen */
.wp-sheet {
  position: fixed; inset: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  overflow-y: auto; font-size: 13px;
}
.wp-sheet .wp { display: contents; }
.wp-back { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; font-weight: bold; font-size: 14px; text-align: left; }
.wp-arrow { font-size: 18px; line-height: 1; }
.wp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 2px 0; font-size: 14px; }
.wp-head span { color: #404040; font-size: 13px; white-space: nowrap; }
.wp-sheet .wp-time { height: 32px; padding: 0 6px; display: grid; place-items: center; font-size: 16px; font-weight: bold; text-align: center; }
.wp-sheet .wp-map { justify-self: center; }
.wp-sheet .wp-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; height: auto; margin: 0; }
.wp-sheet .tlb { height: 44px; margin: 0; font-size: 16px; }
.wp-sheet .tlb svg { width: 16px; height: 16px; }
.wp-sheet .wp-track { margin: 0; padding-bottom: 20px; }
.wp-sheet .wp-track::before { top: 15px; height: 6px; }
.wp-sheet .wp-slider { height: 36px; }
.wp-sheet .wp-slider::-webkit-slider-runnable-track { height: 36px; }
.wp-sheet .wp-slider::-moz-range-track { height: 36px; }
.wp-sheet .wp-slider::-webkit-slider-thumb { width: 20px; height: 34px; }
.wp-sheet .wp-slider::-moz-range-thumb { width: 20px; height: 34px; }
.wp-sheet .tl-days { left: 10px; right: 10px; height: 18px; font-size: 12px; }
.wp-sheet .wp-video { height: 44px; margin: 0; font-size: 14px; }
.wp-sheet .wp-video svg { width: 16px; height: 16px; }
/* turned sideways: the map takes the height, the rest goes beside it */
.wp-sheet.wp-side { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr auto; align-content: stretch; column-gap: 10px; row-gap: 7px; }
.wp-side > *, .wp-side .wp > * { grid-column: 2; }
.wp-side .wp-map { grid-column: 1; grid-row: 1 / -1; align-self: start; }
.wp-side .wp-back { height: 36px; }
.wp-side .tlb { height: 40px; }
.wp-side .wp-video { grid-row: -2; align-self: end; height: 40px; }

/* ---- 1.12: a country's mascot walks in with a sign (mascot.ts) ---- */
.mascot { position: absolute; bottom: 6px; width: 250px; height: 330px; z-index: 6; pointer-events: none; transform-origin: 50% 100%; will-change: transform, right; }
.mascot-art { position: absolute; left: 40px; bottom: 0; width: 170px; height: 210px; }
.mascot-art svg { display: block; }
.mascot-stick { position: absolute; left: 167px; top: 104px; width: 7px; height: 152px; background: #a8743f; border: 1px solid #6b4a24; border-radius: 3px; }
.mascot-sign {
  position: absolute; left: 0; bottom: 224px; width: 240px; min-height: 104px; display: grid; place-items: center; padding: 10px 12px;
  background: #fff; border: 3px solid #000; border-radius: 8px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  font: bold 19px/1.25 var(--font); color: #000; text-align: center; overflow-wrap: anywhere; transform: rotate(-3deg);
}
.mascot.sad .mascot-sign { transform: rotate(2.5deg); }
.mascot-sign span { display: block; }

/* ---- 1.12.1: every country in "Countries" (scrolled on the computer), name and country in "You" open their windows ---- */
#countries-box { display: flex; flex-direction: column; }
#top-countries { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
body.mobile #countries-box { display: block; overflow: visible; }
body.mobile #top-countries { overflow: visible; }
body.mobile #minimap { touch-action: pan-y; }
.mpanel-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.me-link { border: 0; padding: 0; margin: 0; background: none; font: inherit; font-weight: bold; color: inherit; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.me-link:hover { text-decoration: underline; }

/* ---- 1.14: encirclement notices (they stay until closed), the panel dot, "of them taken" ---- */
.notices { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 8; display: flex; flex-direction: column; gap: 6px; width: max-content; max-width: calc(100% - 30px); pointer-events: none; }
.notice { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 6px 8px 6px 10px; background: #ffffe1; border: 1px solid var(--dark); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35); font-size: 13px; line-height: 1.35; }
.notice .txt { flex: 1; min-width: 0; }
.notice .btns { display: flex; gap: 6px; align-items: center; }
.notice .button { min-width: 0; white-space: nowrap; }
.notice .tb { width: 20px; height: 20px; }
body.mobile .notices { left: 8px; right: 8px; top: 46px; transform: none; width: auto; max-width: none; }
body.mobile .notice { flex-wrap: wrap; font-size: 14px; padding: 9px 10px; }
body.mobile .notice .btns { width: 100%; justify-content: flex-end; }
body.mobile .notice .button { height: 34px; padding: 0 14px; }
.mpanel-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e00000; box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.25); flex: none; }
.mpanel-dot[hidden] { display: none; }
#me dt.sub { padding-left: 10px; font-weight: normal; }
.away { display: flex; flex-direction: column; min-width: min(440px, 80vw); }
.away-row { display: flex; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--shadow); }
.away-row:last-child { border-bottom: 0; }
.away-row .ico { font-size: 18px; width: 22px; text-align: center; flex: none; }
.away-row .txt { flex: 1; }
.away-row .when { color: #444; }
body.mobile .away-row { flex-wrap: wrap; }
body.mobile .away-row .button { width: 100%; height: 36px; }
/* 1.18: whose flag / whose zone, by the click (the Windows 95 tooltip) */
.cell-info {
  position: absolute; z-index: 5; max-width: min(320px, calc(100% - 4px)); padding: 2px 5px;
  background: #ffffe1; border: 1px solid #000; color: #000; font-size: 11px; line-height: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.cell-info[hidden] { display: none; }
body.mobile .cell-info { font-size: 13px; line-height: 17px; padding: 3px 7px; }

/* 1.19: the feed of the week's encirclements (computers only) */
.feed-box { flex: 1 1 0; min-height: 90px; display: flex; flex-direction: column; overflow: hidden; }
.feed-box[hidden] { display: none; }
.feed { flex: 1; min-height: 0; overflow-y: auto; margin: 2px 0 0; padding: 1px 0; list-style: none; background: #fff; }
.feed li { display: flex; align-items: baseline; padding: 2px 4px; line-height: 14px; cursor: pointer; }
.feed li:hover, .feed li:focus-visible { background: #000080; color: #fff; outline: none; }
.feed li:hover .feed-time, .feed li:focus-visible .feed-time { color: #c0c0ff; }
.feed-time { flex: none; width: 52px; color: #606060; white-space: nowrap; }
.feed-text { flex: 1; min-width: 0; }
.feed-text .flag { margin: 0 3px 0 0; vertical-align: -1px; }
.feed-text b { font-weight: bold; }

/* 1.21: "You" - name and country across the box, without labels */
#me dd.me-wide { grid-column: 1 / -1; text-align: left; min-width: 0; }
#me dd.me-wide .me-link { display: block; max-width: 100%; text-align: left; }
#me dd.me-country { margin-bottom: 4px; }
#me dd.me-country .me-link { font-weight: normal; }
/* 1.21: the map never shrinks (the slider stayed outside it on low windows); a low window gets a smaller map */
#minimap-box { flex-shrink: 0; }
body:not(.mobile) #minimap { width: clamp(180px, calc(100vh - 430px), 314px); height: clamp(180px, calc(100vh - 430px), 314px); }
.side-cols { min-height: 118px; }
/* 1.22: the greeting of the first visit */
.welcome-line { margin: 4px 12px 8px; font-size: 13px; line-height: 1.4; max-width: 420px; }
