.mode { color: var(--secondary); font-size: 13px; font-weight: 700; text-align: end; }
.table-meta { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: 13px; }
#trump { color: #d0e5d8; font-size: 12px; }
#trump[data-broken] { color: #ffe7a8; }
.seats {
  display: grid; grid-template-columns: minmax(58px,1fr) minmax(110px,2fr) minmax(58px,1fr);
  grid-template-areas: ". partner ." "left trick right" ". you .";
  align-items: center; gap: 4px; margin-block-start: 6px;
}
.seat { display: grid; justify-items: center; gap: 2px; padding: 4px; border: 1px solid transparent; border-radius: 6px; text-align: center; }
.seat[data-turn] { border-color: #efcd84; background: #2b6352; }
.seat strong { font-size: 13px; }
.seat small { color: #dcf0e0; font-size: 11px; }
.seat[data-seat="0"] { grid-area: you; }
.seat[data-seat="1"] { grid-area: left; }
.seat[data-seat="2"] { grid-area: partner; }
.seat[data-seat="3"] { grid-area: right; }
.trick {
  grid-area: trick; display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  grid-template-areas: ". north ." "west . east" ". south .";
  justify-items: center; align-items: center; gap: 2px; min-height: 100px;
}
.played {
  display: grid; align-content: center; justify-content: center; width: clamp(27px,8vw,45px); min-height: 34px;
  border: 1px dashed #7ea994; border-radius: 5px; color: #c8e0d2; font-size: 13px; font-weight: 750;
}
.played[data-card] { border-style: solid; background: #fffdf5; color: #172b23; border-color: #b7c8b8; }
.played[data-card][data-red] { color: #a22233; }
.played[data-winner] { outline: 2px solid #f8d587; outline-offset: 1px; }
.played[data-seat="0"] { grid-area: south; }
.played[data-seat="1"] { grid-area: west; }
.played[data-seat="2"] { grid-area: north; }
.played[data-seat="3"] { grid-area: east; }
.status { min-height: 20px; }
.panel { margin-block: 8px; }
.panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-block-end: 4px; }
.panel-heading h2, .result h2 { margin: 0; font-size: 14px; }
.panel-heading span { color: var(--secondary); font-size: 12px; }
.bids, .hand { display: grid; grid-template-columns: repeat(13, minmax(0,1fr)); gap: 4px; }
.bid, .hand-card {
  min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 5px;
  padding: 2px; font-size: 14px; font-weight: 750; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bid { background: var(--soft); }
.bid[data-suggested] { border-color: var(--accent); color: var(--accent); }
.bid:hover:not(:disabled) { border-color: var(--accent); }
.hand-card { min-height: 49px; display: grid; align-content: center; gap: 0; background: #fffdf5; color: #162c23; line-height: 1; }
.hand-card span:last-child { font-size: 17px; }
.hand-card[data-red] { color: #a22233; }
.hand-card[data-legal] { border: 2px solid var(--accent); }
.hand-card[data-legal]:hover { background: #e9f3e8; }
.hand-card[data-blocked] { opacity: .44; }
.hand-card:disabled { cursor: default; }
.result { padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); }
.result-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.result-team { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.result-team strong { display: block; color: var(--accent); font-size: 18px; }
.result-team small { display: block; color: var(--secondary); font-size: 12px; }
.actions { margin-top: 8px; }
@media (max-width: 560px) {
  .bids, .hand { grid-template-columns: repeat(7,minmax(0,1fr)); }
  .seat { padding: 2px; }
  .seat strong { font-size: 12px; }
  .seat small { font-size: 10px; }
  .played { min-height: 30px; }
}
.actions button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* The diamond of seats stays the same for each four-seat trick game. */
.trick-game .card-room { padding-inline: clamp(16px, 5vw, 70px); }
.trick-game .table { padding: 0; background: transparent; border: 0; }
.trick-game .table-meta { justify-content: center; column-gap: clamp(8px, 3vw, 32px); flex-wrap: wrap; }
.trick-game .seats { max-width: 700px; margin-inline: auto; }
.trick-game .card-room[data-phase="bid"] .trick { display: none; }
.trick-game .seat { border-radius: 9px; color: var(--room-ink); }
.trick-game .seat[data-turn] { border-color: var(--gold); background: #0e3c2d; }
.trick-game .seat small, .trick-game .panel-heading span { color: var(--room-soft); }
.trick-game .played[data-card] { background: #fcf5e5; border-color: #d7c7a3; color: var(--rank-ink); }
.trick-game .played[data-card][data-red] { color: var(--rank-red); }
.trick-game .card-room .status { margin: 8px 0; }
.trick-game .panel { width: min(760px, 100%); margin-inline: auto; }
.trick-game .hand-panel .panel-heading { justify-content: center; }
.trick-game .card-room .hand { padding-block-start: 4px; }
.trick-game .card-room .hand-card[data-legal] { border: 2px solid var(--gold); }
.trick-game .card-room .hand-card[data-legal]:hover { background: #ffedbf; }
.trick-game .card-room .hand-card[data-blocked] { opacity: 1; color: #425b4e; background: #b1c4b6; border-color: #a1b8a7; }
.trick-game .card-room .hand-card[data-blocked][data-red] { color: #774548; }
.trick-game .bid { background: #0f392b; color: var(--room-ink); border-color: #a0bca680; }
.trick-game .bid[data-suggested] { background: var(--gold); color: #241c0e; border-color: var(--gold); }
.trick-game .bid:hover:enabled { border-color: var(--gold); }
.trick-game .result-team { background: transparent; border-color: #93ac9460; }
.trick-game .result-team strong { color: var(--gold); }
.trick-game .result-team small { color: var(--room-soft); }
.trick-game #next { background: var(--gold); color: #241c0e; border-color: var(--gold); }

@media (orientation: landscape) and (max-height: 550px) {
  .trick-game .seats { grid-template-rows: auto auto auto; margin-block-start: 1px; gap: 1px; }
  .trick-game .seat { padding: 1px 4px; gap: 0; }
  .trick-game .seat strong, .trick-game .table-meta, .trick-game .panel-heading span { font-size: 11px; }
  .trick-game .seat small { font-size: 10px; }
  .trick-game .trick { min-height: 62px; }
  .trick-game .played { min-height: 25px; font-size: 11px; }
  .trick-game .panel { margin-block: 4px; }
  .trick-game .bid { min-height: 32px; }
  .trick-game .bids { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .trick-game .card-room .status { margin-block: 3px; }
  .trick-game .card-room[data-phase="over"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "table status" "table result" "table actions";
    align-content: center;
    column-gap: clamp(12px, 3vw, 32px);
    padding-block: 14px;
    border-radius: 8% / 18%;
  }
  .trick-game .card-room[data-phase="over"] .table { grid-area: table; align-self: center; }
  .trick-game .card-room[data-phase="over"] .status { grid-area: status; font-size: clamp(17px, 2.5vw, 25px); }
  .trick-game .card-room[data-phase="over"] .result { grid-area: result; }
  .trick-game .card-room[data-phase="over"] .actions { grid-area: actions; }
}

.ohhell-game #bids { grid-template-columns: repeat(auto-fit, minmax(30px, 1fr)); }
.ohhell-game .seat { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 6px; }
.ohhell-game .seat strong { flex: 0 0 100%; }
.ohhell-game .bid:disabled { opacity: .45; cursor: default; }
.ohhell-game .result-teams { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ohhell-game .result-team[data-winner] { border-color: var(--gold); }
@media (orientation: portrait) and (max-width: 390px) {
  .trick-game .seats { grid-template-columns: minmax(0, 1fr) minmax(84px, 1.3fr) minmax(0, 1fr); }
}
@media (max-width: 390px), (orientation: landscape) and (max-height: 550px) {
  .ohhell-game .result-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.euchre-game #bids { display: flex; flex-wrap: wrap; gap: 6px; }
.euchre-game #bids button { flex: 1; padding-inline: 9px; white-space: nowrap; }
.euchre-game .call-options { display: flex; align-items: center; gap: 12px; }
.euchre-game .call-options label { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; white-space: nowrap; }
.euchre-game .call-options #bids { flex: 1; }
.euchre-game #alone { width: 18px; height: 18px; accent-color: #edc47b; }
.euchre-game .seat[data-resting] { opacity: .55; }
.euchre-game .seat[data-maker] strong { color: var(--gold); }
.euchre-game .seat { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 6px; }
.euchre-game .seat strong { flex: 0 0 100%; }
@media (max-width: 500px) {
  .euchre-game .call-options { flex-wrap: wrap; gap: 3px; }
  .euchre-game .call-options #bids { flex-basis: 100%; }
}

.briscola-game .seats {
  max-width: 620px;
  grid-template-columns: 1fr;
  grid-template-areas: "partner" "trick" "you";
}
.briscola-game .seat[data-seat="1"] { grid-area: partner; }
.briscola-game .trick {
  grid-template-columns: 1fr;
  grid-template-areas: "north" "south";
  min-height: 82px;
}
.briscola-game .played[data-seat="1"] { grid-area: north; }
.briscola-game .card-room .hand { display: flex; gap: 8px; }
.briscola-game .card-room .hand-card + .hand-card { margin-inline-start: 0; }
.briscola-game .hand-card .card-value { position: absolute; left: 5px; bottom: 6px; color: #665332; font-size: 11px; }
@media (orientation: landscape) and (max-height: 550px) {
  .briscola-game .trick { min-height: 54px; }
  .briscola-game .hand-card .card-value { bottom: 4px; font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 370px) {
  .euchre-game .played { min-height: 21px; }
  .euchre-game .trick { gap: 1px; }
  .euchre-game .card-room:is([data-phase="bid"], [data-phase="discard"]) .seats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "left partner right you";
  }
  .euchre-game .card-room[data-phase="discard"] .trick { display: none; }
}

@media (orientation: portrait) and (max-width: 700px) {
  .briscola-game .card-room .hand-card { height: 78px; }
}
/* Playable vs not (Muse #41): when some cards can be played, the others dim; playable ones lift on hover.
   While nothing is playable (bidding, waiting), the hand stays fully readable. */
.trick-game .hand:has(.hand-card:enabled) .hand-card:disabled { opacity: .5; filter: saturate(.5); }
@media (hover: hover) { .trick-game button.hand-card:enabled:hover { transform: translateY(-5px); } }

/* Character avatars above seat names. */
.seat > .lp-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #f4e7c4; overflow: hidden; box-shadow: 0 1px 3px #0005; }
.seat > .lp-avatar svg { display: block; width: 100%; height: 100%; }
.seat[data-turn] > .lp-avatar, .seat[data-active] > .lp-avatar { border-color: var(--gold); }
@media (max-width: 420px), (orientation: landscape) and (max-height: 480px) { .seat > .lp-avatar { width: 28px; height: 28px; border-width: 1px; } }
