/* Common behavior and hit-area contract, with each game retaining its palette. */
.ug-participant-roster,.ug-participant-row {min-width:0;}
.ug-participant-row {align-items:center;}
.ug-participant-name {min-width:0;max-width:100%;}
.ug-participant-avatar,.ug-participant-remove {position:relative;touch-action:manipulation;flex-shrink:0;}
.ug-participant-avatar:not(:disabled) {cursor:pointer;}
.ug-participant-remove:not(:disabled) {cursor:pointer;}
.ug-participant-avatar::after,.ug-participant-remove::after {
  content:'';position:absolute;top:50%;left:50%;width:max(44px,100%);height:max(44px,100%);
  transform:translate(-50%,-50%);pointer-events:auto;
}
.ug-participant-row :is(input,button):focus-visible {outline:3px solid #d7eaa5;outline-offset:2px;}
@media(prefers-reduced-motion:reduce){.ug-participant-row *{transition:none!important;animation:none!important;}}


/* Dice-style participant editor shared by Pirate, Bomb, Reaction, and Timer.
   Rows reuse ParticipantEditor; palette is deliberately theme-aware. */
body .ug-dice-style-roster.ug-participant-roster {
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;
  align-items:stretch;margin-top:18px;margin-bottom:18px;min-width:0;
}
body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row {
  display:flex;flex-direction:row;align-items:center;gap:7px;min-width:0;
  padding:7px 8px;border:1px solid #59787a;border-radius:12px;
  background:#1b343c;color:#f2f7ef;transition:border-color .15s;
}
body .ug-dice-style-roster .ug-dice-style-row:focus-within {
  border-color:#d5ef96;background:#24424a;
}
body .ug-dice-style-roster .ug-dice-style-row .ug-participant-number {
  flex:0 0 20px;min-width:20px;text-align:center;font-size:11px;
  font-weight:800;color:#c9dcac;
}
body .ug-dice-style-roster .ug-dice-style-row .ug-participant-avatar {
  display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;
  min-height:44px;padding:0;margin:0;border:1px solid #76949a;
  border-radius:11px;background:#39565c;color:#fff;
  font:25px/1 system-ui,sans-serif;cursor:pointer;
}
body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name {
  flex:1;min-width:0;width:100%;min-height:40px;max-width:100%;
  padding:6px 2px;margin:0;border:0;border-radius:0;outline:0;
  background:transparent;color:#f8fff3;box-shadow:none;
  font-size:16px;font-weight:750;text-overflow:ellipsis;
}
body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name::placeholder {
  color:#b7c9c1;opacity:1;
}
body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove {
  flex:0 0 44px;display:grid;place-items:center;
  width:44px;min-width:44px;min-height:44px;padding:0;margin:0;
  border:0;border-radius:7px;background:transparent;color:#dceae2;
  font-size:23px;line-height:1;cursor:pointer;
}
body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove:not(:disabled):hover {
  color:#fff;background:#734c50;
}
body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove:disabled {
  opacity:.3;cursor:not-allowed;
}
body .ug-dice-style-roster .ug-dice-style-controls {
  grid-column:1/-1;
}
body .ug-dice-style-controls {
  display:flex;align-items:center;justify-content:flex-start;
  flex-wrap:wrap;gap:12px;min-width:0;margin-top:4px;
}
body .ug-dice-style-controls .ug-dice-style-add {
  min-height:44px;padding:9px 15px;border:1px solid #d7f497;
  border-radius:10px;background:#d7f497;color:#1c362d;
  font-size:13px;font-weight:800;cursor:pointer;
}
body .ug-dice-style-controls .ug-dice-style-add:disabled {opacity:.5;cursor:not-allowed;}
body .ug-dice-style-controls .ug-dice-style-count {font-size:12px;color:#c4dbce;}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row {
  background:#f2f7f2;color:#244738;border-color:#bdd2c4;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row:focus-within {
  background:#fff;border-color:#568771;box-shadow:0 0 0 2px #56877126;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-number {color:#426854;}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-avatar {
  background:#e2f0e7;color:#234737;border-color:#adccba;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name {color:#244738;}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name::placeholder {color:#617b6c;}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove {
  color:#496759;background:#e9f2ec;border:1px solid #c4d8ca;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove:not(:disabled):hover {
  color:#803c31;background:#fbe9e4;border-color:#dfb8ac;
}
html[data-theme="light"] body .ug-dice-style-controls .ug-dice-style-add {
  color:#fff;background:#2b6246;border-color:#2b6246;
}
html[data-theme="light"] body .ug-dice-style-controls .ug-dice-style-count {color:#4b6c58;}
@media(max-width:700px){
  body .ug-dice-style-roster.ug-participant-roster {grid-template-columns:minmax(0,1fr);gap:8px;}
}
@media(max-width:480px){
  body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row {gap:5px;padding:6px;}
  body .ug-dice-style-roster .ug-dice-style-row .ug-participant-number {flex-basis:18px;min-width:18px;}
}

/* Dice-style rosters keep their own palette against legacy high-specificity form rules. */
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row{
 background:#f3f8f4!important;color:#244738!important;border-color:#bdd2c4!important;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row:focus-within{
 background:#f9fcfa!important;border-color:#568771!important;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name{
 background:transparent!important;color:#244738!important;-webkit-text-fill-color:#244738;
}
html[data-theme="light"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name::placeholder{
 color:#607c6b!important;-webkit-text-fill-color:#607c6b;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row{
 background:#192f38!important;color:#f1f7ed!important;border-color:#557476!important;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row.ug-participant-row:focus-within{
 background:#203b44!important;border-color:#d5ef96!important;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name{
 background:transparent!important;color:#f8fff1!important;-webkit-text-fill-color:#f8fff1;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row input.ug-participant-name::placeholder{
 color:#b7cda9!important;-webkit-text-fill-color:#b7cda9;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-number{
 color:#c5ddb3!important;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove{
 background:transparent!important;color:#dceae2!important;border:0!important;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-remove:hover:not(:disabled){
 background:#65434b!important;color:#fff!important;
}
html[data-theme="dark"] body .ug-dice-style-roster .ug-dice-style-row .ug-participant-avatar{
 background:#35545b!important;color:#fff;border-color:#658681!important;
}
html[data-theme="dark"] body .players.ug-dice-style-roster .ug-dice-style-count{
 color:#39524a;
}
