body:not(.running) #roles.kernel-picker,
#familyRole.kernel-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}

#roles.kernel-picker button,
#familyPanel .kernel-picker button {
  flex: 0 0 72px;
  min-height: 68px;
  padding: 6px 4px;
  text-align: center;
  overflow-wrap: normal;
}

.kernel-picker .role-icon {
  width: 32px;
  height: 32px;
}

#roleTip,
#familyRoleTip {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#roleInfo {
  display: grid;
  gap: 8px 12px;
  align-items: start;
  margin: 8px 0 4px;
  padding: 10px;
  min-width: 0;
  border: 1.5px solid #c08e5f;
  border-radius: 13px;
  background: #fff8e9;
  box-shadow: 0 2px 0 #eacc9f;
  container-type: inline-size;
}

#roleInfoTitle {
  margin: 0;
  color: #532918;
  font-size: 17px;
  line-height: 1.15;
}

#roleInfo #roleInfoText {
  margin: 4px 0 0;
  color: #67442f;
  font-size: 13px;
  line-height: 1.32;
  max-width: 40ch;
}

#roleInfoCanvas {
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 5 / 2;
  border-radius: 8px;
  background: #fae9c5;
  pointer-events: none;
}

#roleInfo button#roleInfoReplay {
  min-height: 34px;
  margin-top: 5px;
  padding: 4px 9px;
  border: 1px solid #ba875f;
  border-radius: 8px;
  background: #fff1d3;
  color: #673c25;
  font-size: 12px;
  font-weight: 800;
}

#roleInfoReplay:hover {
  background: #ffdfa8;
}

.card:has(#roles[data-choose-again]) :is(.ribbon,#roleInfo,.keys,.touch-help),
.running .card #roleInfo,
.family-playing .card #roleInfo {
  display: none;
}

@media (any-pointer: coarse) {
  #roleInfo button#roleInfoReplay {
    min-height: 44px;
  }
}

@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 480px) {
  body:not(.preview):not(.running) main {
    height: auto;
    min-height: calc(100dvh - 34px);
    align-items: start;
    padding-block: 8px 12px;
  }
}

@container (min-width: 330px) {
  .role-info-copy {
    grid-column: 1;
    grid-row: 1;
  }

  #roleInfoCanvas {
    grid-column: 2;
    grid-row: 1;
    width: 156px;
    max-width: 100%;
  }
}
