/* v079: decorative surfaces only. The sea, minimap, map selector and navigation
   dialog are deliberately outside every selector below. No animated UI effects. */
.classic-frames {
  --frame-metal: #b39358;
  --frame-dim: #665334;
  --frame-light: #e6cf9e;
  --frame-text: #eee3cc;
  --frame-muted: #c1b59d;
  --frame-panel: #071014;
  --frame-edge: url('assets/ui/classic-frame.svg') 12 / 5px / 0 stretch;
  --frame-shadow: inset 0 0 0 1px #201b13, inset 0 0 0 3px #b393581c, 0 2px 8px #0008;
  --frame-button: linear-gradient(#3d392e, #171b19 48%, #0c1112);
  --frame-primary: linear-gradient(#856b43, #534025 48%, #34291c);
  --frame-wood: linear-gradient(#130b0680, #090705c9), url('assets/ui/sealight-wood.svg') center / 768px 384px;
}

body.classic-frames .comms-dock .chat-panel:has(.chat-body.hidden) { display: none; }
body.classic-frames #topChatButton[aria-expanded='true'] {
  background: var(--frame-primary);
  border-color: #d5b679;
}
@media (max-width: 650px) {
  body.classic-frames .chart-shortcuts {
    display: flex;
    flex-shrink: 1;
    min-width: 0;
    max-width: 45vw;
    overflow-x: auto;
    scrollbar-width: thin;
  }
}

/* Explicit frame owners prevent generic .panel/button rules from reaching maps. */
body.classic-frames :is(.mission, .comms-dock .panel, .comms-body,
  .combat-hud .action-dock, .combat-hud .utility-dock,
  .combat-hud .status-dock .ship-card, .combat-hud .status-dock .target-card,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card, .honor-card,
  dialog:not(:where(#mapModal, #navigationModal))) {
  border: 2px solid var(--frame-metal);
  border-image: var(--frame-edge);
  border-radius: 0;
  background: var(--frame-panel);
  color: var(--frame-text);
  box-shadow: var(--frame-shadow);
  backdrop-filter: none;
}

body.classic-frames :is(.mission > .panel-title, .comms-heading,
  .ship-menu-header, .market-links, .harbor-header, .harbor-footer,
  .seal-slot-menu header, .ammo-picker header,
  dialog:not(:where(#mapModal, #navigationModal)) .modal-panel > h2,
  .harbor-dialog > header) {
  background: var(--frame-wood);
  border-image: none;
  border-bottom: 1px solid var(--frame-metal);
  color: var(--frame-light);
  box-shadow: inset 0 1px #d8b77c30, inset 0 -1px #090705;
  font-family: Georgia, 'Times New Roman', serif;
  text-shadow: 0 1px 1px #000;
}
body.classic-frames .topbar {
  background: var(--frame-wood);
  border-bottom-color: var(--frame-metal);
  box-shadow: inset 0 -1px #171108;
}

/* Keep existing dialog dimensions, scrolling and mobile breakpoints. */
body.classic-frames dialog:not(:where(#mapModal, #navigationModal)) :is(.modal-panel,
  .ship-menu-content, .ship-menu-body, .market-workspace, .quest-workspace,
  .quest-catalog, .quest-details, .market-products, .seal-dialog-content) {
  background: var(--frame-panel);
  color: var(--frame-text);
  border-image: none;
}
body.classic-frames dialog:not(:where(#mapModal, #navigationModal)) .modal-panel {
  border: 0;
  border-radius: 0;
}
body.classic-frames :is(.ship-profile, .ship-vessel, .ship-performance,
  .ship-values, .ship-overview, .upgrade-item, .fleet-card, .elite-detail,
  .elite-cell, .quest-active, .market-sidebar, .harbor-nav, .harbor-captain,
  .harbor-readiness, .harbor-next, .harbor-confirm, .talent-branch) {
  border-color: var(--frame-dim);
  border-radius: 0;
  background-color: var(--frame-panel);
  background-image: none;
  box-shadow: inset 0 1px #c1a16c12;
}
body.classic-frames :is(.ship-menu-nav, .fleet-tabs, .cargo-tabs,
  .ship-menu-footer, .market-footer, .quest-footer) {
  background: #0b1011;
  border-color: var(--frame-dim);
  color: var(--frame-muted);
}
body.classic-frames :is(.ship-menu-content > h3, .quest-catalog > h3,
  .quest-details > h3, .market-sidebar h3, .market-products > h3) {
  color: var(--frame-light);
  border-color: var(--frame-dim);
}

/* Buttons stay the same size; tabs, controls and fields share one metal finish. */
body.classic-frames :is(.topbar, .mission, .comms-dock, .combat-hud,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card, .honor-page,
  dialog:not(:where(#mapModal, #navigationModal))) :is(button, summary,
  .empty-slot, .back-button, .account-primary) {
  background: var(--frame-button);
  border: 1px solid var(--frame-metal);
  border-image: none;
  border-radius: 0;
  box-shadow: inset 0 1px #e5c99433, inset 0 0 0 1px #11130f;
  color: var(--frame-text);
  text-shadow: 0 1px #000;
}
/* Disclosure headings are timber rather than ordinary command buttons. */
body.classic-frames .comms-dock .comms-heading {
  background: var(--frame-wood);
  border: 0;
  border-bottom: 1px solid var(--frame-dim);
  color: var(--frame-light);
}
body.classic-frames :is(.topbar, .mission, .comms-dock, .combat-hud,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card, .honor-page,
  dialog:not(:where(#mapModal, #navigationModal))) :is(button, summary,
  .back-button, .account-primary):not(:disabled):not([aria-disabled='true']):hover {
  border-color: #e3c68b;
  background: linear-gradient(#55503c, #27291e 48%, #171a15);
}
body.classic-frames :is(.topbar, .mission, .comms-dock, .combat-hud,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card,
  dialog:not(:where(#mapModal, #navigationModal))) :is(button, summary):not(:disabled):active {
  box-shadow: inset 0 2px 4px #000a;
}
body.classic-frames :is(.chat-channels, .ship-menu-nav, .fleet-tabs,
  .cargo-tabs, .market-links, .harbor-dialog nav) button[aria-pressed='true'],
body.classic-frames :is(#chatSend, .cargo-buy, .ship-control,
  .start-button, .account-primary, .seal-primary, #sealLoginButton) {
  background: var(--frame-primary);
  border-color: #d5b679;
  color: #fff1d3;
}
body.classic-frames :is(.topbar, .mission, .comms-dock, .combat-hud,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card,
  dialog:not(:where(#mapModal, #navigationModal))) :is(button:disabled, [aria-disabled='true']),
body.classic-frames :is(#chatSend, .cargo-buy, .ship-control,
  .start-button, .account-primary, .seal-primary, #sealLoginButton):disabled {
  background: #1b201e;
  border-color: #5e6253;
  color: #aaa99b;
  text-shadow: none;
}
body.classic-frames :is(.comms-dock, .ammo-picker, .account-card,
  dialog:not(:where(#mapModal, #navigationModal))) :is(input, select, textarea) {
  background: #040b0e;
  border: 1px solid var(--frame-dim);
  border-radius: 0;
  color: var(--frame-text);
  box-shadow: inset 0 1px 3px #0008;
}
body.classic-frames :is(.comms-dock, .ammo-picker, .account-card,
  dialog:not(:where(#mapModal, #navigationModal))) :is(input, textarea)::placeholder {
  color: #aaa99b;
}
body.classic-frames :is(.topbar, .mission, .comms-dock, .combat-hud,
  .ammo-picker, .seal-slot-menu, .harbor-frame, .account-card, .honor-page,
  dialog:not(:where(#mapModal, #navigationModal))) :focus-visible {
  outline: 2px solid #fff0b6;
  outline-offset: -2px;
}

/* Preserve active combat signals and drag/drop cues over the new surfaces. */
body.classic-frames .combat-hud :is(.action, .utility-row button, .empty-slot) {
  background: radial-gradient(ellipse at 45% 20%, #37362a, #080e11 80%);
}
body.classic-frames .combat-hud :is(.action.active, button[aria-pressed='true']) {
  border-color: #f2d391;
  box-shadow: inset 0 0 0 1px #d6b76b;
}
body.classic-frames .combat-hud .seal-drop-target {
  outline: 2px solid #f2d391;
  outline-offset: -2px;
  background: #66512b;
}
body.classic-frames .combat-hud :is(.bar.hp, .reference-xp-meter) {
  border: 1px solid var(--frame-metal);
  border-radius: 0;
  box-shadow: inset 0 1px #e3c68b33;
}
body.classic-frames .combat-hud #shipDetails {
  background: transparent;
  border: 0;
  box-shadow: none;
}
/* Target health follows the same responsive anchor and width as captain health. */
body.classic-frames .combat-hud .status-dock .target-card {
  position: absolute;
  left: calc(var(--toolbar-left) + var(--toolbar-actions) + 8px);
  right: auto;
  top: auto;
  bottom: 58px;
  width: var(--toolbar-status);
  max-width: none;
  transform: none;
  display: block;
}
body.classic-frames .combat-hud .status-dock #targetDetails {
  height: 25px;
  min-height: 25px;
  padding: 3px 0;
  gap: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body.classic-frames .combat-hud #targetDetails .hud-title { display: none; }
body.classic-frames .combat-hud .target-card .bar.enemy {
  height: 19px;
  min-height: 19px;
  border: 1px solid var(--frame-metal);
  border-radius: 0;
  background: #3e0d10;
  box-shadow: inset 0 1px #e3c68b33;
}
body.classic-frames .combat-hud .target-card .bar.enemy i {
  border-radius: 0;
  background: linear-gradient(#f16b5f, #d13232 45%, #951b24 60%, #cb303a);
}
body.classic-frames .combat-hud .status-dock #clearTarget {
  position: absolute;
  right: -29px;
  top: 0;
  width: 24px;
  min-width: 24px;
  height: 29px;
  min-height: 29px;
  padding: 0;
  font-size: 17px;
}
body.classic-frames .combat-hud .target-card.hidden { display: none; }
body.classic-frames .chat-panel .chat-resize {
  border: 0;
  border-left: 1px solid var(--frame-dim);
  background: linear-gradient(135deg, transparent 48%, #d5b679 49% 52%, transparent 53% 65%, #b39358 66% 69%, transparent 70%), #172019;
  color: var(--frame-light);
}
body.classic-frames dialog:not(:where(#mapModal, #navigationModal)) .close {
  border-radius: 0;
  background: var(--frame-button);
}

/* The online login template and honor page use the same lightweight frame. */
body.classic-auth main {
  border: 2px solid var(--frame-metal);
  border-image: var(--frame-edge);
  border-radius: 0;
  background: var(--frame-panel);
  box-shadow: var(--frame-shadow);
  color: var(--frame-text);
}
body.classic-auth h1 { color: var(--frame-light); font-family: Georgia, serif; }
body.classic-auth input {
  background: #040b0e;
  border: 1px solid var(--frame-dim);
  border-radius: 0;
  color: var(--frame-text);
  font-size: 16px;
}
body.classic-auth button {
  border: 1px solid var(--frame-metal);
  border-radius: 0;
  background: var(--frame-primary);
  color: #fff1d3;
  font: bold 16px Georgia, serif;
  box-shadow: inset 0 1px #e5c99433;
}
body.classic-auth button:not(:disabled):hover { border-color: #f2d391; }
body.classic-auth :focus-visible { outline: 2px solid #fff0b6; outline-offset: 2px; }
body.classic-auth button:disabled { background: #1b201e; color: #aaa99b; }
body.classic-auth #message { border-color: var(--frame-dim); background: #101917; }

/* Three health/XP strips fit inside the existing 84px timber footer. */
body.classic-frames .combat-hud .status-dock #shipDetails {
  height: 43px;
  min-height: 43px;
  padding: 3px 0;
  gap: 3px;
}
body.classic-frames .combat-hud .status-dock .target-card { bottom: 49px; }
body.classic-frames .combat-hud .status-dock #targetDetails {
  height: 21px;
  min-height: 21px;
  padding: 2px 0;
}
body.classic-frames .combat-hud .status-dock :is(.bar.hp, .bar.enemy, .reference-xp-meter) {
  height: 17px;
  min-height: 17px;
}
body.classic-frames .combat-hud .status-dock :is(.bar span, .reference-xp-meter > span) {
  font: bold 10px/13px Tahoma, Arial, sans-serif;
}
body.classic-frames .combat-hud .status-dock #clearTarget {
  right: 1px;
  top: 1px;
  height: 24px;
  min-height: 24px;
  width: 24px;
  min-width: 24px;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 1;
  font-size: 14px;
}
body.classic-frames .combat-hud #enemyHpText { padding-right: 24px; }
