html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #0b0b10;
    color: #eee;
    font-family: system-ui, sans-serif;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* Top bar (wrapping, centered) */
#bar{
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;          /* ✅ allow 2nd row (and more) */
  gap: 8px;
  padding: 10px;
  align-items: center;

  justify-content: center;  /* ✅ center items when space */
  align-content: center;    /* ✅ when multiple rows, keep them tidy */

  background: #12121a;

  /* ✅ remove horizontal scrolling behavior */
  overflow: hidden;
  white-space: normal;
}

button {
    background: #1f1f2a;
    color: #eee;
    border: 1px solid #2f2f3a;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    flex: 0 0 auto;
}


#wrap {
    height: calc(var(--vh) - 56px);
}
#c {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.hint {
    opacity: .75;
    font-size: 12px;
    margin-left: auto;
}

#dbg {
    position: fixed;
    right: 8px;
    top: 58px;
    z-index: 9999;
    font: 12px system-ui, sans-serif;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    pointer-events: none;
}

.hudBtn {
  font: 700 14px system-ui, sans-serif;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
}



.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  z-index: 100;
}

.modalCard {
  width: min(520px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  border-radius: 16px;
  background: rgba(12,16,22,0.96);
  color: rgba(255,255,255,0.92);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: 14px;
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.modalTitle { font: 900 20px system-ui, sans-serif; }
.modalSub   { font: 500 12px system-ui, sans-serif; opacity: 0.75; }

.tabs { display: flex; gap: 8px; margin: 8px 0 12px; }
.tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font: 700 13px system-ui, sans-serif;
}
.tab.active { background: rgba(255,255,255,0.16); }

.hidden { display: none !important; }

.tabPanel ul { margin: 0; padding-left: 18px; }
.tabPanel li { margin: 8px 0; }

.notes { display: grid; gap: 6px; }
.noteVer { font: 900 14px system-ui, sans-serif; opacity: 0.9; }
.noteItem { font: 500 13px system-ui, sans-serif; opacity: 0.85; }
