/* ============================================================================
 * Main-screen top-left chrome (area card · menu dock · status chips)
 * + shared Settings screen (General · Graphics · Audio · Keyboard · Controller)
 * ============================================================================ */

#top-bar {
  gap: 7px;
}

#area-card {
  min-width: 190px;
  max-width: 340px;
  padding: 6px 12px 7px 11px;
  background: linear-gradient(90deg, rgba(12, 9, 6, 0.78), rgba(12, 9, 6, 0.42) 75%, rgba(12, 9, 6, 0));
  border-left: 2px solid #a6834a;
  pointer-events: none;
}
#area-name {
  font: 16px/1.2 var(--font-title);
  color: #f1d58e;
  letter-spacing: 0.8px;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
#area-name:empty { display: none; }
#area-card #stats {
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.38;
  color: #c9b998;
  white-space: pre-line;
}

.top-dock {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 7px;
  background: linear-gradient(180deg, rgba(36, 27, 18, 0.94), rgba(16, 12, 8, 0.94));
  border: 1px solid #5e4a2f;
  box-shadow: inset 0 0 0 1px rgba(235, 200, 118, 0.07), 0 2px 6px rgba(0, 0, 0, 0.6);
  color: #e3cf9a;
  font: 12px/1 var(--font-ui);
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 190px;
}
.dock-btn svg {
  width: 15px;
  height: 15px;
  fill: #c9a55e;
  flex-shrink: 0;
}
.dock-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock-btn kbd,
.set-box kbd {
  display: inline-block;
  min-width: 14px;
  padding: 1px 4px;
  border: 1px solid #5b4830;
  border-bottom-width: 2px;
  background: rgba(0, 0, 0, 0.45);
  color: #a99470;
  font: 10px/1.2 var(--font-ui);
  text-align: center;
}
.dock-btn:hover {
  border-color: #c8a45c;
  color: #fff0c4;
}
.dock-btn:hover svg { fill: #f0cf7e; }
.dock-btn.coop-online {
  border-color: #4f8d47;
}
.dock-btn.coop-online svg { fill: #8fd982; }

.top-status {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.top-status:not(:has(> :not([hidden]))) { display: none; }
.status-chip {
  padding: 2px 7px;
  background: rgba(14, 11, 8, 0.82);
  border: 1px solid #4d3d28;
  color: #b7a37c;
  font: 10.5px/1.3 var(--font-ui);
  cursor: pointer;
}
.status-chip[hidden] { display: none; }
.status-chip.on { color: #ffe294; border-color: #a8863f; }
.status-chip.warn { color: #f0a58f; border-color: #7b3c2e; }

body.mobile-mode #area-card {
  min-width: 0;
  padding: 3px 7px 4px;
}
body.mobile-mode #area-name { font-size: 12px; }
body.mobile-mode #area-card #stats {
  font-size: 9.5px;
  background: none;
  padding: 0;
}
body.mobile-mode .dock-btn {
  height: 24px;
  padding: 0 5px;
  font-size: 10px;
  gap: 4px;
}
body.mobile-mode .dock-btn kbd,
body.mobile-mode .dock-btn .dock-lbl { display: none; }
body.mobile-mode .dock-btn svg { width: 14px; height: 14px; }

/* ---------------- Settings modal (inherits .char-modal-box panel_bg.webp stone frame) ---------------- */
.set-box {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  height: min(670px, calc(100vh - 32px));
}
.set-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 14px;
  margin-top: 6px;
}
.set-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 154px;
  flex-shrink: 0;
}
.set-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(12, 14, 19, 0.92);
  border: 1px solid #3a3d46;
  color: #b5aa94;
  font: 13.5px/1.1 var(--font-title);
  letter-spacing: 0.6px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.set-tab-ico {
  width: 18px;
  text-align: center;
  color: #8f7a52;
  font-size: 13px;
}
.set-tab:hover { border-color: #9e834e; color: #f5e4ba; background: rgba(24, 26, 32, 0.95); }
.set-tab.on {
  background: linear-gradient(90deg, #3e2f1a, #191817);
  border-color: #d9b86c;
  color: #fff2c4;
  box-shadow: inset 0 0 10px rgba(217, 184, 108, 0.2);
}
.set-tab.on .set-tab-ico { color: #f5d482; }
.set-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.set-body > .gfx-rows {
  flex: 0 0 auto;
  overflow: visible;
}
.set-body .gfx-gpu-banner { margin-top: 0; }
.set-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 6px;
  font: 14.5px/1.2 var(--font-title);
  color: #ebd086;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px #000;
  position: relative;
}
.set-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: url('../../assets/ui/divider.webp') center / 100% 4px no-repeat;
  opacity: 0.75;
}
.set-section:first-child { margin-top: 0; }
.set-sub {
  font: 12px/1.2 var(--font-title);
  color: #b59c69;
  margin-top: 2px;
}
.set-note {
  font-size: 11.5px;
  color: #9d8d70;
  line-height: 1.4;
}

/* skill binding cards */
.set-binds {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.set-bind-gap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-right: 6px;
  text-align: right;
  white-space: nowrap;
  font: 12px/1.3 var(--font-title);
  color: #b59c69;
}
.set-bind {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(24, 18, 12, 0.92);
  border: 1px solid #4f3e28;
  color: #e8d6aa;
  text-align: left;
  cursor: pointer;
  min-height: 58px;
}
.set-bind:hover { border-color: #b59454; }
.set-bind.picking {
  border-color: #f2d27c;
  box-shadow: 0 0 10px rgba(242, 210, 124, 0.35), inset 0 0 10px rgba(242, 210, 124, 0.12);
}
.set-bind .set-sk-ico { grid-row: 1 / span 2; }
.set-bind-key {
  display: flex;
  gap: 3px;
  align-items: center;
}
.set-bind-key .xb-badge { transform: scale(0.9); transform-origin: left center; }
.set-bind-name {
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-bind.empty .set-bind-name { color: #7e7058; font-style: italic; }
.set-sk-ico {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 1px solid #2c2318;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.set-sk-ico.empty {
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  color: #6f6047;
  font-size: 20px;
}

/* skill picker */
.set-picker {
  padding: 8px;
  background: rgba(10, 8, 5, 0.9);
  border: 1px solid #806538;
}
.set-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #d9c08a;
  margin-bottom: 6px;
}
.set-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 5px;
}
.set-pick-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 3px 4px;
  background: rgba(26, 20, 13, 0.92);
  border: 1px solid #45372a;
  color: #d8c7a0;
  cursor: pointer;
}
.set-pick-cell:hover { border-color: #c09a55; }
.set-pick-cell.on { border-color: #f2d27c; background: rgba(60, 45, 22, 0.92); }
.set-pick-cell.clear {
  justify-content: center;
  color: #a58f69;
  font-size: 12px;
  min-height: 62px;
}
.set-pick-name {
  font-size: 10.5px;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-pick-lv {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* sliders */
.set-slider {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.set-slider input[type="range"] {
  width: 190px;
  accent-color: #d4ad5c;
}
.set-slider-val {
  width: 38px;
  text-align: right;
  font: 11.5px/1 monospace;
  color: #e9d39a;
}

/* keyboard shortcut and gamepad tables */
.set-shortcuts-table,
.gp-map-table {
  margin: 6px 0 10px;
}
.set-shortcuts-table td.key-col {
  white-space: nowrap;
}
.set-shortcuts-table kbd {
  display: inline-block;
  min-width: 54px;
  padding: 3px 6px;
  background: rgba(14, 10, 7, 0.95);
  border: 1px solid #755f3c;
  color: #fae4a4;
  font: 12px/1.2 monospace;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.gp-map-table td.gp-col {
  white-space: nowrap;
  vertical-align: middle;
}
.gp-map-table .xb-badge {
  margin-right: 2px;
}

.set-body .gp-status-line { margin: 0; }
.set-body .gp-guide-grid { max-height: none; overflow: visible; }

@media (max-width: 640px), (max-height: 460px) {
  .set-layout { flex-direction: column; gap: 8px; margin-top: 8px; }
  .set-tabs { flex-direction: row; width: auto; overflow-x: auto; }
  .set-tab { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  .set-box { height: calc(100vh - 16px); }
  .set-slider input[type="range"] { width: 120px; }
  .set-binds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .set-bind-gap { display: none; }
}
body.mobile-mode .set-box { max-height: none; overflow: hidden; }

/* Character / Exit actions under the tab list */
.set-tabs-gap { flex: 1 1 auto; min-height: 12px; }
.set-tab.set-act { font-size: 13px; }
.set-tab.set-act kbd { margin-left: auto; }
.set-tab.exit { border-color: #5f2c24; color: #e6a596; }
.set-tab.exit:hover { border-color: #b4483a; color: #ffd2c8; }
.set-box { position: relative; }
.set-confirm-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 3, 2, 0.85);
  z-index: 30;
}
.set-confirm {
  width: min(460px, calc(100% - 32px));
  font-size: 13px;
  color: #d8c8a2;
}
.set-confirm-title { color: #dfca92; }
.set-confirm-desc { font-size: 12.5px; color: #c4bba8; line-height: 1.45; }
.set-confirm-btns { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.ui-small-btn.danger { border-color: #9a3d31; color: #ffc4b8; }
@media (max-width: 640px), (max-height: 460px) {
  .set-tabs-gap { display: none; }
}

/* Realm MOTD / maintenance banner (admin config) */
#realm-banner { position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: min(90vw, 640px);
  padding: 4px 14px; border: 1px solid #5a4a2a; border-radius: 3px; background: rgba(12, 10, 6, .82); color: #d8c99a;
  font-size: 13px; text-align: center; pointer-events: none; }
#realm-banner.warn { border-color: #8a2a1a; color: #ff9a80; }


/* Controller D-pad focus (ARPG options menu): highlighted row / button */
.set-box .set-focus {
  outline: 2px solid #ffd978;
  outline-offset: 1px;
  box-shadow: 0 0 14px rgba(255, 208, 96, 0.45);
}
.set-box .gfx-row.set-focus,
.set-box .gfx-preset-bar.set-focus {
  background: linear-gradient(90deg, rgba(92, 68, 30, 0.55), rgba(32, 24, 14, 0.2));
}
.set-box .gfx-row.set-focus .gfx-row-label::before {
  content: '▶ ';
  color: #ffd978;
}
.set-pad-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 16px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #524129;
  color: #c9b48a;
  font: 12.5px/1 var(--font-title);
}
.set-pad-legend > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- Auto Play tab ---------------- */
.ap-status-card {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(28, 21, 13, 0.92), rgba(14, 10, 7, 0.92));
  border: 1px solid #57442a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ap-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ap-task-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #ead6a4;
}
.ap-task-line strong { color: #c7ae78; font-weight: 600; }
.ap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b4d37;
  display: inline-block;
  flex-shrink: 0;
}
.ap-dot.on { background: #7ad96c; box-shadow: 0 0 6px rgba(122, 217, 108, 0.7); }
.ap-dot.warn { background: #f0b254; box-shadow: 0 0 6px rgba(240, 178, 84, 0.7); }
.ap-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  font-size: 11.5px;
  color: #b7a37c;
}
.ap-stat-chips b { color: #f2da99; font-weight: 600; }
.ap-log {
  margin-top: 2px;
  padding: 5px 7px;
  background: rgba(6, 5, 3, 0.65);
  border: 1px solid #3a2d1d;
  font-size: 11px;
  line-height: 1.35;
  color: #a89673;
  max-height: 96px;
  overflow-y: auto;
}
.ap-log-line {
  display: flex;
  gap: 7px;
}
.ap-log-t {
  color: #7d6c4e;
  font-family: monospace;
  min-width: 44px;
  text-align: right;
  flex-shrink: 0;
}
.ap-pick-btn {
  min-width: 120px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-pick-btn.picking {
  border-color: #f2d27c;
  color: #fff2c6;
  box-shadow: 0 0 8px rgba(242, 210, 124, 0.35);
}
.ap-picker-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.ap-picker .ap-cell {
  min-height: 34px;
  justify-content: center;
  padding: 6px 8px;
}
.ap-picker .ap-cell .set-pick-name {
  font-size: 11.5px;
  white-space: normal;
}
