.modal-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  position: absolute;
}

.modal {
  display: none;
  position: absolute;
  z-index: 30000;
  border: 1px solid black;
  box-shadow: 0px 0px 10px 0px black;
  background-image: url("/png/bg.png");
}

.modal-header {
  background-image: url("/png/bg2.png");
  cursor: grab;
  text-align: center;
  padding: 4px;
}

.modal .modal-footer {
  text-align: right;
}

.modal-body {
  box-shadow: inset 0 0 6px black;
  padding: 12px;
}

.tab-flex {
  display: flex;
}

.offer-tab {
  flex: 1 1 auto;
  padding: 4px;
  background-image: url("/png/bg2.png");
}

.offers {
  display: flex;
  flex-wrap: wrap;
  padding: 8px;
  justify-content: flex-start;
  align-items: flex-start;
  background-image: url("/png/bg3.png");
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.offers canvas {
  margin: 2px;
  cursor: pointer;
  border: 1px solid transparent;
}

.offers canvas:hover {
  border: 1px solid gold;
}

.offer-tab.selected {
  border-bottom: 0px;
  background-image: url("/png/bg3.png");
}

.modal input {
  color: white;
  border: 1px solid black;
}

#offer-modal {
  width: 360px;
  max-width: 90vw;
}

#offer-price {
  width: 64px;
  display: inline-block;
}

#offer-name-wrapper {
  flex: 1 0 auto;
  text-align: right;
}

#buy-count-wrapper {
  display: flex;
}

#buy-count {
  width: 100px;
  margin-left: 8px;
  margin-right: 8px;
}

#offer-count {
  width: 32px;
  text-align: right;
}

#offer-info {
  min-height: 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid black;
  padding: 4px;
  background-image: url("/png/bg2.png");
}

#book-text-area {
  height: 220px;
  resize: none;
  scrollbar-width: thin;
  background-image: url("/png/bg2.png");
  color: white;
  font-weight: bold;
  padding: 16px;
  padding-right: 8px;
  font-size: 12px;
  font-family: Verdana;
  box-shadow: inset 0 0 8px black;
  border: 1px solid black;
  border-radius: 16px 0px 0px 16px;
}

#book-text-area:disabled {
  color: grey;
}

#book-text-area:focus {
  outline: none;
}

.map-modal-wrapper {
  position: relative;
}

.map-modal-wrapper span {
  position: absolute;
  left: 4px;
  top: 4px;
}

.map-modal-wrapper .vline {
  pointer-events: none;
  border-bottom: 1px solid white;
  width: 256px;
  top: 128px;
  position: absolute;
}

.map-modal-wrapper .hline {
  pointer-events: none;
  border-right: 1px solid white;
  left: 128px;
  position: absolute;
  height: 256px;
}

#spellbook-list {
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  background-image: url("/png/bg.png");
  width: 400px;
}

.spellbook-wrapper {
  width: 45%;
  border: 1px solid black;
  flex: 1 1 auto;
  display: flex;
  margin: 4px;
  align-items: center;
  background-image: url("/png/bg2.png");
}

.spellbook-wrapper canvas {
  flex: 0 1 auto;
  width: 32px;
  height: 32px;
  box-shadow: 0px 0px 4px 0px black;
  cursor: pointer;
}

.spellbook-wrapper span {
  flex: 0 1 auto;
  text-align: center;
  width: 100%;
}

#spellbook-wrapper-prototype {
  display: none;
}

#hotbar-config-modal {
  width: 620px;
  max-width: 92vw;
}

#hotbar-config-modal .modal-header {
  font-size: 18px;
  font-weight: bold;
}

#radio-editor-modal {
  width: 560px;
  max-width: 94vw;
}

