/* web/hud/panel_actions.css
   What a side panel lets you act on: a row that opens a menu beside the panel
   (web/hud/beside_menu.js) -- an item in the Inventory panel, something worn in the
   Equipment panel -- that menu, drawn with the Panels menu's own rules (.menu, .mhead,
   .mi in web/play-panels.css), a question asked inside a panel (.pn-ask), a heading
   of yours with Remove heading, the Friends panel (web/hud/friends_panel.js), what
   the Link panel lets you do (web/hud/link_panel.js), and the Guild panel
   (web/hud/guild_panel.js), whose rows are the Friends panel's. */

/* A row you can act on is a button that still looks like its row. Its name carries the
   Tap indicator (web/hud/tap.css), and the one under the pointer or with its menu open
   the Tap indicator under the pointer. */
.inv-item.act, .eq-row.act {
  width: 100%; margin: 0; padding-top: 0; padding-bottom: 0; padding-right: .3em;
  background: none; border: 0; border-radius: 4px; font: inherit; text-align: left; cursor: pointer;
}
.inv-item.act { color: var(--pn-soft); }
.eq-row.act { color: inherit; padding-left: 0; }
.inv-item.act:focus-visible, .eq-row.act:focus-visible { outline: 1px solid #7fb2ff; outline-offset: -1px; }

/* The menu: placed by the script beside the panel, at the panel's text size. */
.menu.bm-menu {
  position: fixed; top: 0; right: auto; z-index: 40; font-family: var(--mono);
  min-width: 14em; max-width: min(22em, calc(100vw - 16px)); box-sizing: border-box;
  background: var(--tip-bg, #12141a); border: 1px solid #3a3f4b; border-radius: 6px;
  padding: .35em; color: var(--pn-text); box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.bm-menu .mhead {
  font-size: .93em; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--pn-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .3em; padding: .15em .5em .4em; border-bottom: 1px dashed var(--line);
}
.bm-menu .mi { display: flex; align-items: baseline; font-size: .93em; }
.bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bm-meta { flex: none; padding-left: 1.6em; font-size: .9em; color: var(--pn-faint); }
.bm-menu .mi.now, .bm-menu .mi.now .bm-meta { color: var(--tc); }
.bm-menu .mi:focus-visible { outline: 1px solid #7fb2ff; outline-offset: -1px; }
/* A piece's grade, the letter in its own look, in a column of its own at the right. */
.bm-grade { flex: none; min-width: 1ch; padding-left: 1.2em; text-align: right; font-weight: 700; }
.bm-meta + .bm-grade { padding-left: .8em; }
.bm-lead { display: inline-flex; align-items: center; }
.bm-grade.lead { padding: 0 .6em 0 0; min-width: 1.2ch; text-align: left; }
/* A choice you cannot take is dimmed, letter and all, with why under it. */
.bm-menu .mi.cant { opacity: .5; }
.bm-menu .mi.cant + .bm-note { padding-left: 1.2em; }
.bm-note { padding: 2px 8px 5px; font-size: .85em; color: var(--warn); }
.bm-note.none { color: var(--pn-label); }
.bm-input { display: flex; gap: 6px; padding: 4px 8px 6px; }
.bm-input input, .pn-ask-row input {
  flex: 1; min-width: 0; font: inherit; font-size: .9em; background: var(--cell); color: var(--ink);
  border: 1px solid var(--cell-edge); border-radius: 4px; padding: 2px 6px;
}
.bm-go { padding: 0 .8em; font-size: .85em; }
/* A menu opening with a card (web/hud/card.js, drawn by web/hud/tap.css) is wide enough for
   an inspect card's two columns, and keeps that width while the card is asked for. The card
   scrolls on its own, so the choices stay in view. One opening with the name alone keeps the
   menu's own width. */
.menu.bm-menu.carded { width: min(calc(46ch + 36px), calc(100vw - 16px)); max-width: none; }
.bm-menu .tap-card {
  max-height: min(24em, calc(var(--seen-h, 100vh) * .45));
  margin-bottom: 4px; border-bottom: 1px dashed var(--line);
}

/* A question asked inside a panel, before anything is changed. */
.pn-ask { margin: .3em 0 .5em; border: 1px solid #3a3f4b; border-radius: 6px; padding: .5em; background: #15171c; }
.pn-ask-q { font-size: .92em; color: var(--pn-text); }
.pn-ask-row { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .45em; }
.pn-ask-row input { min-width: 6em; }
.pn-ask-note { margin: .3em 0 0; font-size: .85em; color: var(--pn-label); }
.pn-ask-note[hidden] { display: none; }

/* A heading of yours: Remove heading after its rule, shown when pointed at. */
.pn-heading.own .hd-remove {
  order: 3; padding: 0 .7em; font-size: 1em; letter-spacing: 0; text-transform: none; opacity: 0;
}
.pn-heading.own:hover .hd-remove, .pn-heading.own:focus-within .hd-remove { opacity: 1; }

/* ---- friends (web/hud/friends_panel.js) --------------------------------- */
.dkpanel[data-panel="friends"], .rq-pop[data-panel="friends"] { --tc: #e98fd8; }
.fr-row { position: relative; min-height: var(--pn-row); display: flex; align-items: center; gap: .6em; }
.fr-dot { flex: none; width: .5em; height: .5em; border-radius: 50%; background: #7fd18e; }
.fr-row.off .fr-dot { background: #3a3f4b; }
.fr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pn-text); }
.fr-row.off .fr-name { color: var(--pn-faint); }
.fr-what { flex: none; color: var(--pn-label); font-size: .9em; white-space: nowrap; }
/* Unfriend sits over the row's right end, shown when the row is pointed at. */
.fr-drop {
  position: absolute; right: 0; padding: 0 .7em; font-size: .82em;
  background: var(--panel); opacity: 0;
}
.fr-row:hover .fr-drop, .fr-row:focus-within .fr-drop { opacity: 1; }
.fr-ask { margin-top: .7em; }
.fr-ask .pn-ask-row { margin-top: 0; }

/* ---- the Link panel's actions (web/hud/link_panel.js) -------------------- */
/* The leader's member: its name row is a button that still looks like the row, the
   name carrying the Tap indicator (web/hud/tap.css). */
.lk .lk-act {
  flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: .6em;
  margin: 0 -.3em; padding: 0 .3em; background: none; border: 0; border-radius: 4px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.lk .lk-act:focus-visible { outline: 1px solid #7fb2ff; outline-offset: -1px; }
.lk-ask { margin-top: .7em; }
.lk-ask > .pn-ask-q + .pn-ask-row { margin-top: .45em; }
.lk-ask > .pn-ask-row:first-child { margin-top: 0; }
.lk-foot { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .7em; }

/* ---- the Guild panel (web/hud/guild_panel.js) ---------------------------- */
.gd-motd { display: flex; align-items: baseline; gap: .6em; margin: .1em 0 .6em; }
.gd-motd-text { flex: 1; min-width: 0; color: var(--pn-text); font-style: italic; overflow-wrap: anywhere; }
.gd-motd.empty .gd-motd-text { color: var(--pn-faint); font-style: normal; }
.gd-edit { flex: none; padding: 0 .7em; font-size: .82em; }
.gd-editor .pn-ask-row input { flex-basis: 100%; }
.gd-rank { flex: none; color: var(--pn-label); font-size: .9em; white-space: nowrap; }
.fr-row.off .gd-rank { color: var(--pn-faint); }
/* A row you may act on holds its parts in a button that still looks like the row, the
   name carrying the Tap indicator (web/hud/tap.css). */
.gd .gd-act {
  flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: .6em;
  margin: 0 -.3em; padding: 0 .3em; background: none; border: 0; border-radius: 4px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.gd .gd-act:focus-visible { outline: 1px solid #7fb2ff; outline-offset: -1px; }
.gd-ask { margin-top: .7em; }
.gd-ask .pn-ask-row { margin-top: 0; }
.gd-foot { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .7em; }

/* With touch controls (web/hud/controls.js), what pointing shows is always there.
   The condition sits in :where(), as in web/hud/touch.css. */
:where(:root[data-controls="touch"]) .pn-heading.own .hd-remove { opacity: 1; }
:where(:root[data-controls="touch"]) .fr-drop { position: static; opacity: 1; }
