/* Shared UI: keyword help, card info, glossary, class portraits, small screens, touch, dark look */
/* keyword help: card panels, tap bubble, guide */
.card .kw-panel { display: none; position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: 220px; z-index: 70; pointer-events: none;
  flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #0e1222; border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; }
.card .kw-panel div { font: 400 11.5px/1.4 var(--font-body); color: var(--muted); }
.card .kw-panel b { display: block; color: var(--gold-2); font-size: 12px; }
/* keywords are explained once, in the panel beside the card (tooltips.js .kw-pop); the panel above the card stays hidden */
.pile-grid .card { cursor: pointer; }
.tip-bubble {
  z-index: 9600 !important; position: fixed; max-width: 260px; padding: 9px 11px; border: 1px solid var(--gold-2); box-shadow: var(--shadow);
  font: 400 12.5px/1.45 var(--font-body); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s;
  background: var(--ivory) !important; color: var(--ink) !important; border-color: var(--royal) !important; border-radius: 0 !important;
}
.tip-bubble.show { opacity: 1; transform: none; }
.tip-bubble b { display: block; color: var(--gold-2); margin-bottom: 2px; }
.card-info { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; text-align: left; }
.card-info .card.big .kw-panel { display: none !important; }
.card-info .kw-list { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; }
.kw-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.kw-row > span { font-size: 18px; line-height: 1.2; }
.kw-row b { display: block; color: var(--gold-2); font-size: 13.5px; }
.kw-row small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.glossary { text-align: left; max-height: calc(62 * var(--hvh)); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.glossary h3 { margin: 10px 0 2px; font-family: var(--font-display); color: var(--gold-2); font-size: 16px; }

@media (max-width: 860px) {
  .arena.stage { grid-template-columns: 1fr 1fr; padding: 40px 8px 26px; min-height: 330px; }
  .stage .portrait-wrap { width: 100%; max-width: 230px; height: 200px; }
  #enemyPanel.final .portrait-wrap, #enemyPanel.big .portrait-wrap { max-width: 280px; height: 220px; }
  .log-box { width: min(260px, 70%); bottom: 4px; }
}
@media (max-width: 480px) {
  .arena.stage { min-height: 300px; padding-top: 38px; }
  .stage .portrait-wrap { height: 165px; }
  #enemyPanel.final .portrait-wrap, #enemyPanel.big .portrait-wrap { height: 175px; }
  .stage .plate { padding: 4px 6px 5px; }
  .stage .hpbar { width: 128px; }
  .stage .combatant .name { font-size: 13px; }
  .stage .intent { font-size: 12px; padding: 5px 9px; min-height: 32px; }
  .stage .intent-spacer { min-height: 32px; }
  .stage .floater { font-size: 26px; }
}
@media (hover: none) {
  .hand .card:hover:not(.unplayable) { transform: translateY(var(--lift)) rotate(var(--rot)); box-shadow: 0 8px 18px var(--shade-50); z-index: auto; }
  .card.selectable:hover, .pile:hover, .gear-slot:hover, .option-card:hover:not(:disabled) { transform: none; }
  [data-tip]:hover::after { display: none; }
}
.hand .card:active:not(.unplayable) { transform: translateY(-14px) scale(1.04); }

/* Codex: the Cutscenes tab */
.codex-scene .cs-art img { width: 100%; max-height: none; height: 92px; object-fit: cover; border-radius: 6px; }
.beast.codex-scene.unseen .cs-art img { filter: blur(5px) brightness(.35) grayscale(.6); }
.codex-scene .btn { align-self: flex-start; margin-top: auto; }
