@font-face {
  font-family: "Liberation Sans";
  src: url("/assets/fonts/LiberationSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Liberation Sans";
  src: url("/assets/fonts/LiberationSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cirulla Text";
  src: url("/assets/fonts/Nunito-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cirulla Text";
  src: url("/assets/fonts/Nunito-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cirulla Display";
  src: url("/assets/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c1814;
  --cream: #f4ead6;
  --paper: #fff9ef;
  --teal: #123f3c;
  --lagoon: #1d6a62;
  --deep: #0d2224;
  --coral: #c4472f;
  --gold: #c6a15b;
  --line: rgba(28, 24, 20, 0.12);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-family: "Cirulla Text", "Liberation Sans", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body, body * { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100vh;
  touch-action: manipulation;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(198, 161, 91, 0.16), transparent 50%),
    var(--deep);
  color: var(--cream);
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.app {
  width: min(440px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #071625;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px 8px;
}

.brand {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.brand span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Sistema unificato pulsanti */
.ghost, .primary, .quiet, .secondary {
  border-radius: 18px;
  border: 0;
  padding: 12px 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.ghost:active, .primary:active, .quiet:active, .secondary:active {
  transform: scale(0.97);
}

.ghost {
  background: rgba(10, 38, 41, 0.5);
  color: var(--cream);
  border: 1px solid rgba(244, 234, 214, 0.25);
  backdrop-filter: blur(8px);
}

.quiet {
  background: rgba(255, 249, 239, 0.1);
  color: var(--cream);
  backdrop-filter: blur(8px);
}

.primary {
  background: linear-gradient(180deg, #e25a3f, #c4472f);
  color: white;
  box-shadow: 0 4px 12px rgba(196, 71, 47, 0.35);
  text-align: center;
  justify-content: center;
}

.secondary {
  background: linear-gradient(180deg, #ffe57a, #e2ae22);
  color: #3a2a08;
  box-shadow: 0 4px 12px rgba(226, 174, 34, 0.35);
  font-weight: 700;
}

.primary:disabled, .ghost:disabled, .quiet:disabled, .secondary:disabled { 
  opacity: 0.5; 
  cursor: default; 
  transform: none;
}

/* Pulsanti con icone */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-icon svg,
.btn-icon .icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
  margin-top: -1px;
  vertical-align: middle;
}

.home, .lobby {
  width: calc(100% - 28px);
  margin: 12px auto 32px;
}

.panel {
  background: var(--cream);
  color: var(--ink);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel h2 { 
  margin: 0 0 10px; 
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.lede { margin: 0 0 16px; line-height: 1.45; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

label.field { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  font-size: 0.95rem;
  font-weight: 600;
}

input, select {
  border: 2px solid rgba(28, 24, 20, 0.12);
  background: var(--paper);
  border-radius: 14px;
  padding: 14px;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--lagoon);
}

.or {
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 16px 0;
  color: rgba(28, 24, 20, 0.55);
}

.ticket {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 2px dashed rgba(198, 161, 91, 0.4);
  border-radius: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(242, 193, 77, 0.12), rgba(198, 161, 91, 0.08));
  margin-bottom: 16px;
}

.ticket-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ticket-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ticket strong {
  font-size: 2rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  line-height: 1.1;
}

.ticket small {
  color: var(--ink);
  opacity: 0.75;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.screen .ticket small {
  color: rgba(246, 237, 216, 0.88);
  opacity: 1;
}

.screen .ticket .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.choices { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }

.choices button, .seat-card {
  border-radius: 16px;
  border: 2px solid rgba(28, 24, 20, 0.15);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.choices button:hover {
  border-color: rgba(28, 24, 20, 0.25);
  background: rgba(255, 249, 239, 0.9);
}

.choices button.on {
  background: linear-gradient(135deg, #1d6a62, #123f3c);
  color: var(--cream);
  border-color: var(--lagoon);
  box-shadow: 0 4px 12px rgba(29, 106, 98, 0.35);
}

.back-choices button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 108px;
}

.back-choices img {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  background: #123f3c;
}

.table-choices button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 156px;
}

.table-choices img {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.seat-list { display: grid; gap: 10px; }

.seat-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.seat-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.seat-who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.seat-card .avatar {
  width: 36px;
  height: 36px;
  flex: none;
}

.note { font-size: 0.92rem; line-height: 1.4; }

.scores {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scroll-padding: 16px;
  scroll-snap-type: x proximity;
}

.scores::-webkit-scrollbar {
  height: 4px;
}

.scores::-webkit-scrollbar-track {
  background: rgba(244, 234, 214, 0.05);
  border-radius: 2px;
}

.scores::-webkit-scrollbar-thumb {
  background: rgba(244, 234, 214, 0.25);
  border-radius: 2px;
}

.scores::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 234, 214, 0.35);
}

.chip {
  background: linear-gradient(145deg, rgba(244, 234, 214, 0.14), rgba(244, 234, 214, 0.08));
  border: 1.5px solid rgba(244, 234, 214, 0.25);
  border-radius: 16px;
  padding: 12px 14px;
  min-width: 120px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.chip:hover {
  background: linear-gradient(145deg, rgba(244, 234, 214, 0.2), rgba(244, 234, 214, 0.12));
  border-color: rgba(244, 234, 214, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chip.yours { 
  border-color: var(--gold); 
  background: linear-gradient(145deg, rgba(198, 161, 91, 0.2), rgba(198, 161, 91, 0.12));
  box-shadow: 0 3px 10px rgba(198, 161, 91, 0.25);
}

.chip b { 
  display: block; 
  font-size: 1.2rem; 
  margin-bottom: 2px;
  color: var(--cream);
}

.chip small { 
  opacity: 0.85; 
  font-size: 0.88rem;
}

.chip hr {
  border: 0;
  border-top: 1px solid rgba(244, 234, 214, 0.3);
  margin: 10px 0 8px;
}

.chip-stats {
  display: block;
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0.9;
}

@media (display-mode: standalone) {
  #install { display: none; }
}

.arena {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  grid-template-columns: 108px 1fr 108px;
  grid-template-areas:
    "north north north"
    "west felt east"
    "south south south";
}

.arena.players-2 {
  grid-template-areas:
    "north north north"
    "felt felt felt"
    "south south south";
}

.arena.players-3 {
  grid-template-areas:
    "west felt east"
    "south south south";
}

.north { grid-area: north; }
.west { grid-area: west; }
.east { grid-area: east; }
.south { grid-area: south; }
.felt { grid-area: felt; }

.seat {
  background: rgba(8, 22, 24, 0.45);
  border-radius: 16px;
  padding: 8px;
  min-height: 74px;
}

.seat.turn { outline: 2px solid var(--gold); }

.seat .who {
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.who .role {
  font-weight: 400;
}

.mini-hand .card, .mini-hand .back, .backs .back { width: 48px; }

.backs, .mini-hand, .table-cards, .hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.felt {
  --felt-image: url("/assets/img/table.png");
  --felt-fallback: radial-gradient(circle at 50% 40%, #2a7f74, #114940 70%);
  min-height: 280px;
  border-radius: 24px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(7, 28, 30, 0.18), rgba(7, 28, 30, 0.42)),
    var(--felt-image) center/cover no-repeat,
    var(--felt-fallback);
  box-shadow: inset 0 0 0 1px rgba(244, 234, 214, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.felt[data-felt="verde"] {
  --felt-image: url("/assets/img/tables/verde.png");
  --felt-fallback: radial-gradient(circle at 50% 40%, #1d6a42, #0c3022 70%);
}

.felt[data-felt="bordeaux"] {
  --felt-image: url("/assets/img/tables/bordeaux.png");
  --felt-fallback: radial-gradient(circle at 50% 40%, #7a2434, #391018 70%);
}

.felt-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.deck-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 22, 24, 0.45);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
}

.deck-pill .back { width: 36px; }

.table-cards { justify-content: center; min-height: 150px; }

.empty-table {
  margin: auto;
  opacity: 0.85;
  font-style: italic;
}

.card, .back {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  border: 0;
  padding: 0;
  position: relative;
  background: #f4ead6;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.hand .card { width: 92px; }

.card img, .back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card:disabled { opacity: 0.72; }

.card.playable { transform: translateY(0); transition: transform 0.12s ease; }

.card.playable:active, .card.playable:focus-visible { transform: translateY(-8px); }

@media (hover: hover) {
  .card.playable:hover { transform: translateY(-8px); }
}

.wild {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: var(--coral);
  color: white;
  font-style: normal;
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 2px 4px;
  text-align: center;
}

.you {
  background: rgba(244, 234, 214, 0.08);
  border-radius: 18px;
  padding: 10px;
}

.you .who {
  margin: 2px 0 18px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.4;
}

.banner {
  background: var(--cream);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}

.banner.turn-cue {
  max-width: 26rem;
  margin: 0 auto 16px;
  padding: 12px 16px 13px;
  background: rgba(244, 234, 214, 0.1);
  color: var(--cream);
  border: 1px solid rgba(244, 234, 214, 0.28);
  border-radius: 14px;
  text-align: center;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: none;
}

.banner.turn-cue strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.banner .quiet {
  color: var(--ink);
  background: rgba(28, 24, 20, 0.08);
}

.banner p { margin: 4px 0 10px; }

.banner .row, .sheet .row { display: flex; flex-wrap: wrap; gap: 8px; }

.log {
  list-style: none;
  margin: 12px 0 20px;
  padding: 16px;
  max-height: 240px;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.5;
  background: rgba(28, 24, 20, 0.04);
  border-radius: 14px;
  border: 1px solid rgba(28, 24, 20, 0.08);
}

.log li { 
  padding: 6px 0; 
  opacity: 0.88;
  border-bottom: 1px solid rgba(28, 24, 20, 0.05);
}

.log li:last-child {
  border-bottom: none;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(440px, 100%);
  transform: translateX(-50%);
  background: rgba(8, 18, 20, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 120;
  padding: 0;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.overlay.is-enter {
  animation: overlay-appear 0.2s ease-out;
}

@keyframes overlay-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  width: 100%;
  max-height: 82vh;
  overflow: auto;
  background: var(--cream);
  color: var(--ink);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 26px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.overlay.is-enter .sheet {
  animation: sheet-slide 0.3s ease-out;
}

@keyframes sheet-slide {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet h3 { 
  margin: 0 0 12px; 
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.sheet .lede {
  margin: 0 0 20px;
  line-height: 1.5;
  color: rgba(28, 24, 20, 0.85);
}

.sheet p {
  margin: 0 0 16px;
}

.sheet p:last-child {
  margin-bottom: 0;
}

.sheet form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet form p {
  margin: 0;
}

.sheet .field {
  margin-bottom: 0;
}

.sheet button + button {
  margin-top: 10px;
}

.sheet .primary {
  width: 100%;
}

.sheet .quiet {
  width: 100%;
}

.sheet button.option {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
}

table.points {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.points th, table.points td {
  text-align: right;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
}

table.points th:first-child, table.points td:first-child { text-align: left; }

.net-banner {
  margin: 8px 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe57a, #e2ae22);
  color: #3a2a08;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(400px, calc(100vw - 24px));
  margin: 0;
  padding: 10px 8px 10px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.35;
  font-weight: 700;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #4a8fd9, #2d62d6);
  color: #f2f7ff;
}

.toast-enter {
  animation: toast-up 0.34s cubic-bezier(0.18, 0.7, 0.2, 1) both;
}

.toast-ok {
  background: linear-gradient(180deg, #2f9e57, #1e7a42);
  color: #f3fff6;
}

.toast-error {
  background: linear-gradient(180deg, #e25a3f, #c4472f);
  color: #fff5f2;
}

.toast-warn {
  background: linear-gradient(180deg, #ffe57a, #e2ae22);
  color: #3a2a08;
}

.toast-info {
  background: linear-gradient(180deg, #4a8fd9, #2d62d6);
  color: #f2f7ff;
}

@keyframes toast-up {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(120%);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast-x {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.85;
}

.rules { font-size: 0.98rem; line-height: 1.45; }

.rules ul { padding-left: 18px; }

@media (min-width: 900px) {
  .seat-card { grid-template-columns: 1fr; align-items: end; }
}

button, .ghost, .primary, .quiet, .choices button, .emote-btn, .consent-btn {
  min-height: 44px;
  touch-action: manipulation;
}

.host-line {
  margin: 0 16px 8px;
  color: var(--gold);
  font-size: 0.92rem;
}

.emote-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(28, 24, 20, 0.04);
  border-radius: 14px;
}

.emote-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 249, 239, 0.15);
  backdrop-filter: blur(4px);
  color: var(--cream);
  border: 2px solid rgba(244, 234, 214, 0.2);
  border-radius: 14px;
  font-size: 1.8rem;
  transition: all 0.15s ease;
}

.emote-btn:hover {
  background: rgba(255, 249, 239, 0.25);
  border-color: rgba(244, 234, 214, 0.35);
  transform: scale(1.05);
}

.emote-btn:active {
  transform: scale(0.95);
}
  border: 1px solid rgba(244, 234, 214, 0.35);
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.emote-pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  margin: 0 0 0 6px;
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 400;
  vertical-align: middle;
}

.flyer {
  position: fixed;
  z-index: 46;
  pointer-events: none;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
  transform-origin: center center;
}

.flyer.played { z-index: 48; }

body:has(.overlay) .flyer {
  visibility: hidden;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
  padding: 0 12px 8px;
}

.site-nav a {
  color: var(--cream);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
}

.site-nav a[aria-current="page"] {
  background: var(--cream);
  color: var(--teal);
  font-weight: 700;
}

.resume-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 16px 8px;
}

.resume-note a { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: #f2c14d;
  background: rgba(242, 193, 77, 0.12);
  border: 1px solid rgba(242, 193, 77, 0.3);
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  width: 100%;
}

.resume-note a:hover {
  background: rgba(242, 193, 77, 0.2);
  border-color: rgba(242, 193, 77, 0.5);
  transform: translateY(-1px);
}

a.primary {
  display: inline-flex;
  text-decoration: none;
}

.score-stack { display: grid; gap: 4px; }

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.score-extra { display: block; margin-top: 4px; }

table.points td, table.points th {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.panel .rules-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.45; }

.panel .rules-list li { margin: 6px 0; }

.site-foot {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 16px 28px;
}

.site-foot a, .site-foot button {
  color: var(--cream);
  background: transparent;
  border: 0;
  text-decoration: underline;
  min-height: 44px;
  padding: 10px 4px;
}

.consent {
  position: fixed;
  z-index: 80;
  left: 50%;
  right: auto;
  bottom: 12px;
  width: min(416px, calc(100% - 24px));
  transform: translateX(-50%);
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.consent[hidden] { display: none; }

.consent h2 { margin: 0 0 8px; font-size: 1.25rem; }

.consent p { margin: 0 0 10px; line-height: 1.4; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  line-height: 1.35;
}

.check input { width: 22px; height: 22px; margin-top: 2px; }

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.consent-btn {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  border-radius: 16px;
  border: 0;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.consent-btn:first-child {
  background: linear-gradient(135deg, #1d6a62, #123f3c);
  color: white;
  box-shadow: 0 4px 12px rgba(29, 106, 98, 0.35);
}

.consent-btn:last-child {
  background: rgba(28, 24, 20, 0.08);
  color: var(--ink);
  border: 2px solid rgba(28, 24, 20, 0.15);
}

.consent-btn:active {
  transform: scale(0.97);
}
}

#consent-accept { background: var(--teal); color: var(--cream); }

#consent-reject { background: var(--paper); color: var(--ink); }

.consent-more a { color: var(--teal); }

.ranks, .history { margin: 0; padding-left: 18px; line-height: 1.45; }

.ranks li, .history li { margin: 4px 0; }

.history .mark { font-weight: 700; }

.hand-log { margin: 6px 0 0; padding-left: 18px; }

.live-names { display: grid; gap: 10px; margin-bottom: 12px; }

.live-totals { display: grid; gap: 8px; margin: 0 0 14px; }

.live-side {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1.15rem;
}

.live-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.9;
  letter-spacing: 0.01em;
  margin: 4px 0 12px;
}

.live-meta strong {
  color: var(--teal);
  font-size: 1.25rem;
}

.live-side strong { font-size: 1.6rem; }

.live-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.panel .text-btn {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid rgba(28, 24, 20, 0.12);
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.panel .text-btn:hover {
  border-color: rgba(28, 24, 20, 0.2);
  background: rgba(255, 249, 239, 0.8);
}

.panel .text-btn:disabled { opacity: 0.5; cursor: default; }

.sheet .text-btn {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid var(--teal);
  background: var(--paper);
  color: var(--teal);
  font-weight: 600;
  transition: all 0.15s ease;
}

.sheet .text-btn:hover {
  background: rgba(29, 106, 98, 0.08);
}
  font-weight: 700;
}

.ranks li { display: flex; justify-content: space-between; gap: 8px; }

.privacy h1 { font-size: 1.8rem; margin: 8px 0; }

.privacy h2 { font-size: 1.2rem; margin: 18px 0 6px; }

body:has(#consent:not([hidden])) { padding-bottom: 240px; }

@media (max-width: 720px) {
  .arena, .arena.players-2, .arena.players-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "north north"
      "west east"
      "felt felt"
      "south south";
  }
  .west, .east { min-height: 0; }
}

body {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(242, 193, 77, 0.16), transparent 55%),
    #071625;
}

.panel a { color: var(--lagoon); font-weight: 700; }

.panel .quiet {
  color: var(--ink);
  background: rgba(28, 24, 20, 0.08);
  border: 1px solid rgba(28, 24, 20, 0.12);
}

.sheet .quiet {
  color: var(--ink);
  background: rgba(28, 24, 20, 0.08);
  border: 1px solid rgba(28, 24, 20, 0.12);
}

.back-row { margin: 0 16px 8px; }

.back-link {
  color: var(--cream);
  background: rgba(29, 106, 98, 0.3);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(242, 193, 77, 0.25);
  border-radius: 20px;
  padding: 12px 20px 12px 14px;
  font: inherit;
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-link::before {
  content: "←";
  font-size: 1.4em;
  line-height: 1;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}

.back-link:hover {
  background: rgba(29, 106, 98, 0.45);
  border-color: rgba(242, 193, 77, 0.4);
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-link:hover::before {
  transform: translateX(-3px);
}

.back-link:active {
  background: rgba(29, 106, 98, 0.55);
  transform: translateX(-1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dock {
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  color: #f6edd8;
  background:
    linear-gradient(180deg, rgba(8, 28, 48, 0.12) 0%, rgba(8, 28, 48, 0.02) 26%, rgba(6, 16, 28, 0.45) 58%, rgba(6, 14, 24, 0.94) 100%),
    url("/assets/img/hero-porto.jpg") center top / cover no-repeat;
}

.dock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 0;
}

.whoami {
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2c14d;
  color: #3a2a08;
  font-weight: 700;
}

.whoami-text { display: flex; flex-direction: column; text-align: left; }
.whoami-text strong { font-size: 1rem; }
.whoami-text small { color: #f2c14d; }

.dock-tools { display: flex; gap: 8px; }

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(29, 106, 98, 0.85), rgba(18, 63, 60, 0.85));
  backdrop-filter: blur(8px);
  color: #f6edd8;
  border: 1px solid rgba(244, 234, 214, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn svg { width: 24px; height: 24px; }

.dock-tools button.icon-btn {
  border: 0;
  padding: 0;
  min-height: 44px;
  color: #f6edd8;
}

.hero-copy { text-align: center; padding: 22px 16px 0; }

.wordmark {
  margin: 0;
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: clamp(2.2rem, 11vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f2c14d;
  text-shadow: 0 2px 0 #8a5a12, 0 8px 0 rgba(90, 48, 8, 0.35), 0 14px 22px rgba(0, 0, 0, 0.35);
}

.ribbon {
  margin: 4px 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.george {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  background:
    linear-gradient(#c0392b, #c0392b) center / 100% 3px no-repeat,
    linear-gradient(#c0392b, #c0392b) center / 3px 100% no-repeat,
    #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 150px;
  margin: 12px 0 8px;
}

.fan img {
  width: 92px;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  margin: 0 -16px;
}

.fan img:nth-child(1) { transform: rotate(-14deg); }
.fan img:nth-child(2) { transform: translateY(-14px); position: relative; z-index: 1; }
.fan img:nth-child(3) { transform: rotate(14deg); }

.dock-actions { margin-top: auto; padding: 8px 14px 0; }

.sheet-resume {
  display: block;
  margin-bottom: 8px;
  padding: 10px 16px;
  color: #161001;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
  border-radius: 14px;
  background: rgba(242, 193, 77, 0.65);
  border: 1px solid rgba(242, 193, 77, 0.6);
  transition: all 0.2s ease;
}

.sheet-resume:hover {
  background: rgba(242, 193, 77, 0.55);
  border-color: rgba(242, 193, 77, 0.75);
  transform: translateY(-1px);
}

.play-go {
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  background: linear-gradient(135deg, #ffe57a, #e2ae22);
  color: #3a2a08;
  border: 0;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 8px 20px rgba(226, 174, 34, 0.4);
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-go:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(226, 174, 34, 0.35);
}

.play-go strong {
  display: block;
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.play-ico {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: rgba(58, 42, 8, 0.15);
  border-radius: 12px;
}

.play-ico svg { width: 36px; height: 36px; }

.play-go small { 
  display: block; 
  font-size: 0.82rem; 
  font-weight: 600;
  opacity: 0.85;
}

.play-go.slim { 
  justify-content: center;
  padding: 14px 20px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  min-height: 112px;
  border-radius: 18px;
  padding: 14px;
  color: white;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tile:active {
  transform: scale(0.96);
}

.tile:active::before {
  opacity: 1;
}

.tile-ico {
  width: 30px;
  height: 30px;
  margin-bottom: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.tile-ico svg { width: 30px; height: 30px; }

.tile strong { 
  font-size: 0.95rem; 
  letter-spacing: 0.05em; 
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tile small { 
  font-size: 0.78rem; 
  line-height: 1.3;
  opacity: 0.92;
}

.tile.score { 
  background: linear-gradient(135deg, #3d7fe6, #2d62d6);
}

.tile.tour { 
  background: linear-gradient(135deg, #d45848, #c4473a);
}

.tile.rank { 
  background: linear-gradient(135deg, #2a9e55, #1e8a45);
}

.tile.hist { 
  background: linear-gradient(135deg, #7d5ac5, #6a45b5);
}

.deck-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 12px 16px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(8, 22, 36, 0.9);
  color: #f6edd8;
  text-decoration: none;
  border: 1px solid rgba(242, 193, 77, 0.35);
}

.deck-bar img {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}

.deck-bar small {
  display: block;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #f2c14d;
}

.deck-bar .chev { margin-left: auto; font-size: 1.6rem; color: #f2c14d; }

.screen-bar,
.screen {
  width: calc(100% - 24px);
  margin-left: auto;
  margin-right: auto;
}

.screen-bar { 
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.screen-bar h1 { 
  margin: 0; 
  font-size: 1.75rem;
  font-family: "Cirulla Display", "Liberation Sans", sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.screen { margin-top: 12px; margin-bottom: 32px; }
.screen h2 { margin: 18px 0 8px; font-size: 1.15rem; }
.screen-lead { line-height: 1.45; color: rgba(246, 237, 216, 0.9); }

.filters { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }

.filters button {
  border-radius: 18px;
  border: 2px solid rgba(244, 234, 214, 0.25);
  background: rgba(244, 234, 214, 0.08);
  backdrop-filter: blur(4px);
  color: var(--cream);
  padding: 10px 16px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.filters button:hover {
  background: rgba(244, 234, 214, 0.15);
  border-color: rgba(244, 234, 214, 0.4);
  transform: translateY(-1px);
}

.filters button.on {
  background: linear-gradient(135deg, #1d6a62, #123f3c);
  border-color: var(--lagoon);
  color: white;
  box-shadow: 0 4px 12px rgba(29, 106, 98, 0.35);
}
  background: rgba(255, 255, 255, 0.12);
  color: #f6edd8;
}

.filters button.on { background: #f2c14d; color: #3a2a08; font-weight: 700; }

.deck-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.deck-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px;
  color: inherit;
  position: relative;
}

.deck-card img,
.soon-face {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: #14324a;
}

.soon-face {
  display: grid;
  place-items: center;
  color: #f2c14d;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.deck-card strong { font-size: 0.95rem; }
.deck-card small { color: rgba(246, 237, 216, 0.75); }

.picked {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #1e8a45;
  color: white;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.deck-hero {
  width: min(220px, 70%);
  display: block;
  margin: 8px auto;
  border-radius: 14px;
}

.deck-hero.soon-face { aspect-ratio: 3 / 4; margin-left: auto; margin-right: auto; }

.samples { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.samples img { width: 64px; border-radius: 6px; }

.kind-pill {
  display: inline-block;
  background: #f2c14d;
  color: #3a2a08;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.8rem;
}

.order {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(242, 193, 77, 0.45);
  background: transparent;
  color: #f6edd8;
  padding: 12px;
}

.order small { display: block; color: #f2c14d; }
.order:disabled { opacity: 0.7; cursor: default; }

.tour-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  margin: 10px 0;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid rgba(198, 161, 91, 0.25);
  background: linear-gradient(135deg, rgba(29, 106, 98, 0.12), rgba(18, 63, 60, 0.08));
  backdrop-filter: blur(4px);
  color: var(--cream);
  transition: all 0.2s ease;
}

.tour-row:hover {
  border-color: rgba(198, 161, 91, 0.4);
  background: linear-gradient(135deg, rgba(29, 106, 98, 0.18), rgba(18, 63, 60, 0.12));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.tour-row strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.tour-row span {
  font-size: 0.9rem;
  opacity: 0.85;
}

.tour-seats { margin: 0 0 12px; padding-left: 18px; }

.sheet-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #e25a3f, #c4472f);
  color: #fff5f2;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(196, 71, 47, 0.28);
}

.screen .sheet-error {
  background: linear-gradient(180deg, #e25a3f, #c4472f);
  color: #fff5f2;
}

.site-foot,
body > .top,
body > .site-nav,
body > main {
  width: min(440px, 100%);
  margin-left: auto;
  margin-right: auto;
}

body:has(.dock) .site-foot,
body:has(.match) .site-foot {
  background: #071625;
}

body:has(.match) .site-foot { display: none; }

body { background: #030910; }

.site-foot { background: #071625; }

.match {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f6edd8;
  background:
    radial-gradient(ellipse 90% 55% at 50% 46%, rgba(92, 52, 22, 0.45), transparent 62%),
    linear-gradient(180deg, #14100e 0%, #2a1c12 38%, #120e0c 100%);
}

.match-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 4px;
}

.match-title {
  flex: 1;
  text-align: center;
  min-width: 0;
  background: linear-gradient(180deg, #245a86, #163e62);
  border: 2px solid #3c7eae;
  border-radius: 18px;
  padding: 5px 12px 6px;
  box-shadow: 0 3px 0 #0c2a44, 0 8px 14px rgba(0, 0, 0, 0.28);
}

.match-title strong { display: block; font-size: 1rem; line-height: 1.15; color: white; }
.match-title small { color: #f2c14d; font-size: 0.78rem; font-weight: 700; }

.match .icon-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(180deg, #2d74b0, #1a5084);
  box-shadow: 0 3px 0 #0e3358, 0 6px 10px rgba(0, 0, 0, 0.28);
}

.match .icon-btn.chat {
  color: #3a2a08;
  background: linear-gradient(180deg, #f6d15a, #e2a61a);
  box-shadow: 0 3px 0 #a87410, 0 6px 10px rgba(0, 0, 0, 0.28);
}


.match-table {
  flex: 1;
  min-height: 0;
  margin: 0 2px;
  position: relative;
  background: none;
  box-shadow: none;
}

.table-rim {
  position: absolute;
  left: 1%;
  right: 1%;
  top: 0;
  bottom: 0;
  border-radius: 50%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 214, 150, 0.16), transparent 46%),
    url("/assets/img/tables/wood.jpg") center/cover;
  box-shadow:
    0 18px 28px rgba(0, 0, 0, 0.48),
    inset 0 2px 0 rgba(255, 220, 170, 0.28),
    inset 0 -10px 18px rgba(0, 0, 0, 0.38);
}

.opp {
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: 46%;
}

.opp.north { top: 0; left: 50%; transform: translateX(-50%); }
.opp.west { left: 0; top: 44%; transform: translateY(-50%); }
.opp.east { right: 0; top: 44%; transform: translateY(-50%); }

.plate,
.you-plate {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
}

.opp .avatar,
.match-you .avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  margin-right: -16px;
  font-size: 1.05rem;
  border: 3px solid #fff8ea;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}

.opp.north .avatar { background: #c45a3a; color: white; }
.opp.west .avatar { background: #2f74b0; color: white; }
.opp.east .avatar { background: #2f9a5c; color: white; }
.match-you .avatar { background: #e7b02a; color: #3a2a08; }

.opp.west .plate,
.opp.east .plate {
  flex-direction: column;
  align-items: center;
}

.opp.west .avatar,
.opp.east .avatar {
  margin: 0 0 -18px;
  width: 54px;
  height: 54px;
}

.opp.west .plate-text,
.opp.east .plate-text {
  align-items: center;
  text-align: center;
  min-width: 68px;
  padding: 20px 10px 6px;
  border-radius: 18px;
}

.opp.west .plate-text strong,
.opp.east .plate-text strong {
  max-width: 76px;
}

.avatar.has-face {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.avatar.has-face svg.wear {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.avatar.has-face img,
.avatar.has-face svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  display: block;
}

.avatar.has-face.bg-rosso { background: #c44d49; }
.avatar.has-face.bg-blu { background: #2f74b0; }
.avatar.has-face.bg-verde { background: #2f9a5c; }
.avatar.has-face.bg-oro { background: #e7b02a; }
.avatar.has-face.bg-viola { background: #7a4ea3; }
.avatar.has-face.bg-corallo { background: #e07a5f; }
.avatar.has-face.bg-arcobaleno {
  background: linear-gradient(
    180deg,
    #e40303 0 16.6%,
    #ff8c00 16.6% 33.3%,
    #ffed00 33.3% 50%,
    #008026 50% 66.6%,
    #24408e 66.6% 83.3%,
    #732982 83.3% 100%
  );
}
.avatar.has-face.bg-spettro {
  background: conic-gradient(from 210deg, #e40303, #ff8c00, #ffed00, #008026, #24408e, #732982, #e40303);
}
.avatar.has-face.bg-giorgio {
  background:
    linear-gradient(#c8102e, #c8102e) center / 100% 26% no-repeat,
    linear-gradient(#c8102e, #c8102e) center / 26% 100% no-repeat,
    #fff;
}
.avatar.has-face.bg-scudo {
  background:
    linear-gradient(#c8102e, #c8102e) center 46% / 22% 16% no-repeat,
    linear-gradient(#c8102e, #c8102e) center 46% / 16% 42% no-repeat,
    radial-gradient(circle at 50% 46%, #fff8ea 0 42%, #e2b33a 42% 58%, #8c6418 58% 100%);
}
.avatar.has-face.bg-italia {
  background: linear-gradient(90deg, #009246 0 33.3%, #f4f4f4 33.3% 66.6%, #ce2b37 66.6% 100%);
}

.avatar-preview { margin: 8px 0 4px; }
.avatar-preview .avatar { width: 132px; height: 132px; font-size: 1.4rem; }

.avatar-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.face-pick,
.bg-pick {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.face-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  display: block;
}

.swatch {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  padding: 0;
  border: 3px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

.swatch.on,
.face-pick.on,
.bg-pick.on {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--teal);
}

.bg-pick.bg-rosso { background: #c44d49; }
.bg-pick.bg-blu { background: #2f74b0; }
.bg-pick.bg-verde { background: #2f9a5c; }
.bg-pick.bg-oro { background: #e7b02a; }
.bg-pick.bg-viola { background: #7a4ea3; }
.bg-pick.bg-corallo { background: #e07a5f; }
.bg-pick.bg-arcobaleno {
  background: linear-gradient(180deg, #e40303 0 16.6%, #ff8c00 16.6% 33.3%, #ffed00 33.3% 50%, #008026 50% 66.6%, #24408e 66.6% 83.3%, #732982 83.3% 100%);
}
.bg-pick.bg-spettro {
  background: conic-gradient(from 210deg, #e40303, #ff8c00, #ffed00, #008026, #24408e, #732982, #e40303);
}
.bg-pick.bg-giorgio {
  background:
    linear-gradient(#c8102e, #c8102e) center / 100% 26% no-repeat,
    linear-gradient(#c8102e, #c8102e) center / 26% 100% no-repeat,
    #fff;
}
.bg-pick.bg-scudo {
  background:
    linear-gradient(#c8102e, #c8102e) center 46% / 22% 16% no-repeat,
    linear-gradient(#c8102e, #c8102e) center 46% / 16% 42% no-repeat,
    radial-gradient(circle at 50% 46%, #fff8ea 0 42%, #e2b33a 42% 58%, #8c6418 58% 100%);
}
.bg-pick.bg-italia {
  background: linear-gradient(90deg, #009246 0 33.3%, #f4f4f4 33.3% 66.6%, #ce2b37 66.6% 100%);
}

.plate-text,
.you-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 72px;
  line-height: 1.05;
  border-radius: 16px;
  padding: 5px 14px 5px 22px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22), 0 8px 14px rgba(0, 0, 0, 0.22);
}

.opp.north .plate-text { background: linear-gradient(180deg, #c44d49, #8c2828); color: white; }
.opp.west .plate-text { background: linear-gradient(180deg, #3d92d4, #1d629e); color: white; }
.opp.east .plate-text { background: linear-gradient(180deg, #3caf6a, #1d7a42); color: white; }

.plate-text strong,
.you-name strong {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.15;
}

.plate-text small,
.you-name small {
  font-size: 0.62rem;
  line-height: 1.1;
  font-weight: 700;
  opacity: 0.9;
}

.opp .score-pill,
.you-plate .score-pill {
  background: transparent;
  color: inherit;
  border-radius: 0;
  min-width: 0;
  padding: 0;
  font-size: 1.28rem;
  line-height: 1.05;
}

.opp.turn .plate-text,
.match-you.turn .you-name {
  box-shadow: 0 0 0 3px #f2c14d, 0 6px 14px rgba(0, 0, 0, 0.28);
}

.opp .backs,
.opp .mini-hand {
  position: absolute;
  z-index: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  top: 6px;
  left: 6px;
  pointer-events: none;
}

.opp .backs {
  top: calc(100% - 4px);
  z-index: 1;
}

.opp.north .backs {
  left: 50%;
  transform: translateX(-50%);
}

.opp.west .backs { left: 18px; }

.opp.east .backs {
  left: auto;
  right: 18px;
}

.opp .backs .back {
  width: 36px;
  margin: 0 -12px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.opp .mini-hand {
  z-index: 2;
  top: calc(100% + 2px);
  left: 0;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

.opp.north .mini-hand {
  left: 50%;
  transform: translateX(-50%);
}

.opp.west .mini-hand { left: 16px; }

.opp.east .mini-hand {
  left: auto;
  right: 16px;
}

.opp .mini-hand .card {
  width: 56px;
  margin: 0 -14px;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transform-origin: center bottom;
}

.opp .mini-hand .card:nth-child(1) { transform: rotate(-5deg); }
.opp .mini-hand .card:nth-child(2) { transform: translateY(2px); z-index: 1; }
.opp .mini-hand .card:nth-child(3) { transform: rotate(5deg); }
.opp .mini-hand .card:only-child { transform: none; margin: 0; }

.match .felt {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 14%;
  bottom: 13%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  z-index: 1;
  overflow: hidden;
  display: block;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.2), transparent 48%),
    url("/assets/img/tables/felt-green.jpg") center/cover;
  box-shadow:
    inset 0 0 0 8px #5a3818,
    inset 0 0 0 11px rgba(255, 214, 150, 0.28),
    inset 0 0 36px rgba(0, 0, 0, 0.32);
}

.match-table[data-felt="bordeaux"] .felt,
.match .felt[data-felt="bordeaux"] {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.14), transparent 48%),
    url("/assets/img/tables/felt-bordeaux.jpg") center/cover;
}

.match .felt-meta {
  position: absolute;
  top: 16%;
  left: 14%;
  z-index: 2;
  font-size: 0.75rem;
}

.match .deck-pill {
  color: #f6edd8;
  background: rgba(8, 22, 24, 0.55);
  padding: 2px 7px 2px 2px;
}

.match .deck-pill .back { width: 20px; }
.match .deck-pill small { font-weight: 700; }

.match .table-cards {
  position: absolute;
  inset: 9% 8% 8%;
  min-height: 0;
  display: block;
}

.match .table-cards .card {
  position: absolute;
  width: 68px;
  margin: 0;
  transform-origin: center center;
}

.match .empty-table {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
}

.match .banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 4px);
  z-index: 6;
  margin: 0;
  padding: 8px 10px;
  font-size: 0.88rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32);
}

.match .banner p { margin: 4px 0 6px; }

.match-you {
  position: relative;
  z-index: 4;
  margin-top: 0;
  padding: 0 12px 0;
}

.match-table + .match-you { margin-top: -34px; }

.you-plate {
  z-index: 4;
  margin: 0 auto;
  gap: 0;
  background: transparent;
  color: #3a2a08;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.you-name {
  background: linear-gradient(180deg, #ffe57a, #e2ae22);
  color: #3a2a08;
}

.you-point {
  position: absolute;
  top: -9px;
  left: 18px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 11px solid #f2c14d;
  z-index: 3;
}

.match .emote-pop {
  position: absolute;
  top: -10px;
  right: -2px;
  margin: 0;
  z-index: 4;
}

.match .hand {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  height: 128px;
  margin-top: 8px;
  padding-bottom: 6px;
}

.match .hand::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 10px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(70, 150, 255, 0.75), transparent 70%);
  filter: blur(5px);
  pointer-events: none;
  z-index: 0;
}

.match .hand .card {
  position: relative;
  z-index: 1;
  width: 82px;
  margin: 0 -26px;
  border-radius: 10px;
  transform-origin: center bottom;
}

.match .hand .card:nth-child(1) { --fan: rotate(-10deg); transform: var(--fan); }
.match .hand .card:nth-child(2) { --fan: translateY(-4px); transform: var(--fan); z-index: 2; }
.match .hand .card:nth-child(3) { --fan: rotate(10deg); transform: var(--fan); }
.match .hand .card:only-child { --fan: none; transform: none; margin: 0; }
.match .hand .card:first-child:nth-last-child(2) { --fan: rotate(-10deg); transform: var(--fan); }
.match .hand .card:nth-child(2):last-child { --fan: rotate(10deg); transform: var(--fan); z-index: 2; }
.match .hand .card.chosen { --fan: translateY(-22px); transform: var(--fan); z-index: 3; }

.match .hand .card.playable:hover,
.match .hand .card.playable:active,
.match .hand .card.playable:focus-visible {
  transform: var(--fan) translateY(-8px);
}

.match .hand { margin-bottom: calc(4px + env(safe-area-inset-bottom)); }

.score-picks {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.score-picks.n-2 { grid-template-columns: 1fr 1fr; }
.score-picks.n-3 { grid-template-columns: 1fr 1fr 1fr; }

.score-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 12px 12px 14px;
  border-radius: 18px;
  border: 2px solid transparent;
  text-align: left;
  line-height: 1.15;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-pick:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.score-pick .pick-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.score-pick strong {
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 0.95;
}

.score-pick .pick-hand {
  font-size: 0.75rem;
  opacity: 0.8;
}

.score-picks.n-3 .score-pick { padding: 10px; }
.score-picks.n-3 .score-pick strong { font-size: 1.8rem; }
.score-picks.n-3 .pick-name { font-size: 0.78rem; }

.score-pick.tone-0 { background: #d5f0ea; color: #0c3f3a; }
.score-pick.tone-1 { background: #f8d9d2; color: #6e2619; }
.score-pick.tone-2 { background: #d6e4f7; color: #16365f; }
.score-pick.on { 
  box-shadow: inset 0 0 0 3px currentColor, 0 4px 12px rgba(0, 0, 0, 0.15); 
}

.builder { display: grid; gap: 8px; margin-bottom: 14px; }
.builder h3 { margin: 4px 0 0; font-size: 1.15rem; }

.direct-box, .part {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--paper); 
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.direct-box {
  display: none;
}

.part.on { box-shadow: inset 4px 0 0 var(--lagoon); }

.part.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.part-copy strong { display: block; }
.part-copy p {
  margin: 4px 0 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(28, 24, 20, 0.72);
}

.part-copy .assigned-mark {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-weight: 600;
  color: var(--teal);
}

.direct-step, .stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.direct-step button, .stepper button, .part-btn, .pic-btn {
  margin: 0;
  border-radius: 14px;
  border: 2px solid rgba(28, 24, 20, 0.15);
  background: white;
  color: var(--ink);
  min-width: 48px;
  padding: 10px 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.direct-step button:hover, 
.stepper button:hover, 
.part-btn:hover, 
.pic-btn:hover {
  border-color: rgba(28, 24, 20, 0.25);
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.02);
}

.direct-step button:active, 
.stepper button:active, 
.part-btn:active, 
.pic-btn:active {
  transform: scale(0.98);
}

.direct-step button { font-size: 1.4rem; line-height: 1; width: 48px; padding: 0; }

.direct-step input {
  width: 4.2rem;
}

.direct-step button { font-size: 1.4rem; line-height: 1; width: 44px; padding: 0; }

.direct-step input {
  width: 4.2rem;
  padding: 8px 4px;
  text-align: center;
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: 1.8rem;
  line-height: 1;
}

.stepper span {
  min-width: 1.4rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.part-btn { min-width: 68px; }
.part-btn.on, .pic-btn.on {
  background: linear-gradient(135deg, #1d6a62, #123f3c);
  color: var(--cream);
  border-color: var(--lagoon);
  box-shadow: 0 4px 12px rgba(29, 106, 98, 0.35);
}

.part.pic { grid-template-columns: 1fr; }

.pic-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 14px;
}

.pic-btn strong {
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.pic-btn small { font-size: 0.68rem; font-weight: 700; }

.build-math {
  display: none;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.validation-error {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fff3cd;
  border: 1px solid #ffecb5;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #856404;
  line-height: 1.4;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.builder .wide { width: 100%; }

.table-open {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--teal);
  color: var(--cream);
  font-weight: 700;
  text-align: left;
}

.table-open small {
  display: block;
  margin-top: 3px;
  font-weight: 400;
  line-height: 1.35;
  opacity: 0.88;
}

.hand-fold { margin-top: 16px; }
.hand-fold summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }

table.points small.hand-bits {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(28, 24, 20, 0.62);
}

.table-score {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: #071625;
  color: var(--cream);
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  user-select: none;
  -webkit-user-select: none;
}

.table-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.table-bar button {
  margin: 0;
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(244, 234, 214, 0.35);
  border-radius: 999px;
  padding: 8px 14px;
}

.table-bar #table-commit {
  background: var(--coral);
  border-color: transparent;
  color: white;
  font-weight: 700;
}

.table-bar #table-commit:disabled { opacity: 0.45; }

.table-meta, .table-portrait {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
}

.table-portrait { display: none; padding: 0 12px 6px; }

.table-sides {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 6px;
  padding: 0 6px 6px;
}

.table-sides.n-2 { grid-template-columns: 1fr 1fr; }
.table-sides.n-3 { grid-template-columns: 1fr 1fr 1fr; }

.table-side {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
}

.table-side.tone-0 { background: #0e6a62; color: #f4ead6; }
.table-side.tone-1 { background: #c4472f; color: #fff6f2; }
.table-side.tone-2 { background: #1e4e8c; color: #f4ead6; }

.table-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 16px 12px 78px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.table-hit:active { background: rgba(255, 255, 255, 0.08); }

.table-name {
  max-width: 12em;
  font-size: clamp(1rem, 3vh, 1.7rem);
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  text-wrap: balance;
}

.table-num {
  font-family: "Cirulla Display", "Cirulla Text", sans-serif;
  font-size: clamp(3.4rem, 28vh, 10rem);
  font-weight: 400;
  line-height: 0.85;
}

.table-goal, .table-delta {
  font-size: clamp(0.8rem, 2vh, 1rem);
  opacity: 0.88;
}

.table-minus {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 12px;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  font-size: 1.35rem;
  font-weight: 700;
}

.table-side.pulse { animation: score-pulse 0.18s ease; }

@keyframes score-pulse {
  from { filter: brightness(1.28); }
  to { filter: none; }
}

.score-pick:focus-visible,
.part-btn:focus-visible,
.pic-btn:focus-visible,
.direct-step button:focus-visible,
.stepper button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.table-hit:focus-visible,
.table-minus:focus-visible,
.table-bar button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}

body:has(.table-score) { overflow: hidden; }
body:has(.table-score) .site-foot { display: none; }

@media (orientation: portrait) {
  .table-portrait { display: block; }
}

@media (max-width: 380px) {
  .part, .direct-box { grid-template-columns: 1fr; }
  .direct-step, .stepper, .part-btn { justify-self: start; }
}

/* Nasconde cirulla e decino nel segnapunti (si convertono in scope durante il gioco) */
.part:has([data-cirulla]) {
  display: none;
} 
