/* Player controls: flat monster-list rows, with the shared three-button footer.
   Presentation only. Explicit selectors keep prose, names and resource inputs
   intact. Important declarations supersede old per-screen inline decoration. */
body[data-game-controls="flat-v1"] :is(
  button,input[type="submit"],input[type="button"],input[type="reset"],
  a.but,a.link,a.large,a.down,a[role="button"],
  a.alchemy-link,a.alchemy-refresh-button,a.bokor-link,a.contraband-link,
  a.fleet-monster-link,a.fleet-monster-refresh,a.forum-row,
  a.expedition-link,a.expedition-button,.sk-menu a,
  .smiles-picker-categories a,a.smiles-picker-back
){
  appearance:none!important;-webkit-appearance:none!important;
  box-sizing:border-box!important;display:block!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:7px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;
  box-shadow:none!important;color:#e06d17!important;
  font-family:inherit!important;font-size:inherit!important;line-height:1.3!important;
  text-align:left!important;text-decoration:none!important;
  white-space:normal!important;overflow-wrap:anywhere;vertical-align:middle;
  cursor:pointer;
}
body[data-game-controls="flat-v1"] :is(
  button,input[type="submit"],input[type="button"],input[type="reset"],
  a.but,a.link,a.large,a.down,a[role="button"],
  a.alchemy-link,a.alchemy-refresh-button,a.bokor-link,a.contraband-link,
  a.fleet-monster-link,a.fleet-monster-refresh,a.forum-row,
  a.expedition-link,a.expedition-button,.sk-menu a,
  .smiles-picker-categories a,a.smiles-picker-back
):hover{background:#171309!important;color:#f18b3e!important}
body[data-game-controls="flat-v1"] :is(
  button,input[type="submit"],input[type="button"],input[type="reset"],
  a.but,a.link,a.large,a.down,a[role="button"]
):active{background:#211b0f!important;box-shadow:none!important}

/* Archive menus also use non-interactive .link/.large wrappers. */
body[data-game-controls="flat-v1"] :is(div.link,div.large,div.forum-topic-row){
  box-sizing:border-box;background:#000!important;border:0!important;
  border-bottom:1px solid #19170f!important;border-radius:0!important;
  box-shadow:none!important;padding:7px 5px!important;
}
body[data-game-controls="flat-v1"] :is(div.link,div.large) > a{color:#e06d17}

/* Inline reply/delete tools and numbered pages keep their compact layout. */
body[data-game-controls="flat-v1"] :is(
  button.chat-reply-button,button.message-smiles-toggle,button.message-smiles-close,
  [data-inline-del] button,button[aria-label="Удалить сообщение"],
  .fleet-member-actions button,.monster-solo button,
  .page_nav a,a.page,a.forum-page,.mail-paging a,.smiles-picker-pages a
){
  display:inline-block!important;width:auto!important;max-width:100%!important;
  min-height:0!important;margin:0 2px!important;padding:3px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;
  box-shadow:none!important;color:#e06d17!important;
  text-decoration:none!important;vertical-align:baseline;
}
body[data-game-controls="flat-v1"] :is(button.chat-reply-button,button.message-smiles-toggle,[data-inline-del] button){font-size:12px!important}
body[data-game-controls="flat-v1"] .page_nav .page-number-row > a{display:flex!important;margin:0!important;padding:3px 0!important}
body[data-game-controls="flat-v1"] button.message-smiles-close{flex:none;width:28px!important;padding:0!important;line-height:28px!important;text-align:center!important;font-size:24px!important}
body[data-game-controls="flat-v1"] button.smiles-picker-item{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center!important;font-size:12px!important}
body[data-game-controls="flat-v1"] dialog button{min-height:40px;flex:1}

/* Preserve unavailable states and coloured information inside a control. */
body[data-game-controls="flat-v1"] :is(button,input[type="submit"],input[type="button"],input[type="reset"]):disabled,
body[data-game-controls="flat-v1"] :is(a,button)[aria-disabled="true"]{
  opacity:.6!important;color:#898474!important;background:#000!important;cursor:default!important;
}
body[data-game-controls="flat-v1"] .wip-disabled[style*="display:block"]{padding:7px 5px;border-bottom:1px solid #19170f;background:#000}
body[data-game-controls="flat-v1"] :is(a,button,input,summary):focus-visible{outline:2px solid #9bba83!important;outline-offset:2px}

/* Fleet invitations are compact mail cards with text-like POST actions. */
.fleet-invite-card{display:flex;align-items:flex-start;gap:8px;margin:8px 10px 12px;min-width:0}
.fleet-invite-card .fleet-invite-emblem{display:block;flex:0 0 40px;width:40px;height:40px;object-fit:contain}
.fleet-invite-card .fleet-invite-content{flex:1;min-width:0;overflow-wrap:anywhere}
.fleet-invite-card .fleet-invite-message{color:#368c39}
.fleet-invite-card .fleet-invite-message a{color:#e06d17;text-decoration:none}
.fleet-invite-card .fleet-invite-level{white-space:nowrap}
.fleet-invite-card .fleet-invite-actions{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:4px;color:#b9a67b}
.fleet-invite-card form.fleet-invite-action{display:inline-block;margin:0;padding:0}
body[data-game-controls="flat-v1"] .fleet-invite-card button.fleet-invite-choice{
 display:inline!important;width:auto!important;min-width:0!important;min-height:0!important;
 margin:0!important;padding:0!important;border:0!important;background:transparent!important;
 border-radius:0!important;box-shadow:none!important;color:#e06d17!important;
 font:inherit!important;line-height:inherit!important;vertical-align:baseline!important;
 text-decoration:none!important;white-space:nowrap!important;cursor:pointer
}
body[data-game-controls="flat-v1"] .fleet-invite-card button.fleet-invite-choice:hover{color:#f18b3e!important;background:transparent!important;text-decoration:underline!important}
.fleet-invite-card .fleet-invite-status{margin-top:2px}

/* Footer is deliberately the only bevelled control group. */
body[data-game-controls="flat-v1"] .foot{
  display:flex!important;flex-wrap:wrap!important;align-items:center!important;
  justify-content:center!important;gap:5px!important;
  margin:0!important;padding:10px 4px 0!important;
  background:transparent!important;border:0!important;
}
body[data-game-controls="flat-v1"] .foot > a{
  box-sizing:border-box!important;display:inline-flex!important;
  align-items:center!important;justify-content:center!important;gap:4px!important;
  width:auto!important;max-width:100%!important;min-width:0!important;
  min-height:30px!important;margin:0!important;padding:4px 9px!important;
  border:1px solid #171515!important;border-radius:3px!important;
  background:linear-gradient(#423a32,#211b19)!important;
  box-shadow:inset 0 1px 0 #ffffff0b!important;color:#b5c4da!important;
  font-family:inherit!important;font-size:14px!important;font-weight:normal!important;
  line-height:20px!important;text-align:center!important;
  text-decoration:none!important;white-space:nowrap!important;cursor:pointer;
}
body[data-game-controls="flat-v1"] .foot > a:hover{background:linear-gradient(#50463b,#2a2320)!important;color:#d2dcec!important}
body[data-game-controls="flat-v1"] .foot > a:active{background:#211b19!important;box-shadow:inset 0 1px 3px #0008!important}
body[data-game-controls="flat-v1"] .foot > a img{
  width:16px!important;height:16px!important;min-width:16px!important;
  max-width:16px!important;object-fit:contain;margin:0!important;padding:0!important;
  border:0!important;vertical-align:middle!important;flex:none;
}

/* Additional semantic controls found in the full source audit. */
body[data-game-controls="flat-v1"] details > summary{
  box-sizing:border-box;max-width:100%;margin:0;padding:7px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;
  color:#e06d17!important;font-family:inherit!important;font-size:inherit!important;
  line-height:1.3!important;text-align:left!important;white-space:normal!important;
  overflow-wrap:anywhere;cursor:pointer;
}
body[data-game-controls="flat-v1"] details > summary:hover{background:#171309!important;color:#f18b3e!important}

/* These are action/tab groups, not ordinary prose or player-name links. */
body[data-game-controls="flat-v1"] :is(
  .forum-news-actions > a,.forum-news-hide > button,
  .mail-tabs a,.alchemy-tabs > a,.stat-detail-nav > a,.fleet-member-kick > a
){
  box-sizing:border-box!important;display:inline-block!important;
  width:auto!important;max-width:100%!important;min-width:0!important;
  min-height:0!important;margin:0!important;padding:3px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;
  color:#e06d17!important;font-family:inherit!important;font-size:inherit!important;
  line-height:1.3!important;text-decoration:none!important;white-space:normal!important;
  overflow-wrap:anywhere;vertical-align:baseline;cursor:pointer;
}
body[data-game-controls="flat-v1"] :is(
  .forum-news-actions > a,.forum-news-hide > button,
  .mail-tabs a,.alchemy-tabs > a,.stat-detail-nav > a,.fleet-member-kick > a
):hover{background:#171309!important;color:#f18b3e!important}
body[data-game-controls="flat-v1"] .forum-news-hide{flex:none;margin:0}

/* Payment tabs retain their two-column layout and non-clickable current tab. */
body[data-game-controls="flat-v1"] nav[aria-label="Способ оплаты"] > :is(a,[aria-current="page"]){
  box-sizing:border-box!important;flex:1;min-width:0;max-width:100%;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;
  padding:7px 5px!important;color:#e06d17!important;text-decoration:none!important;
  white-space:normal!important;overflow-wrap:anywhere;text-align:center!important;
}
body[data-game-controls="flat-v1"] nav[aria-label="Способ оплаты"] > [aria-current="page"]{color:#bca579!important;cursor:default}
body[data-game-controls="flat-v1"] nav[aria-label="Способ оплаты"] > a:hover{background:#171309!important;color:#f18b3e!important}

/* The profile detail overlay is built by JavaScript after page rendering. */
body[data-game-controls="flat-v1"] [data-stat-detail-overlay] button[aria-label="Закрыть"]{
  display:inline-block!important;flex:none!important;width:28px!important;
  min-width:28px!important;min-height:28px!important;margin:0!important;padding:0!important;
  font-size:24px!important;line-height:28px!important;text-align:center!important;
}

/* Existing Harpy screen rules use !important with higher specificity.
   Only paint is overridden; state-driven display/cooldown rules stay intact. */
body[data-game-controls="flat-v1"] :is(.harpy-screen,.hell-harpy-screen) .monster-action button.but{
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;color:#e06d17!important;
}
body[data-game-controls="flat-v1"] :is(.harpy-screen,.hell-harpy-screen) .monster-action button.but:hover{background:#171309!important;color:#f18b3e!important}
body[data-game-controls="flat-v1"] :is(.harpy-screen,.hell-harpy-screen) .monster-action button.but:is(:disabled,[aria-disabled="true"]){
  opacity:.6!important;color:#898474!important;background:#000!important;cursor:default!important;
}


/* Preserve disabled state after the more specific compact action rules. */
body[data-game-controls="flat-v1"] :is(.forum-news-hide > button,.forum-news-actions > a,.mail-tabs a,.alchemy-tabs > a,.stat-detail-nav > a,.fleet-member-kick > a):is(:disabled,[aria-disabled="true"]){opacity:.6!important;color:#898474!important;background:#000!important;cursor:default!important}
/* Legacy table-card menus. The allowlist excludes names, inventory item links,
   stat values and explanatory inline links. Keep the icon/description cells. */
body[data-game-controls="flat-v1"] :where(.post,.under) td > :is(
  a[href="/tables"]:where(:has(>strong)),a[href="/commands"]:where(:has(>strong)),a[href="/ship?cmd=body"]:where(:has(>strong)),a[href="/hold"]:where(:has(>strong)),
  a[href^="/commands?cmd=show&ids="]:where(:has(>strong)),a[href^="/ship?cmd=show&act=body&ids="]:where(:has(>strong)),
  a[href="/masters?cmd=blacksmith"]:where(:has(>strong)),a[href="/masters?cmd=silver"]:where(:has(>strong)),
  a[href="/masters?cmd=john"]:where(:has(>strong)),a[href="/masters?cmd=erik"]:where(:has(>strong)),
  a[href^="/masters?cmd=john&act=get&id="],a[href="/pursuit?cmd=drugs&act=take"],
  a[href="/monsters?cmd=fonar"]:where(:has(>strong)),a[href="/monsters?cmd=kotel"]:where(:has(>strong))
){
  box-sizing:border-box!important;display:block!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:7px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;
  color:#e06d17!important;font-family:inherit!important;font-size:inherit!important;
  line-height:1.3!important;text-align:left!important;text-decoration:none!important;
  white-space:normal!important;overflow-wrap:anywhere;cursor:pointer;
}
body[data-game-controls="flat-v1"] :where(.post,.under) td > :is(
  a[href="/tables"]:where(:has(>strong)),a[href="/commands"]:where(:has(>strong)),a[href="/ship?cmd=body"]:where(:has(>strong)),a[href="/hold"]:where(:has(>strong)),
  a[href^="/commands?cmd=show&ids="]:where(:has(>strong)),a[href^="/ship?cmd=show&act=body&ids="]:where(:has(>strong)),
  a[href="/masters?cmd=blacksmith"]:where(:has(>strong)),a[href="/masters?cmd=silver"]:where(:has(>strong)),
  a[href="/masters?cmd=john"]:where(:has(>strong)),a[href="/masters?cmd=erik"]:where(:has(>strong)),
  a[href^="/masters?cmd=john&act=get&id="],a[href="/pursuit?cmd=drugs&act=take"],
  a[href="/monsters?cmd=fonar"]:where(:has(>strong)),a[href="/monsters?cmd=kotel"]:where(:has(>strong))
):hover{background:#171309!important;color:#f18b3e!important}

/* Item-card actions stay beside the item. Item/name links are not controls here. */
body[data-game-controls="flat-v1"] :where(.post,.under) td > a:is(
  [href^="/chest?cmd=put&id="],[href^="/chest?cmd=out&id="],
  [href^="/hold?cmd=put&id="],[href^="/showcase?cmd=out&id="],
  [href^="/ship?cmd=body&act=unequip&ids="],[href^="/ship?cmd=body&act=sell&ids="]
),
body[data-game-controls="flat-v1"] :where(.post,.under) td > form:is(
  [action^="/ship?cmd=body&act=unequip&equipment=5&ids="],
  [action^="/ship?cmd=body&act=sell&equipment=5&ids="],
  [data-chest-single]
) > button{
  box-sizing:border-box!important;display:inline-block!important;
  width:auto!important;max-width:100%!important;min-width:0!important;
  min-height:0!important;margin:0!important;padding:3px 5px!important;
  border:0!important;border-bottom:1px solid #19170f!important;
  border-radius:0!important;background:#000!important;box-shadow:none!important;
  color:#e06d17!important;font-family:inherit!important;font-size:inherit!important;
  line-height:1.3!important;text-align:left!important;text-decoration:none!important;
  white-space:normal!important;overflow-wrap:anywhere;vertical-align:baseline;cursor:pointer;
}
body[data-game-controls="flat-v1"] :where(.post,.under) td > a:is(
  [href^="/chest?cmd=put&id="],[href^="/chest?cmd=out&id="],
  [href^="/hold?cmd=put&id="],[href^="/showcase?cmd=out&id="],
  [href^="/ship?cmd=body&act=unequip&ids="],[href^="/ship?cmd=body&act=sell&ids="]
):hover,
body[data-game-controls="flat-v1"] :where(.post,.under) td > form:is(
  [action^="/ship?cmd=body&act=unequip&equipment=5&ids="],
  [action^="/ship?cmd=body&act=sell&equipment=5&ids="],[data-chest-single]
) > button:hover{background:#171309!important;color:#f18b3e!important}
body[data-game-controls="flat-v1"] :where(.post,.under) td > a:is(
  [href^="/chest?cmd=put&id="],[href^="/chest?cmd=out&id="],
  [href^="/hold?cmd=put&id="],[href^="/showcase?cmd=out&id="],
  [href^="/ship?cmd=body&act=unequip&ids="],[href^="/ship?cmd=body&act=sell&ids="]
)[aria-disabled="true"],
body[data-game-controls="flat-v1"] :where(.post,.under) td > form:is(
  [action^="/ship?cmd=body&act=unequip&equipment=5&ids="],
  [action^="/ship?cmd=body&act=sell&equipment=5&ids="],[data-chest-single]
) > button:is(:disabled,[aria-disabled="true"]){opacity:.6!important;color:#898474!important;background:#000!important;cursor:default!important}

/* Typed chest cards wrap complete actions together with their brackets. */
body[data-game-controls="flat-v1"] [data-vanhu-item] :where(.vanhu-item-actions){
  display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;margin-top:3px;min-width:0;
}
body[data-game-controls="flat-v1"] [data-vanhu-item] :where(.vanhu-item-action){
  display:inline-flex;align-items:baseline;max-width:100%;white-space:nowrap;
}
body[data-game-controls="flat-v1"] [data-vanhu-item] :where(.vanhu-item-actions) button{
  display:inline!important;width:auto!important;max-width:100%!important;min-width:0!important;
  min-height:0!important;margin:0!important;padding:3px 0!important;
  border:0!important;background:transparent!important;box-shadow:none!important;
  line-height:inherit!important;vertical-align:baseline;white-space:nowrap!important;
}
body[data-game-controls="flat-v1"] [data-vanhu-item] :where(.vanhu-item-actions) button:hover{
  background:transparent!important;color:#f18b3e!important;text-decoration:underline!important;
}
body[data-game-controls="flat-v1"] [data-vanhu-item] :where(.vanhu-item-actions) button:is(:disabled,[aria-disabled="true"]){
  opacity:.6!important;color:#898474!important;background:transparent!important;cursor:default!important;text-decoration:none!important;
}

/* Resource-lot withdrawal is an inline POST action between legacy brackets. */
body[data-game-controls="flat-v1"] form[action^="/auk?cmd=res&act=my&func=take&id="]{
  display:inline-flex!important;align-items:baseline;vertical-align:baseline;
  max-width:100%;margin:0;padding:0;white-space:nowrap;
}
body[data-game-controls="flat-v1"] form[action^="/auk?cmd=res&act=my&func=take&id="] > button{
  display:inline!important;width:auto!important;max-width:100%!important;min-width:0!important;
  min-height:0!important;margin:0!important;padding:3px 0!important;
  border:0!important;background:transparent!important;box-shadow:none!important;
  line-height:inherit!important;vertical-align:baseline;white-space:nowrap!important;
}
body[data-game-controls="flat-v1"] form[action^="/auk?cmd=res&act=my&func=take&id="] > button:hover{
  background:transparent!important;color:#f18b3e!important;text-decoration:underline!important;
}
body[data-game-controls="flat-v1"] form[action^="/auk?cmd=res&act=my&func=take&id="] > button:is(:disabled,[aria-disabled="true"]){
  opacity:.6!important;color:#898474!important;background:transparent!important;cursor:default!important;text-decoration:none!important;
}

/* A presentation rule must never reveal a control hidden by game state or JS. */
body[data-game-controls="flat-v1"] [hidden][hidden],
body[data-game-controls="flat-v1"] :is(button,input,a,summary)[hidden][hidden],
body[data-game-controls="flat-v1"] :is(button,input,a,summary)[style][style*="display:none" i],
body[data-game-controls="flat-v1"] :is(button,input,a,summary)[style][style*="display: none" i],
body[data-game-controls="flat-v1"] :is(button,input,a,summary)[style][style*="display :none" i],
body[data-game-controls="flat-v1"] :is(button,input,a,summary)[style][style*="display : none" i]{display:none!important}
/* The monster timer intentionally reserves one invisible grid cell. */
body[data-game-controls="flat-v1"] .monster-screen [data-boss-harpoon-ready-in] > [hidden][hidden]{display:block!important;visibility:hidden;pointer-events:none}