#club-bar-modal { width: 520px; max-width: 92vw; }
#club-bar-modal .modal-header { font-size: 19px; font-weight: bold; }
#club-bar-text { margin: 4px 0 14px; font-size: 17px; font-weight: bold; }
#club-bar-list { max-height: 300px; overflow-y: auto; overflow-x: hidden; margin-bottom: 12px; }
.club-bar-item { display:flex; justify-content:space-between; width:100%; padding:12px 10px; background:transparent; border:0; border-bottom:1px solid #333; color:white; font-weight:bold; font-size:18px; text-align:left; cursor:pointer; }
.club-bar-item b { color:#ffd500; }
.club-bar-item:hover, .club-bar-item.selected { background:#222; color:#ffd500; }

.radio-editor-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px 12px;
}

.radio-editor-body > label,
.radio-editor-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-editor-body input,
.radio-editor-body select {
  box-sizing: border-box;
  width: 100%;
}

.radio-editor-body > label,
.radio-editor-row label,
.radio-editor-styles {
  font-size: 12px;
}

.radio-editor-row {
  display: flex;
  gap: 10px;
}

.radio-editor-row label {
  flex: 1 1 50%;
}

.radio-editor-rhythm {
  align-items: end;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid #444;
  border-radius: 3px;
  display: grid;
  gap: 4px 8px;
  grid-template-columns: 1fr 0.8fr 1.35fr;
  padding: 6px 8px;
}

.radio-editor-rhythm label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 3px;
  min-width: 0;
}

.radio-editor-rhythm-status {
  color: #ffd500;
  font-size: 10px;
  font-weight: bold;
  grid-column: 1 / -1;
  line-height: 1.2;
  min-height: 12px;
  text-align: center;
}

.radio-editor-rhythm-status[data-source="bass"] {
  color: #65ffb0;
}

.radio-editor-help {
  color: #ccc;
  font-size: 10px;
  line-height: 1.4;
  margin: 2px 0;
}

.radio-editor-music {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid #4c4c4c;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 3px 0;
  padding: 7px;
}

.radio-editor-section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.radio-editor-section-title strong {
  color: #ffd500;
  font-size: 12px;
}

.radio-editor-section-title button,
.radio-editor-track button,
.radio-editor-queue-controls button {
  height: 24px;
  min-width: 0;
  padding: 2px 8px;
}

.radio-editor-track-list {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #333;
  max-height: 92px;
  overflow-y: auto;
}

.radio-editor-track {
  align-items: center;
  border-bottom: 1px solid #333;
  display: flex;
  gap: 6px;
  min-height: 26px;
  padding: 2px 4px;
}

.radio-editor-track:last-child {
  border-bottom: 0;
}

.radio-editor-track > span:not(.radio-editor-track-controls) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-editor-track > small {
  color: #bbb;
  flex: 0 0 42px;
  text-align: right;
}

.radio-editor-queued-track > b {
  color: #ffd500;
  flex: 0 0 18px;
  text-align: center;
}

.radio-editor-track-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.radio-editor-track-controls button {
  padding: 1px 6px;
}

.radio-editor-empty {
  color: #aaa;
  font-size: 10px;
  padding: 8px;
  text-align: center;
}

.radio-editor-queue-title {
  border-top: 1px solid #444;
  margin-top: 2px;
  padding-top: 5px;
}

#radio-editor-queue-status {
  color: #65ffb0;
  font-size: 10px;
}

.radio-editor-queue-controls {
  align-items: end;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(150px, 1fr) auto auto;
}

.radio-editor-queue-controls label {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  gap: 2px;
}

.radio-editor-toggle {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
}

.radio-editor-light-toggles {
  display: grid;
  gap: 4px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radio-editor-light-toggles input {
  width: auto;
}

.radio-editor-range-title {
  display: flex;
  justify-content: space-between;
}

.radio-editor-range-title output {
  color: #ffd500;
  font-weight: bold;
}

.radio-editor-styles {
  display: grid;
  gap: 4px 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.radio-editor-styles > span {
  grid-column: 1 / -1;
}

.radio-editor-styles label {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 6px;
}

.radio-editor-styles input {
  width: auto;
}

@media (max-width: 620px), (max-height: 620px) {
  .radio-editor-body {
    gap: 2px;
    max-height: 76vh;
    padding: 6px 8px;
  }

  .radio-editor-rhythm {
    gap: 3px 6px;
    padding: 4px 6px;
  }

  .radio-editor-styles {
    gap: 2px 6px;
  }

  .radio-editor-track-list {
    max-height: 74px;
  }

  .radio-editor-queue-controls {
    grid-template-columns: 1fr 1fr;
  }

  .radio-editor-queue-controls label {
    grid-column: 1 / -1;
  }
}

.hotbar-config-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.hotbar-config-tabs button {
  flex: 1 1 auto;
  height: 38px;
  background-image: url("/png/bg2.png");
  color: white;
  border: 1px solid black;
  font-weight: bold;
}

.hotbar-config-tabs button.selected {
  background-image: url("/png/bg3.png");
  border-bottom-color: transparent;
}

.hotbar-config-content {
  min-height: 230px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.hotbar-config-item-row,
.hotbar-config-spell-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.65);
  cursor: pointer;
  font-weight: bold;
}

.hotbar-config-item-row:hover,
.hotbar-config-spell-row:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.hotbar-config-item-row canvas,
.hotbar-config-spell-row canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  background-image: url("/png/bg2.png");
  border: 1px solid black;
}

.hotbar-config-modes h3 {
  margin: 0 0 10px 0;
}

.hotbar-config-modes button,
.hotbar-config-text button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px;
  background-image: url("/png/bg2.png");
  color: white;
  border: 1px solid black;
  font-weight: bold;
}

.hotbar-config-text input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 10px;
  font-size: 14px;
  color: white;
  background-image: url("/png/bg2.png");
}

.hotbar-config-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  color: #ccc;
  font-weight: bold;
}

.hotbar-config-footer {
  text-align: center !important;
}

.hotbar-config-footer .danger {
  color: #ff7777;
  font-weight: bold;
}
