/* The shared look of every page: the colours, fonts, panels and buttons of the map page's widgets and dialogs
   (index.css) and of the other pages (pages.css) are built from these. */
:root {
  --font-ui:   system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; /* dice expressions and results only */

  --panel-bg:      rgba(18, 18, 18, 0.88);  /* widgets over the map */
  --dialog-bg:     #222;
  --panel-border:  rgba(255, 255, 255, 0.15);
  --panel-shadow:  0 4px 14px rgba(0, 0, 0, 0.55);
  --panel-radius:  6px;
  --header-bg:     rgba(255, 255, 255, 0.07);
  --divider:       rgba(255, 255, 255, 0.1);

  --text:        #ddd;
  --text-strong: #fff;
  --text-muted:  #999;
  --text-faint:  #666;

  --btn-bg:           rgba(255, 255, 255, 0.08);
  --btn-border:       rgba(255, 255, 255, 0.14);
  --btn-hover-bg:     rgba(255, 255, 255, 0.18);
  --btn-active-bg:    rgba(255, 255, 255, 0.28);
  --input-bg:         rgba(0, 0, 0, 0.35);
  --input-border:     rgba(255, 255, 255, 0.22);
  --focus-ring:       0 0 0 2px rgba(74, 144, 217, 0.85);

  --accent:        #4a90d9;
  --accent-hover:  #3a7bc8;
  --danger:        #cc2200;
  --danger-hover:  #aa1800;
  --error-text:    #ff6b6b;
  --success-text:  #6c6;
  --warning-text:  #ffb347;
  --dice-blue:     #7ab4ff;
  --dice-gold:     #ffd060;
}

/* A ? in a circle that shows its .help-tip on hover, or on tap (it takes focus: tabindex="0"). On every page. */
.help-icon {
  display: inline-block;
  position: relative;
  width: 14px;
  height: 14px;
  line-height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  font-size: 10px;
  font-weight: normal;
  color: var(--text-muted);
  text-align: center;
  cursor: default;
  vertical-align: middle;
  margin-left: 4px;
  user-select: none;
}
.help-icon:focus { outline: none; border-color: var(--text-strong); color: var(--text-strong); }
.help-tip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%); /* centered under the icon: inside a dialog whether the icon is left or right */
  width: 240px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  color: #eee;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  z-index: 200;
}
.help-icon:hover .help-tip, .help-icon:focus .help-tip { display: block; }

/* A spinning circle, beside e.g. "Uploading…" while a map is processed. On every page. */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--input-border);
  border-top-color: var(--text-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* A file field shown as a box to click, or drop a file on (Add/Edit Map, the POI dialog's New Map) */
.file-area {
  width: 100%;
  position: relative;
}
.file-area input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-area .file-dummy {
  width: 100%;
  box-sizing: border-box;
  padding: 24px 16px;
  border: 2px dashed var(--input-border);
  border-radius: 4px;
  background: var(--input-bg);
  text-align: center;
  color: var(--text-muted);
  transition: border-color 0.2s, background 0.2s;
}
/* .has-file is set by the page once a file is chosen */
.file-area .file-dummy .success { display: none; }
.file-area:hover .file-dummy,
.file-area.has-file .file-dummy {
  border-color: var(--success-text);
  color: var(--text-strong);
}
.file-area.has-file .file-dummy .success { display: inline-block; }
.file-area.has-file .file-dummy .default { display: none; }
