
/* Il tavolo resta largo quanto la mano su schermi piccoli. */
body.sr-tressette {
  --tr-ink: #faf7ee;
  --tr-muted: #c2d5ca;
  --tr-gold: #f4cf85;
  --tr-line: #446357;
  --tr-felt: #153e33;
  --tr-panel: #132f27;
  color: var(--tr-ink);
}

.sr-tressette .tr-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-tressette .tr-page { width: min(100% - 32px, 1000px); margin: 0 auto 32px; padding: 0; }
.sr-tressette .tr-breadcrumb {
  position: static;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  height: auto;
  padding: 16px 0 10px;
  border: 0;
  background: none;
  backdrop-filter: none;
  color: var(--tr-muted);
  font-size: .82rem;
}
.tr-breadcrumb a { color: var(--tr-muted); }
.tr-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.tr-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: -.035em; }
.tr-heading p { margin: 3px 0 0; color: var(--tr-muted); font-size: .95rem; }
.tr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 228px); gap: 16px; align-items: start; }
.tr-game { min-width: 0; }
.tr-scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.tr-score { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--tr-line); border-radius: 8px; background: var(--tr-panel); }
.tr-score > div { display: grid; }
.tr-score span { color: var(--tr-muted); font-size: .84rem; }
.tr-score small { color: var(--tr-muted); font-size: .72rem; }
.tr-score strong { color: var(--tr-gold); font-size: 1.2rem; font-variant-numeric: tabular-nums; line-height: 1.18; white-space: nowrap; }
.tr-felt {
  padding: 10px 12px 8px;
  border: 2px solid #75593a;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 25%, #205242, var(--tr-felt) 65%, #14372f);
}
.tr-felt-head { display: flex; justify-content: space-between; gap: 6px; color: var(--tr-muted); font-size: .84rem; }
.tr-trick {
  display: grid;
  grid-template-columns: repeat(var(--tr-seats, 2), minmax(0, 78px));
  justify-content: center;
  gap: 10px;
  margin: 10px 0 6px;
}
.tr-slot { min-width: 0; max-width: 78px; text-align: center; }
.tr-slot-name { display: block; min-height: 1.35em; margin-bottom: 4px; color: var(--tr-muted); font-size: .77rem; }
.tr-slot[data-active] .tr-slot-name { color: var(--tr-gold); font-weight: 750; }
.tr-slot-card { display: block; aspect-ratio: 5 / 8; width: 100%; max-width: 64px; margin: auto; border: 1px dashed #638775; border-radius: 7px; background: #102e2559; }
.tr-slot-card[data-played] { border: 0; background: none; }
.tr-slot-card[data-winning] { outline: 2px solid var(--tr-gold); outline-offset: 2px; }
.tr-slot-card svg, .tr-card svg { display: block; width: 100%; height: auto; }
.tr-status { min-height: 2.65em; display: grid; place-items: center; margin: 3px 0 0; color: var(--tr-ink); text-align: center; font-size: .91rem; line-height: 1.25; }
.tr-status[data-yours] { color: var(--tr-gold); font-weight: 720; }

.tr-rack, .tr-result { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--tr-line); border-radius: 10px; background: var(--tr-panel); }
.tr-hand-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.tr-hand-head h2, .tr-result h2 { margin: 0; color: var(--tr-ink); font-size: 1rem; }
.tr-hand-head span { color: var(--tr-muted); font-size: .79rem; }
.tr-hand { display: grid; grid-template-columns: repeat(10, minmax(0, 64px)); gap: 5px; justify-content: center; }
.tr-card {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 8;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}
.tr-card[aria-disabled="true"] { cursor: default; }
.tr-card[data-other-suit] svg { opacity: .66; }
.tr-card[data-available]:hover { outline: 2px solid var(--tr-gold); outline-offset: 1px; }
.tr-draw, .tr-declared { margin: 6px 0 0; color: var(--tr-muted); font-size: .8rem; line-height: 1.35; }
.tr-draw:empty { display: none; }
.tr-result { border-color: #92794f; }
.tr-result h2 { font-size: 1.35rem; }
.tr-result p { margin: 6px 0; font-size: .95rem; }
.tr-result .tr-button { margin-top: 4px; }
.tr-rules { border: 1px solid var(--tr-line); border-radius: 10px; background: var(--tr-panel); }
.tr-rules summary { min-height: 44px; padding: 9px 10px; color: var(--tr-gold); font-weight: 700; cursor: pointer; }
.tr-rules > div { padding: 0 10px 10px; }
.tr-rules p { margin: 0 0 8px; color: var(--tr-muted); line-height: 1.4; font-size: .84rem; }
.tr-rules a, .tr-footer a { color: var(--tr-gold); font-size: .82rem; }
.tr-rules .tr-rank { color: var(--tr-gold); font-weight: 750; font-variant-numeric: tabular-nums; }

.tr-button, .tr-dialog select {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--tr-line);
  border-radius: 7px;
  background: #234539;
  color: var(--tr-ink);
  font: inherit;
  font-size: .87rem;
}
.tr-button { cursor: pointer; font-weight: 700; }
.tr-heading .tr-button { flex-shrink: 0; white-space: nowrap; }
.tr-button:hover { border-color: var(--tr-gold); }
.tr-primary { color: #241d12; background: var(--tr-gold); border-color: var(--tr-gold); }
.sr-tressette :is(button, a, summary, select, input):focus-visible { outline: 2px solid var(--tr-gold); outline-offset: 2px; }
.tr-dialog { position: fixed; inset: 0; margin: auto; width: min(100% - 28px, 390px); max-height: calc(100dvh - 28px); padding: 17px; border: 1px solid var(--tr-line); border-radius: 12px; color: var(--tr-ink); background: var(--tr-panel); }
.tr-dialog::backdrop { background: #021610bd; }
.tr-dialog form { display: grid; gap: 5px; }
.tr-dialog h2 { margin: 0 0 4px; font-size: 1.3rem; }
.tr-dialog select { width: 100%; margin: 0 0 6px; }
.tr-dialog .tr-check { display: flex; min-height: 44px; align-items: center; gap: 8px; }
.tr-dialog input { width: 19px; height: 19px; accent-color: var(--tr-gold); }
.tr-dialog-actions { display: flex; justify-content: end; gap: 8px; }
.tr-footer { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; padding: 12px; border-top: 1px solid var(--tr-line); }

@media (max-width: 760px) {
  .tr-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tr-hand { grid-template-columns: repeat(5, minmax(0, 59px)); }
  .tr-slot-card { max-width: 52px; }
}

@media (max-width: 380px) {
  .sr-tressette .tr-page { width: calc(100% - 20px); }
  .tr-heading p { font-size: .83rem; }
  .tr-heading { margin-bottom: 8px; }
  .tr-felt { padding-inline: 8px; }
  .tr-trick { gap: 6px; }
  .tr-slot-name { font-size: .68rem; }
  .tr-hand { grid-template-columns: repeat(5, minmax(0, 51px)); }
  .tr-rack { padding-inline: 7px; }
}

