.vd-game-perudo { --game-color: #486490; }
.perudo-box-art { width: 100%; height: 100%; }

.perudo-game { --perudo-accent: #486490; --vd-muted: #5f6c7b; --perudo-paper: #fffaf0; color: var(--vd-ink); padding: 12px 0 24px; }
.perudo-status { margin-bottom: 22px; }
.perudo-status .vd-eyebrow { color: var(--perudo-accent); font-size: 12px; line-height: 1.5; letter-spacing: 1.4px; }
.perudo-status h1 { margin: 10px 0; font-size: clamp(30px, 3.5vw, 42px); line-height: 1.12; font-weight: 750; letter-spacing: -1.2px; overflow-wrap: anywhere; }
.perudo-status h1 span { display: block; color: var(--perudo-accent); }
.perudo-status > p:not(.vd-eyebrow) { color: var(--vd-muted); font-size: 14px; }
.perudo-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.perudo-action-panel, .perudo-board, .perudo-controls { min-width: 0; }
.perudo-hand { padding: 18px; background: #edf0f6; border: 1px solid #d6dce8; border-radius: 18px; }
.perudo-hand-caption { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.perudo-hand-caption .vd-eyebrow { color: var(--perudo-accent); font-size: 12px; letter-spacing: 1px; }
.perudo-hand-caption strong { color: var(--vd-ink); font-size: 12px; overflow-wrap: anywhere; text-align: right; }
.perudo-hand p { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--vd-muted); }
.perudo-dice { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 17px 0 6px; }
.perudo-die { display: grid; flex: 0 0 auto; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 43px; height: 43px; padding: 8px; gap: 3px; border: 1px solid #e4dccd; border-radius: 10px; background: var(--perudo-paper); box-shadow: 0 2px 0 #ded7c9, 0 4px 8px #263b5810; }
.perudo-pip { background: #263b58; border-radius: 50%; visibility: hidden; }
.perudo-die-1 { background: #dce5f4; border-color: #c6d2e6; box-shadow: 0 2px 0 #b7c5da, 0 4px 8px #263b5810; }
.perudo-die-1 .perudo-pip-5 { transform: rotate(45deg) scale(1.4); border-radius: 1px; background: #486490; }
.perudo-die-1 .perudo-pip-5, .perudo-die-2 .perudo-pip-1, .perudo-die-2 .perudo-pip-9, .perudo-die-3 .perudo-pip-1, .perudo-die-3 .perudo-pip-5, .perudo-die-3 .perudo-pip-9, .perudo-die-4 .perudo-pip-1, .perudo-die-4 .perudo-pip-3, .perudo-die-4 .perudo-pip-7, .perudo-die-4 .perudo-pip-9, .perudo-die-5 .perudo-pip-1, .perudo-die-5 .perudo-pip-3, .perudo-die-5 .perudo-pip-5, .perudo-die-5 .perudo-pip-7, .perudo-die-5 .perudo-pip-9, .perudo-die-6 .perudo-pip-1, .perudo-die-6 .perudo-pip-3, .perudo-die-6 .perudo-pip-4, .perudo-die-6 .perudo-pip-6, .perudo-die-6 .perudo-pip-7, .perudo-die-6 .perudo-pip-9 { visibility: visible; }
.perudo-hide { display: inline-flex; align-items: center; min-height: 44px; margin: 4px 0; }
.perudo-controls { margin: 16px 0 22px; }
.perudo-bid-fields { display: grid; grid-template-columns: minmax(0, .85fr) 20px minmax(0, 1.35fr); gap: 9px; align-items: end; }
.perudo-bid-fields > div { min-width: 0; }
.perudo-bid-fields > span { align-self: center; text-align: center; padding-top: 20px; color: var(--vd-muted); font-size: 24px; }
.perudo-bid-fields label { display: block; color: var(--vd-muted); font-size: 12px; margin-bottom: 8px; }
.perudo-bid-fields input, .perudo-bid-fields select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #cdd3dd; border-radius: 11px; background: #fffefa; color: var(--vd-ink); padding: 10px; font-size: 16px; }
.perudo-game .perudo-button { width: 100%; min-height: 49px; margin-top: 13px; border-radius: 12px; font-size: 14px; box-shadow: 0 2px 5px #263b5808; transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.perudo-game .vd-button-primary { background: var(--perudo-accent); color: #fffefa; border: 1px solid var(--perudo-accent); }
.perudo-game .vd-button-secondary { background: #fffefa; border: 1px solid #cdd3dd; color: var(--perudo-accent); }
.perudo-game .perudo-button:hover { transform: none; filter: brightness(.98); box-shadow: 0 4px 10px #263b5812; }
.perudo-game :is(button,input,select,a,summary):focus-visible { outline: 3px solid var(--perudo-accent); outline-offset: 4px; }
.perudo-game button:disabled { opacity: .55; cursor: wait; }
.perudo-hint { color: var(--vd-muted); font-size: 12px; line-height: 1.65; margin: 12px 0; overflow-wrap: anywhere; }
.perudo-current-bid { padding: 24px; border: 1px solid #d9dfeb; border-radius: 20px; background: linear-gradient(135deg, #e6edf8, #f0f3f9); color: #263b58; box-shadow: 0 5px 18px #263b5808; }
.perudo-current-bid .vd-eyebrow { font-size: 12px; letter-spacing: 1.5px; color: #53698c; }
.perudo-current-bid > strong { display: flex; gap: 20px; align-items: center; font-size: clamp(44px, 6vw, 76px); font-weight: 800; line-height: 1; letter-spacing: -2px; margin: 18px 0; overflow-wrap: anywhere; }
.perudo-current-bid > strong small { font-size: .46em; color: #7188ad; }
.perudo-current-bid > .perudo-no-bid { font-size: 30px; letter-spacing: -1px; line-height: 1.12; }
.perudo-current-bid p { margin: 0; color: #586b88; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.perudo-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.perudo-player { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 8px; align-items: center; border: 1px solid var(--vd-line); border-radius: 12px; padding: 10px; background: #fffefa; transition: background-color 180ms ease, border-color 180ms ease; }
.perudo-player.is-active { border-color: #8299bf; background: #edf1f8; box-shadow: inset 3px 0 #6480ae; }
.perudo-player.is-out { opacity: .55; }
.perudo-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #dce5f4; color: #3f587f; font-size: 12px; font-weight: 800; grid-row: span 2; }
.perudo-player strong { font-size: 12px; overflow-wrap: anywhere; line-height: 1.25; }
.perudo-player > span:last-child { font-size: 12px; color: var(--vd-muted); margin-top: 4px; }
.perudo-wait { border: 1px dashed #ccd2dc; padding: 14px; border-radius: 9px; color: var(--vd-muted); font-size: 13px; line-height: 1.65; }
.perudo-wait strong { color: var(--vd-ink); }
.perudo-resolution { margin: 18px 0; padding: 18px; border: 1px solid #d6dce8; border-radius: 18px; background: #fffefa; }
.perudo-resolution h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; font-weight: 800; color: var(--perudo-accent); overflow-wrap: anywhere; }
.perudo-resolution > p { color: var(--vd-muted); font-size: 12px; line-height: 1.6; }
.perudo-reveal-row { padding: 12px 0 4px; }
.perudo-reveal-row > strong { font-size: 12px; overflow-wrap: anywhere; }
.perudo-reveal-row .perudo-dice { margin-top: 9px; }
.perudo-table-art { display: none; }
.perudo-tv { width: 100%; max-width: 1100px; margin: auto; }
.perudo-tv .perudo-status h1 { font-size: clamp(34px, 3.3vw, 48px); }
.perudo-tv .perudo-status h1 span { display: inline; margin-left: 18px; }
.perudo-tv .perudo-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.perudo-tv .perudo-current-bid { min-height: 205px; padding: 30px; }
.perudo-tv .perudo-current-bid > strong { font-size: 88px; }
.perudo-tv .perudo-current-bid > .perudo-no-bid { font-size: 39px; }
.perudo-tv .perudo-current-bid p { font-size: 16px; }
.perudo-tv .perudo-players { margin: 0; gap: 12px; }
.perudo-tv .perudo-player { min-height: 69px; padding: 13px; }
.perudo-tv .perudo-player strong { font-size: 16px; }
.perudo-tv .perudo-player > span:last-child { font-size: 13px; }
.perudo-tv .perudo-resolution { margin: 0; grid-column: 2; grid-row: 1 / span 3; }
.perudo-tv .perudo-board:has(.perudo-resolution) .perudo-players { grid-column: 1; }
.perudo-tv .perudo-reveal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.perudo-tv .perudo-reveal-row .perudo-dice { margin: 0; }
.perudo-tv-note { color: var(--vd-muted); font-size: 13px; margin-top: 22px; }
@media (min-width: 900px) {
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; }
  .perudo-tv .perudo-table-art { display: block; width: 100%; height: 170px; object-fit: cover; object-position: 50% 58%; margin: 0 0 20px; border-radius: 14px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-current-bid > strong { font-size: clamp(76px, 6vw, 104px); }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-current-bid > .perudo-no-bid { font-size: 38px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player { min-height: 80px; padding: 15px; grid-template-columns: 34px minmax(0, 1fr); gap: 3px 11px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-avatar { width: 34px; height: 34px; font-size: 12px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player strong { font-size: 19px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player > span:last-child { font-size: 14px; }
}
@media (max-width: 700px) {
  .perudo-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .perudo-status { margin-bottom: 16px; }
  .perudo-status h1 { font-size: 29px; }
  .perudo-status h1 span { display: inline; margin-left: 8px; }
  .perudo-current-bid { padding: 20px; }
  .perudo-current-bid > strong { font-size: 52px; margin: 14px 0; }
  .perudo-hand { padding: 13px; }
  .perudo-dice { gap: 7px; }
  .perudo-die { width: 39px; height: 39px; padding: 7px; }
  .perudo-tv .perudo-board { grid-template-columns: minmax(0, 1fr); }
  .perudo-tv .perudo-resolution { grid-column: auto; grid-row: auto; }
}
@media (min-width: 900px) and (max-height: 800px) {
  .pr-display.pr-game-perudo { padding-top: 14px; padding-bottom: 16px; }
  .pr-display.pr-game-perudo .pr-room-header { min-height: 54px; }
  .pr-display.pr-game-perudo .pr-connection { min-height: 22px; }
  .pr-display.pr-game-perudo .pr-display-footer { margin-top: 10px; padding-top: 12px; }
  .perudo-tv { padding-top: 4px; padding-bottom: 8px; }
  .perudo-tv .perudo-status { margin-bottom: 14px; }
  .perudo-tv .perudo-status .vd-eyebrow { margin: 0; }
  .perudo-tv .perudo-status h1 { font-size: 38px; line-height: 1.1; margin: 8px 0; letter-spacing: -1.2px; }
  .perudo-tv .perudo-status h1 span { margin-left: 8px; }
  .perudo-tv .perudo-status > p:not(.vd-eyebrow) { margin: 8px 0 0; }
  .perudo-tv .perudo-board { gap: 14px 20px; }
  .perudo-tv .perudo-current-bid { min-height: 0; padding: 18px 22px; }
  .perudo-tv .perudo-current-bid > strong { font-size: 64px; margin: 12px 0; }
  .perudo-tv .perudo-current-bid > .perudo-no-bid { font-size: 32px; }
  .perudo-tv .perudo-current-bid p { font-size: 14px; line-height: 1.45; }
  .perudo-tv .perudo-table-art { height: 150px; margin-bottom: 16px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player { min-height: 64px; padding: 11px 13px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player strong { font-size: 17px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-player > span:last-child { font-size: 12px; }
  .perudo-tv .perudo-board:not(:has(.perudo-resolution)) .perudo-current-bid > .perudo-no-bid { font-size: 32px; }
  .perudo-tv .perudo-players { gap: 8px; }
  .perudo-tv .perudo-player { min-height: 52px; padding: 8px 10px; }
  .perudo-tv .perudo-player strong { font-size: 14px; }
  .perudo-tv .perudo-player > span:last-child { font-size: 12px; margin-top: 2px; }
  .perudo-tv .perudo-resolution { padding: 14px 16px; }
  .perudo-tv .perudo-resolution h2 { font-size: 18px; line-height: 1.25; margin-bottom: 8px; }
  .perudo-tv .perudo-resolution > p { font-size: 12px; line-height: 1.45; margin: 0 0 6px; }
  .perudo-tv .perudo-reveal-row { padding: 7px 0 3px; }
  .perudo-tv .perudo-reveal-row > strong { font-size: 12px; line-height: 1.35; }
  .perudo-tv .perudo-dice { gap: 7px; }
  .perudo-tv .perudo-die { width: 37px; height: 37px; padding: 7px; gap: 3px; }
  .perudo-tv-note { margin-top: 10px; font-size: 12px; line-height: 1.5; }
}
@media (prefers-reduced-motion: reduce) { .perudo-game * { transition: none !important; animation: none !important; } }
.perudo-draft { display:inline-flex; align-items:center; gap:.4rem; margin:.2rem 0; padding:.2rem .7rem .2rem .3rem; border-radius:999px; background:#fff3c9; font-size:.95rem; animation:perudo-draft-in .2s ease-out; }
.perudo-draft[hidden] { display:none; }
.perudo-draft-avatar { width:1.6rem; height:1.6rem; display:block; }
@keyframes perudo-draft-in { from { opacity:0; transform:translateY(.25rem); } }
@media (prefers-reduced-motion: reduce) { .perudo-draft { animation:none; } }
.pdie { display: grid; flex: 0 0 auto; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 43px; height: 43px; padding: 8px; gap: 3px; border: 1px solid #e4dccd; border-radius: 10px; background: var(--perudo-paper); box-shadow: 0 2px 0 #ded7c9, 0 4px 8px #263b5810; }
.pdie-1 { background: #dce5f4; border-color: #c6d2e6; box-shadow: 0 2px 0 #b7c5da, 0 4px 8px #263b5810; }
.pdie-1 .perudo-pip-5 { transform: rotate(45deg) scale(1.4); border-radius: 1px; background: #486490; }
.pdie-1 .perudo-pip-5, .pdie-2 .perudo-pip-1, .pdie-2 .perudo-pip-9, .pdie-3 .perudo-pip-1, .pdie-3 .perudo-pip-5, .pdie-3 .perudo-pip-9, .pdie-4 .perudo-pip-1, .pdie-4 .perudo-pip-3, .pdie-4 .perudo-pip-7, .pdie-4 .perudo-pip-9, .pdie-5 .perudo-pip-1, .pdie-5 .perudo-pip-3, .pdie-5 .perudo-pip-5, .pdie-5 .perudo-pip-7, .pdie-5 .perudo-pip-9, .pdie-6 .perudo-pip-1, .pdie-6 .perudo-pip-3, .pdie-6 .perudo-pip-4, .pdie-6 .perudo-pip-6, .pdie-6 .perudo-pip-7, .pdie-6 .perudo-pip-9 { visibility: visible; }
.pdie { width: 48px; height: 48px; padding: 9px; }
.pdie-lg { width: 84px; height: 84px; padding: 15px; gap: 5px; border-radius: 18px; }
/* The bid composer */
.perudo-qty { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.perudo-step { width: 64px; height: 64px; border: 0; border-radius: 22px; background: #edf0f6; color: var(--perudo-accent); font: inherit; font-size: 32px; font-weight: 500; line-height: 1; cursor: pointer; transition: transform 140ms var(--vd-ease), background 140ms; }
.perudo-step:hover:not(:disabled) { background: #e2e8f2; }
.perudo-step:active:not(:disabled) { transform: scale(.94); }
.perudo-step:disabled { opacity: .35; cursor: default; }
.perudo-step[hidden] { display: none; }
.perudo-qty-value { display: grid; justify-items: center; gap: 2px; }
.perudo-qty-value label { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--vd-muted); }
.perudo-bid-form .perudo-qty-value input { width: 100%; min-height: 0; border: 0; background: none; padding: 0; text-align: center; font-size: 56px; font-weight: 780; letter-spacing: -.03em; line-height: 1; color: var(--vd-ink); -moz-appearance: textfield; appearance: textfield; }
.perudo-qty-value input::-webkit-outer-spin-button, .perudo-qty-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.perudo-faces { display: grid; grid-template-columns: repeat(var(--faces, 5), minmax(0, 1fr)); gap: 6px; margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.perudo-face-die { display: block; width: 100%; max-width: 48px; }
.perudo-face .pdie { width: 100%; height: auto; aspect-ratio: 1; padding: 17%; gap: 2px; box-sizing: border-box; }
.perudo-face { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 18px; background: #f3f1ea; cursor: pointer; transition: background 140ms, box-shadow 140ms, transform 140ms var(--vd-ease); }
.perudo-face input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.perudo-face small { font-size: 12px; font-weight: 650; color: var(--vd-muted); }
.perudo-face:hover { background: #ebe8de; }
.perudo-face:active { transform: scale(.96); }
.perudo-face.is-selected, .perudo-face:has(input:checked) { background: #fff; box-shadow: inset 0 0 0 2.5px var(--perudo-accent), 0 6px 14px -8px #486490aa; }
.perudo-face:has(input:focus-visible) { outline: 3px solid var(--perudo-accent); outline-offset: 2px; }
.perudo-held { margin: 12px 0 0; text-align: center; font-size: 14px; font-weight: 650; color: var(--perudo-accent); }
.perudo-held[hidden] { display: none; }
.perudo-hand .perudo-die { transition: transform 160ms var(--vd-ease), opacity 160ms, box-shadow 160ms; }
.perudo-hand .perudo-die.is-match { transform: translateY(-5px); box-shadow: 0 0 0 2.5px var(--perudo-accent), 0 8px 12px -6px #263b5877; }
.perudo-hand .perudo-die.is-dim { opacity: .7; }
.perudo-game .perudo-bid-form .perudo-button { min-height: 56px; border-radius: 999px; font-size: 16px; }
/* Bid on the table, and who still has dice */
.perudo-current-bid > strong { gap: 16px; }
.perudo-current-bid > strong .pdie { flex: none; }
.perudo-tv .perudo-current-bid > strong .pdie-lg { width: 112px; height: 112px; padding: 20px; gap: 6px; }
.perudo-count { margin-top: 4px; font-size: 12px; color: var(--vd-muted); }
.perudo-minis { display: flex; flex-wrap: wrap; gap: 4px; }
.perudo-minis i { position: relative; width: 14px; height: 14px; border-radius: 5px; background: var(--perudo-paper); box-shadow: inset 0 0 0 1.5px #c9bfae, 0 1.5px 0 #ded7c9; }
.perudo-minis i::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #263b58; }
@media (prefers-reduced-motion: reduce) { .perudo-step, .perudo-face, .perudo-hand .perudo-die { transition: none; } }
