/* Hand of playing cards (cards.js, hand.js) and selection suggestions. */

.hand-area { margin-top: 14px; }
.hand-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.hand-head h3 { margin: 0; }
.hand-over { display: inline-block; width: 1.15em; height: 1em; margin-left: 0.4em; vertical-align: -0.12em; }
.hand-over svg { display: block; width: 100%; height: 100%; }
.cards-fan { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-end; min-height: 108px; padding-top: 16px; }
.pgroup { display: inline-flex; }
.pgroup .pcard + .pcard { margin-left: -32px; }  /* every card keeps a 30px clickable strip */

.pcard {
  position: relative; width: 62px; height: 88px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 8px; cursor: pointer; user-select: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #fbf6ea), #fbf6ea 55%);
  border: 2px solid color-mix(in srgb, var(--c) 75%, #2a221e);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: #2a221e;
}
/* The raised card sits above the overlap so the one you clicked is the one that shows. */
.pcard:hover { transform: translateY(-4px); }
.pcard.raised { z-index: 1; transform: translateY(-16px); box-shadow: 0 10px 18px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--link-hover); }
.pcard:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pcard-corner { position: absolute; top: 3px; left: 6px; font: 800 0.8rem var(--font); }
.pcard-art { width: 40px; height: 40px; }
.pcard-name { font: 700 0.68rem var(--font); text-transform: uppercase; letter-spacing: 0.04em; }
.pcard-name.long { font-size: min(0.52rem, 9px); letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) { .pcard { transition: none; } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; min-height: 34px; }
.suggestions .why { font-size: 0.75rem; color: var(--muted); }
.suggestions button.off { opacity: 0.55; cursor: not-allowed; }
.trade-pick { display: inline-flex; gap: 4px; align-items: center; }
.trade-pick .pcard { width: 40px; height: 56px; }
.trade-pick .pcard-art { width: 24px; height: 24px; }
.trade-pick .pcard-name, .trade-pick .pcard-corner { display: none; }


/* Commodities stay a step more coloured than resources: gold cloth, blue coin, green paper. */
.pcard.commodity {
  border-color: color-mix(in srgb, var(--c) 72%, #2a221e);
  background: linear-gradient(165deg, color-mix(in srgb, var(--c) 52%, #fbf6ea), color-mix(in srgb, var(--c) 24%, #fbf6ea));
}
.pcard-ribbon {
  position: absolute; top: 4px; right: -2px; padding: 0 4px; border-radius: 3px 0 0 3px;
  background: #2a221e; color: #fbf6ea; font: 700 0.48rem var(--font); text-transform: uppercase; letter-spacing: 0.04em;
}
.trade-pick .pcard-ribbon { display: none; }

/* in a stack only the top card shows the commodity ribbon, so it never covers its neighbours */
.pgroup .pcard:not(:last-child) .pcard-ribbon { display: none; }
